/* Hull Quest — shared styles for the player picker (/) and a kid's page (/k/<kid>).
   Ported from the design canvas (direction C · Quest). Always dark: Stephen
   chose the design's dark look for every device (2026-11-21). */
@font-face {
  font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap;
  src: url(/fonts/unbounded-latin-var.woff2) format('woff2');
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/fonts/inter-latin-var.woff2) format('woff2');
}

:root {
  --bg: #0D0F1C; --surface: #161A2E; --surface2: #12152A; --ink: #F4F5FF; --muted: #A2A8CC;
  --line: #272C4D; --track: #262B4A; --dot: #1C2140; --glow1: #3A2A8C; --glow2: #0E5A55;
  --xp: #7CF5C4; --xp-glow: rgba(124,245,196,.6); --gold: #FFC84A; --gold-soft: #3A2E12;
  --gold-glow: rgba(255,200,74,.55); --flame: #FF8A50; --done-bg: #10261F; --kid-glow: #5A3A12;
  --hex-idle: #3A4070; --chip: #222744; --on-accent: #0D0F1C;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: 'Inter', system-ui, sans-serif; min-height: 100vh;
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.display { font-family: 'Unbounded', sans-serif; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Page frame: the design is an 820px-wide iPad portrait; it scales down to phones. */
.page { position: relative; max-width: 820px; margin: 0 auto; min-height: 100vh; overflow: hidden;
  padding: max(40px, env(safe-area-inset-top)) 48px max(44px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 24px; }
.page > * { position: relative; }
.backdrop { position: absolute !important; inset: 0; pointer-events: none; }

/* Header */
.brand { display: flex; align-items: center; gap: 10px; }
.brand span { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 20px; letter-spacing: .02em; }
.eyebrow { font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1.title { margin: 0; font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 58px; line-height: 1; letter-spacing: -0.02em; }

/* Bars */
.bar { position: relative; border-radius: 999px; background: var(--track); }
.bar > .fill { height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.3,1.2,.4,1); }
.bar .marker { position: absolute; width: 3px; border-radius: 2px; background: var(--ink); }

/* Family goal card */
.goal { padding: 22px 24px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; align-items: center; gap: 22px; }
.goal .icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--gold-soft); flex-shrink: 0; }
.goal .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.goal .head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.goal .name { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 19px; }
.goal .pct { font-weight: 700; font-size: 15px; color: var(--muted); white-space: nowrap; }
.goal .pct b { color: var(--gold); font-size: 20px; }
.goal .bar { height: 14px; }
.goal .bar > .fill { background: var(--gold); box-shadow: 0 0 18px var(--gold-glow); }
.goal .bar .marker { top: -5px; height: 24px; }
.goal .line { font-size: 15px; font-weight: 600; color: var(--muted); }

/* Player cards (picker) */
.players { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card { display: flex; align-items: center; gap: 18px; padding: 18px 22px 18px 16px; border-radius: 26px; text-decoration: none;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), inset 0 -3px 0 var(--kid-shadow, transparent);
  transition: transform .2s cubic-bezier(.3,1.4,.5,1), box-shadow .2s; min-height: 150px; }
.card:hover, .card:focus-visible { transform: translateY(-4px); }
.card:focus-visible { outline: 3px solid var(--xp); outline-offset: 3px; }
.card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.card .row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.card .name { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 24px; }
.flame { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 15px; color: var(--flame); white-space: nowrap; }
.card .bar { height: 8px; overflow: hidden; }
.card .xpline { font-size: 14px; font-weight: 600; color: var(--muted); }
.card .today { font-size: 14px; font-weight: 700; }
.mission { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.center { display: flex; justify-content: center; }

/* Kid page */
.switch { display: flex; align-items: center; gap: 12px; min-height: 48px; text-decoration: none; }
.switch .who { display: flex; flex-direction: column; line-height: 1.1; }
.switch .who b { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 22px; }
.switch .who span { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 15px; color: var(--muted); white-space: nowrap; }
.pill.streak { font-weight: 800; font-size: 16px; color: var(--flame); }

.level { display: flex; flex-direction: column; gap: 14px; }
.level .top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.level .lv { font-size: 14px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--xp); }
.level .headline { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -0.02em; }
.level .nums { position: relative; text-align: right; white-space: nowrap; }
.level .nums b { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 22px; }
.level .nums span { font-weight: 700; font-size: 16px; color: var(--muted); }
.level .bar { height: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.level .bar > .fill { background: linear-gradient(90deg, var(--xp), #4DA3FF); box-shadow: 0 0 18px var(--xp-glow); }
.level .hint { font-size: 16px; font-weight: 600; color: var(--muted); }
.gain { position: absolute; right: 0; top: -22px; font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 22px;
  color: var(--xp); text-shadow: 0 0 16px var(--xp-glow); pointer-events: none; opacity: 0; }
.gain.go { animation: floatup 1.1s ease-out both; }
@keyframes floatup { 0% { transform: translateY(6px); opacity: 0 } 20% { opacity: 1 } 100% { transform: translateY(-34px); opacity: 0 } }

.boss { padding: 2px; border-radius: 26px; background-image: linear-gradient(110deg, #FFC84A, #FF8A50, #C77DFF, #FFC84A);
  background-size: 200% 100%; animation: shimmer 6s linear infinite; }
@keyframes shimmer { 0% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
.boss .in { display: flex; align-items: center; gap: 20px; padding: 20px 22px; border-radius: 24px; background: var(--surface); }
.boss .ic { width: 76px; height: 76px; border-radius: 22px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); flex-shrink: 0; }
.boss .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.boss .kick { font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.boss .what { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 28px; line-height: 1.1; }
.boss .side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.boss .xp { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 24px; color: var(--gold); }
.boss button { height: 44px; padding: 0 18px; border-radius: 12px; border: 0; cursor: pointer; font: 800 15px 'Inter', sans-serif; white-space: nowrap;
  background: var(--gold); color: #1A1406; }
.boss button.waiting { background: transparent; color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }

.groups { display: flex; flex-direction: column; gap: 18px; }
.cleared { all: unset; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 18px; background: var(--surface2); flex-wrap: wrap; }
.cleared:focus-visible { outline: 3px solid var(--xp); outline-offset: 2px; }
.cleared b { font-weight: 700; font-size: 16px; }
.cleared .muted { font-size: 15px; }
.cleared .plus { margin-left: auto; font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 15px; color: var(--xp); }
.group { display: flex; flex-direction: column; gap: 8px; }
.group .gh { display: flex; align-items: baseline; gap: 10px; }
.group h2 { margin: 0; font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.group .count { font-size: 14px; font-weight: 700; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quest { all: unset; cursor: pointer; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px 10px 12px;
  border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.quest:focus-visible { outline: 3px solid var(--xp); outline-offset: 2px; }
.quest .hex path.h { fill: transparent; stroke: var(--hex-idle); }
.quest .hex path.t { stroke: transparent; }
.quest .label { flex: 1; font-size: 17px; font-weight: 700; line-height: 1.2; text-align: left; }
.quest .chip { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 14px; padding: 5px 9px; border-radius: 9px; background: var(--chip); white-space: nowrap; }
.quest.on { background: var(--done-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--xp) 35%, transparent); }
.quest.on .hex path.h { fill: var(--xp); stroke: var(--xp); }
.quest.on .hex path.t { stroke: var(--on-accent); }
.quest.on .label { color: var(--muted); }
.quest.on .chip { color: var(--xp); background: transparent; }
.quest.pending .chip { color: var(--gold); }
.hexpop { animation: hexpop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes hexpop { 0% { transform: scale(.7) rotate(-20deg) } 60% { transform: scale(1.15) rotate(4deg) } 100% { transform: scale(1) rotate(0) } }
.empty { padding: 28px; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 18px; font-weight: 600; text-align: center; color: var(--muted); }

.levelup .headline { animation: lvpop .7s cubic-bezier(.3,1.6,.5,1); color: var(--gold); }
@keyframes lvpop { 0% { transform: scale(.8) } 60% { transform: scale(1.08) } 100% { transform: scale(1) } }

.offline { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 16px; border-radius: 12px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 14px; color: var(--muted); display: none; }
.offline.show { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Phones */
@media (max-width: 640px) {
  .page { padding: max(24px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom)); gap: 20px; }
  h1.title { font-size: 40px; }
  .players { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .goal { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; }
  .goal .icon { display: none; }
  .level .headline { font-size: 34px; }
  .boss .in { flex-wrap: wrap; gap: 14px; padding: 16px; }
  .boss .ic { width: 56px; height: 56px; }
  .boss .what { font-size: 22px; }
  .boss .side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
  .grid { grid-template-columns: 1fr; }
}
