/* A shared finish for the daily hub, play screens and results.
   Game colors identify a puzzle; they never encode its answer or score. */
:root {
  --orange: #e8ac4b;
  --orange-soft: rgba(232,172,75,.14);
  --w-55: #b3b7ce;
  --w-70: #ccd0e2;
  --btn-radius: 12px;
}
body { background: #111344; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #e8ac4b; outline-offset: 4px;
}
.btn { font-size: .9rem; font-weight: 600; min-height: 48px; }
.btn-primary { background: #edb556; color: #17183f; }
.btn-primary:hover { background: #f6c777; filter: none; }
.btn-ghost { border-color: #ffffff35; }
.btn[disabled] { opacity: .45; }
.btn:active { transform: translateY(1px); }
.wrap { width: min(540px, 100%); padding-top: calc(22px + env(safe-area-inset-top)); }
.app-header { padding-bottom: 16px; border-bottom: 1px solid #ffffff18; }
.back { color: #d3d6e7; font-size: .8rem; }
.streak { font-size: .8rem; min-height: 38px; color: #f2c77e; background: #ffffff05; border-color: #ffffff18; }
.game-art { --game-ink: #246c5e; --game-paper: #ddf1e9; --game-soft: #b6d9cd; display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--game-paper); color: var(--game-ink); }
.game-art[data-kind="timeline"] { --game-ink: #965222; --game-paper: #f9e7d5; --game-soft: #edc8a5; }
.game-art[data-kind="pairs"] { --game-ink: #6d4ba3; --game-paper: #ece2f8; --game-soft: #d4bde9; }
.game-art[data-kind="routes"] { --game-ink: #326a99; --game-paper: #dcecf9; --game-soft: #b8d4e9; }
.game-art[data-kind="mini"] { --game-ink: #827025; --game-paper: #f5edca; --game-soft: #dfd29b; }
.game-art svg { width: 48px; height: 48px; }
.art-grid { stroke: currentColor; stroke-width: 1; opacity: .22; }
.art-line { stroke: currentColor; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.art-dot, .art-block { fill: currentColor; }
.art-tile { fill: var(--game-soft); stroke: currentColor; stroke-width: 2; }
.art-paper { fill: #fffdf6; stroke: currentColor; stroke-width: 1.5; }

/* Homepage: quiet framing, recognizable games, and room to breathe. */
body[data-screen="hub"] { background: #111344; }
body[data-screen="hub"] .wrap { width: min(1120px, 100%); padding-inline: 36px; }
.hub-home .hub-header { padding-top: calc(22px + env(safe-area-inset-top)); padding-bottom: 18px; }
.hub-header .wordmark .name { font-size: 28px; }
.hub-intro { padding: 27px 0 25px; gap: 24px; }
.hub-intro h1 { font-size: clamp(32px, 3.1vw, 43px); line-height: 1.1; letter-spacing: -.7px; }
.hub-date { font-size: 11px; letter-spacing: .035em; margin-bottom: 9px; }
.hub-date > span { padding-inline: 5px; }
.hub-description { font-size: 13px; line-height: 1.65; }
.hub-description br { display: none; }
.hub-description br::after { content: ' '; }
.hub-description { max-width: 510px; }
.hub-home .btn { min-height: 46px; border-radius: 12px; font-size: 13px; }
.hub-home .btn-primary { background: #edb556; color: #17183f; }
.hub-home .btn-primary:hover { background: #f6c777; }
.hub-intro-action > p { margin-top: 10px; color: #b9bfd9; }
.hub-momentum { margin-bottom: 22px; }
.personal-result { grid-template-columns: minmax(0, 1fr) 1.1fr; gap: 0 24px; padding: 18px 22px; background: #ffffff05; border: 1px solid #ffffff23; border-radius: 14px; }
.personal-result .progress-kicker { font-size: 11px; margin-bottom: 6px; }
.personal-result h2 { font: 500 18px/1.35 var(--serif); }
.personal-numbers { gap: 18px; }
.personal-numbers > div { border-left: 1px solid #ffffff1d; padding-left: 18px; }
.personal-numbers b { font: 600 26px/1.1 var(--sans); letter-spacing: -.7px; color: #f2c77e; font-variant-numeric: tabular-nums; }
.personal-numbers small { font-size: 12px; letter-spacing: normal; }
.personal-numbers span { font-size: 10px; line-height: 1.5; margin-top: 5px; }
.hub-layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; }
.hub-play-panel { padding: 23px; border: 1px solid #e6e3dd; border-radius: 20px; background: #f8f7f3; box-shadow: 0 8px 30px #05062218; }
.hub-play-panel::before { display: none; }
.hub-panel-heading h2 { font: 600 25px/1.2 var(--serif); }
.hub-panel-heading > span { font-size: 11px; }
.hub-five-track { margin: 14px 0 20px; gap: 6px; }
.hub-five-track span { height: 4px; background: #e4e2dd; }
.hub-five-track span.filled { background: #35735c; }
.hub-games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hub-games .tile { grid-template-columns: 58px minmax(0, 1fr); gap: 14px 12px; padding: 18px 16px 14px; border-radius: 14px; border: 1px solid #e3e1db; box-shadow: 0 2px 3px #13153b03; background: #fff; min-height: 148px; transition: border-color 160ms, box-shadow 160ms, transform 160ms; }
.hub-games .tile:hover { background: #fff; border-color: #9d9db4; box-shadow: 0 5px 16px #13153b0d; transform: translateY(-2px); }
.hub-games .tile:active { transform: translateY(0); }
.hub-games .game-art { width: 58px; height: 58px; border-radius: 14px; }
.hub-games .game-art svg { width: 44px; height: 44px; }
.hub-games .game-kind { display: block; color: #777586; font-size: 10px; font-weight: 500; margin-bottom: 5px; }
.hub-games .tile h3 { font: 650 19px/1.15 var(--sans); letter-spacing: -.5px; margin-bottom: 5px; }
.hub-games .tile p { font-size: 12px; line-height: 1.5; color: #686575; }
.tile-footer { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #efedf0; padding-top: 12px; }
.tile-detail { display: inline-flex; align-items: center; gap: 5px; color: #777586; font-size: 10px; font-weight: 500; }
.tile-detail svg { width: 12px; height: 12px; }
.tile-detail svg path { stroke: #35735c; }
.hub-games .status { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; padding: 6px 12px; color: #2c2e61; background: #efeff7; font-size: 11px; line-height: 1.4; }
.hub-games .status.done { color: #35735c; background: #edf5f0; }
.hub-games .tile.done { border-color: #d7e4dc; }
.hub-games .tile:last-child { grid-template-columns: 58px minmax(0, 1fr) auto; min-height: 98px; padding: 18px 16px; }
.hub-games .tile:last-child .tile-footer { grid-column: auto; border: 0; padding: 0; flex-direction: column; align-items: flex-end; gap: 9px; }
.hub-home .hub-rhythm { background: #ffffff06; border-color: #ffffff1f; border-radius: 16px; padding: 22px 20px; }
.hub-rhythm h2 { font-size: 25px; }
.hub-rhythm .activity-mark { border-radius: 7px; }
.hub-rhythm .progress-copy, .hub-return > p { font-size: 12px; }
.hub-return { padding: 0 6px; }
.hub-return > h2 { font-size: 23px; }
.hub-board-panel { margin-top: 24px; }
.hub-home .hub-leaderboard .lb-cta { border-radius: 999px; }
.hub-footer { margin-top: 26px; }

/* Shared play surface. Boards keep their exact gesture and scoring behavior. */
.game-top { display: flex; gap: 12px; margin: 2px 0 24px; align-items: center; }
.game-top .game-art { width: 46px; height: 46px; border-radius: 12px; }
.game-top .game-art svg { width: 35px; height: 35px; }
.game-heading { flex: 1; min-width: 0; }
.game-top .kicker { color: #fff; font: 600 20px/1.2 var(--sans); letter-spacing: -.4px; margin: 0; }
.game-edition { font-size: 11px; color: #adb4d0; margin: 5px 0 0; }
.quiet-timer { border: 1px solid #ffffff20; background: #ffffff06; border-radius: 999px; padding: 8px 11px; font-size: 12px; color: #c7cce1; }
.game-finished { display: inline-flex; align-items: center; gap: 5px; color: #b1dec5; font-size: 11px; }
.game-finished svg { width: 12px; height: 12px; }
.game-finished path { stroke: currentColor; }
.prompt { font-size: 28px; line-height: 1.18; margin-bottom: 12px; }
.hint-line { font-size: 13px; line-height: 1.6; margin-bottom: 18px; }
.meta-line { font-size: 11px; line-height: 1.5; gap: 12px; }
.chart { background: #0b1035; border-color: #ffffff24; border-radius: 16px; }
.chart text { fill: #b5bed7; }
.chart .grid { stroke: #ffffff12; }
.chart .guess { stroke: #efb65a; }
.trend-instruction { font-size: 13px; padding: 11px 13px; background: #ffffff07; border: 1px solid #ffffff17; border-radius: 10px; }
.trend-scroll-hint { font-size: 11px; }
.tl-list { gap: 10px; }
.tl-item { background: #f7f6f1; color: #242541; border-color: #e9e6e0; border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.4; }
.tl-item .pos { display: grid; place-items: center; height: 28px; border-radius: 50%; background: #e9e5dc; color: #656073; font-size: 12px; }
.tl-item .grip { color: #777387; min-height: 44px; min-width: 34px; }
.tl-item .grip:hover { color: #22224f; }
.tl-item.dragging { background: #e7e1f5; border-color: #b6a7d6; box-shadow: 0 8px 20px #06072426; }
.tl-item.locked { background: #dceee2; border-color: #9ac2ab; }
.tl-item.locked .pos { color: #2e654b; background: #c7e3d1; }
.tl-item.wrongpos { border-color: #d68577; }
.pair-item { background: #ffffff08; border-color: #ffffff26; border-radius: 12px; min-height: 66px; font-size: 13px; line-height: 1.45; }
.pair-item.selected { background: #e8ac4b20; border: 2px solid #edb556; padding: 9px 11px; }
.pair-item.paired { background: #bfc7f815; border-color: #a8afd4; }
.pair-item.correct { background: #3fa36c25; border-color: #70b88e; }
.pair-item.wrong { background: #c45c4a25; border-color: #e3988a; }
.routes-svg { display: block; max-width: 420px; align-self: center; margin-inline: auto; border: 1px solid #babcd2; border-radius: 14px; background: #f3f2ee; }
.routes-svg .cell { fill: #f3f2ee; stroke: #d4d4dc; stroke-width: 1; }
.routes-svg .cell.on { fill: #dce7f7; }
.routes-svg .path { stroke: #5968a6; opacity: 1; }
.routes-svg .path.solution { stroke: #408269; }
.routes-svg .wp { fill: #22264f; stroke: #22264f; }
.routes-svg .wp.hit { fill: #f3bf62; stroke: #816b38; }
.routes-svg .wp.start { stroke: #b87918; }
.routes-svg .hint { stroke: #ad7c2f; }
.route-speed { font-size: 12px; }
.route-speed-help summary { min-height: 36px; padding: 7px 0; }
body[data-screen="routes"] > .wrap > .btn-inline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mini-grid { width: 100%; max-width: 400px; align-self: center; border-radius: 12px; background: #9397b5; gap: 2px; padding: 2px; }
.mcell { border-radius: 3px; font-size: 26px; }
.mcell .num { font-size: 10px; top: 4px; left: 5px; }
.mcell.sel { box-shadow: inset 0 0 0 2px #bd8b32; }
.clue-bar { min-height: 62px; background: #ffffff0a; border-color: #ffffff20; }
.clue-bar button { min-height: 44px; }
.clue-lists { font-size: 12px; line-height: 1.6; gap: 18px; }
.clue-lists h4 { font-size: 11px; margin-top: 8px; }

/* Results: personal achievement and an obvious next step before the detail. */
.reveal { border-radius: 18px; border-color: #ffffff25; background: #ffffff05; padding: 24px 20px; animation: rise 200ms ease; }
.reveal h2 { font-size: 26px; line-height: 1.2; }
.reveal p { font-size: 14px; line-height: 1.65; }
.score-line { margin: 16px 0; }
.score-line .big { font: 600 44px/1 var(--sans); letter-spacing: -2px; color: #f2c77e; }
.score-line .of { font-size: 12px; }
.result-next { margin: 0 0 24px; }
.badge { font-size: 11px; font-weight: 600; padding: 7px 11px; }
.source, .aside { font-size: 12px !important; line-height: 1.65 !important; }
.reveal .streak-secured { padding: 13px 15px; }
.reveal .streak-secured p { font-size: 13px; }
.recap { background: #f8f7f3; color: #212248; border: 1px solid #e6e3dd; border-radius: 20px; padding: 26px 22px; box-shadow: 0 12px 40px #05062222; }
.recap .brand { color: #212248; font-size: 28px; }
.recap .when { color: #747083; font-size: 12px; margin: 7px 0 19px; }
.recap .rows { margin: 12px 0 20px; gap: 0; }
.recap .row { grid-template-columns: 32px 75px 1fr 46px; padding: 12px 0; border-bottom: 1px solid #e6e3e5; gap: 10px; font-size: 13px; }
.recap .game-art { width: 30px; height: 30px; border-radius: 8px; }
.recap .game-art svg { width: 25px; height: 25px; }
.recap .bar { background: #e5e3ec; height: 6px; }
.recap .bar i { background: #7571a7; }
.recap .pts { color: #5b586e; font-size: 12px; }
.recap .score-hero { border: 0; padding: 0 0 20px; border-bottom: 1px solid #e0dce5; margin: 0; }
.recap .score-hero .num { font: 600 55px/1.1 var(--sans); letter-spacing: -2px; }
.recap .score-hero .of, .recap .score-hero .time { color: #777185; font-size: 12px; }
.recap .btn-ghost { color: #36345f; border-color: #bab6c9; }
.recap .btn-ghost:hover { background: #eeecf5; }
.recap .copied { color: #5b586e; font-size: 11px; margin-bottom: 0; }
.recap-actions { margin-top: 6px; }
.recap :is(button, a):focus-visible { outline-color: #56558d; }

@container (max-width: 850px) {
  .hub-layout { grid-template-columns: minmax(0, 1fr) 235px; gap: 18px; }
  .hub-games { grid-template-columns: 1fr; }
  .hub-games .tile, .hub-games .tile:last-child { grid-template-columns: 52px minmax(0, 1fr) auto; min-height: 98px; padding: 16px 13px; gap: 10px; }
  .hub-games .game-art { width: 52px; height: 52px; }
  .hub-games .tile-footer, .hub-games .tile:last-child .tile-footer { grid-column: auto; border: 0; padding: 0; flex-direction: column; align-items: flex-end; }
  .hub-games .tile-detail { font-size: 9px; }
  .hub-games .tile h3 { font-size: 18px; }
  .hub-games .status { padding: 6px 9px; }
  .hub-play-panel { padding: 20px; }
}
@container (max-width: 700px) {
  .hub-layout { grid-template-columns: 1fr; gap: 24px; }
  .hub-side { grid-template-columns: 1fr 1fr; gap: 20px; }
  .hub-intro { display: block; padding: 24px 0 22px; }
  .hub-intro h1 { font-size: 35px; }
  .hub-intro-action { display: flex; align-items: center; gap: 15px; text-align: left; margin-top: 18px; }
  .hub-intro-action .btn { width: auto; flex: none; }
  .hub-intro-action > p { margin: 0; max-width: 155px; line-height: 1.6; }
  .personal-result { grid-template-columns: minmax(0, 1fr) 1.1fr; display: grid; padding: 17px 18px; gap: 0 15px; }
  .personal-result h2 { margin: 0; font-size: 18px; }
  .personal-numbers { gap: 12px; }
  .personal-numbers > div { padding-left: 12px; }
  .personal-numbers b { font-size: 24px; }
  .hub-header .wordmark .name { font-size: 25px; }
}
@container (max-width: 480px) {
  .hub-side { grid-template-columns: 1fr; }
  .hub-home .hub-header { padding-block: calc(18px + env(safe-area-inset-top)) 16px; align-items: center; }
  .hub-header .wordmark .name { font-size: 23px; }
  .hub-header .streak { font-size: 10px; padding-inline: 8px; }
  .hub-intro h1 { font-size: 32px; }
  .hub-description { font-size: 12px; }
  .hub-intro-action > p { font-size: 10px; }
  .hub-momentum { margin-bottom: 18px; }
  .personal-result { display: block; padding: 16px; }
  .personal-result .progress-kicker { display: inline; font-size: 10px; }
  .personal-result h2 { display: inline; font-family: var(--sans); font-size: 11px; margin-left: 8px; line-height: 1.5; }
  .personal-numbers { margin-top: 16px; gap: 12px; }
  .personal-numbers > div:first-child { border-left: 0; padding-left: 0; }
  .personal-numbers span { font-size: 9px; }
  .hub-play-panel { padding: 18px 14px; border-radius: 16px; }
  .hub-panel-heading h2 { font-size: 24px; }
  .hub-games .tile, .hub-games .tile:last-child { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; min-height: 92px; padding: 13px 10px; }
  .hub-games .game-art { width: 44px; height: 48px; border-radius: 11px; }
  .hub-games .game-art svg { width: 36px; height: 36px; }
  .hub-games .tile p { font-size: 11px; }
  .hub-games .game-kind { display: none; }
  .hub-games .status { font-size: 10px; padding: 6px 9px; }
  .hub-games .tile-detail { font-size: 9px; }
  .hub-games .tile:not(.done):not(.started) .tile-detail { display: none; }
}
@media (max-width: 620px) { body[data-screen="hub"] .wrap { padding-inline: 18px; } }
@media (max-width: 380px) {
  .recap-actions { flex-direction: column; }
  body[data-screen="hub"] .wrap { padding-inline: 12px; }
  .wrap { padding-inline: 18px; }
  .hub-games .status { padding-inline: 7px; }
  .hub-games .tile, .hub-games .tile:last-child { gap: 8px; }
  .recap { padding: 22px 16px; }
  .recap .row { grid-template-columns: 28px 64px 1fr 42px; gap: 8px; font-size: 12px; }
  .game-edition { font-size: 10px; }
  .reveal { padding: 20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-games .tile:hover, .btn:active { transform: none; }
}
