:root {
    --bg: #0f1220;
    --card: #171a2b;
    --grid: #22253a;
    --text: #e6e9ff;
    --muted: #9aa3c7;
    --accent: #7c9cff;
    --on: #28c98b;
    --on-ink: #03150e;
    --focus: #ffd166;
    --radius: 14px;
}

html,
body {
    height: 100%;
    margin: 0;
    background: radial-gradient(1200px 800px at 10% 0%, #151938 0%, #0e0f1c 40%, #0a0b14 100%), var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

.wrap {
    max-width: 980px;
    margin: 24px auto;
    padding: 16px;
}

header {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

h1 {
    font-size: clamp(20px, 2.6vw, 32px);
    margin: 0;
    letter-spacing: 0.4px;
    font-weight: 700;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: #071226;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .06s ease, box-shadow .15s ease, background .15s ease, opacity .15s;
    box-shadow: 0 8px 20px rgba(124, 156, 255, .25);
    user-select: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: transparent;
    color: var(--muted);
    border: 1px solid #2b2e47;
    box-shadow: none;
}

.board {
    background: linear-gradient(180deg, #121427, #0f1121);
    border-radius: var(--radius);
    padding: clamp(10px, 1.6vw, 16px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: clamp(8px, 1.2vw, 14px);
}

.cell {
    position: relative;
    display: inline-grid;
    place-items: center;
    text-align: center;
    min-height: clamp(66px, 10.2vw, 120px);
    padding: 10px;
    border-radius: 12px;
    background: radial-gradient(240px 160px at 50% 0%, #1b1f36 0%, #14182d 55%, #111428 100%);
    color: var(--muted);
    border: 1px solid #262a45;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.15;
    transition: transform .06s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.cell:hover {
    box-shadow: 0 8px 18px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.cell:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px var(--focus),
        0 10px 24px rgba(0, 0, 0, .35),
        inset 0 0 0 1px rgba(255, 255, 255, .05);
}

.cell[aria-pressed="true"] {
    background: linear-gradient(180deg, rgba(40, 201, 139, .12), rgba(40, 201, 139, .06));
    color: var(--on);
    border-color: rgba(40, 201, 139, .5);
    text-shadow: 0 0 12px rgba(40, 201, 139, .4);
}

.cell[disabled] {
    cursor: not-allowed;
    opacity: 0.95;
    border-style: dashed;
}

.label {
    font-size: clamp(12px, 1.3vw, 16px);
    padding: 0 4px;
}

.badge {
    position: absolute;
    inset: 8px auto auto 8px;
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 999px;
    background: rgba(124, 156, 255, .15);
    color: var(--muted);
    border: 1px solid #2b2e47;
    letter-spacing: .3px;
    text-transform: uppercase;
    font-weight: 800;
}

footer {
    margin-top: 14px;
    color: #7d86ad;
    font-size: 12px;
    text-align: center;
    opacity: .9;
}

@media (max-width: 460px) {
    .badge {
        display: none;
    }
}
