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

#game-root .cb-topbar,
#game-root .cb-stats,
#game-root .cb-actions,
#game-root .cb-hud,
#game-root .cb-entry,
#game-root .cb-controls,
#game-root .cb-result-actions,
#game-root .cb-secret {
    display: flex;
    align-items: center;
    gap: 8px;
}

#game-root .cb-topbar {
    justify-content: space-between;
    margin-bottom: 12px;
}

#game-root .cb-stat,
#game-root .cb-hud-card {
    min-width: 72px;
    padding: 8px 10px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: #f8faf8;
    text-align: center;
}

#game-root .cb-stat span,
#game-root .cb-hud-card span {
    display: block;
    color: var(--cg-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

#game-root .cb-stat strong,
#game-root .cb-hud-card strong {
    display: block;
    margin-top: 2px;
    font-size: 1rem;
}

#game-root .cb-hud {
    justify-content: center;
    margin-bottom: 10px;
}

#game-root .cb-btn {
    min-height: 40px;
    padding: 8px 13px;
    border: 1px solid #bcc8c3;
    border-radius: 8px;
    background: #fff;
    color: var(--cg-ink);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

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

#game-root .cb-primary {
    border-color: var(--cg-green);
    background: var(--cg-green);
    color: #fff;
}

#game-root .cb-icon-btn {
    min-width: 40px;
    padding: 6px;
}

#game-root .cb-board {
    display: grid;
    gap: 5px;
    max-width: 360px;
    margin: 0 auto;
    padding: 10px;
    border: 1px solid #cbd5d1;
    border-radius: 12px;
    background: #edf1ef;
}

#game-root .cb-row {
    display: grid;
    grid-template-columns: repeat(4, 42px) 34px;
    justify-content: center;
    align-items: center;
    gap: 7px;
    min-height: 48px;
    padding: 3px 7px;
    border-radius: 7px;
}

#game-root .cb-row-active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(33, 43, 40, 0.09);
}

#game-root .cb-slot {
    width: 38px;
    height: 38px;
    border: 2px solid #b9c4c0;
    border-radius: 50%;
    background: #dfe5e2;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

#game-root .cb-slot-filled {
    border-color: rgba(20, 31, 29, 0.3);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.35), 0 2px 5px rgba(0, 0, 0, 0.14);
}

#game-root .cb-fb {
    display: grid;
    grid-template-columns: repeat(2, 9px);
    gap: 4px;
    justify-content: center;
}

#game-root .cb-peg {
    width: 9px;
    height: 9px;
    border: 1px solid #aab5b1;
    border-radius: 50%;
    background: #d9dfdc;
}

#game-root .cb-peg-exact {
    border-color: #18201e;
    background: #18201e;
}

#game-root .cb-peg-near {
    border-color: #88938f;
    background: #fff;
}

#game-root .cb-status {
    min-height: 20px;
    margin: 10px 0;
    color: var(--cg-muted);
    text-align: center;
    font-size: 0.84rem;
}

#game-root .cb-palette {
    display: grid;
    grid-template-columns: repeat(6, 44px);
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

#game-root .cb-swatch {
    width: 44px;
    height: 44px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #aebbb6, 0 3px 8px rgba(0, 0, 0, 0.14);
    cursor: pointer;
}

#game-root .cb-swatch:hover,
#game-root .cb-swatch:focus-visible {
    transform: translateY(-2px) scale(1.04);
    outline: 2px solid var(--cg-ink);
    outline-offset: 2px;
}

#game-root .cb-entry,
#game-root .cb-controls,
#game-root .cb-result-actions,
#game-root .cb-secret {
    justify-content: center;
}

#game-root .cb-controls {
    margin-top: 8px;
}

#game-root .cb-result {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #a7cdbf;
    border-radius: 10px;
    background: #eef8f4;
    text-align: center;
}

#game-root .cb-result[hidden],
#game-root .cb-modal[hidden] {
    display: none;
}

#game-root .cb-result-kicker {
    display: block;
    color: var(--cg-green);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

#game-root .cb-result > strong {
    display: block;
    margin: 3px 0;
    font-size: 1.25rem;
}

#game-root .cb-result p {
    margin: 4px 0 10px;
    color: var(--cg-muted);
}

#game-root .cb-slot-mini {
    width: 28px;
    height: 28px;
    margin-bottom: 10px;
}

#game-root .cb-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(18, 28, 25, 0.58);
}

#game-root .cb-modal-card {
    position: relative;
    width: min(460px, 100%);
    padding: 22px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

#game-root .cb-modal-card h2 {
    margin: 0 0 10px;
}

#game-root .cb-modal-card p {
    color: var(--cg-muted);
    line-height: 1.5;
}

#game-root .cb-close {
    position: absolute;
    top: 10px;
    right: 10px;
}

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

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

    #game-root .cb-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    #game-root .cb-actions {
        position: static;
        justify-content: flex-end;
    }

    #game-root .cb-stat {
        min-width: 0;
    }

    #game-root .cb-board {
        padding: 7px 4px;
    }

    #game-root .cb-row {
        grid-template-columns: repeat(4, 34px) 28px;
        gap: 6px;
        min-height: 41px;
    }

    #game-root .cb-slot {
        width: 32px;
        height: 32px;
    }

    #game-root .cb-palette {
        grid-template-columns: repeat(6, 38px);
        gap: 6px;
    }

    #game-root .cb-swatch {
        width: 38px;
        height: 38px;
    }

    #game-root .cb-controls {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }
}
