/* Brain Brunch: shared styles for every page. Light theme by default, dark via [data-theme="dark"] on <html>. */
:root {
  --bg: #F7F5EF;
  --surface: #FFFFFF;
  --surface-2: #EEF1F7;
  --line: #D9DFEA;
  --text: #14213A;
  --muted: #55627A;
  --accent: #F5C542;
  --accent-ink: #14213A;
  --select: #2D5BD0;
  --board: #2D5BD0;
  --hole: #F7F5EF;
  --red: #E5484D;
  --yellow: #F5C542;
  --ok: #1B8A5E;
  --warn: #B4540A;
  --shadow: 0 1px 2px rgba(20, 33, 58, .06), 0 8px 24px rgba(20, 33, 58, .07);
  --radius: 18px;
  --display: 'Bricolage Grotesque', 'Segoe UI', sans-serif;
  --body: 'DM Sans', 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1B2D;
  --surface: #182A44;
  --surface-2: #132238;
  --line: #2A4064;
  --text: #F4F1E8;
  --muted: #A9B6CC;
  --select: #F5C542;
  --hole: #0F1B2D;
  --ok: #4FD1A5;
  --warn: #F5A15B;
  --shadow: none;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: inherit; }
a:hover { color: var(--select); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }
p { margin: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--select); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.eyebrow { color: var(--select); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 21px; }
.logo:hover { color: inherit; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-weight: 500; }
.nav a { text-decoration: none; padding: 8px 0; }
.theme-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--select); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { color: var(--accent-ink); background: #F0B92A; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--text); }
.btn-outline:hover { color: var(--text); background: var(--surface-2); }
.btn-quiet { background: var(--surface-2); color: var(--text); border-color: var(--line); border-radius: 12px; }
.btn-quiet:hover { color: var(--text); border-color: var(--select); }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.panel h2 { font-family: var(--body); font-size: 16px; font-weight: 700; }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-top: 56px; padding-bottom: 48px; }
.hero-text { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(36px, 6vw, 58px); font-weight: 800; }
.hero .lead { color: var(--muted); font-size: 19px; max-width: 540px; }
.hero-art { flex: 1 1 340px; min-width: 0; display: flex; justify-content: center; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.section { padding-top: 48px; padding-bottom: 48px; }
.section > h2 { font-size: 32px; font-weight: 800; margin-bottom: 22px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.feature { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 26px; }
.feature-art { flex: 0 0 168px; height: 144px; border-radius: 14px; background: var(--board); display: flex; align-items: center; justify-content: center; }
.feature-body { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.feature h3 { font-size: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.soon { border-style: dashed; box-shadow: none; background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.soon h3 { font-size: 22px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step-num { font-family: var(--display); font-size: 40px; font-weight: 800; color: var(--select); margin-bottom: 6px; }
.step h3 { font-family: var(--body); font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; color: var(--muted); font-size: 14px; }
.ad-slot { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: 13px; min-height: 90px; }
.ad-slot.box { min-height: 250px; }
.page-head { padding-top: 40px; padding-bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.page-head h1 { font-size: clamp(34px, 5vw, 46px); font-weight: 800; }
.tabs { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin: 24px 0 30px; max-width: 100%; }
.tab { min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
fieldset { border: 0; margin: 0 0 30px; padding: 0; min-width: 0; }
legend { font-weight: 700; font-size: 19px; margin-bottom: 12px; padding: 0; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice .box {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 18px; border-radius: 16px; background: var(--surface);
  border: 2px solid var(--line); transition: border-color .15s ease;
}
.choice:hover .box { border-color: var(--muted); }
.choice input:checked + .box { border-color: var(--select); background: var(--surface-2); box-shadow: 0 0 0 1px var(--select); }
.choice input:focus-visible + .box { outline: 3px solid var(--select); outline-offset: 2px; }
.choice .name { font-family: var(--display); font-size: 22px; font-weight: 800; }
.choice .desc { color: var(--muted); font-size: 14px; }
.pips { display: flex; gap: 4px; margin-bottom: 6px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.pips i.on { background: var(--select); }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pill .box { flex-direction: row; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px; border-radius: 999px; font-weight: 600; }
.option-groups { display: flex; flex-wrap: wrap; gap: 0 40px; }
.field { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.field label { font-weight: 700; }
.input {
  min-height: 50px; padding: 0 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
.input:focus { border-color: var(--select); outline: none; }
.code-input { text-transform: uppercase; letter-spacing: .15em; font-weight: 700; }
.lobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 24px; }
.lobby-grid .card { display: flex; flex-direction: column; gap: 14px; }
.lobby-grid h2 { font-size: 26px; }
.form-error { color: var(--warn); font-weight: 600; min-height: 1.5em; }
@keyframes drop {
  0%   { transform: translateY(var(--fall, -300%)); animation-timing-function: cubic-bezier(.5, 0, 1, 1); }
  62%  { transform: translateY(0); animation-timing-function: ease-out; }
  76%  { transform: translateY(-14%); animation-timing-function: ease-in; }
  88%  { transform: translateY(0); animation-timing-function: ease-out; }
  94%  { transform: translateY(-4%); animation-timing-function: ease-in; }
  100% { transform: translateY(0); }
}
@keyframes winpulse { 50% { transform: scale(.88); } }
@keyframes pulse { 50% { transform: scale(.9); } }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -9px 0; } 40% { translate: 8px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; } }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--select); }
#sound-toggle .icon-off { display: none; }
#sound-toggle[aria-pressed="false"] .icon-on { display: none; }
#sound-toggle[aria-pressed="false"] .icon-off { display: block; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.head-tools { display: flex; align-items: center; gap: 10px; }
.play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 24px; }
.play-head h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); }
.dot.wait { background: var(--accent); }
.play-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-top: 18px; padding-bottom: 48px; }
.play-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.play-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.status { font-size: 20px; font-weight: 700; text-align: center; min-height: 1.5em; }
.status[data-tone="good"] { color: var(--ok); }
.status[data-tone="bad"] { color: var(--warn); }
.player { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 2px solid transparent; position: relative; }
.player.active { border-color: var(--select); background: var(--surface-2); }
.player .pname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .pmeta { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.reaction {
  position: absolute; right: 10px; top: -14px; padding: 4px 10px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700;
  opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.reaction.show { opacity: 1; transform: none; }
.btn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.btn-grid .btn { padding: 0 10px; }
.score-row { display: flex; justify-content: space-between; gap: 10px; }
.share-code { font-family: var(--display); font-size: 32px; font-weight: 800; letter-spacing: .14em; }
.share-link { width: 100%; font-size: 14px; }
.react-row { display: flex; flex-wrap: wrap; gap: 8px; }
.react-row .btn { min-height: 44px; padding: 0 14px; font-weight: 500; }
.notice { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 40px 20px; }
body:not(.mode-cpu) .only-cpu { display: none !important; }
body:not(.mode-online) .only-online { display: none !important; }
:root { --match-bg: #1B8A5E; --match-ink: #FFFFFF; --rail: #C9A46A; }
:root[data-theme="dark"] { --match-bg: #4FD1A5; --match-ink: #0F1B2D; --rail: #8C6E45; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); }
.ladder-page { max-width: 600px; padding-bottom: 40px; }
.ladder-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 24px; }
.ladder-head h1 { font-size: clamp(28px, 6vw, 36px); font-weight: 800; }
.ladder-head h1 .muted { font-weight: 600; }
.archive-note { margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.ladder-goal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 14px; font-size: 18px; }
.rung-tag { position: absolute; right: calc(100% + 30px); font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
@keyframes tilepop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes goalpop { 0% { transform: scale(1); } 40% { transform: scale(1.18) rotate(-4deg); } 100% { transform: none; } }
.ladder-msg { text-align: center; min-height: 1.6em; font-weight: 600; margin: 4px 0; }
.ladder-msg[data-tone="bad"] { color: var(--warn); }
.ladder-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ladder-controls .btn { min-height: 44px; padding: 0 16px; }
.keyboard { display: flex; flex-direction: column; gap: 6px; user-select: none; -webkit-user-select: none; }
.kb-row { display: flex; justify-content: center; gap: 5px; }
.key {
  flex: 1 1 0; max-width: 46px; min-width: 0; height: 52px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; padding: 0;
  box-shadow: 0 2px 0 var(--line); touch-action: manipulation;
}
.key:hover { border-color: var(--select); }
.key:active { transform: translateY(1px); }
.key.dead { opacity: .35; }
.key.goal-letter:not(.dead) { background: var(--match-bg); color: var(--match-ink); border-color: var(--match-bg); }
.result { margin-top: 18px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.result h2 { font-size: 28px; font-weight: 800; }
dialog { border: 1px solid var(--line); border-radius: 20px; padding: 0; background: var(--surface); color: var(--text); width: min(460px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
dialog::backdrop { background: rgba(10, 18, 32, .55); }
.dialog-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.dialog-body h2 { font-size: 26px; font-weight: 800; }
.dialog-body h3 { font-family: var(--body); font-size: 16px; }
.dialog-body ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.dialog-body .btn { align-self: flex-start; }
.example { display: flex; flex-wrap: wrap; gap: 6px 10px; font-family: var(--display); font-weight: 800; letter-spacing: .08em; }
.example span { padding: 4px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.example b { color: var(--match-bg); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; }
.stat-grid div { display: flex; flex-direction: column; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.stat-grid strong { font-family: var(--display); font-size: 30px; }
.stat-grid span { font-size: 13px; color: var(--muted); }
.dist-row { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.dist-bar { display: block; }
.dist-fill { display: block; min-width: 24px; padding: 2px 8px; border-radius: 6px; background: var(--select); color: var(--surface); font-weight: 700; text-align: right; font-size: 13px; }
:root[data-theme="dark"] .dist-fill { color: #0F1B2D; }
.archive-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 24px 0 40px; }
.archive-item { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; }
.archive-item:hover { border-color: var(--select); color: inherit; }
.archive-item strong { font-family: var(--display); font-size: 20px; }
.archive-item .state { font-size: 13px; font-weight: 700; }
.archive-item .state.done { color: var(--ok); }
.daily-card { display: flex; flex-direction: column; gap: 14px; }
.daily-words { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .1em; }
.daily-words .w { padding: 6px 12px; border-radius: 10px; background: var(--surface-2); border: 2px solid var(--line); }
.prose { max-width: 720px; padding-top: 32px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 14px; }
.prose h1 { font-size: 40px; font-weight: 800; }
.prose h2 { font-size: 22px; margin-top: 12px; }
.prose ul { margin: 0; padding-left: 22px; }
.prose pre { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); padding: 14px; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 520px) {
  .rung-tag { display: none; }
}
.game-page { max-width: 640px; padding-bottom: 40px; }
.game-page.wide { max-width: 920px; }
.game-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 24px; margin-bottom: 14px; }
.game-head h1 { font-size: clamp(28px, 6vw, 36px); font-weight: 800; }
.game-head h1 .muted { font-weight: 600; }
.game-head .eyebrow { margin-bottom: 2px; }
.loading { text-align: center; padding: 48px 0; }
.game-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.timer { font-family: var(--display); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.game-msg { text-align: center; min-height: 1.6em; font-weight: 600; margin: 8px 0; }
.game-msg[data-tone="bad"] { color: var(--warn); }
.game-msg[data-tone="good"] { color: var(--ok); }
.score-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
#r-extra:empty { display: none; }
@keyframes wave { 50% { transform: scale(.82); background: var(--match-bg); color: var(--match-ink); } }
:root[data-theme="dark"] #ng-notes[aria-pressed="true"] { color: #0F1B2D; }
.seg-btn { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.seg-btn[aria-pressed="true"] .sw.fill { background: var(--accent-ink); }
@media (max-width: 640px) {
  .site-header .wrap { gap: 6px 12px; padding-top: 10px; padding-bottom: 8px; }
  .site-header .nav { display: contents; }
  .site-header .theme-toggle { order: 1; margin-left: auto; }
  .site-header .nav::before { content: ''; order: 2; flex-basis: 100%; height: 0; }
  .site-header .nav a { order: 3; padding: 6px 0; margin-right: 14px; font-size: 15px; }
}
.key.wide { max-width: 64px; flex-grow: 1.5; }
.hub-hero { padding-top: 48px; padding-bottom: 24px; }
.hub-hero-text { max-width: 720px; display: flex; flex-direction: column; gap: 16px; }
.hub-hero h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 800; }
.hub-hero .lead { color: var(--muted); font-size: 19px; }
.hub-progress { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.hub-bar { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.hub-bar span { display: block; height: 100%; width: 0; background: var(--match-bg); border-radius: 999px; transition: width .6s ease; }
.hub-progress p { font-weight: 700; }
.hub-section { padding-top: 32px; padding-bottom: 8px; scroll-margin-top: 12px; }
.hub-section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 14px; }
.hub-section-head h2 { font-size: 28px; font-weight: 800; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hub-card { display: flex; gap: 16px; align-items: flex-start; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .12s ease, border-color .12s ease; }
.hub-card:hover { transform: translateY(-2px); border-color: var(--select); color: var(--text); }
.hub-card.is-done { background: var(--surface-2); }
.hub-icon { flex: none; width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--select) 14%, var(--surface)); color: var(--select); }
.hub-icon svg { width: 40px; height: 40px; }
.hub-icon.hub-quad { background: transparent; }
.hub-icon.hub-quad svg { width: 52px; height: 52px; }
.hub-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hub-name { font-family: var(--display); font-size: 21px; font-weight: 800; }
.hub-blurb { color: var(--muted); font-size: 15px; }
.hub-status { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--select); }
.hub-status.done { color: var(--ok); }
.archive-tabs { flex-wrap: wrap; border-radius: 18px; }
:root {
  --tile-top: linear-gradient(180deg, #FFFFFF 0%, #F2F4FA 100%);
  --tile-edge: #C7CFDF;
  --tile-ink: #14213A;
  --tray: linear-gradient(160deg, #3B69DD 0%, #2650C4 55%, #1E43AA 100%);
  --tray-edge: #17368A;
  --slot: #E9EDF6;
  --glow-a: rgba(45, 91, 208, .16);
  --glow-b: rgba(245, 197, 66, .22);
  --glow-c: rgba(229, 72, 77, .10);
  --lift: 0 2px 0 var(--tile-edge), 0 6px 14px rgba(20, 33, 58, .10);
}
:root[data-theme="dark"] {
  --tile-top: linear-gradient(180deg, #2A4268 0%, #1F3456 100%);
  --tile-edge: #0B1729;
  --tile-ink: #F4F1E8;
  --tray: linear-gradient(160deg, #2C56C9 0%, #1F45A8 55%, #183886 100%);
  --tray-edge: #0E2460;
  --slot: #13233D;
  --glow-a: rgba(79, 129, 255, .20);
  --glow-b: rgba(245, 197, 66, .10);
  --glow-c: rgba(229, 72, 77, .08);
  --lift: 0 2px 0 var(--tile-edge), 0 8px 18px rgba(0, 0, 0, .35);
}
.site-header { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.card { box-shadow: var(--lift); }
.btn-primary { box-shadow: 0 3px 0 #C99A14, 0 8px 16px rgba(245, 197, 66, .25); }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #C99A14; }
.btn-quiet { background: var(--tile-top); box-shadow: 0 2px 0 var(--tile-edge); }
.btn-quiet:active { transform: translateY(2px); box-shadow: none; }
.tilt-stage { perspective: 1100px; }
.tilt-board, .tilt-card { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transform-style: preserve-3d; transition: transform .35s ease-out; will-change: transform; }
.tilt-card { position: relative; overflow: hidden; }
.tilt-card::after { /* glossy light that follows the pointer */
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(420px circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, .22), transparent 45%);
  opacity: var(--go, .6); transition: opacity .3s;
}
.flip-in { animation: flipin .55s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes flipin { from { transform: perspective(900px) rotateY(-70deg) translateZ(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.jump { animation: jump .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes jump { 30% { transform: translateY(-14px) rotateX(10deg); } 60% { transform: translateY(2px); } }
.key { background: var(--tile-top); color: var(--tile-ink); border: 0; box-shadow: 0 3px 0 var(--tile-edge), 0 5px 10px rgba(20, 33, 58, .10); border-radius: 10px; transition: transform .06s, box-shadow .06s; }
.key:active { transform: translateY(3px); box-shadow: 0 0 0 var(--tile-edge); }
.key.goal-letter:not(.dead) { box-shadow: 0 3px 0 #116343, 0 5px 10px rgba(27, 138, 94, .3); }
:root[data-theme="dark"] .tile.match { background: linear-gradient(180deg, #6DE0B8, #3FC495); color: #0F1B2D; box-shadow: 0 4px 0 #1F8F67, 0 8px 16px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .ng-cell.given { background: linear-gradient(180deg, #344E78, #2A4166); }
:root[data-theme="dark"] .ng-cell.peer { background: color-mix(in srgb, var(--select) 14%, #22385A); }
:root[data-theme="dark"] .ng-cell.same { background: color-mix(in srgb, var(--select) 26%, #22385A); }
:root[data-theme="dark"] .cw-cell.word { background: color-mix(in srgb, var(--select) 30%, #22385A); }
:root[data-theme="dark"] .pl-cell.on { background: linear-gradient(180deg, #F6D06A, #E2AE2A); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), inset 0 -3px 0 rgba(0, 0, 0, .25); }
.hub-card { border: 0; box-shadow: var(--lift); }
.hub-card:hover { transform: translateY(-4px); }
.hub-icon { background: linear-gradient(160deg, #4B78EA, #2449B3); color: #fff; box-shadow: 0 3px 0 #17368A, 0 8px 16px rgba(45, 91, 208, .3), inset 0 1px 0 rgba(255, 255, 255, .35); }
.hub-icon.hub-mischief, .hub-icon.hub-ninegrid { background: linear-gradient(160deg, #F6C94B, #E09E16); color: #3A2600; box-shadow: 0 3px 0 #A86F05, 0 8px 16px rgba(224, 158, 22, .3), inset 0 1px 0 rgba(255, 255, 255, .4); }
.hub-icon.hub-riddle, .hub-icon.hub-logicgrid, .hub-icon.hub-picture, .hub-icon.hub-next { background: linear-gradient(160deg, #F07178, #D6363D); box-shadow: 0 3px 0 #8E1F23, 0 8px 16px rgba(214, 54, 61, .28), inset 0 1px 0 rgba(255, 255, 255, .35); }
.hub-icon.hub-quad { background: transparent; box-shadow: none; }
.hub-card.is-done .hub-icon { filter: saturate(.6); }
.badge-shelf { display: flex; flex-wrap: wrap; gap: 12px; }
.medal { width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.medal .coin {
  width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: radial-gradient(circle at 35% 30%, #FFF4C4, #F5C542 45%, #C99A14 100%);
  box-shadow: 0 4px 0 #9C7408, 0 10px 18px rgba(201, 154, 20, .35), inset 0 -4px 6px rgba(0, 0, 0, .15);
}
.medal.silver .coin { background: radial-gradient(circle at 35% 30%, #FFFFFF, #CFD7E6 45%, #93A0B8 100%); box-shadow: 0 4px 0 #6C7A94, 0 10px 18px rgba(108, 122, 148, .3); }
.medal.bronze .coin { background: radial-gradient(circle at 35% 30%, #FFE0C2, #E09A5B 45%, #A9622A 100%); box-shadow: 0 4px 0 #7D461B, 0 10px 18px rgba(169, 98, 42, .3); }
.medal.locked .coin { background: var(--slot); box-shadow: inset 0 0 0 2px var(--line); filter: grayscale(1); opacity: .55; }
.medal.new .coin { animation: coinspin 1.2s ease both; }
@keyframes coinspin { 0% { transform: rotateY(0) scale(.4); } 60% { transform: rotateY(540deg) scale(1.15); } 100% { transform: rotateY(720deg) scale(1); } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(140%); z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 700; box-shadow: 0 14px 30px rgba(0, 0, 0, .3);
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast .coin { width: 40px; height: 40px; font-size: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 35% 30%, #FFF4C4, #F5C542 45%, #C99A14 100%); animation: coinspin 1.2s ease both; }
.result .streak-flame { font-size: 34px; display: inline-block; animation: flame 1.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flame { 50% { transform: scale(1.12) rotate(-4deg); } }
@media (prefers-reduced-motion: reduce) {
  .tilt-board, .tilt-card { transform: none !important; transition: none; }
  .flip-in, .jump, .medal.new .coin, .toast .coin, .result .streak-flame { animation: none; }
}
:root[data-theme="dark"] .ng-cell.boxalt:not(.sel):not(.peer):not(.same):not(.clash) { background: linear-gradient(180deg, #2E3F5E, #26364F); }
.tilt-card::after { background: radial-gradient(380px circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, .10), transparent 50%); opacity: var(--go, 0); }
:root[data-theme="dark"] .tilt-card::after { background: radial-gradient(380px circle at var(--gx, 30%) var(--gy, 0%), rgba(255, 255, 255, .06), transparent 50%); }
.tilt-board { transform-style: flat; transform: perspective(1100px) rotateX(var(--rx, 0deg)); }
.tilt-card { transform-style: flat; }
.hub-icon.hub-board { background: linear-gradient(160deg, #2FB487, #12795A); color: #fff; box-shadow: 0 3px 0 #0B5A41, 0 8px 16px rgba(18, 121, 90, .28), inset 0 1px 0 rgba(255, 255, 255, .35); }
.hub-card.is-soon { opacity: .62; box-shadow: none; border: 1px dashed var(--line); background: transparent; }
.hub-card.is-soon:hover { transform: none; }
.hub-card.is-soon .hub-status { color: var(--muted); }
@keyframes pc-pop { from { transform: scale(.35) translateY(-30%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes pc-flip { 0% { transform: rotateY(0) scale(1); } 50% { transform: rotateY(90deg) scale(1.12); } 100% { transform: rotateY(0) scale(1); } }
@keyframes pc-out { to { transform: scale(1.5); opacity: 0; } }
@keyframes hint-glow { from { box-shadow: 0 0 0 0 rgba(245, 197, 66, .0); } to { box-shadow: 0 0 0 5px rgba(245, 197, 66, .9); } }
@keyframes win-glow { to { box-shadow: 0 2px 0 var(--edge), 0 0 0 4px #F5C542, 0 0 16px 4px rgba(245, 197, 66, .7); } }
@keyframes line-in { from { transform: scale(.2); } }
@keyframes rm-wobble { 50% { transform: rotate(-8deg) scale(1.05); } }
@keyframes sow { 0% { transform: none; } 40% { transform: scale(1.1); box-shadow: inset 0 5px 10px rgba(0, 0, 0, .5), 0 0 0 4px rgba(245, 197, 66, .9); } 100% { transform: none; } }
@keyframes capt { 40% { box-shadow: inset 0 5px 10px rgba(0, 0, 0, .5), 0 0 0 5px #E5484D; } }
/* Progress dots (used by several daily games) */
.nx-dots { display: flex; gap: 8px; }
.nx-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.nx-dot.right { background: var(--match-bg); }
.nx-dot.wrong { background: var(--warn); }

/* =====================================================================
   FROSTED AURORA: soft colored light drifting behind frosted-glass panels.
   Big panels blur what is behind them; small tiles use see-through glass
   without blur (much lighter on phones).
   ===================================================================== */
:root {
  --bg: #EDF2FA;
  --surface-2: rgba(255, 255, 255, .55);
  --line: rgba(20, 33, 58, .12);
  --muted: #46536B;
  --glass: rgba(255, 255, 255, .5);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-edge: rgba(255, 255, 255, .85);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 44px rgba(40, 62, 120, .13);
  --glass-shadow-hi: inset 0 1px 0 rgba(255, 255, 255, .95), 0 30px 60px rgba(40, 62, 120, .22);
  --chip: rgba(255, 255, 255, .62);
  --track: rgba(20, 33, 58, .1);
  --au1: #86C8FF; --au2: #FFC6A6; --au3: #93EFCB; --au4: #CDB8FF;
  --au-strength: .78;
  --tile-top: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(242, 245, 252, .88) 100%);
  --tile-edge: rgba(150, 165, 200, .55);
  --slot: rgba(255, 255, 255, .5);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .9), 0 3px 0 var(--tile-edge), 0 10px 22px rgba(40, 62, 120, .12);
  --radius: 24px;
  --tray: linear-gradient(160deg, rgba(72, 116, 232, .8) 0%, rgba(38, 80, 196, .86) 55%, rgba(30, 67, 170, .92) 100%);
}
:root[data-theme="dark"] {
  --bg: #0A1226;
  --surface: #16223D;
  --surface-2: rgba(40, 58, 98, .55);
  --line: rgba(170, 195, 255, .16);
  --muted: #B3C0D8;
  --glass: rgba(24, 36, 66, .5);
  --glass-strong: rgba(22, 34, 62, .8);
  --glass-edge: rgba(170, 195, 255, .2);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 44px rgba(0, 0, 0, .45);
  --glass-shadow-hi: inset 0 1px 0 rgba(255, 255, 255, .12), 0 30px 60px rgba(0, 0, 0, .55);
  --chip: rgba(30, 44, 78, .65);
  --track: rgba(255, 255, 255, .12);
  --au1: #2856D6; --au2: #7E3556; --au3: #0F7E62; --au4: #4A2C98;
  --au-strength: .7;
  --tile-top: linear-gradient(180deg, rgba(52, 76, 120, .92) 0%, rgba(36, 56, 94, .9) 100%);
  --tile-edge: rgba(6, 12, 26, .8);
  --slot: rgba(20, 32, 58, .6);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .1), 0 3px 0 var(--tile-edge), 0 10px 22px rgba(0, 0, 0, .4);
}

/* The aurora: four pre-blurred lights that slowly drift (only transform animates, so it stays cheap). */
body { background: var(--bg); }
body::before, body::after {
  content: ''; position: fixed; z-index: -1; pointer-events: none; inset: -15vmax;
  opacity: var(--au-strength);
  will-change: transform;
}
body::before {
  background:
    radial-gradient(38vmax 38vmax at 12% 10%, var(--au1), transparent 70%),
    radial-gradient(34vmax 34vmax at 92% 30%, var(--au2), transparent 70%);
  animation: aurora-a 34s ease-in-out infinite alternate;
}
body::after {
  background:
    radial-gradient(40vmax 40vmax at 45% 95%, var(--au3), transparent 70%),
    radial-gradient(30vmax 30vmax at 85% 85%, var(--au4), transparent 70%);
  animation: aurora-b 42s ease-in-out infinite alternate;
}
@keyframes aurora-a { to { transform: translate(6vmax, 4vmax) scale(1.12) rotate(4deg); } }
@keyframes aurora-b { to { transform: translate(-5vmax, -6vmax) scale(.92) rotate(-5deg); } }

/* Glass building blocks */
.glass, .card, .panel, dialog {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}
.card, .panel { border-radius: var(--radius); }
dialog { background: var(--glass-strong); border-radius: 26px; box-shadow: var(--glass-shadow-hi); }
dialog::backdrop { background: rgba(10, 18, 40, .35); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.glass-chip, .badge, .chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--glass-edge); font-weight: 600; font-size: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.glass-chip svg { width: 18px; height: 18px; }

/* Header: a floating glass bar */
.site-header { background: none; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 12px 12px 0; position: relative; z-index: 5; }
.site-header .wrap {
  max-width: 1200px; padding: 10px 12px 10px 18px; border-radius: 22px;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
}
.nav { gap: 2px 4px; }
.nav a { padding: 8px 12px; border-radius: 12px; transition: background .15s; }
.nav a:hover { background: var(--chip); color: var(--text); }
.theme-toggle, .icon-btn { background: var(--chip); border: 1px solid var(--glass-edge); transition: transform .2s; }
.theme-toggle:hover, .icon-btn:hover { transform: rotate(-10deg) scale(1.05); border-color: var(--glass-edge); }
@media (max-width: 640px) {
  .site-header { padding: 8px 8px 0; }
  .site-header .wrap { padding: 8px 10px 6px 14px; justify-content: flex-start; gap: 4px 2px; }
  .site-header .nav a { padding: 6px 8px; margin-right: 2px; }
}
.site-footer { border: 0; margin-top: 32px; padding: 0 12px 12px; }
.site-footer .wrap { max-width: 1200px; border-radius: 20px; background: var(--glass); border: 1px solid var(--glass-edge); padding: 18px 22px; }

/* Buttons */
.btn-primary { background: linear-gradient(180deg, #FFD964, #F5C542); box-shadow: 0 4px 0 #C99A14, 0 12px 26px rgba(245, 197, 66, .4), inset 0 1px 0 rgba(255, 255, 255, .6); transition: transform .15s, box-shadow .15s; }
.btn-primary:hover { background: linear-gradient(180deg, #FFDE74, #F5C542); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #C99A14; }
.btn-quiet { background: var(--chip); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 2px 0 var(--tile-edge); }
.btn-outline { border-color: var(--glass-edge); background: var(--chip); }
.btn-outline:hover { background: var(--glass-strong); }
.tabs { background: var(--glass); border: 1px solid var(--glass-edge); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.tab[aria-selected="true"] { background: linear-gradient(180deg, #FFD964, #F5C542); box-shadow: 0 2px 0 #C99A14; }
.choice .box { background: var(--glass); border: 2px solid var(--glass-edge); box-shadow: var(--glass-shadow); transition: transform .2s, border-color .15s; }
.choice:hover .box { transform: translateY(-3px); border-color: var(--glass-edge); }
.choice input:checked + .box { background: var(--glass-strong); border-color: var(--select); box-shadow: 0 0 0 1px var(--select), var(--glass-shadow); }
.input { background: var(--glass-strong); border: 2px solid var(--glass-edge); }
.archive-item { background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); border-radius: 18px; transition: transform .2s; }
.archive-item:hover { transform: translateY(-3px); border-color: var(--glass-edge); }
.player.active { background: var(--glass-strong); }
.stat-grid div { background: var(--chip); border: 1px solid var(--glass-edge); }
.ad-slot { border-color: var(--glass-edge); background: var(--glass); }
.toast { background: var(--glass-strong); color: var(--text); border: 1px solid var(--glass-edge); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--glass-shadow-hi); }
.xp-toast .xp-coin { width: auto; min-width: 44px; padding: 0 10px; font-size: 15px; font-weight: 800; color: #0B3D2A; border-radius: 999px; background: linear-gradient(180deg, #8FF0C8, #2FB487); }

/* XP bar (home dashboard + result cards) */
.xp-bar { display: block; height: 10px; border-radius: 999px; background: var(--track); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12); }
.xp-bar.big { height: 14px; }
.xp-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #8FF0C8, #2FB487 60%, #1B8A5E); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); transition: width .8s cubic-bezier(.3, 1.3, .5, 1); }
.r-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(360px, 100%); margin: 6px auto 0; font-size: 14px; }
.r-progress .xp-bar { width: 100%; }
.r-level { font-weight: 800; }
.chest-cta { margin-top: 6px; }

/* ---------- Home ---------- */
.home { padding-bottom: 12px; }
.home-hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; padding-top: 28px; }
.hero-copy { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: 12px 4px; }
.hero-copy h1 { font-size: clamp(42px, 6.4vw, 72px); font-weight: 800; line-height: 1.0; letter-spacing: -.02em; }
.hero-copy .lead { font-size: 18px; color: var(--muted); max-width: 520px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta { border-radius: 18px; }
.cta svg { width: 20px; height: 20px; }
.today-card { flex: 1 1 440px; min-width: 0; border-radius: 30px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.today-head h2 { font-size: 26px; font-weight: 800; }
.today-head .glass-chip { color: var(--muted); font-weight: 700; padding: 4px 12px; font-size: 13px; }
.today-body { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.ring { position: relative; width: 164px; height: 164px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--track); stroke-width: 11; }
.ring-prog { fill: none; stroke: url(#ringg); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.3, 1.3, .5, 1); }
.ring-label { position: absolute; inset: 0; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; text-align: center; line-height: 1; }
.ring-label strong { font-family: var(--display); font-size: 44px; font-weight: 800; }
.ring-label small { font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--muted); align-self: flex-end; padding-bottom: 4px; }
.ring-label span { flex-basis: 100%; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.today-stats { flex: 1 1 210px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.streak-row { display: flex; align-items: center; gap: 12px; }
.streak-row .flame { width: 46px; height: 46px; flex: none; transform-origin: 50% 90%; animation: flick 1.6s ease-in-out infinite alternate; }
@keyframes flick { to { transform: scale(1.08) rotate(3deg); } }
.big { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.small { font-size: 13px; }
.strong { font-weight: 700; }
.level-row { display: flex; flex-direction: column; gap: 6px; }
.level-line { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.level-line .muted { font-variant-numeric: tabular-nums; }
.today-body { flex: 1; }
.today-dots { margin-top: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(20px, 1fr)); gap: 6px; }
.tdot { height: 10px; border-radius: 999px; background: var(--track); transition: background .4s, transform .2s; }
.tdot:hover { transform: scaleY(1.6); }
.tdot.on { background: linear-gradient(90deg, #5FA8FF, #2D5BD0); }

.hooks { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; padding-top: 22px; }
.hook-card { border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hook-card h2 { font-size: 22px; font-weight: 800; }
.hook-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hook-top svg { width: 24px; height: 24px; color: #B4540A; }
.eyebrow.warm { color: #B4540A; }
:root[data-theme="dark"] .eyebrow.warm, :root[data-theme="dark"] .hook-top svg { color: #F5A15B; }
.chest-card { flex-direction: row; align-items: center; gap: 16px; }
.chest-art { flex: none; width: 104px; }
.chest-svg { width: 104px; height: 96px; overflow: visible; }
.hook-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hook-body .btn { align-self: flex-start; min-height: 44px; }
.chest-glowball, .chest-coin { opacity: 0; transition: opacity .4s; }
.chest-card[data-state="ready"] .chest-svg { animation: chest-glow 2.2s ease-in-out infinite alternate, chest-wiggle 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.chest-card[data-state="ready"] .chest-glowball { opacity: .45; }
@keyframes chest-glow { to { filter: drop-shadow(0 0 22px rgba(245, 197, 66, .9)); } }
@keyframes chest-wiggle { 0%, 80%, 100% { transform: none; } 85% { transform: rotate(-5deg); } 90% { transform: rotate(5deg); } 95% { transform: rotate(-3deg); } }
.chest-card[data-state="opened"] .chest-lid { transform: rotate(-28deg) translate(-4px, -6px); transform-origin: 10px 40px; }
.chest-card[data-state="opened"] .chest-coin, .chest-card[data-state="opened"] .chest-glowball { opacity: .9; }
.chest-card[data-state="opened"] .chest-glowball { opacity: .35; }
.chest-card.just-opened .chest-lid { animation: lid-open .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.chest-card.just-opened .chest-coin { animation: coin-rise .9s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes lid-open { from { transform: none; } }
@keyframes coin-rise { from { transform: translateY(14px); opacity: 0; } }
.weekly-bar { display: grid; grid-template-columns: repeat(var(--segs, 5), minmax(0, 1fr)); gap: 6px; }
.weekly-bar span { height: 30px; border-radius: 10px; background: var(--track); }
.weekly-bar span.on { background: linear-gradient(160deg, #FFB46B, #F07A1E); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 0 #B4540A; }
.badge-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge-mini .medal { width: auto; }
.shelf-card { border-radius: 26px; padding: 22px; }

.search-row { position: relative; padding-top: 28px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-radius: 18px; max-width: 520px; min-height: 54px; cursor: text; }
.search-box svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; outline: none; min-height: 50px; }
.search-box:focus-within { box-shadow: 0 0 0 3px var(--select), var(--glass-shadow); }
.search-results { position: absolute; z-index: 10; top: calc(100% + 6px); left: 20px; width: min(520px, calc(100% - 40px)); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; background: var(--glass-strong); }
.search-results p { padding: 10px 12px; }
.search-hit { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.search-hit:hover, .search-hit:focus-visible { background: var(--chip); color: inherit; }
.search-hit span { font-size: 14px; }

.hub-section { padding-top: 34px; scroll-margin-top: 16px; }
.hub-section-head { align-items: baseline; }
.hub-section-head h2, .cat-page .hub-section-head h1 { font-size: 34px; font-weight: 800; }
.see-all { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; color: var(--select); }
.see-all svg { width: 18px; height: 18px; }
.cat-page .page-head { padding-top: 24px; padding-bottom: 0; }

/* Glass game tiles that tilt toward you */
.tiles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.tiles-grid.tiles-board { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gtile {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 20px; min-width: 0;
  border-radius: 26px; text-decoration: none; color: var(--text);
  background: linear-gradient(160deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .38));
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow);
  transform: perspective(900px) rotateX(0) rotateY(0); transition: transform .35s cubic-bezier(.2, .9, .25, 1.2), box-shadow .35s;
}
:root[data-theme="dark"] .gtile { background: linear-gradient(160deg, rgba(40, 58, 98, .62), rgba(24, 36, 66, .5)); }
.gtile:hover { color: var(--text); transform: perspective(900px) rotateX(7deg) rotateY(-5deg) translateY(-8px); box-shadow: var(--glass-shadow-hi); }
.gtile:active { transform: perspective(900px) rotateX(2deg) translateY(-2px) scale(.98); }
.gtile .shine { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(115deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 34%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .16) 100%); opacity: .7; transition: transform .5s, opacity .5s; }
:root[data-theme="dark"] .gtile .shine { opacity: .18; }
.gtile:hover .shine { transform: translateX(16%); opacity: 1; }
:root[data-theme="dark"] .gtile:hover .shine { opacity: .3; }
.gtile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.orb {
  position: relative; flex: none; width: 62px; height: 62px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(160deg, var(--o1), var(--o2));
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .55), inset 0 -6px 12px rgba(0, 0, 0, .18), 0 10px 22px rgba(20, 33, 58, .22);
  transition: transform .35s cubic-bezier(.2, .9, .25, 1.3);
}
.orb svg { position: relative; z-index: 1; width: 36px; height: 36px; }
.orb::after { content: ''; position: absolute; left: 12%; right: 12%; top: 6%; height: 38%; border-radius: 14px 14px 40% 40%; background: linear-gradient(rgba(255, 255, 255, .6), rgba(255, 255, 255, 0)); }
.gtile:hover .orb { transform: scale(1.08) rotate(-4deg); }
.gtile-board .orb { width: 54px; height: 54px; border-radius: 50%; }
.gtile-board .orb svg { width: 30px; height: 30px; }
.done-mark { display: none; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: linear-gradient(160deg, #4FD1A5, #1B8A5E); box-shadow: 0 0 0 4px rgba(79, 209, 165, .25), 0 6px 14px rgba(27, 138, 94, .35); }
.done-mark svg { width: 18px; height: 18px; }
.gtile.is-done .done-mark { display: flex; animation: pop-in .45s cubic-bezier(.3, 1.7, .5, 1) both; }
@keyframes pop-in { from { transform: scale(.2); opacity: 0; } }
.gtile-cat { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gtile-name { font-family: var(--display); font-size: 22px; font-weight: 800; line-height: 1.1; }
.gtile-board .gtile-name { font-size: 19px; }
.gtile-blurb { font-size: 14px; color: var(--muted); }
.gtile-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.gtile-foot .hub-status { margin: 0; color: var(--select); }
.gtile-foot .hub-status.done { color: var(--ok); }
.xp-chip { padding: 3px 10px; border-radius: 999px; background: var(--chip); border: 1px solid var(--glass-edge); white-space: nowrap; font-size: 12px; }
.gtile.is-soon { opacity: .6; border-style: dashed; box-shadow: none; }
.gtile.is-soon:hover { transform: none; }
.gtile.is-soon .hub-status { color: var(--muted); }


/* Phones: compact two-column tiles, centered dashboard */
@media (max-width: 560px) {
  .home-hero { padding-top: 18px; }
  .today-card { padding: 20px; }
  .today-body { justify-content: center; }
  .tiles-grid, .tiles-grid.tiles-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gtile { padding: 14px; border-radius: 22px; gap: 4px; }
  .gtile .orb { width: 48px; height: 48px; border-radius: 16px; }
  .gtile .orb svg { width: 28px; height: 28px; }
  .gtile-board .orb { border-radius: 50%; }
  .gtile-name, .gtile-board .gtile-name { font-size: 17px; }
  .gtile-blurb { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .gtile-foot { flex-direction: column; align-items: flex-start; gap: 6px; }
  .done-mark { width: 28px; height: 28px; }
  .hub-section-head h2 { font-size: 28px; }
  .chest-art, .chest-svg { width: 84px; }
  .chest-svg { height: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .streak-row .flame, .chest-card[data-state="ready"] .chest-svg { animation: none; }
  .gtile, .gtile:hover { transform: none; }
}
/* XP toasts drop in from the top so they never cover badge toasts at the bottom. */
.toast.xp-toast { bottom: auto; top: 18px; transform: translateX(-50%) translateY(-180%); }
.toast.xp-toast.show { transform: translateX(-50%) translateY(0); }

/* =====================================================================
   HEADER: glass logo that tilts toward the pointer, glossy 3D name,
   a gliding glass highlight in the menu, and the streak chip.
   ===================================================================== */
.site-header .wrap { position: relative; }
.logo { gap: 12px; perspective: 500px; isolation: isolate; }
.logo-tile {
  --rx: 0deg; --ry: 0deg; --gx: 50%;
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at var(--gx) 0%, #9CCBFF 0%, rgba(156, 203, 255, 0) 55%), linear-gradient(150deg, #5FA8FF 0%, #3F7BEA 45%, #2D5BD0 100%);
  box-shadow: inset 0 2px 1px rgba(255, 255, 255, .7), inset 0 -4px 8px rgba(10, 30, 90, .35), 0 3px 0 #1E43AA, 0 10px 18px rgba(45, 91, 208, .35);
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d; transition: transform .25s ease-out;
}
.logo:hover .logo-tile { transition: transform .08s linear; }
.logo-gloss { position: absolute; overflow: hidden; left: 8%; right: 8%; top: 4%; height: 46%; border-radius: 10px 10px 50% 50%; pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, .75), rgba(255, 255, 255, .05)); }
.logo-gloss::after { content: ''; position: absolute; inset: -40% -60%; background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .85) 50%, transparent 60%); transform: translateX(-70%); animation: logo-sweep 7s ease-in-out 1.2s infinite; }
@keyframes logo-sweep { 0%, 78% { transform: translateX(-70%); } 92%, 100% { transform: translateX(70%); } }
.logo-egg { position: relative; transform: translateZ(14px); filter: drop-shadow(0 2px 2px rgba(10, 30, 90, .35)); transition: transform .3s; }
.logo-yolk { transform-origin: 17.6px 17.2px; transform-box: view-box; }
.logo:hover .logo-egg { animation: egg-wobble .9s ease-in-out; }
.logo:hover .logo-yolk { animation: yolk-jiggle .9s ease-in-out; }
.logo-tile.boing { animation: logo-boing .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes egg-wobble { 0%, 100% { transform: translateZ(14px) rotate(0); } 20% { transform: translateZ(14px) rotate(-10deg) scale(1.05); } 45% { transform: translateZ(14px) rotate(8deg); } 70% { transform: translateZ(14px) rotate(-4deg); } }
@keyframes yolk-jiggle { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.12, .9); } 50% { transform: scale(.94, 1.08); } 75% { transform: scale(1.04, .97); } }
@keyframes logo-boing { 40% { transform: scale(.86); } }

.logo-word { display: inline-flex; gap: .26em; font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.lw { position: relative; display: inline-block; padding-bottom: 4px; color: transparent; -webkit-background-clip: text; background-clip: text; }
.lw-a { background-image: linear-gradient(180deg, #8EC4FF 0%, #5B95F5 46%, #2D5BD0 54%, #4A80EC 100%); }
.lw-b { background-image: linear-gradient(180deg, #FFE38F 0%, #F7C948 46%, #E0A010 54%, #F2B731 100%); }
/* the extruded "3D" edge sits behind each word */
.lw::before { content: attr(data-text); position: absolute; left: 0; top: 0; z-index: -1; color: #1E43AA;
  text-shadow: 0 1px 0 #2650C4, 0 2px 0 #1E43AA, 0 3px 0 #17368A, 0 5px 8px rgba(20, 33, 58, .28); }
.lw-b::before { color: #B7820C; text-shadow: 0 1px 0 #C99A14, 0 2px 0 #B7820C, 0 3px 0 #94680A, 0 5px 8px rgba(20, 33, 58, .28); }
/* a glint that slides across the letters */
.lw::after { content: attr(data-text); position: absolute; left: 0; top: 0; color: transparent; -webkit-background-clip: text; background-clip: text; pointer-events: none;
  background-image: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .95) 50%, transparent 58%); background-size: 300% 100%; background-position: 120% 0; animation: word-glint 7s ease-in-out 1.4s infinite; }
.lw-b::after { animation-delay: 1.6s; }
@keyframes word-glint { 0%, 76% { background-position: 120% 0; } 94%, 100% { background-position: -20% 0; } }
.logo-word { transition: transform .3s cubic-bezier(.2, .9, .3, 1.4); }
.logo:hover .logo-word { transform: translateY(-2px) scale(1.03); }
.nav-short { display: none; }
:root[data-theme="dark"] .lw::before { color: #0E2460; text-shadow: 0 1px 0 #17368A, 0 2px 0 #0E2460, 0 3px 0 #0A1A48, 0 5px 10px rgba(0, 0, 0, .5); }
:root[data-theme="dark"] .lw-b::before { color: #7A5508; text-shadow: 0 1px 0 #94680A, 0 2px 0 #7A5508, 0 3px 0 #5E4106, 0 5px 10px rgba(0, 0, 0, .5); }

/* menu highlight */
.nav { position: relative; }
.nav a { position: relative; z-index: 1; transition: color .2s; }
.nav a:hover { background: none; }
.nav-ink { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 12px; opacity: 0; pointer-events: none;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 12px rgba(40, 62, 120, .14);
  transition: transform .35s cubic-bezier(.3, .9, .3, 1.15), width .35s cubic-bezier(.3, .9, .3, 1.15), opacity .2s; }
:root[data-theme="dark"] .nav-ink { background: rgba(120, 150, 230, .2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.nav-ink.on { opacity: 1; }
.nav a.is-here { font-weight: 700; }
.nav a.nudge::after { content: ''; position: absolute; top: 5px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 2px var(--glass-strong); animation: nudge-pulse 2s ease-out infinite; }
@keyframes nudge-pulse { 0% { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 2px rgba(229, 72, 77, .5); } 70%, 100% { box-shadow: 0 0 0 2px var(--glass-strong), 0 0 0 9px rgba(229, 72, 77, 0); } }

/* streak + level chip */
.hdr-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 6px 0 8px; padding: 6px 12px 6px 9px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px; color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 240, 214, .7)); border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 #fff, 0 3px 10px rgba(234, 106, 18, .16); transition: transform .2s; }
.hdr-chip[hidden] { display: none; }
.hdr-chip:hover { color: var(--text); transform: translateY(-2px); }
.hdr-chip b { font-variant-numeric: tabular-nums; }
.hdr-lv { padding-left: 7px; margin-left: 1px; border-left: 1px solid var(--line); color: var(--muted); font-weight: 700; }
.hdr-fire { display: inline-block; transform-origin: 50% 90%; animation: fire-flicker 2.4s ease-in-out infinite; }
@keyframes fire-flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08, .95) rotate(-4deg); } 60% { transform: scale(.96, 1.06) rotate(3deg); } }
.hdr-chip.at-risk { animation: chip-pulse 1.8s ease-in-out infinite; }
.hdr-chip.fresh .hdr-fire { filter: grayscale(.6); }
@keyframes chip-pulse { 50% { box-shadow: inset 0 1px 0 #fff, 0 0 0 4px rgba(234, 106, 18, .22); } }
:root[data-theme="dark"] .hdr-chip { background: linear-gradient(180deg, rgba(60, 80, 130, .7), rgba(90, 60, 40, .55)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }

@media (max-width: 640px) {
  .logo-tile { width: 36px; height: 36px; border-radius: 11px; }
  .logo-egg { width: 22px; height: 22px; }
  .logo-word { font-size: 21px; }
  .site-header .nav a.hdr-chip { order: 1; margin: 0 6px 0 auto; padding: 5px 10px 5px 8px; font-size: 13px; }
  .site-header .nav a.hdr-chip:not([hidden]) ~ .theme-toggle { margin-left: 0; }
  .site-header .nav { position: static; }
  .site-header .nav a[data-cat] { padding: 6px 6px; margin-right: 0; }
  .nav-full { display: none; }
  .nav-short { display: inline; }
}
@media (max-width: 380px) { .hdr-lv { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .logo-gloss::after, .lw::after, .hdr-fire, .hdr-chip.at-risk, .nav a.nudge::after, .logo:hover .logo-egg, .logo:hover .logo-yolk { animation: none; }
  .lw::after { display: none; }
}

/* On-screen keyboard (word games) */
.kbd { display: flex; flex-direction: column; gap: 6px; margin: 16px auto 0; max-width: 520px; user-select: none; -webkit-user-select: none; }
.kbd-row { display: flex; justify-content: center; gap: 5px; }
.kbd-key { flex: 1 1 0; min-width: 0; max-width: 46px; height: 52px; border-radius: 10px; border: 1px solid var(--glass-edge); background: var(--tile-top); color: var(--text);
  font: 700 15px var(--body); box-shadow: var(--lift); cursor: pointer; transition: transform .08s, background .2s, color .2s; }
.kbd-key.wide { flex: 1.6 1 0; max-width: 76px; font-size: 13px; }
.kbd-key:active { transform: translateY(2px); }
.kbd-key.hit { background: linear-gradient(170deg, #6FA8FF, #2D5BD0); color: #fff; border-color: transparent; }
.kbd-key.near { background: linear-gradient(170deg, #FFB48A, #EE6A33); color: #fff; border-color: transparent; }
.kbd-key.miss { background: rgba(70, 80, 100, .35); color: rgba(255, 255, 255, .85); border-color: transparent; box-shadow: none; }
:root[data-theme="dark"] .kbd-key.miss { background: rgba(10, 16, 30, .6); color: rgba(255, 255, 255, .45); }
@media (max-width: 400px) { .kbd-key { height: 48px; font-size: 14px; } .kbd-row { gap: 4px; } }

/* Latin-square number grids (Sign Grid, Number Pens) */
.lt-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; width: min(100%, 440px); margin: 6px auto 0; padding: 12px; border-radius: 22px; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow); }
.lt-grid.gaps { gap: 0; }
.lt-cell { position: relative; aspect-ratio: 1; margin: 0; padding: 0; border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--tile-top); box-shadow: var(--lift); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lt-v { font: 800 clamp(20px, 6vw, 30px) var(--display); }
.lt-cell.given .lt-v { color: var(--select); }
.lt-cell.peer { background: color-mix(in srgb, var(--select) 8%, transparent); }
.lt-cell.sel { background: linear-gradient(170deg, #FFE38F, #F5C542); color: #14213A; }
.lt-cell.bad .lt-v { color: #E5484D; }
.lt-cell.solved { background: linear-gradient(170deg, #9FE8C8, #1B8A5E); color: #fff; border-color: transparent; }
.lt-cell.solved .lt-v { color: #fff; }
.lt-notes { display: grid; grid-template-columns: repeat(3, 1fr); width: 86%; height: 86%; }
.lt-notes i { font: 700 clamp(8px, 2.2vw, 11px) var(--body); font-style: normal; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.lt-slot { display: flex; align-items: center; justify-content: center; font: 800 clamp(14px, 4vw, 20px) var(--display); color: var(--muted); }
.lt-pad { display: flex; justify-content: center; gap: 8px; margin: 14px auto 0; flex-wrap: wrap; }
.lt-key { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--glass-edge); background: var(--tile-top); box-shadow: var(--lift); font: 800 22px var(--display); color: var(--text); cursor: pointer; }
.lt-key.full { opacity: .35; }
.lt-tools { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lt-tools .btn.on { background: linear-gradient(180deg, #FFD964, #F5C542); }

/* Compact whole catalog cards; icons retain their original responsive sizes. */
.tiles-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.tiles-grid.tiles-board { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.gtile { padding: 16px; gap: 4px; border-radius: 23px; }
.gtile-top { margin-bottom: 4px; }
.gtile-foot { padding-top: 6px; }
@media (max-width: 560px) {
  .tiles-grid, .tiles-grid.tiles-board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gtile { padding: 10px; gap: 3px; border-radius: 19px; }
  .gtile-top { margin-bottom: 2px; }
  .gtile-foot { padding-top: 4px; gap: 4px; }
}

/* Short game hooks stay visible on compact cards, including phones. */
.gtile-blurb { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 13px; line-height: 1.35; }
@media(max-width:560px){
 .gtile-blurb { font-size:12px; line-height:1.3; }
 .gtile-foot { flex-direction:row; align-items:center; font-size:11px; gap:4px; }
 .gtile-foot .xp-chip { font-size:10px; padding:2px 6px; }
}
/* Let each short hook finish naturally rather than cutting off its invitation. */
.gtile-blurb { display:block; -webkit-line-clamp:unset; overflow:visible; }
