/* Retro Space Cat · mobile-first */

:root {
  --cream: #f4f3ef;
  --paper: #ffffff;
  --ink: #151515;
  --muted: #5c5a55;
  --line: #e3e0d8;
  --space: #0b0e1c;
  --space-2: #161b38;
  --teal: #13e2b0;
  --cyan: #00c8e0;
  --blue: #2f8cff;
  --purple: #7b5cff;
  --pink: #ff5d7a;
  --gold: #ffc93c;
  --grad-text: linear-gradient(90deg, #13e2b0 0%, #00b2ff 40%, #8b5cf6 75%, #ff3fb4 100%);
  --grad-card: linear-gradient(160deg, #00c9d6 0%, #7b5cff 55%, #ff6b81 100%);
  --pixel: "Silkscreen", "Courier New", monospace;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  position: relative; /* lets Google's consent button anchor to the bottom of the page (see app.js) */
  min-height: 100vh;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.65 var(--mono);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
.narrow { max-width: 520px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--paper); padding: 8px; z-index: 10; }

/* ---------- Type ---------- */
.pixel-title {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  line-height: 1.1;
  margin: 0 0 .5em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pixel-title--hero { font-size: clamp(2.6rem, 12vw, 4.6rem); }
.pixel-title--small { font-size: clamp(1.35rem, 5vw, 1.7rem); }
.pixel-title--light { background: none; color: #fff; }
.eyebrow {
  font-family: var(--pixel);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .25em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  font-family: var(--pixel);
  font-size: 1rem;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
  color: #fff;
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  padding: .7em 1.2em;
  min-height: 48px;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
  touch-action: manipulation;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .7; cursor: default; transform: none; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.btn--pink { background: var(--pink); }
.btn--cyan { background: var(--cyan); color: var(--ink); }
.btn--big { font-size: 1.15rem; padding: .85em 1.6em; min-height: 56px; }
.btn--small { font-size: .8rem; padding: .35em .8em; min-height: 36px; box-shadow: 3px 3px 0 var(--ink); }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--muted);
  text-decoration: underline; cursor: pointer;
}

/* ---------- Top bar ---------- */
.envbar {
  background: var(--gold);
  font-size: .75rem;
  text-align: center;
  padding: 4px var(--gutter);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px var(--gutter);
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
}
.topbar__brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: .85rem; }
.topbar__brand span { font-family: var(--pixel); white-space: nowrap; }
.topbar__nav { display: flex; align-items: center; gap: 14px; font-size: .85rem; margin-left: auto; }
.topbar__end { display: flex; align-items: center; gap: 10px; }
.topbar__login { min-height: 34px; height: 34px; padding-block: 0; } /* same height as the chip and burger */
.topbar__burger { display: none; }
.topbar__wallet, .topbar__menu-only { display: none; }

/* Phones: the links live in a menu that drops down from the bar (only once JS can open it). */
@media (max-width: 759px) {
  .topbar__burger {
    display: grid; place-items: center; width: 38px; height: 34px; padding: 0; /* same height as the Stardust chip */
    background: var(--paper); color: var(--ink); border: 2px solid var(--ink); cursor: pointer;
  }
  .topbar__burger-close, .topbar.is-open .topbar__burger-open { display: none; }
  .topbar.is-open .topbar__burger-close { display: block; }
  .topbar.is-open .topbar__burger { background: var(--ink); color: #fff; }
  /* Full screen below the bar: fades and slides in, links following one after another. */
  .topbar__brand, .topbar__end { position: relative; z-index: 1; }
  .js .topbar__nav {
    position: fixed; inset: 0; z-index: 0; margin: 0; overflow-y: auto;
    padding: var(--menu-top, 64px) 0 calc(24px + env(safe-area-inset-bottom, 0px));
    flex-direction: column; align-items: stretch; gap: 0;
    /* cream, with a 2px line where the bar ends */
    background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 calc(var(--menu-top, 64px) - 2px) / 100% 2px, var(--cream);
    visibility: hidden; opacity: 0; transform: translateY(-12px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  }
  .js .topbar.is-open .topbar__nav {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
  }
  .js .topbar__nav > * { opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }
  .js .topbar.is-open .topbar__nav > * { opacity: 1; transform: none; }
  .js .topbar.is-open .topbar__nav > :nth-child(2) { transition-delay: .03s; }
  .js .topbar.is-open .topbar__nav > :nth-child(3) { transition-delay: .06s; }
  .js .topbar.is-open .topbar__nav > :nth-child(4) { transition-delay: .09s; }
  .js .topbar.is-open .topbar__nav > :nth-child(5) { transition-delay: .12s; }
  .js .topbar__link {
    display: block; padding: 20px var(--gutter); border-bottom: 1px solid var(--line);
    font-family: var(--pixel); font-size: 1.3rem; text-transform: uppercase; letter-spacing: .04em;
  }
  .js .topbar__link:hover, .js .topbar__link[aria-current="page"] { background: var(--paper); }
  .js .topbar__link[aria-current="page"] { box-shadow: inset 4px 0 0 var(--pink); }
  html.menu-open { overflow: hidden; } /* the page behind does not scroll */
  .js .topbar__menu-only { display: block; }
  .js .topbar__wallet { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 16px var(--gutter); font-size: .95rem; border-bottom: 1px solid var(--line); }
  .topbar__wallet span { display: inline-flex; align-items: center; gap: 6px; }
  /* No JS: the links stay in the bar, under the name. */
  html:not(.js) .topbar { flex-wrap: wrap; }
}
.topbar__link { text-decoration: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--paper); border: 2px solid var(--ink);
  padding: 2px 10px; font-weight: 700; text-decoration: none;
}
a.chip:hover { background: var(--cream); }
.chip--account { padding: 0 0 0 10px; gap: 0; min-height: 34px; }
.chip--account > img { margin-right: 6px; }
.chip__account {
  display: inline-flex; align-items: center; gap: 5px;
  margin-left: 10px; padding: 0 8px; align-self: stretch;
  background: var(--ink); color: #fff;
  font-family: var(--pixel); font-size: .7rem; font-weight: 400; text-transform: uppercase; letter-spacing: .05em;
}
a.chip--account:hover .chip__account { background: var(--pink); }
.chip__label { display: none; }

/* ---------- Footer ---------- */
/* Bottom padding keeps footer text clear of Google's floating consent button (bottom-left). */
.footer { margin-top: 56px; border-top: 1px solid var(--line); padding-block: 28px 140px; font-size: .8rem; color: var(--muted); }
.footer__brand { font-family: var(--pixel); color: var(--ink); margin-bottom: .4em; }
.footer__links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer__consent { font-size: inherit; color: inherit; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 22px 20px;
}
.card--gradient { background: var(--grad-card); color: #fff; }
.alert { background: #ffe3e8; border-left: 4px solid var(--pink); padding: 10px 12px; }

/* ---------- Station tracker ---------- */
.tracker {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  margin-top: 16px;
}
.tracker__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .85rem; }
.tracker__top p { margin: 0; }
.tracker__count strong { font-family: var(--pixel); font-size: 1.1rem; }
.tracker__reset { color: var(--muted); }
.tracker__bar { height: 10px; background: var(--line); margin: 10px 0 12px; border: 2px solid var(--ink); }
.tracker__bar span { display: block; height: 100%; background: var(--grad-text); transition: width .6s ease; }
.tracker__list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; /* one step per station, always one row */ gap: 6px; }
.tracker__list a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; text-align: center; font-size: .65rem; line-height: 1.2; color: var(--muted);
  padding: 4px 2px;
}
.tracker__num {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  font-family: var(--pixel); font-size: .95rem; color: var(--ink);
  border: 2px solid var(--ink); background: var(--cream);
}
.tracker__name { display: none; }
.tracker__list .is-done .tracker__num { background: var(--teal); }
/* Pixel tick (see pixel_tick()): 8x5 pixels drawn at 2x, so each pixel is a crisp 2px square. */
.tick { display: block; width: 16px; height: 10px; }
.station-tile__num .tick { width: 24px; height: 15px; }
.tracker__list .is-current .tracker__num { background: var(--pink); color: #fff; }
.tracker__list .is-current a { color: var(--ink); font-weight: 700; }

/* ---------- Station page ---------- */
.station-head { margin: 28px 0 18px; }
.station-head__intro { max-width: 46ch; }
.console {
  position: relative;
  background:
    radial-gradient(1px 1px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 68%, #cfe8ff 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 58%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 86%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 36%, #ffd9f0 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 88%, #fff 50%, transparent 51%),
    radial-gradient(ellipse at 80% 20%, rgba(19, 226, 176, .18), transparent 60%),
    radial-gradient(ellipse at 10% 90%, rgba(123, 92, 255, .25), transparent 55%),
    var(--space);
  color: #eef0ff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 24px 18px 28px;
  text-align: center;
  overflow: hidden;
}
.console a:not(.btn) { color: var(--teal); }
.console__hint { font-size: .8rem; color: #aab0d6; margin: 12px 0 0; }
.console__error { color: #ffb3c1; margin: 14px 0 0; }
.station-info {
  margin-top: 32px;
  padding: 18px 20px;
  background: var(--paper);
  border-radius: var(--radius);
  font-size: .9rem;
}
.station-info__title { font-family: var(--pixel); font-size: 1rem; margin: 0 0 .5em; }
.station-info__meta { color: var(--muted); margin: 0; font-size: .8rem; }
.coming-soon { padding: 24px 0; }
.coming-soon .pixel-title { background: none; color: var(--teal); }

/* Result */
.result { padding: 8px 0 4px; }
.result__label { font-family: var(--pixel); color: var(--teal); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .06em; }
.result__amount {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-family: var(--pixel); font-weight: 700; font-size: clamp(2.6rem, 14vw, 3.6rem); line-height: 1;
  margin: 0 0 12px; color: #fff;
}
.result__msg { font-size: 1.05rem; margin-bottom: 4px; }
.result__next { margin-top: 26px; }
.result__done p { margin-bottom: .6em; }
.result__done .pixel-title { background: none; color: var(--gold); }

/* Station 1: Launch Pad */
.launch__sky { position: relative; height: 230px; display: flex; align-items: flex-end; justify-content: center; }
.launch__pad { position: absolute; bottom: 0; left: 50%; width: 150px; height: 12px; transform: translateX(-50%); background: #4a4f6d; border-top: 4px solid #8a90b8; }
/* Lift-off (a transition) is on the wrapper and the shake (an animation) on the rocket:
   on one element, removing the animation cancels the transition. */
.rocket-lift { position: relative; z-index: 1; display: block; margin-bottom: 8px; }
.rocket { display: block; image-rendering: pixelated; filter: drop-shadow(0 0 1px #000); }
.rocket__flame { opacity: 0; }
.launch.is-fuelling .rocket { animation: shake .12s infinite; }
.launch.is-fuelling .rocket__flame { opacity: 1; animation: flicker .1s infinite alternate; }
.launch.is-launched .rocket-lift { transition: transform 1s cubic-bezier(.5, 0, .9, .4); transform: translateY(-340px); }
.launch.is-launched .rocket__flame { opacity: 1; }
.launch__countdown {
  position: absolute; top: 12px; left: 0; right: 0;
  font-family: var(--pixel); font-size: 3rem; color: var(--gold); line-height: 1;
  min-height: 1em;
}
.launch__controls { margin-top: 22px; }
@keyframes shake { 0% { transform: translate(0, 0); } 50% { transform: translate(-2px, 1px); } 100% { transform: translate(2px, -1px); } }
@keyframes flicker { from { transform: scaleY(1); } to { transform: scaleY(1.25); } }

.console__prompt { font-family: var(--pixel); color: var(--teal); margin: 0 0 16px; min-height: 1.4em; }
.tracker__streak { color: var(--ink); }
.tracker__streak strong { font-family: var(--pixel); color: var(--pink); }
.result__bonuses { list-style: none; padding: 0; margin: 0 0 10px; font-size: 1rem; }
.result__bonuses strong { color: var(--gold); font-family: var(--pixel); }
.result__title-unlock strong { color: var(--teal) !important; }
.result__streak { color: #cfd3f5; }
.console .result { margin-top: 22px; border-top: 2px dashed rgba(255, 255, 255, .15); padding-top: 18px; }
.console [data-play][hidden] + .result { margin-top: 0; border-top: 0; padding-top: 8px; }

/* Station 2: Asteroid Mine */
.mine__rocks { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.rock {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .04); border: 2px solid rgba(255, 255, 255, .15); border-radius: 10px;
  padding: 12px 6px 10px; width: 31%; max-width: 130px; cursor: pointer; color: #fff;
  transition: transform .15s, border-color .15s;
  touch-action: manipulation;
}
.rock:not(:disabled):hover { transform: translateY(-4px) rotate(-2deg); border-color: var(--teal); }
.rock:disabled { cursor: default; }
.rock:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.rock__art { width: 100%; max-width: 96px; height: auto; image-rendering: pixelated; }
.rock--1 .rock__art { transform: rotate(35deg); }
.rock--2 .rock__art { transform: scaleX(-1) rotate(-20deg); }
.rock__crack { opacity: 0; }
.rock__value { font-family: var(--pixel); font-size: 1.2rem; color: #aab0d6; }
.rock.is-cracking { animation: shake .1s infinite; border-color: var(--gold); }
.rock.is-open .rock__crack { opacity: 1; }
.rock.is-picked { border-color: var(--teal); background: rgba(19, 226, 176, .12); }
.rock.is-picked .rock__value { color: #fff; font-size: 1.5rem; }
.rock.is-other { opacity: .55; }
.rock.is-jackpot .rock__value { color: var(--gold); }

/* Station 3: Cosmic Wheel */
.wheel__frame { position: relative; width: min(280px, 80vw); margin: 0 auto 22px; }
/* The spin (a transition, set by JS) and the waiting wobble (an animation) live on
   different elements: on one element, removing the animation cancels the transition. */
.wheel__spin { display: block; }
.wheel__disc { display: block; width: 100%; height: auto; }
.wheel__label { font-family: var(--pixel); font-size: 17px; font-weight: 700; fill: #151515; }
.wheel__pointer {
  position: absolute; top: -6px; left: 50%; z-index: 1; transform: translateX(-50%);
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 24px solid #fff; filter: drop-shadow(0 2px 0 #151515);
}
.wheel.is-revving .wheel__disc { animation: rev .5s ease-in-out infinite alternate; }
@keyframes rev { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }

/* Station 4: Cat Quarters (pixel-art cabin, see views/stations/cat-room.php) */
.cat-room {
  width: 100%; max-width: 384px; margin: 0 auto 14px;
  border: 3px solid #000; border-radius: 6px; overflow: hidden; background: #1b2140;
}
.cat-room svg { display: block; width: 100%; height: auto; }
.cat-room .mood-part { display: none; }
.cat-room[data-mood="0"] .mood-0, .cat-room[data-mood="1"] .mood-1, .cat-room[data-mood="2"] .mood-2,
.cat-room[data-mood="3"] .mood-3, .cat-room[data-mood="4"] .mood-4, .cat-room[data-mood="5"] .mood-5 { display: inline; }
.cat-room .twinkle { animation: twinkle 1.8s steps(2) infinite; }
.cat-room .twinkle--late { animation-delay: .9s; }
@keyframes twinkle { 50% { opacity: .15; } }

/* Mood animations */
.cat-room[data-mood="1"] .fx--zzz { animation: drift 2.4s steps(4) infinite; }
.cat-room[data-mood="0"] .fx--cloud { animation: drift 3s steps(3) infinite alternate; }
.cat-room[data-mood="3"] .fx--sparkle, .cat-room[data-mood="4"] .fx--sparkle { animation: twinkle 1s steps(2) infinite; }
.cat-room[data-mood="4"] .cat-body { animation: hop .8s steps(2) infinite; }
.cat-room[data-mood="5"] .cat-body { animation: purr .16s steps(2) infinite; }
.cat-room[data-mood="5"] .fx--hearts { animation: drift 1.6s steps(4) infinite; }
@keyframes drift { 0% { transform: translate(0, 1px); opacity: 1; } 100% { transform: translate(1px, -2px); opacity: .4; } }
@keyframes hop { 50% { transform: translateY(-1px); } }
@keyframes purr { 50% { transform: translateX(.5px); } }

/* Feed: food appears, the cat walks over and munches. Pet: a hand pats, hearts rise. */
.cat-room .bowl__food, .cat-room .pet-hand, .cat-room .fx--love { opacity: 0; }
.cat-room .cat-walk { transition: transform 1s steps(6); }
.cat-room.is-feeding .bowl__food { opacity: 1; }
.cat-room.is-feeding .cat-walk { transform: translateX(10px); }
.cat-room.is-eating .cat-body { animation: munch .3s steps(2) infinite; }
.cat-room.is-eating .bowl__food { animation: twinkle .6s steps(2) infinite; }
.cat-room.is-petting .pet-hand { opacity: 1; animation: pat .35s steps(2) infinite; }
.cat-room.is-petting .fx--love { opacity: 1; animation: drift 1.2s steps(4) infinite; }
.cat-room.is-petting .mood-part.fx { display: none; }
@keyframes munch { 50% { transform: translateY(1px); } }
@keyframes pat { 50% { transform: translateY(2px); } }

.cat__mood { margin: 0 0 6px; }
.cat__mult { font-family: var(--pixel); color: var(--gold); margin-left: 6px; }
.cat__meter { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.cat__meter span { width: 22px; height: 12px; border: 2px solid #8a90b8; }
.cat__meter span.is-on { background: var(--pink); border-color: var(--pink); }
.cat__actions { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.cat__actions .btn { min-width: 120px; }

/* Station 5: Mystery Signal */
.signal { text-align: left; }
.signal__label { font-family: var(--pixel); font-size: .8rem; color: var(--teal); text-transform: uppercase; letter-spacing: .08em; display: flex; align-items: center; gap: 8px; }
.signal__dot { width: 10px; height: 10px; background: var(--pink); border-radius: 50%; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.signal__q { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 16px; }
.signal__options { display: grid; gap: 10px; margin-bottom: 14px; }
.signal__opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  font: inherit; color: #fff; background: rgba(255, 255, 255, .06);
  border: 2px solid rgba(255, 255, 255, .2); border-radius: 8px; padding: 12px 14px; min-height: 52px; cursor: pointer;
  touch-action: manipulation;
}
.signal__opt:not(:disabled):hover { border-color: var(--teal); }
.signal__opt:disabled { cursor: default; }
.signal__opt:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.signal__letter {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px;
  font-family: var(--pixel); background: var(--cream); color: var(--ink); border: 2px solid var(--ink);
}
.signal__opt.is-chosen { border-color: var(--gold); animation: blink .4s steps(2) infinite; }
.signal__opt.is-correct { border-color: var(--teal); background: rgba(19, 226, 176, .18); }
.signal__opt.is-correct .signal__letter { background: var(--teal); }
.signal__opt.is-wrong { border-color: var(--pink); background: rgba(255, 93, 122, .16); }
.signal__opt.is-wrong .signal__letter { background: var(--pink); color: #fff; }
.signal__fact { background: rgba(255, 255, 255, .06); border-left: 4px solid var(--gold); padding: 10px 12px; font-size: .9rem; }
.signal .btn, .signal .console__hint { display: flex; margin-inline: auto; width: fit-content; }
.signal .console__hint { display: block; text-align: center; width: auto; }

/* Banners (the winner's medal banner) */
.welcome { max-width: 1180px; margin: 16px auto 0; padding-inline: var(--gutter); }
.welcome__inner {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--paper); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--ink); padding: 18px;
}
.welcome__inner { padding: 14px 16px; font-size: .85rem; line-height: 1.5; }
.welcome__text p { margin-bottom: .5em; }
.welcome__title { font-family: var(--pixel); font-size: 1.15rem; margin: 0 0 .3em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.welcome__text ul { margin: 0 0 12px; padding-left: 1.1em; }
.welcome__text li { margin-bottom: 4px; }
.welcome__text form { margin: 0; }

/* Admin */
.admin__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; }
.admin__table td { vertical-align: top; }
.admin__table tr.is-inactive td { color: var(--muted); text-decoration: line-through; }
.notice { background: #e1fbf3; border-left: 4px solid var(--teal); padding: 10px 12px; }
.form__answers { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.form__answer { display: flex; align-items: center; gap: 10px; }
.form__answer input[type="radio"] { width: 20px; height: 20px; flex: none; }
textarea.form__input { resize: vertical; }

/* ---------- Ads ---------- */
.ad {
  display: block;
  margin: 40px 0;
  min-height: 280px;      /* reserved so ads never shift buttons */
  text-align: center;
}
.ad__label { display: block; font-size: .65rem; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.ad--placeholder {
  border: 2px dashed #c9c5ba;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
}
.ad--station_side { display: none; }
/* Top banner: phones and tablets only; fixed 100px so the page never jumps when it loads. */
.ad--station_top { min-height: 0; margin: 22px 0 6px; }
.ad--station_top ins, .ad--station_top.ad--placeholder { height: 100px; }

/* ---------- Home ---------- */
.hero {
  background: #05060c url("../img/nebula.jpg") center / cover no-repeat;
  color: #fff;
  padding-block: 40px 48px;
}
.hero__inner { display: grid; gap: 28px; align-items: center; }
.hero__text p { max-width: 46ch; }
.hero__done { font-family: var(--pixel); color: var(--teal); }
.section { margin-top: 36px; }
.section__lead { color: var(--muted); }
.station-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.station-tile a {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center;
  background: var(--paper); border-radius: var(--radius); padding: 14px 16px;
  text-decoration: none; border: 2px solid transparent;
}
.station-tile a:hover { border-color: var(--ink); }
.station-tile__num {
  grid-row: span 3; display: grid; place-items: center; width: 44px; height: 44px;
  font-family: var(--pixel); font-size: 1.2rem; border: 2px solid var(--ink); background: var(--cream);
}
.station-tile.is-done .station-tile__num { background: var(--teal); }
.station-tile__name { font-family: var(--pixel); font-size: 1.05rem; }
.station-tile__tag { font-size: .8rem; color: var(--muted); }
.station-tile__status { font-size: .75rem; font-weight: 700; color: #0a8f6e; }
.home-grid { display: grid; gap: 20px; }
.stat { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; }
.stat__num { font-family: var(--pixel); font-size: 1.5rem; }
.stat__label { margin: 0; opacity: .9; font-size: .85rem; }

/* Tables */
.table-scroll { overflow-x: auto; }
.board { width: 100%; border-collapse: collapse; font-size: .85rem; }
.board th, .board td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.board th { background: #f8f7f3; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board tr.is-me td { background: #e1fbf3; font-weight: 700; }
.board__gap td { text-align: center; color: var(--muted); letter-spacing: .3em; padding-block: 2px; background: none; }
.board__name { font-weight: 700; word-break: break-word; }
.board__id { color: var(--muted); font-weight: 400; }
.board__you {
  margin-left: 6px; font-family: var(--pixel); font-size: .65rem; text-transform: uppercase;
  background: var(--teal); color: var(--ink); padding: 1px 5px; vertical-align: 1px;
}
.board__hint { font-size: .8rem; color: var(--muted); margin: 12px 0 0; }
.board__more { margin: 16px 0 0; text-align: right; }
.board__hint--top { margin: -6px 0 12px; }
.board__rank { width: 2.5em; }
.board__rank .medal { display: block; }
.board__player { text-decoration: none; }
.board__player:hover { text-decoration: underline; }

/* Medals */
.medal { flex: none; image-rendering: pixelated; }
.prizes {
  background: var(--cream); border: 2px dashed #c9c5ba; border-radius: 8px;
  padding: 10px 12px; margin: 0 0 14px; font-size: .82rem;
}
.prizes__title { font-family: var(--pixel); font-size: .8rem; text-transform: uppercase; margin: 0 0 6px; }
.prizes__list { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.prizes__list li { display: flex; align-items: center; gap: 8px; }
.prizes__note { margin: 0; color: var(--muted); font-size: .76rem; }
@media (min-width: 720px) { .prizes__list { grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 22px; } }

.medals { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.medals__item { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--cream); border-radius: 8px; padding: 12px 6px 10px; text-align: center; }
.medals__item.is-empty .medal { opacity: .3; filter: grayscale(1); }
.medals__count { font-family: var(--pixel); font-size: 1.2rem; }
.medals__label { font-size: .72rem; color: var(--muted); }

/* Public profile */
.profile { margin-top: 24px; }
.profile__name { word-break: break-word; margin-bottom: .2em; }
.profile__name--id { background: none; color: var(--muted); }
.profile__since { color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.profile__recent { list-style: none; margin: 0 0 24px; padding: 0; font-size: .82rem; display: grid; gap: 6px; }
.profile__recent li { display: flex; align-items: center; gap: 8px; }
.profile__nomedals { color: var(--muted); margin: 0 0 24px; }
.profile__links { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; font-size: .85rem; }
.account__links { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin: 0 0 24px; }

/* Shop */
.shop { margin-top: 24px; }
.shop__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shop__head .section__lead { max-width: 52ch; }
.shop__balance { font-size: 1rem; margin: 6px 0 0; }
.shop__wallet { display: grid; gap: 6px; justify-items: start; }
.shop__progress { display: flex; align-items: center; gap: 8px; font-size: .75rem; color: var(--muted); }
.shop__bar { display: block; width: 90px; height: 8px; border: 2px solid var(--ink); background: var(--line); }
.shop__bar span { display: block; height: 100%; background: #b9a7ff; }

/* Moonstones */
.moonstone { display: inline-block; vertical-align: -2px; image-rendering: pixelated; }
.item__price .moonstone { vertical-align: -1px; }
.result__moonstone { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--pixel); color: #c4b0ff; margin: 6px 0 2px; }
.result__progress { color: #aab0d6; font-size: .78rem; margin: 2px 0 0; }
.account__moonstones, .account__stardust { display: flex; align-items: center; gap: 6px; }
.account__progress { display: block; font-size: .7rem; color: var(--muted); }
.shop__section { margin-top: 28px; }
.shop__title { font-family: var(--pixel); font-size: 1.15rem; margin: 0 0 .2em; }
.shop__blurb { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.shop__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--paper); border: 2px solid transparent; border-radius: var(--radius); padding: 12px 10px 14px;
  scroll-margin-top: 90px;
}
.item.is-equipped { border-color: var(--teal); }
.item__preview {
  display: grid; place-items: center; width: 100%; height: 112px; margin-bottom: 10px;
  background: var(--space); border-radius: 8px;
}
.item__preview svg { image-rendering: pixelated; }
.item__title-text { font-family: var(--pixel); color: var(--gold); font-size: .95rem; padding: 0 8px; }
.item__name { font-family: var(--pixel); font-size: .85rem; margin: 0; }
.item__price { font-size: .78rem; color: var(--muted); margin: 2px 0 10px; }
.item form { margin: 0; }
.item__btn { min-width: 120px; }
.item__btn.is-confirming { background: var(--gold); color: var(--ink); }
.item__state { font-family: var(--pixel); font-size: .75rem; text-transform: uppercase; color: #0a8f6e; padding: 8px 0; }
.item__state--short { color: var(--muted); text-transform: none; font-family: var(--mono); }
.shop__subtitle { font-family: var(--pixel); font-size: .95rem; margin: 22px 0 .2em; }
.item.is-locked .item__preview { opacity: .45; filter: grayscale(1); }
.item__state--locked { color: var(--muted); text-transform: none; font-family: var(--mono); }
@media (min-width: 560px) { .shop__grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .shop__grid { grid-template-columns: repeat(6, 1fr); } }

/* Badges beside names; titles; the shareable card */
.badge-art { display: inline-block; vertical-align: -2px; margin-right: 5px; image-rendering: pixelated; }
.profile__name .badge-art { vertical-align: 0; margin-right: 8px; }
.profile__title { font-family: var(--pixel); color: #c9921a; margin: -.2em 0 .3em; }
.card-share { margin: 0 0 24px; }
.card-share__img { display: block; width: 100%; height: auto; border-radius: 8px; border: 3px solid var(--ink); image-rendering: pixelated; }
.card-share__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.card-share__status { font-size: .8rem; color: var(--muted); }


/* Winner's banner colours */
.medal-banner .welcome__inner { align-items: center; border-color: #c9921a; box-shadow: 5px 5px 0 #c9921a; }
.medal-banner__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.medal-banner__actions form { margin: 0; }

/* Leaderboard page */
.leaderboard { margin-top: 28px; }
.leaderboard__intro { margin-bottom: 12px; }
.leaderboard__empty { text-align: center; padding: 24px 0; color: var(--muted); }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tabs__tab {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--pixel); font-size: .72rem; line-height: 1.2; text-transform: uppercase; text-decoration: none;
  padding: 8px 6px; min-height: 44px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
}
@media (min-width: 560px) { .tabs__tab { flex: none; font-size: .8rem; padding: 8px 14px; } }
@media (max-width: 379px) {
  .topbar { gap: 8px; }
  .topbar__brand { font-size: .78rem; }
  .topbar__end { gap: 8px; }
  .chip--account { padding-left: 7px; }
  .chip--account > img { margin-right: 4px; }
  .chip__account { margin-left: 7px; padding: 0 6px; }
}
.tabs__tab:hover { background: var(--cream); }
.tabs__tab.is-active { background: var(--ink); color: #fff; }

/* Account */
.account { margin-top: 24px; }
.account__email { color: var(--muted); word-break: break-all; }
.account__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 24px; }
.account__stats div { background: var(--cream); border-radius: 8px; padding: 10px 12px; }
.account__stats dt { font-size: .75rem; color: var(--muted); }
.account__stats dd { margin: 0; font-family: var(--pixel); font-size: 1.15rem; }
.account__heading { font-family: var(--pixel); font-size: 1.1rem; margin: 0 0 .4em; }
.account__hint { color: var(--muted); margin: 0; }
.account__hint--gap { margin-bottom: 22px; }
.account__logout { margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }

/* ---------- Login ---------- */
.login-card { margin-top: 32px; text-align: center; }
.login-card__again { margin-top: 24px; }
.login-card__cat { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 3px solid var(--ink); }
.form { display: grid; gap: 12px; text-align: left; margin-top: 8px; }
.form__label { font-size: .8rem; color: var(--muted); }
.form__input { font: inherit; padding: 14px; border: 2px solid var(--ink); border-radius: 6px; width: 100%; background: #fff; }
.form__input:focus { outline: 3px solid var(--blue); outline-offset: 1px; }
.form__check { display: flex; gap: 10px; align-items: flex-start; font-size: .8rem; margin-bottom: 8px; }
.form__check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.debug { text-align: left; white-space: pre-wrap; font-size: .7rem; background: #111; color: #eee; padding: 12px; overflow-x: auto; }

/* Confetti canvas */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; }

/* ---------- Wider screens ---------- */
@media (min-width: 560px) {
  .chip__label { display: inline; }
  .tracker__name { display: block; }
  .welcome__inner { padding: 18px; font-size: .9rem; }
  .station-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 820px) {
  .hero { padding-block: 72px; }
  .home-grid { grid-template-columns: 1fr 1fr; }
  .station-grid { grid-template-columns: repeat(3, 1fr); }
  .console { padding: 32px 28px 36px; }
  .launch__sky { height: 260px; }
}
@media (min-width: 1040px) {
  .station-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
  /* Sticky sidebar ad (desktop only): the column stretches to the main content's height so
     the ad can stay in view below the top bar while scrolling, and stops at the column end. */
  .station-side { align-self: stretch; }
  .ad--station_top { display: none; }
  .ad--station_side { display: block; min-height: 600px; margin-top: 28px; position: sticky; top: 80px; }
  .station-grid { grid-template-columns: repeat(6, 1fr); }
  .station-tile a { grid-template-columns: 1fr; text-align: left; height: 100%; align-content: start; }
  .station-tile__num { grid-row: auto; margin-bottom: 8px; }
}

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

/* ---------- Home, logged out: what the game is ---------- */
.hero__kicker { font-family: var(--pixel); color: var(--teal); letter-spacing: .04em; margin: 0 0 8px; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 20px; }
.hero__browse { color: #fff; font-weight: 700; }
.hero__lead { font-size: 1rem; }
@media (min-width: 820px) { .hero__lead { font-size: 1.1rem; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step { background: var(--paper); border-radius: var(--radius); padding: 18px 18px 6px; }
.step__num {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 10px;
  font-family: var(--pixel); font-size: 1.2rem; color: #fff; background: var(--grad-card); border: 2px solid var(--ink);
}
.step__title { font-family: var(--pixel); font-size: 1.05rem; margin: 0 0 6px; }
.step p { font-size: .9rem; }
.showcase { display: grid; gap: 18px; align-items: center; }
.showcase__cats { display: flex; justify-content: center; gap: 4px; background: var(--space) url("../img/nebula.jpg") center / cover; border-radius: 8px; padding: 18px 10px 10px; }
.showcase__cats svg { width: 30%; max-width: 104px; height: auto; }
.showcase__text p:last-child { margin-bottom: 0; }
.cta { margin-top: 36px; text-align: center; padding-block: 32px; }
.cta p { color: var(--muted); }
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .showcase { grid-template-columns: 1fr 1.2fr; gap: 28px; }
}
/* One column: the heading, standfirst and buttons get the full width */
.hero--intro .hero__text p { max-width: 62ch; }
@media (min-width: 1100px) {
  .hero--intro .hero__br { display: none; } /* "Retro Space Cat" on one line */
}

/* ---------- Home, signed in: slim status strip ---------- */
.hero--slim { padding-block: 22px 26px; }
.hero__slim { display: grid; gap: 18px; align-items: center; }
.hero__hello p { margin: 0; }
.hero__today { display: flex; align-items: center; gap: 12px; margin: 4px 0 !important; }
.hero__today span { font-size: 1rem; }
.hero__today-num { font-family: var(--pixel); font-size: clamp(2rem, 9vw, 2.8rem); line-height: 1; margin-right: 6px; color: var(--gold); }
.hero__meta { font-size: .85rem; opacity: .85; }
.hero__done { display: flex; align-items: center; gap: 10px; margin: 0; }
.hero__done .tick { width: 24px; height: 15px; }
@media (min-width: 820px) {
  .hero.hero--slim { padding-block: 28px; }
  .hero__slim { grid-template-columns: 1fr auto; }
}

/* "Today in orbit": live activity beside the logged-out hero */
.pulse {
  background: var(--space) url("../img/nebula.jpg") center / cover; color: #fff;
  border-radius: var(--radius); padding: 22px 20px;
}
.pulse__title { font-family: var(--pixel); font-size: 1rem; color: var(--teal); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.pulse__dot { width: 10px; height: 10px; background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: pulse-blink 1.6s steps(2, jump-none) infinite; }
@keyframes pulse-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) {
  .pulse__dot { animation: none; }
  .js .topbar__nav, .js .topbar__nav > * { transform: none !important; transition-property: opacity, visibility !important; transition-delay: 0s !important; }
}
.pulse__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 14px; }
.pulse__stats dt { font-size: .75rem; opacity: .8; }
.pulse__stats dd { margin: 2px 0 0; font-family: var(--pixel); font-size: 1.45rem; color: var(--gold); display: flex; align-items: center; gap: 6px; }
.pulse__empty { margin: 0 0 14px; }
.pulse__leader { font-size: .85rem; margin: 0 0 6px; }
.pulse__leader a { color: #fff; font-weight: 700; }
.pulse__reset { font-size: .75rem; opacity: .75; margin: 0; }
@media (min-width: 820px) {
  .pulse { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: center; padding: 26px 32px; }
  .pulse__title { grid-column: 1 / -1; }
  .pulse__stats, .pulse__empty { grid-row: span 2; margin: 0; }
  .pulse__stats dd { font-size: 1.9rem; }
}

/* ---------- How Stardust works ---------- */
.guide { padding-block: 28px 8px; }
.guide__lead { max-width: 70ch; }
.guide__section { margin-top: 20px; }
.guide__section > p { max-width: 70ch; }
.guide__section .pixel-title { display: flex; align-items: center; gap: 10px; }
.guide__subtitle { font-family: var(--pixel); font-size: .95rem; margin: 22px 0 .3em; }
.guide__table { margin: 6px 0 4px; }
.guide__table th[scope="row"] { font-family: var(--pixel); font-weight: 400; white-space: nowrap; background: none; }
.guide__table td:not(.num) { min-width: 14em; }
.guide__table--narrow { max-width: 420px; }
.guide__table--narrow td:not(.num) { min-width: 0; }
.guide__titles { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.guide__titles li { background: var(--cream); padding: 10px 12px; display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.guide__titles span { color: var(--muted); white-space: nowrap; }
.guide__medals { margin-bottom: 12px; }
/* Phones: each station is a small stacked card rather than a wide table row. */
@media (max-width: 599px) {
  .guide__table--stations thead { display: none; }
  .guide__table--stations tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .guide__table--stations th[scope="row"], .guide__table--stations td { padding: 0; border: 0; text-align: left; }
  .guide__table--stations th[scope="row"], .guide__table--stations td:not(.num) { grid-column: 1 / -1; min-width: 0; }
  .guide__table--stations td.num { text-align: left; }
  .guide__table--stations td.num::before { content: attr(data-label) ": "; color: var(--muted); }
  .guide__table--stations td.guide__none { display: none; }
}

/* ---------- Terms and Privacy ---------- */
.legal { padding-block: 28px 8px; }
.legal__body { max-width: 80ch; margin-top: 18px; }
.legal__body h2 { font-family: var(--pixel); font-size: 1.05rem; margin: 1.6em 0 .4em; }
.legal__body h3, .legal__body h4 { font-size: .95rem; margin: 1.2em 0 .3em; }
.legal__body h2:first-child, .legal__body p:first-child { margin-top: 0; }
.legal__body ul { padding-left: 1.2em; }
.legal__body li { margin-bottom: 4px; }
.legal__body { overflow-wrap: anywhere; }
.legal__date { color: var(--muted); font-size: .85rem; }

/* ---------- Account and profile: two columns on wide screens ---------- */
@media (min-width: 900px) {
  .narrow.split { max-width: 1080px; }
  .split .card { padding: 28px 32px; }
  .split__cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .split .account__stats { grid-template-columns: repeat(5, 1fr); }
  /* Profile: the card down the left, the details stacked on the right. */
  .split .profile { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .split .profile > * { grid-column: 2; }
  .split .profile__card { grid-column: 1; grid-row: 1 / span 5; }
  .split .profile__card .card-share { margin-bottom: 0; }
  .split .profile__stats .account__stats { grid-template-columns: repeat(2, 1fr); }
  .split .profile__links { grid-column: 1 / -1; }
}

/* Admin: player export */
.admin__export { margin-top: 18px; }
.admin__export .form__input { max-width: 220px; }
.admin__back { margin-top: 18px; font-size: .9rem; }

/* ---------- Admin: site report ---------- */
.admin__nav { margin: 0 0 18px; }
.wrap.admin { padding-block: 24px 8px; }
.stats .admin__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.stats__range { margin: 0; }
.stats__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0 0; }
.stats__tiles div { background: var(--paper); border-radius: var(--radius); padding: 12px 14px; }
.stats__tiles dt { font-size: .75rem; color: var(--muted); }
.stats__tiles dd { margin: 2px 0 0; font-family: var(--pixel); font-size: 1.5rem; }
.stats__tiles span { font-size: .72rem; color: var(--muted); }
.stats__card { margin-top: 18px; }
.stats__sub { margin-top: 22px; }
.stats__chart { margin: 8px 0 0; }
.stats__chart svg { display: block; width: 100%; height: auto; font-family: var(--mono); }
.stats__grid { stroke: var(--line); stroke-width: 1; }
.stats__axis { fill: var(--muted); font-size: 11px; }
.stats__mark { fill: #2f8cff; }
.stats__hit { fill: transparent; }
.stats__bar:hover .stats__hit { fill: rgba(47, 140, 255, .08); }
.stats__bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: .85rem; }
.stats__bars li { display: grid; grid-template-columns: minmax(0, 12em) 1fr 3.5em; gap: 10px; align-items: center; }
.stats__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats__track { height: 10px; background: var(--cream); border-radius: 4px; overflow: hidden; }
.stats__track span { display: block; height: 100%; background: #2f8cff; border-radius: 0 4px 4px 0; }
.stats__value { text-align: right; font-variant-numeric: tabular-nums; }
.stats__total { font-weight: 700; padding-top: 6px; border-top: 1px solid var(--line); }
.stats__table { margin-top: 12px; font-size: .82rem; }
.stats__table td, .stats__table th { white-space: nowrap; }
@media (min-width: 900px) {
  .stats__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .stats__tiles { grid-template-columns: repeat(4, 1fr); }
}

/* Admin home */
.admin__cards { display: grid; gap: 18px; margin-top: 18px; }
.admin__card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border: 2px solid transparent; transition: border-color .15s; }
.admin__card:hover, .admin__card:focus-visible { border-color: var(--ink); }
.admin__card p { color: var(--muted); font-size: .9rem; }
.admin__facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.admin__facts div { background: var(--cream); border-radius: 8px; padding: 8px 12px; }
.admin__facts dt { font-size: .7rem; color: var(--muted); }
.admin__facts dd { margin: 0; font-family: var(--pixel); font-size: 1.2rem; }
.admin__today { font-size: .82rem !important; }
.admin__go { margin-top: auto; font-family: var(--pixel); font-size: .8rem; color: var(--ink); text-decoration: underline; }
@media (min-width: 820px) { .admin__cards { grid-template-columns: repeat(3, 1fr); } }

/* Quick taps on buttons and keys never trigger double-tap zoom on phones (pinch zoom still works). */
button, .btn, [role="button"], .decoder__keys, .station-tile a { touch-action: manipulation; }

/* ---------- Station 6: Star Decoder ---------- */
.decoder { text-align: center; }
.decoder .signal__label { justify-content: center; margin-bottom: 14px; }
.decoder__grid { display: grid; gap: 6px; justify-content: center; margin: 0 auto 12px; }
.decoder__row { display: grid; grid-template-columns: repeat(5, 52px); gap: 6px; }
.decoder__tile {
  display: grid; place-items: center; height: 52px; font-family: var(--pixel); font-size: 1.5rem; text-transform: uppercase;
  color: #fff; border: 2px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04);
}
.decoder__tile.is-typed { border-color: rgba(255, 255, 255, .7); }
.decoder__tile.is-hit { background: #0a8f6e; border-color: #0a8f6e; }
.decoder__tile.is-near { background: #c9921a; border-color: #c9921a; }
.decoder__tile.is-miss { background: #3a3f5c; border-color: #3a3f5c; }
.decoder__tile.is-flip { animation: decoder-flip .45s ease; }
@keyframes decoder-flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
.decoder__row.is-shake { animation: decoder-shake .35s; }
@keyframes decoder-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .decoder__tile.is-flip, .decoder__row.is-shake { animation: none; } }
.decoder__msg { min-height: 1.6em; margin: 0 0 12px; color: #fff; }
.decoder__keys { display: grid; gap: 6px; margin: 0 auto 14px; max-width: 500px; }
.decoder__keyrow { display: flex; justify-content: center; gap: 5px; }
.decoder__key {
  flex: 1 1 0; min-width: 0; max-width: 44px; height: 50px; padding: 0; cursor: pointer;
  font-family: var(--pixel); font-size: .9rem; color: #fff; background: #5a6085; border: 0; border-radius: 4px;
}
.decoder__key--wide { max-width: 70px; flex-grow: 1.6; font-size: .7rem; }
.decoder__key--enter { max-width: 96px; flex-grow: 2.4; }
.decoder__key.is-hit { background: #0a8f6e; }
.decoder__key.is-near { background: #c9921a; }
.decoder__key.is-miss { background: #262a40; color: #8a8fb0; }
.decoder__key:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.decoder__share { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.decoder .btn--big { margin: 4px auto 10px; }
@media (max-width: 379px) {
  .decoder__row { grid-template-columns: repeat(5, 46px); }
  .decoder__tile { height: 46px; font-size: 1.3rem; }
  .decoder__key { height: 46px; font-size: .8rem; }
}

/* Star Decoder record (account page and profile) */
.decoder-stats { margin: 0 0 24px; }
.decoder-stats__tiles dd small { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.decoder-stats__sub { font-family: var(--pixel); font-size: .85rem; margin: 4px 0 8px; }
.decoder-stats__dist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 420px; font-size: .8rem; }
.decoder-stats__dist li { display: grid; grid-template-columns: 1.4em 1fr 2.6em; gap: 8px; align-items: center; }
.decoder-stats__n { font-family: var(--pixel); text-align: center; }
.decoder-stats__track { height: 14px; background: var(--cream); border-radius: 4px; overflow: hidden; }
.decoder-stats__track span { display: block; height: 100%; min-width: 2px; background: #0a8f6e; border-radius: 0 4px 4px 0; }
.decoder-stats__x .decoder-stats__track span { background: #8a8fb0; }
.decoder-stats__count { text-align: right; font-variant-numeric: tabular-nums; }
.decoder-stats__note { margin: 6px 0 0; font-size: .75rem; }
.profile__decoder .account__stats { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stats__tiles--inline { margin: 4px 0 18px; }
.stats__tiles--inline div { background: var(--cream); }
@media (min-width: 900px) { .stats__tiles--inline { grid-template-columns: repeat(3, 1fr); } }
