:root { color-scheme: dark; --ink: #0e2926; --gold: #e8bf75; --cream: #faf2e0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--cream); background: #000; }
* { box-sizing: border-box; }
body { --ad-gap: 60px; margin: 0; height: 100svh; height: 100dvh; display: flex; flex-direction: column; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
main { --edge: 16px; --spacing: 12px; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--spacing); padding: var(--edge); background: linear-gradient(to bottom right, var(--ink), color-mix(in srgb, var(--ink) 55%, black)); }
button { appearance: none; border: 0; font: inherit; color: inherit; cursor: pointer; background: none; padding: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; }
header, .title, header nav, footer { display: flex; align-items: center; }
header { justify-content: space-between; flex-wrap: wrap; gap: 8px; min-height: 48px; flex-shrink: 0; }
header nav { margin-left: auto; }
.title, header nav { gap: 10px; }
h1 { font: 600 27px/1.15 Georgia, "Times New Roman", serif; margin: 0; white-space: nowrap; }
.portrait { width: 48px; height: 48px; flex-shrink: 0; }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 1px solid var(--gold); }
.icon { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; }
.icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.scores { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 16px; background: #ffffff0b; border: 1px solid color-mix(in srgb, var(--gold) 20%, transparent); flex-shrink: 0; }
.metric { flex: 1; text-align: center; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.metric span { font-size: 9px; font-weight: 700; letter-spacing: 1px; color: #faf2e099; }
.metric strong { font-size: 26px; line-height: 1.15; font-weight: 500; font-variant-numeric: tabular-nums; }
.world-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; flex-wrap: wrap; }
.world-score span { font-size: 12px; font-weight: 500; letter-spacing: normal; color: var(--cream); max-width: 100%; overflow-wrap: anywhere; }
.world-score span:empty { display: none; }
#score, .trophy { color: var(--gold); }
.trophy { border-radius: 8px; background: #ffffff05; }
.trophy svg { fill: currentColor; stroke-width: 1; }
#levels { display: flex; gap: 8px; flex-shrink: 0; }
#levels button { flex: 1; min-width: 0; min-height: 44px; padding: 5px 2px; display: flex; flex-direction: column; justify-content: center; gap: 3px; border-radius: 12px; background: #ffffff0e; color: #faf2e0cc; }
#levels button[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
#levels b { font-size: 12px; font-weight: 600; }
#levels small { font-size: 10px; }
.board { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 8px; }
.board-status { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #faf2e0a6; }
#streak { color: var(--gold); }
#board-space { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
#loading { position: absolute; width: min(320px, 85%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; font-size: 14px; }
#loading[hidden], #retry[hidden] { display: none; }
#download-progress { width: 100%; height: 12px; accent-color: var(--gold); border: none; border-radius: 8px; overflow: hidden; background: #ffffff15; }
#download-progress::-webkit-progress-bar { background: #ffffff15; border-radius: 8px; }
#download-progress::-webkit-progress-value { background: var(--gold); border-radius: 8px; }
#download-progress::-moz-progress-bar { background: var(--gold); border-radius: 8px; }
#download-percent { font-variant-numeric: tabular-nums; color: var(--gold); }
#cards { align-self: start; display: grid; grid-template-columns: repeat(var(--columns, 4), var(--card-width, 100px)); gap: var(--gap, 6px); }
.card { width: var(--card-width, 100px); height: var(--card-height, 125px); overflow: hidden; border-radius: calc(var(--card-width, 100px) * .03565); position: relative; box-shadow: 0 2px 3px #0003; }
.card canvas { display: block; width: 100%; height: 100%; }
.card canvas { position: absolute; inset: 0; }
.card.matched:not(.solved) { visibility: hidden; pointer-events: none; }
/* Status-only space includes the main padding/gap and the banner's 9px inset. */
footer { height: calc(var(--ad-gap) - var(--edge) - var(--spacing) - 9px); flex-shrink: 0; }
footer > span { flex: 1; text-align: center; font-size: 10px; color: #faf2e080; }
dialog { width: min(620px, calc(100vw - 32px)); max-height: calc(100svh - 40px); border: 1px solid #e8bf7533; border-radius: 16px; padding: 20px; background: var(--ink); color: var(--cream); box-shadow: 0 16px 60px #0006; }
dialog::backdrop { background: #0006; backdrop-filter: blur(4px); }
dialog[open] { display: flex; flex-direction: column; }
.panel-header { display: flex; flex-shrink: 0; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
h2 { margin: 0; font: 600 24px Georgia, serif; }
#done, .dialog-action { color: var(--gold); min-height: 44px; padding: 8px 14px; border-radius: 8px; background: #ffffff0c; }
#panel-body { overflow-y: auto; min-height: 0; font-size: 15px; line-height: 1.6; }
#panel-body p { margin: 0 0 16px; }
#panel-body a { color: var(--gold); }
.dedication { text-align: center; font: 600 22px/1.5 Georgia, serif; }
.dedication img { width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; margin-top: 20px; }
.deck-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 16px; }
.deck-gallery button { min-width: 0; font-size: 12px; line-height: 1.4; }
.deck-gallery img { width: 100%; aspect-ratio: 1122 / 1402; border-radius: 8px; border: 1px solid #e8bf7540; }
.deck-gallery button[aria-pressed="true"] img { outline: 3px solid var(--gold); outline-offset: -3px; }
.deck-gallery span { display: block; height: 34px; }
.points { position: fixed; z-index: 2; pointer-events: none; color: var(--gold); font-size: 28px; font-weight: 700; padding: 8px 14px; background: var(--ink); border: 1px solid var(--gold); border-radius: 30px; }
.nickname-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.nickname-form input { width: 100%; padding: 10px; font: inherit; border: 1px solid var(--gold); border-radius: 8px; background: #0003; color: var(--cream); }
.nickname-help { font-size: 12px; color: #faf2e0aa; }
.leaderboard-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.leaderboard-table caption { text-align: left; color: #faf2e0aa; }
.leaderboard-table th, .leaderboard-table td { padding: 8px 4px; text-align: left; border-bottom: 1px solid #ffffff15; overflow-wrap: anywhere; }
.leaderboard-table th, .leaderboard-table td:first-child { white-space: nowrap; }
.leaderboard-table th:nth-child(3), .leaderboard-table td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-button { min-height: 44px; padding: 4px; color: var(--gold); font-size: 12px; }
.leaderboard-table select { max-width: 110px; font: inherit; }
.leaderboard-body > .dialog-action { margin: 4px; }
@media (max-height: 649px) { main { --edge: 10px; --spacing: 8px; } h1 { font-size: 20px; } .portrait { width: 36px; height: 36px; } header { min-height: 44px; } .scores { padding: 6px; } .metric strong { font-size: 20px; } }
@media (max-width: 600px), (max-height: 449px) { h1 { font-size: 20px; } .portrait { width: 36px; height: 36px; } .title, header nav { gap: 4px; } header .icon { width: 36px; } }
@media (max-width: 450px) { .metric strong { font-size: 24px; } }
@media (max-height: 449px) and (min-width: 700px) { main { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr auto; } #levels, .board, footer { grid-column: 1 / -1; } .board { min-height: 0; } }
@media (max-height:549px) and (min-width:601px) { main { display:grid; --spacing:6px; grid-template-columns:min(260px,38%) minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:6px 14px; } header { grid-column:1; grid-row:1; align-self:start; align-content:start; } header nav { margin-left:0; } .scores { grid-column:1; grid-row:1; align-self:end; } .metric strong { font-size:17px; } .metric span { font-size:7px; letter-spacing:.5px; } .trophy { width:30px; } #levels { grid-column:2; grid-row:1; align-self:start; z-index:1; } .board { grid-column:2; grid-row:1; padding-top:50px; } footer { grid-column:1 / -1; grid-row:2; } }
@media (prefers-reduced-motion: reduce) { dialog::backdrop { backdrop-filter: none; } }
