#game-root .rv-shell {
    max-width: 520px;
    margin: 0 auto;
    padding: 14px 12px 28px;
    color: var(--cg-ink);
    font-family: Inter, Arial, sans-serif;
}

#game-root .rv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

#game-root .rv-stats,
#game-root .rv-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

#game-root .rv-stat {
    min-width: 62px;
    padding: 8px 9px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: 0 6px 16px rgba(30, 37, 40, 0.06);
}

#game-root .rv-stat span {
    display: block;
    color: var(--cg-muted);
    font-size: 10px;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
}

#game-root .rv-stat strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1;
}

#game-root .rv-icon-btn,
#game-root .rv-new,
#game-root .rv-close,
#game-root .rv-banner-actions button {
    min-height: 44px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    color: var(--cg-ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

#game-root .rv-icon-btn {
    width: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

#game-root .rv-icon-btn svg {
    width: 22px;
    height: 22px;
}

#game-root .rv-new {
    padding: 0 14px;
}

#game-root .rv-icon-btn:hover,
#game-root .rv-new:hover,
#game-root .rv-close:hover,
#game-root .rv-banner-actions button:hover {
    border-color: var(--cg-teal);
    transform: translateY(-1px);
}

#game-root .rv-icon-btn:focus-visible,
#game-root .rv-new:focus-visible,
#game-root .rv-close:focus-visible,
#game-root .rv-cell:focus-visible,
#game-root .rv-banner-actions button:focus-visible {
    outline: 3px solid rgba(18, 122, 137, 0.35);
    outline-offset: 2px;
}

#game-root .rv-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: 0 6px 16px rgba(30, 37, 40, 0.06);
}

#game-root .rv-side {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 76px;
}

#game-root .rv-side-ai {
    justify-content: flex-end;
}

#game-root .rv-side-text span {
    display: block;
    color: var(--cg-muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
}

#game-root .rv-side-text strong {
    display: block;
    margin-top: 1px;
    font-size: 22px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

#game-root .rv-chip {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex: 0 0 auto;
}

#game-root .rv-chip-b {
    background: radial-gradient(circle at 34% 30%, #4a555a, var(--cg-ink) 62%);
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.4);
}

#game-root .rv-chip-w {
    background: radial-gradient(circle at 34% 30%, #ffffff, #dfe4dc 70%);
    border: 1px solid var(--cg-line);
    box-shadow: inset 0 -2px 3px rgba(30, 37, 40, 0.15);
}

#game-root .rv-turn {
    flex: 1;
    color: var(--cg-muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

#game-root .rv-shell[data-state="over"] .rv-turn {
    color: var(--cg-green);
}

#game-root .rv-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    width: min(100%, 480px);
    margin: 0 auto;
    padding: 8px;
    border-radius: 10px;
    background: var(--cg-green);
    box-shadow: var(--cg-shadow);
}

#game-root .rv-cell {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(8, 34, 26, 0.18);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#game-root .rv-cell.rv-legal {
    cursor: pointer;
}

#game-root .rv-cell.rv-legal:hover {
    background: rgba(255, 255, 255, 0.14);
}

#game-root .rv-cell.rv-cursor {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}

#game-root .rv-cell.rv-hint-mark {
    box-shadow: inset 0 0 0 3px var(--cg-amber);
    background: rgba(196, 122, 23, 0.3);
}

#game-root .rv-cell.rv-hint-mark .rv-dot {
    background: #ffd98a;
}

#game-root .rv-dot {
    width: 26%;
    height: 26%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: rv-pulse 1.4s ease-in-out infinite;
    pointer-events: none;
}

#game-root .rv-disc {
    width: 82%;
    height: 82%;
    border-radius: 50%;
    pointer-events: none;
}

#game-root .rv-disc.rv-b {
    background: radial-gradient(circle at 34% 30%, #4a555a, var(--cg-ink) 62%);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.35), inset 0 -3px 4px rgba(0, 0, 0, 0.4);
}

#game-root .rv-disc.rv-w {
    background: radial-gradient(circle at 34% 30%, #ffffff, #dfe4dc 70%);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3), inset 0 -3px 4px rgba(30, 37, 40, 0.18);
}

#game-root .rv-disc.rv-pop {
    animation: rv-pop 300ms ease both;
}

#game-root .rv-disc.rv-flip {
    animation: rv-flip 340ms ease both;
}

#game-root .rv-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px auto 0;
    width: min(100%, 480px);
    padding: 12px 14px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
    animation: rv-rise 260ms ease both;
}

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

#game-root .rv-banner strong {
    font-size: 18px;
}

#game-root .rv-banner-actions {
    display: flex;
    gap: 8px;
}

#game-root .rv-banner-actions button {
    padding: 0 14px;
}

#game-root .rv-banner-actions button:first-child {
    background: var(--cg-ink);
    border-color: var(--cg-ink);
    color: #ffffff;
}

#game-root .rv-banner-actions button:first-child:hover {
    background: var(--cg-teal);
    border-color: var(--cg-teal);
}

#game-root .rv-hint {
    margin: 12px 0 0;
    color: var(--cg-muted);
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
}

#game-root .rv-overlay {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(30, 37, 40, 0.36);
}

#game-root .rv-overlay[hidden] {
    display: none;
}

#game-root .rv-dialog {
    position: relative;
    width: min(100%, 440px);
    padding: 22px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
}

#game-root .rv-dialog h2 {
    margin: 0 44px 10px 0;
    font-size: 21px;
    line-height: 1.15;
}

#game-root .rv-dialog p {
    margin: 0 0 10px;
    color: var(--cg-muted);
    line-height: 1.45;
}

#game-root .rv-dialog ul {
    margin: 0;
    padding-left: 18px;
    color: var(--cg-ink);
    font-size: 14px;
    line-height: 1.5;
    display: grid;
    gap: 7px;
}

#game-root .rv-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    padding: 0;
    font-size: 26px;
    line-height: 1;
}

@keyframes rv-flip {
    0% { transform: rotateY(0) scale(1); }
    50% { transform: rotateY(90deg) scale(1.14); }
    100% { transform: rotateY(0) scale(1); }
}

@keyframes rv-pop {
    0% { transform: scale(0.35); opacity: 0.4; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes rv-pulse {
    0%, 100% { transform: scale(1); opacity: 0.55; }
    50% { transform: scale(1.25); opacity: 0.9; }
}

@keyframes rv-rise {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 430px) {
    #game-root .rv-shell {
        padding-left: 8px;
        padding-right: 8px;
    }

    #game-root .rv-topbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    #game-root .rv-stat {
        flex: 1;
        text-align: center;
    }

    #game-root .rv-new {
        flex: 1;
    }

    #game-root .rv-scorebar {
        padding: 8px 10px;
    }

    #game-root .rv-side {
        min-width: 62px;
    }

    #game-root .rv-side-text strong {
        font-size: 19px;
    }

    #game-root .rv-turn {
        font-size: 12px;
    }

    #game-root .rv-board {
        gap: 2px;
        padding: 6px;
    }

    #game-root .rv-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    #game-root .rv-banner-actions button {
        flex: 1;
    }
}
