@font-face { font-family: Geist; src: url(geist-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: Geist; src: url(geist-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
:root { color-scheme: dark; color: #f5f1ff; --muted: #b2abc9; --line: #423956; --mint: #b7f5d2; --panel: #1b1a30; font-family: Geist, system-ui, sans-serif; background: #10111f; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; min-height: 100dvh; background: radial-gradient(ellipse at 62% 17%, #261e40, transparent 58%); }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
h1, h2, p { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
.arcade-topbar { --header-accent: #d8bafa; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.primary, .neutral, .quiet, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 680; }
.primary { background: var(--mint); color: #13291f; }
.primary:hover { background: #d0ffe3; }
.neutral, .icon-button, select { color: #f8f4ff; background: #28243e; border-color: var(--line); }
.neutral:hover:not(:disabled), .icon-button:hover { border-color: #ad8fde; }
.icon-button { min-width: 40px; padding-inline: 7px; font-size: 19px; }
.quiet { color: var(--muted); padding-inline: 6px; }
.quiet:hover { color: #fff; }
button:disabled { opacity: .52; }
main { width: min(1120px,calc(100% - 40px)); margin: 22px auto 0; }
.lab-hero { display: grid; grid-template-columns: minmax(250px,.8fr) minmax(0,1.4fr); min-height: 360px; overflow: hidden; border: 1px solid #554465; border-radius: 20px; background: #19172a; }
.hero-copy { padding: clamp(22px,5vw,62px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 17px; }
.hero-copy h1 { font-size: clamp(57px,8vw,116px); line-height: .84; font-weight: 810; letter-spacing: -.07em; }
.hero-copy h1 em { color: #d7b5fb; font-style: normal; }
.hero-copy p { color: var(--muted); max-width: 28ch; line-height: 1.45; }
.hero-copy .cost { font-size: 12px; }
.lab-hero img { width: 100%; min-height: 0; height: 100%; object-fit: cover; object-position: 61% center; }
.select-title { font-size: 17px; margin: 17px 0 9px; }
.levels { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.level { display: grid; justify-items: start; gap: 3px; padding: 10px 13px; color: #eee7fa; background: linear-gradient(135deg,#2f2546,#201b33); border: 1px solid #554369; border-radius: 10px; text-align: start; }
.level span, .level small { color: var(--muted); font-size: 11px; }
.level strong { font-size: clamp(18px,2.6vw,29px); font-variant-numeric: tabular-nums; }
.level[aria-pressed=true] { border-color: var(--mint); }
.level[aria-pressed=true] strong { color: var(--mint); }
.lab-footer { width: min(1120px,calc(100% - 40px)); display: flex; gap: 16px; margin: 17px auto; color: var(--muted); font-size: 12px; }
.lab-footer button { padding: 0; border: 0; background: none; color: inherit; }
.lab-footer :is(a,button):hover { text-decoration: underline; }
.playing { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.playing .lab-footer { display: none; }
.playing .arcade-topbar { width: 100%; flex: 0 0 auto; }
.playing main, #game { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.playing main { width: min(1320px,calc(100% - 20px)); margin-top: 6px; }
.game-tools { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 4px 0 7px; }
.game-tools .neutral { min-height: 36px; }
.metrics { display: flex; gap: clamp(7px,2vw,25px); justify-content: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.metrics strong { margin-inline-start: 4px; color: #fff; font-size: 15px; font-variant-numeric: tabular-nums; }
.metrics .live-points { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.metrics #live-score { display: inline-block; min-width: 3ch; color: var(--mint); }
.board-scroll { flex: 1; min-height: 0; overflow: auto; container-type: size; overscroll-behavior: contain; padding: 3px; }
#board { display: grid; width: min(100%, 100cqh, 820px); grid-template-columns: repeat(var(--columns),minmax(0,1fr)); gap: var(--gap, 4px); margin: auto; aspect-ratio: 1; }
#board[data-zoom] { width: max(100%, min(840px, calc(var(--columns) * 32px))); margin-inline: auto; }
.card { display: grid; place-items: center; position: relative; padding: 0; border: 1px solid #514564; border-radius: clamp(2px,.8vw,9px); color: #a49cbd; background: linear-gradient(145deg,#332b48,#211f35 72%); box-shadow: inset 0 1px #d2b4f221, 0 2px #0d0d17a6; aspect-ratio: 1; touch-action: manipulation; }
.card[data-state=closed]:hover { border-color: #b99cde; }
.card[data-state=closed]::before { content: ''; width: 42%; height: 42%; border: 1px solid #a184bd88; transform: rotate(45deg) scale(.71); border-radius: 22%; }
.blank-tile { display: grid; place-items: center; aspect-ratio: 1; border: 1px solid #353047; border-radius: clamp(2px,.8vw,9px); background: #1a1728; }
.blank-tile::before { content: ''; display: block; width: 16%; aspect-ratio: 1; border-radius: 50%; background: #5b4a72; }
.card:focus-visible { z-index: 1; outline-offset: 0; }
.card.open { color: var(--face); border-color: color-mix(in srgb,var(--face) 75%,#262039); background: linear-gradient(145deg,color-mix(in srgb,var(--face) 24%,#1c182a),#1c172b); }
.card.matched { color: var(--face); border-color: color-mix(in srgb,var(--face) 44%,#1c172b); background: #211b32; box-shadow: none; }
.card svg { width: 59%; height: 59%; overflow: visible; filter: drop-shadow(0 0 4px currentColor); }
.card.matched svg { filter: none; opacity: .75; }
.card .variant { position: absolute; right: 3%; bottom: 1%; font-size: clamp(5px, .9vw, 12px); line-height: 1; font-weight: 760; font-variant-numeric: tabular-nums; }
dialog { width: min(530px,calc(100% - 24px)); max-height: calc(100dvh - 20px); padding: 16px; background: #1d1b31; border: 1px solid #64547b; border-radius: 16px; color: #fff; }
dialog::backdrop { background: #090a14b9; }
.dialog-head, .dlg-row, .page-actions, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.dialog-head h2 { font-size: 22px; }
.dialog-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 12px; }
dialog p { margin-block: 10px; color: var(--muted); }
.standings-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 11px; padding-block: 8px; }
.ranking-switch { display: flex; gap: 4px; }
.ranking-switch button { min-height: 38px; }
.ranking-switch button[aria-pressed=true] { border-color: var(--mint); color: var(--mint); background: #29433c; }
.ranking-period, .ranking-rule { font-size: 12px; }
.ranking-period:empty { display: none; }
select { min-height: 38px; padding-inline: 9px; border-radius: 7px; }
.standing-content table { width: 100%; border-collapse: collapse; font-size: 13px; }
.standing-content :is(td,th) { text-align: start; padding: 7px 5px; border-bottom: 1px solid #373049; }
.standing-content th { color: var(--muted); font-weight: 550; }
.standing-content td:nth-child(2) { overflow-wrap: anywhere; }
.standing-content :is(td,th):nth-child(n+3) { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.page-actions { margin-top: 8px; }
.result-score { font-size: clamp(34px,8vw,62px); color: var(--mint); font-weight: 780; line-height: 1; letter-spacing: -.06em; }
#notice { position: fixed; z-index: 5; bottom: 14px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 20px); padding: 10px 14px; border-radius: 8px; border: 1px solid #926e6e; background: #312238; }
.retired-page { display: grid; min-height: 80dvh; place-content: center; justify-items: center; gap: 20px; text-align: center; }
.syca-consent { position: fixed; z-index: 8; bottom: 12px; left: 12px; width: min(390px,calc(100% - 24px)); padding: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; font-size: 13px; }
.syca-consent p { margin: 5px 0; color: var(--muted); }
.syca-consent a { text-decoration: underline; }
.syca-consent button { border: 1px solid var(--line); border-radius: 6px; background: #3a3150; color: #fff; margin: 7px 6px 0 0; padding: 6px 8px; }
@media(max-width:650px) {
    main { width: calc(100% - 24px); margin-top: 12px; }
    .lab-hero { grid-template-columns: .95fr 1fr; min-height: 260px; }
    .hero-copy { padding: 15px; gap: 11px; }
    .hero-copy h1 { font-size: clamp(38px,9vw,57px); }
    .hero-copy p { font-size: 13px; }
    .levels { gap: 5px; }
    .level { padding: 7px 4px; justify-items: center; white-space: nowrap; }
}
@media(max-height:450px) {
    .playing .arcade-topbar { min-height: 42px; padding-block: 2px; }
    .game-tools { padding: 0 0 3px; gap: 3px 10px; }
    .game-tools .neutral { min-height: 30px; padding-block: 4px; }
}
@media(max-width:365px) {
    .game-tools .neutral { padding-inline: 8px; }
}
