#game-root .th-shell {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
    border: 1px solid var(--cg-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--cg-shadow);
}

#game-root .th-bar,
#game-root .th-levels,
#game-root .th-counters,
#game-root .th-actions,
#game-root .th-stats,
#game-root .th-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#game-root .th-bar {
    justify-content: space-between;
    margin-bottom: 10px;
}

#game-root .th-levels {
    padding: 4px;
    border-radius: 9px;
    background: #edf1ef;
}

#game-root .th-level,
#game-root .th-button {
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #bbc8c3;
    border-radius: 8px;
    background: #fff;
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

#game-root .th-level {
    min-width: 38px;
    padding: 6px;
}

#game-root .th-level:hover,
#game-root .th-level:focus-visible,
#game-root .th-button:hover,
#game-root .th-button:focus-visible {
    border-color: var(--cg-teal);
    outline: none;
}

#game-root .th-level-on,
#game-root .th-button-primary {
    border-color: var(--cg-green);
    background: var(--cg-green);
    color: #fff;
}

#game-root .th-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

#game-root .th-counter,
#game-root .th-mini {
    min-width: 66px;
    padding: 7px 9px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: #f8faf8;
    text-align: center;
}

#game-root .th-counter span,
#game-root .th-mini span {
    display: block;
    color: var(--cg-muted);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

#game-root .th-counter strong,
#game-root .th-mini strong {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
}

#game-root .th-status {
    min-height: 22px;
    margin-bottom: 8px;
    color: var(--cg-muted);
    text-align: center;
    font-size: 0.84rem;
}

#game-root .th-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    min-height: 330px;
    padding: 22px 14px 14px;
    border-radius: 14px;
    background: linear-gradient(#e7f1f4 0 72%, #d5c3a4 72% 100%);
    outline: none;
}

#game-root .th-peg {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 285px;
    flex-direction: column;
    padding: 0 5px 32px;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
}

#game-root .th-peg:hover {
    background: rgba(255, 255, 255, 0.22);
}

#game-root .th-cursor {
    border-color: var(--cg-amber);
    background: rgba(255, 255, 255, 0.35);
}

#game-root .th-source {
    border-color: var(--cg-blue);
}

#game-root .th-pole {
    position: absolute;
    left: 50%;
    bottom: 33px;
    width: 12px;
    height: 210px;
    transform: translateX(-50%);
    border-radius: 8px 8px 0 0;
    background: #765337;
    box-shadow: inset 3px 0 rgba(255, 255, 255, 0.18);
}

#game-root .th-base {
    position: absolute;
    left: 4%;
    right: 4%;
    bottom: 26px;
    height: 14px;
    border-radius: 8px;
    background: #68462f;
}

#game-root .th-discs {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    align-items: center;
    flex-direction: column-reverse;
}

#game-root .th-disc {
    height: 25px;
    margin-top: 2px;
    border: 2px solid rgba(24, 31, 29, 0.22);
    border-radius: 99px;
    box-shadow: inset 0 4px rgba(255, 255, 255, 0.24), 0 3px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.18s ease;
}

#game-root .th-lifted {
    transform: translateY(-26px);
    box-shadow: inset 0 4px rgba(255, 255, 255, 0.24), 0 10px 14px rgba(0, 0, 0, 0.18);
}

#game-root .th-peglabel {
    position: absolute;
    bottom: 2px;
    color: #4c3a2d;
    font-size: 0.74rem;
    font-weight: 900;
}

#game-root .th-shake {
    animation: th-shake 0.28s ease;
}

@keyframes th-shake {
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

#game-root .th-actions,
#game-root .th-stats,
#game-root .th-banner-actions {
    justify-content: center;
}

#game-root .th-actions {
    margin-top: 10px;
}

#game-root .th-stats {
    margin-top: 8px;
}

#game-root .th-hint {
    max-width: 620px;
    margin: 10px auto 0;
    color: var(--cg-muted);
    text-align: center;
    font-size: 0.8rem;
    line-height: 1.45;
}

#game-root .th-banner {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    place-items: center;
    padding: 16px;
    border-radius: inherit;
    background: rgba(20, 31, 29, 0.58);
}

#game-root .th-banner[hidden] {
    display: none;
}

#game-root .th-banner-panel {
    width: min(390px, 100%);
    padding: 20px;
    border-radius: 12px;
    background: #fff;
    text-align: center;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

#game-root .th-banner-panel h2 {
    margin: 0 0 6px;
}

#game-root .th-banner-panel p {
    margin: 0 0 14px;
    color: var(--cg-muted);
    line-height: 1.45;
}

@media (max-width: 640px) {
    #game-root .th-shell {
        padding: 10px;
    }

    #game-root .th-bar {
        align-items: stretch;
        flex-direction: column;
    }

    #game-root .th-levels,
    #game-root .th-counters {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    #game-root .th-counters {
        grid-template-columns: repeat(3, 1fr);
    }

    #game-root .th-counter {
        min-width: 0;
    }

    #game-root .th-board {
        gap: 3px;
        min-height: 260px;
        padding: 14px 3px 10px;
    }

    #game-root .th-peg {
        min-height: 230px;
        padding: 0 1px 28px;
    }

    #game-root .th-pole {
        bottom: 30px;
        width: 9px;
        height: 165px;
    }

    #game-root .th-base {
        bottom: 24px;
        height: 11px;
    }

    #game-root .th-disc {
        height: 20px;
        border-width: 1px;
    }

    #game-root .th-mini {
        min-width: 0;
    }
}
