:root {
    --bg-color: #121212;
    --text-color: #ffffff;
    --tower-color: #555;
    --disk-base-color: #bb86fc;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    width: 100%;
    max-width: 800px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.back-btn {
    align-self: flex-start;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
}

h1 {
    font-size: 2.5rem;
    margin: 0;
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

select,
button {
    background-color: #1e1e1e;
    color: var(--text-color);
    border: 1px solid #555;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: inherit;
    cursor: pointer;
}

.stats {
    display: flex;
    gap: 2rem;
    font-size: 1.2rem;
}

.towers-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    min-height: 400px;
    height: auto;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 10px;
}

.tower {
    position: relative;
    width: 30%;
    min-height: 350px;
    height: auto;
    display: flex;
    flex-direction: column-reverse;
    /* Stack from bottom */
    align-items: center;
    cursor: pointer;
    padding-bottom: 25px;
    /* Space for base */
    justify-content: flex-start;
}

.tower:hover .pole {
    background-color: #777;
}

.tower.selected .pole {
    background-color: var(--disk-base-color);
    box-shadow: 0 0 10px var(--disk-base-color);
}

.pole {
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 320px;
    background-color: var(--tower-color);
    border-radius: 5px 5px 0 0;
    z-index: 0;
    transition: background-color 0.3s;
}

.base {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20px;
    background-color: var(--tower-color);
    border-radius: 4px;
    z-index: 0;
}

.disk {
    height: 22px;
    border-radius: 11px;
    background-color: var(--disk-base-color);
    z-index: 1;
    margin-bottom: 1px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* Disk colors - 10层圆盘宽度分布，每层差异约7-8% */
.disk[data-size="0"] {
    width: 25%;
    background-color: #ff5252;
}

.disk[data-size="1"] {
    width: 33%;
    background-color: #ff4081;
}

.disk[data-size="2"] {
    width: 41%;
    background-color: #e040fb;
}

.disk[data-size="3"] {
    width: 49%;
    background-color: #7c4dff;
}

.disk[data-size="4"] {
    width: 57%;
    background-color: #536dfe;
}

.disk[data-size="5"] {
    width: 65%;
    background-color: #448aff;
}

.disk[data-size="6"] {
    width: 73%;
    background-color: #40c4ff;
}

.disk[data-size="7"] {
    width: 81%;
    background-color: #18ffff;
}

.disk[data-size="8"] {
    width: 89%;
    background-color: #64ffda;
}

.disk[data-size="9"] {
    width: 97%;
    background-color: #a7ffeb;
}

.instructions {
    color: #aaaaaa;
    text-align: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: #1e1e1e;
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    border: 2px solid var(--disk-base-color);
}

.modal-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--disk-base-color);
}

.modal-content button {
    margin-top: 1rem;
    background-color: var(--disk-base-color);
    color: #000;
    border: none;
    font-weight: bold;
}