body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.game-container {
    text-align: center;
    max-width: 700px;
}

.game-area {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    margin: 0;
}

.status {
    font-size: 1.2rem;
    margin-bottom: 5px;
    font-weight: bold;
    color: #2c3e50;
    min-height: 1.5em;
}

.move-counter {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

/* Board layout - 3 pegs side by side */
.toh-board {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 10px;
    user-select: none;
}

.toh-peg-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    min-width: 140px;
}

.toh-peg-container:hover {
    background: rgba(52, 152, 219, 0.08);
}

.toh-peg-container.selected {
    background: rgba(52, 152, 219, 0.15);
    box-shadow: 0 0 0 2px var(--primary-color, #3498db);
}

.toh-peg-container.invalid-target {
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.toh-peg-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 8px;
}

/* Disc stacking area */
.toh-peg-discs {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: flex-start;
    min-height: 120px;
    width: 100%;
    gap: 3px;
}

/* The vertical rod */
.toh-peg-rod {
    width: 8px;
    height: 130px;
    background: linear-gradient(to right, #8B7355, #A0896C, #8B7355);
    border-radius: 4px 4px 0 0;
    margin-top: -130px;
    pointer-events: none;
    z-index: 0;
}

/* The base */
.toh-peg-base {
    width: 130px;
    height: 10px;
    background: linear-gradient(to bottom, #8B7355, #6B5B45);
    border-radius: 3px;
    pointer-events: none;
}

/* Discs */
.toh-disc {
    height: 24px;
    border-radius: 12px;
    z-index: 1;
    transition: transform 0.15s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toh-disc.lifting {
    transform: translateY(-10px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Disc sizes (1=smallest, 4=largest) */
.toh-disc[data-size="1"] {
    width: 40px;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
}
.toh-disc[data-size="2"] {
    width: 65px;
    background: linear-gradient(to bottom, #3498db, #2980b9);
}
.toh-disc[data-size="3"] {
    width: 90px;
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
}
.toh-disc[data-size="4"] {
    width: 115px;
    background: linear-gradient(to bottom, #f39c12, #e67e22);
}

/* Game buttons */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

#exit-game-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

/* Online info */
.online-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.opponent-name {
    font-weight: 600;
    color: var(--text-muted, #666);
}

/* Win highlight */
.toh-peg-container.winner {
    animation: winGlow 0.5s ease-in-out 3;
}

@keyframes winGlow {
    0%, 100% { box-shadow: 0 0 0 2px transparent; }
    50% { box-shadow: 0 0 20px rgba(243, 156, 18, 0.6); }
}

/* Responsive */
@media (max-width: 500px) {
    .toh-board {
        gap: 8px;
        padding: 10px 2px;
    }

    .toh-peg-container {
        min-width: 95px;
        padding: 5px;
    }

    .toh-peg-discs {
        min-height: 90px;
    }

    .toh-peg-rod {
        height: 100px;
        margin-top: -100px;
    }

    .toh-peg-base {
        width: 90px;
    }

    .toh-disc {
        height: 20px;
    }

    .toh-disc[data-size="1"] { width: 30px; }
    .toh-disc[data-size="2"] { width: 48px; }
    .toh-disc[data-size="3"] { width: 66px; }
    .toh-disc[data-size="4"] { width: 84px; }
}
