/* Wobble: "Mission patch" UI, sister to Waddle; jet cyan is the secondary accent. Flat indigo panels, cream keylines and stitching,
   coral primary actions, gold star accents. Fonts are self hosted, latin subset. */
@font-face {
  font-family: 'Fredoka';
  src: url('./fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Figtree';
  src: url('./fonts/figtree-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  /* palette from DESIGN.md */
  --space-bg: #0d0b1f;
  --panel: #17133a;
  --panel-2: #211c4d;
  --panel-3: #2c2660;
  --ink-deep: #07061a;
  --cream: #f6efe0;
  --muted: #b9b3d9;
  --faint: #8f89b8;
  --keyline: rgba(246, 239, 224, 0.9);
  --stitch: rgba(246, 239, 224, 0.3);
  --rule: rgba(185, 179, 217, 0.22);
  --coral: #ff6b5e;
  --coral-deep: #c9443a;
  --gold: #ffd75e;
  --gold-deep: #c99a1e;
  --glow: #5ef2ff;
  --plasma: #c13df0;
  --pink: #ff5fb7;
  --danger: #ff5a6e;

  --font-display: 'Fredoka', 'Nunito', ui-rounded, system-ui, sans-serif;
  --font-body: 'Figtree', ui-sans-serif, system-ui, sans-serif;

  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 20px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius-card: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* a five point star, used as a mask so it takes any color */
  --star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.8l2.95 6.6 7.2.7-5.43 4.8 1.6 7.07L12 17.3l-6.32 3.67 1.6-7.07L1.85 9.1l7.2-.7z' fill='%23000' stroke='%23000' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--space-bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(var(--safe-t) + var(--space-3)) calc(var(--safe-r) + var(--space-4)) 0 calc(var(--safe-l) + var(--space-4));
  pointer-events: none;
  /* above .screen so the mute button stays clickable on the start, pause and game over cards */
  z-index: 11;
  transition: opacity 240ms var(--ease);
}
#app[data-mode="loading"] #hud,
#app[data-mode="menu"] .hud-score,
#app[data-mode="menu"] #btn-pause,
#app[data-mode="over"] #btn-pause,
#app[data-mode="over"] .hud-score { opacity: 0; pointer-events: none; }

/* score sits on a small patch: indigo fill, cream keyline, stitched inner line */
.hud-score {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 92px;
  padding: 8px 16px 9px;
  border-radius: 22px;
  background: var(--panel);
  box-shadow: inset 0 0 0 2px var(--glow), 0 4px 0 var(--ink-deep);
  color: var(--cream);
  transition: opacity 240ms var(--ease);
}
.hud-score::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px dashed rgba(94, 242, 255, 0.35);
  border-radius: 17px;
  pointer-events: none;
}
.score-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 8vw, 48px);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  transform-origin: center;
}
.score-num.pop { animation: pop 260ms var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.18); color: var(--gold); } 100% { transform: scale(1); } }
.score-best {
  margin-top: 2px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}
.score-best b { color: var(--gold); font-weight: 800; letter-spacing: 0.04em; }

.hud-actions { display: flex; gap: var(--space-2); pointer-events: auto; }
#btn-pause { order: -1; }
.icon-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--panel);
  color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--keyline), 0 4px 0 var(--ink-deep);
  cursor: pointer;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), background-color 120ms var(--ease), opacity 240ms var(--ease);
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 2px var(--keyline), 0 1px 0 var(--ink-deep); }
.icon-btn .ico-off { display: none; }
.icon-btn[aria-pressed="true"] { color: var(--muted); }
.icon-btn[aria-pressed="true"] .ico-on { display: none; }
.icon-btn[aria-pressed="true"] .ico-off { display: block; }

/* ---------- warnings and floating labels ---------- */
/* the saucer is overhead: a cyan tractor beam narrows in from above and the edges go dark */
#vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 320ms var(--ease);
  background: radial-gradient(120% 90% at 50% 45%, rgba(13, 11, 31, 0) 45%, rgba(13, 11, 31, 0.78) 100%);
  overflow: hidden;
}
#vignette::before,
#vignette::after {
  content: '';
  position: absolute;
  left: 50%; top: -4%;
  width: 150%; height: 108%;
  transform: translateX(-50%);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
}
/* the cone itself, with faint scan bands like an old print */
#vignette::before {
  background:
    repeating-linear-gradient(to bottom, rgba(94, 242, 255, 0.14) 0 3px, rgba(94, 242, 255, 0) 3px 14px),
    linear-gradient(to bottom, rgba(94, 242, 255, 0.42), rgba(94, 242, 255, 0.12) 70%, rgba(94, 242, 255, 0.04));
}
/* bright edge lines of the beam */
#vignette::after {
  background:
    linear-gradient(to bottom, rgba(94, 242, 255, 0.9), rgba(94, 242, 255, 0));
  -webkit-mask: linear-gradient(to right, #000 0 1.2%, transparent 1.2% 98.8%, #000 98.8%);
  mask: linear-gradient(to right, #000 0 1.2%, transparent 1.2% 98.8%, #000 98.8%);
  opacity: 0.55;
}
#app.is-hurry #vignette { opacity: 1; }
#app.is-hurry #vignette::before,
#app.is-hurry #vignette::after { animation: beam 1400ms ease-in-out infinite alternate; }
@keyframes beam {
  from { transform: translateX(-50%) scaleX(1.25); opacity: 0.55; }
  to { transform: translateX(-50%) scaleX(0.8); opacity: 1; }
}


#fx { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.float-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--gold);
  text-shadow:
    2px 0 0 var(--ink-deep), -2px 0 0 var(--ink-deep), 0 2px 0 var(--ink-deep), 0 -2px 0 var(--ink-deep),
    0 4px 0 var(--ink-deep);
  animation: floatUp 800ms var(--ease) forwards;
  white-space: nowrap;
}
@keyframes floatUp {
  0% { opacity: 0; margin-top: 0; }
  15% { opacity: 1; }
  100% { opacity: 0; margin-top: -56px; }
}

/* ---------- screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  /* the top band is a border, not padding, so a scrolling card is clipped below the HUD buttons */
  border-top: calc(var(--safe-t) + 68px) solid rgba(13, 11, 31, 0.5);
  padding: var(--space-2) calc(var(--safe-r) + var(--space-4)) calc(var(--safe-b) + var(--space-4)) calc(var(--safe-l) + var(--space-4));
  background: rgba(13, 11, 31, 0.5);
  background-clip: padding-box;
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: screenIn 320ms var(--ease);
}
.screen[hidden] { display: none; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

/* an embroidered patch: indigo twill, cream border, a stitched line inside, a flat drop shadow */
.card {
  position: relative;
  width: min(100%, 384px);
  margin: auto;
  padding: 28px var(--space-6) var(--space-6);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow:
    inset 0 0 0 3px var(--keyline),
    0 0 0 5px var(--space-bg),
    0 10px 0 5px var(--ink-deep),
    0 24px 48px rgba(0, 0, 0, 0.45);
  color: var(--cream);
  text-align: center;
  animation: cardIn 420ms var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1.5px dashed var(--stitch);
  border-radius: calc(var(--radius-card) - 8px);
  pointer-events: none;
}
.card > * { position: relative; }
.card-small { width: min(100%, 300px); }
@keyframes cardIn { from { transform: translateY(16px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

/* the mission emblem at the top of the start patch: a moon, an orbit, a star */
.patch-mark {
  display: block;
  width: 76px; height: 76px;
  margin: -64px auto 4px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: inset 0 0 0 3px var(--glow), 0 0 0 5px var(--space-bg), 0 6px 0 5px var(--ink-deep);
}
.patch-mark svg { display: block; width: 100%; height: 100%; }

.title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 68px;
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--cream);
  text-shadow: 0 4px 0 var(--coral-deep);
}
/* a row of gold stars under the name, like the rocker on a mission patch */
.title::after {
  content: '';
  display: block;
  width: 128px; height: 16px;
  margin: 12px auto 0;
  background:
    linear-gradient(var(--glow), var(--glow)) left center / 34px 2px no-repeat,
    linear-gradient(var(--glow), var(--glow)) right center / 34px 2px no-repeat,
    radial-gradient(circle, var(--gold) 0 3px, transparent 3.5px) 44px center / 10px 10px no-repeat,
    radial-gradient(circle, var(--gold) 0 3px, transparent 3.5px) 74px center / 10px 10px no-repeat;
}
.title::before {
  content: '';
  position: absolute;
  left: 50%; bottom: -1px;
  width: 16px; height: 16px;
  transform: translateX(-50%);
  background: var(--gold);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
}
.title-sm { font-size: 48px; text-shadow: 0 3px 0 var(--coral-deep); }
.title-sm::before, .title-sm::after { display: none; }

.tagline > span { display: inline-block; }
.tagline {
  margin: var(--space-3) auto var(--space-5);
  max-width: 26ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: 1.25;
  color: var(--cream);
  text-wrap: balance;
}

.btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), background-color 120ms var(--ease), color 120ms var(--ease);
}
.btn-primary {
  background: var(--coral);
  color: var(--space-bg);
  box-shadow: 0 5px 0 var(--coral-deep), 0 5px 0 2px var(--ink-deep);
}
.btn-primary:hover { background: #ff7d71; }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-deep), 0 1px 0 2px var(--ink-deep); }
.btn-dark {
  width: auto;
  min-width: 88px;
  min-height: 52px;
  font-size: 20px;
  background: var(--gold);
  color: var(--space-bg);
  box-shadow: 0 4px 0 var(--gold-deep), 0 4px 0 2px var(--ink-deep);
}
.btn-dark:hover { background: #ffe07e; }
.btn-dark:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-deep), 0 1px 0 2px var(--ink-deep); }
.btn-dark[disabled] { opacity: 0.55; cursor: default; }
.btn-ghost {
  margin-top: var(--space-4);
  min-height: 52px;
  font-size: 20px;
  background: transparent;
  color: var(--cream);
  box-shadow: inset 0 0 0 2px var(--keyline);
}
.btn-ghost:hover { background: var(--panel-2); }
.btn-ghost:active { transform: translateY(2px); }
.card-small .btn-primary { margin-top: var(--space-5); }

.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible, .skin:focus-visible, input:focus-visible {
  outline: 3px solid var(--glow);
  outline-offset: 4px;
}

.hint { margin: var(--space-4) 0 0; font-size: var(--text-sm); color: var(--muted); font-weight: 500; text-wrap: balance; }
.hint-touch { display: none; }
@media (hover: none), (pointer: coarse) {
  .hint-touch { display: block; }
  .hint-keys { display: none; }
}

/* suit picker: round fabric swatches with a cream ring on the chosen one */
.skins {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1.5px dashed var(--stitch);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
}
.skins[hidden] { display: none; }
.skins-label {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.skin-list { display: flex; gap: 2px; }
.skin {
  position: relative;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
  display: grid; place-items: center;
  transition: transform 140ms var(--ease);
}
.skin i {
  display: block;
  width: 30px; height: 30px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(13, 11, 31, 0.35);
}
.skin::before {
  content: '';
  position: absolute;
  inset: 2px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
  pointer-events: none;
}
.skin:hover:not([disabled])::before { opacity: 0.4; transform: scale(1); }
.skin[aria-checked="true"]::before { opacity: 1; transform: scale(1); }
.skin[disabled] { cursor: default; }
.skin[disabled] i { opacity: 0.18; }
.skin[disabled]::after {
  content: attr(data-need);
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: var(--cream);
  font-variant-numeric: tabular-nums;
}

/* leaderboard */
.board { margin-top: var(--space-5); text-align: left; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); padding: 0 2px; min-height: 28px; }
.board-head h2 {
  margin: 0;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.05;
  color: var(--cream);
  white-space: nowrap;
}
.board-head h2::before {
  content: '';
  flex: none;
  width: 16px; height: 16px;
  background: var(--gold);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
}
.board-me { font-size: var(--text-sm); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  border-radius: 16px;
  background: var(--space-bg);
  min-height: 44px;
  max-height: 208px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-3) transparent;
  /* soft edges where text scrolls under the top and bottom of the card */
  -webkit-mask: linear-gradient(transparent, #000 16px, #000 calc(100% - 14px), transparent);
  mask: linear-gradient(transparent, #000 16px, #000 calc(100% - 14px), transparent);
}
#btn-rename { white-space: nowrap; }
.board-list li {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--cream);
  font-variant-numeric: tabular-nums lining-nums;
}
.board-list li + li { box-shadow: 0 -1px 0 var(--rule); }
.board-list li .rk { color: var(--faint); font-weight: 800; }
.board-list li .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.02em; }
.board-list li .sc { font-weight: 800; font-size: var(--text-base); font-variant-numeric: tabular-nums lining-nums; }
.board-list li:nth-child(1) .rk { color: var(--gold); }
.board-list li.is-me { background: var(--coral); color: var(--space-bg); box-shadow: none; }
.board-list li.is-me + li { box-shadow: none; }
.board-list li.is-me .rk { color: var(--space-bg); }
.board-list li.is-gap { display: block; min-height: 0; text-align: center; padding: 0; color: var(--faint); line-height: 1; }
.board-list li.is-note {
  display: block;
  padding: var(--space-3);
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
.board-list li.is-skel {
  height: 32px;
  margin: 2px 0;
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
  box-shadow: none;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- game over ---------- */
.over-reason {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 26px;
  line-height: 1.12;
  color: var(--cream);
  text-wrap: balance;
}
.over-score { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.over-stat {
  padding: var(--space-3) var(--space-2) var(--space-2);
  border-radius: 18px;
  background: var(--space-bg);
  box-shadow: inset 0 0 0 2px var(--panel-3);
}
.over-stat:first-child { box-shadow: inset 0 0 0 2px var(--coral); }
.over-label { display: block; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.over-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 48px;
  line-height: 1.05;
  color: var(--cream);
  font-variant-numeric: tabular-nums lining-nums;
}
.over-num-muted { color: var(--muted); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: var(--space-3) 0 0;
  padding: 6px 16px 7px 12px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--space-bg);
  font-weight: 800;
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: badgeIn 420ms var(--ease);
}
.badge::before {
  content: '';
  width: 16px; height: 16px;
  background: var(--space-bg);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
}
.badge[hidden] { display: none; }
@keyframes badgeIn { 0% { transform: scale(0.8); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

.name-form { margin-top: var(--space-4); text-align: left; }
.name-form[hidden] { display: none; }
.name-form label { display: block; margin: 0 0 6px 4px; font-size: var(--text-sm); font-weight: 700; color: var(--muted); }
.name-row { display: flex; gap: var(--space-3); align-items: center; }
.name-row input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 var(--space-4);
  border: 2px solid var(--panel-3);
  border-radius: 999px;
  background: var(--space-bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  user-select: text;
  -webkit-user-select: text;
}
.name-row input::placeholder { color: var(--faint); font-weight: 600; }
.name-row input:focus { border-color: var(--cream); outline: none; }
.name-row input:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.over-status { min-height: 20px; margin: var(--space-2) 0 0; font-size: var(--text-sm); font-weight: 700; color: var(--muted); }
.over-status.is-error { color: var(--danger); }
.over-status:empty { display: none; }
.link-btn {
  min-height: 44px;
  margin: -8px -4px -8px 0;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.link-btn:hover { color: var(--cream); }
.link-btn[hidden] { display: none; }
#screen-over .btn-primary { margin-top: var(--space-5); }

/* ---------- loading ---------- */
.loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-6);
  background:
    radial-gradient(1.5px 1.5px at 18% 22%, var(--cream) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 76% 14%, var(--cream) 50%, transparent 51%),
    radial-gradient(2px 2px at 64% 72%, var(--gold) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 80%, var(--muted) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 52%, var(--muted) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 8% 58%, var(--cream) 50%, transparent 51%),
    var(--space-bg);
  transition: opacity 400ms var(--ease), visibility 400ms;
}
/* a moon with a tiny star orbiting it */
.loading::before {
  content: '';
  width: 72px; height: 72px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 38%, #3a3763 0 7px, transparent 7.5px),
    radial-gradient(circle at 64% 64%, #3a3763 0 5px, transparent 5.5px),
    radial-gradient(circle at 66% 30%, #3a3763 0 3.5px, transparent 4px),
    #5b5788;
  box-shadow: inset -8px -6px 0 #524e7e, 0 0 0 3px var(--space-bg), 0 0 0 5px var(--keyline);
}
.loading::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  background: var(--gold);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
  animation: orbit 1.6s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes orbit {
  from { transform: translateY(-54px) rotate(0deg) translateX(60px) rotate(0deg); }
  to { transform: translateY(-54px) rotate(360deg) translateX(60px) rotate(-360deg); }
}
.loading-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 4px 0 var(--coral-deep);
}
.loading-sub { color: var(--muted); font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; font-size: var(--text-sm); }
.loading.is-done { opacity: 0; visibility: hidden; }
.loading.is-error::after { display: none; }
.loading.is-error .loading-sub { text-transform: none; letter-spacing: 0; max-width: 30ch; text-align: center; color: var(--cream); font-size: var(--text-base); font-weight: 600; }

#debug {
  position: absolute; left: 8px; bottom: 8px; z-index: 30;
  max-width: 60vw; max-height: 40vh; overflow: auto;
  margin: 0; padding: 8px;
  background: rgba(13, 11, 31, 0.85); color: var(--cream);
  font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
  border-radius: 8px;
}
#debug[hidden] { display: none; }

/* ---------- compact phones ---------- */
@media (max-height: 760px) {
  .card { padding: 24px var(--space-5) var(--space-5); }
  .patch-mark { width: 64px; height: 64px; margin-top: -54px; }
  .title { font-size: 56px; }
  .title::after { margin-top: 8px; }
  .title-sm { font-size: 44px; }
  .tagline { margin: var(--space-2) auto var(--space-4); font-size: 18px; }
  .hint { margin-top: var(--space-3); }
  .board { margin-top: var(--space-4); }
  .board-list { max-height: 140px; }
  .over-num { font-size: 40px; }
  .btn { min-height: 52px; }
}
@media (max-height: 680px) {
  .card { padding-top: 20px; }
  .patch-mark { width: 56px; height: 56px; margin-top: -44px; margin-bottom: 2px; }
  .title { font-size: 52px; }
  .title::after { margin-top: 6px; }
  .tagline { margin: 6px auto var(--space-3); }
  .hint { margin-top: var(--space-2); }
  .skins { margin-top: var(--space-3); padding-top: var(--space-2); }
  .board { margin-top: var(--space-3); }
}
@media (max-height: 700px) and (orientation: portrait) {
  .over-reason { font-size: 22px; margin-bottom: var(--space-3); }
  .over-stat { padding: var(--space-2) var(--space-2) 6px; }
  .over-num { font-size: 34px; }
  .badge { margin-top: var(--space-2); }
  .name-form { margin-top: var(--space-3); }
  #screen-over .board { margin-top: var(--space-3); }
  #screen-over .board-list { max-height: 104px; }
  #screen-over .btn-primary { margin-top: var(--space-4); }
}
@media (max-width: 360px) {
  .card { padding-left: var(--space-4); padding-right: var(--space-4); }
  .skins-label { letter-spacing: 0.08em; }
}

/* ---------- landscape phones: two columns ---------- */
@media (max-height: 460px) and (orientation: landscape) {
  #hud { padding-top: calc(var(--safe-t) + var(--space-2)); }
  .hud-score { min-width: 80px; padding: 6px 12px 7px; }
  .score-num { font-size: 34px; }
  .screen { border-top-width: 0; padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 76px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 76px); align-items: flex-start; }
  #screen-pause { align-items: center; }
  .patch-mark { display: none; }
  #screen-start .card, #screen-over .card {
    width: min(100%, 680px);
    display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-6);
    align-items: start; align-content: start; text-align: left;
    padding: 20px var(--space-5);
  }
  #screen-start .board, #screen-over .board { grid-column: 2; grid-row: 1 / span 8; margin-top: 0; }
  #screen-start .card > :not(.board):not(.patch-mark), #screen-over .card > :not(.board) { grid-column: 1; }
  .title { font-size: 52px; }
  .title::before { left: 64px; }
  .title::after { margin-left: 0; }
  .tagline { margin: var(--space-2) 0 var(--space-3); font-size: 17px; }
  .hint { margin-top: var(--space-2); }
  .skins { margin-top: var(--space-3); padding-top: var(--space-2); }
  #screen-over .badge { justify-self: start; }
  .over-reason { font-size: 22px; margin-bottom: var(--space-3); }
  .over-num { font-size: 36px; }
  .board-list { max-height: 228px; }
  #screen-over .board-list { max-height: 196px; }
  #screen-over .btn-primary { margin-top: var(--space-3); }
  .btn { min-height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .screen, .badge, .score-num.pop { animation: none; }
  #app.is-hurry #vignette::before, #app.is-hurry #vignette::after, .loading::after, .board-list li.is-skel { animation: none; }
  .loading::after { transform: translateY(-54px) translateX(60px); }
  .skin, .skin::before, .btn, .icon-btn, #vignette { transition: none; }
}

/* ---------- cross promotion: the sister game, quiet and secondary ---------- */
.card > .promo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  min-height: 56px;
  padding: 8px 12px 8px 8px;
  border-radius: 18px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--panel-3);
  color: var(--cream);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.card > .promo:hover { background: var(--panel-2); box-shadow: inset 0 0 0 1.5px var(--muted); }
.card > .promo:active { background: var(--panel-3); }
.card > .promo:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.promo-icon { flex: none; display: block; width: 40px; height: 40px; border-radius: 50%; }
.promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.promo-label { font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.promo-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.1; color: var(--cream); }
.promo-line { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--muted); }
.promo-arrow { flex: none; color: var(--muted); transition: transform 120ms var(--ease), color 120ms var(--ease); }
.card > .promo:hover .promo-arrow { color: var(--cream); transform: translateX(2px); }
#screen-over .promo { margin-top: var(--space-4); }
.promo-name { font-size: 16px; }
@media (max-width: 400px) { .promo-line { font-size: 12px; letter-spacing: -0.005em; } .card > .promo { gap: 10px; padding-inline: 10px 8px; } }
/* with the promo the start card can be taller than the screen; keep room so the emblem on top is never clipped */
@media (min-height: 461px), (orientation: portrait) {
  #screen-start.screen { padding-top: 64px; }
}
@media (max-height: 680px) and (orientation: portrait) {
  #screen-start.screen { padding-top: 52px; }
}
/* landscape phones: tuck the card under the leaderboard in the right column */
@media (max-height: 460px) and (orientation: landscape) {
  #screen-start .card > .promo.promo, #screen-over .card > .promo.promo {
    /* absolute inside its grid area: column 2, pinned to the bottom of the card content */
    position: absolute;
    grid-column: 2 / 3; grid-row: auto;
    left: 0; right: 0; bottom: 20px; width: auto;
    margin: 0;
    min-height: 52px;
    padding: 6px 10px 6px 6px;
  }
  .promo-line { display: none; }
  #screen-start .board, #screen-over .board { padding-bottom: 64px; }
  #screen-start .board-list { max-height: 196px; }
  #screen-over .board-list { max-height: 160px; }
}
@media (prefers-reduced-motion: reduce) {
  .card > .promo, .promo-arrow { transition: none; }
}

/* ---------- hold to fly prompt: a small patch in the lower third while the astronaut hovers ---------- */
#ready {
  position: absolute;
  left: 50%;
  bottom: max(calc(var(--safe-b) + 28px), 20vh);
  z-index: 9;
  max-width: calc(100% - var(--safe-l) - var(--safe-r) - 2 * var(--space-4));
  padding: 11px 22px 12px;
  border-radius: 999px;
  background: rgba(23, 19, 58, 0.92);
  box-shadow: inset 0 0 0 2px var(--glow), 0 4px 0 var(--ink-deep), 0 0 24px rgba(94, 242, 255, 0.18);
  color: var(--cream);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transform: translateX(-50%);
  animation: readyPulse 1.6s var(--ease) infinite;
}
#ready[hidden] { display: none; }
@keyframes readyPulse {
  0%, 100% { transform: translateX(-50%) scale(1); box-shadow: inset 0 0 0 2px var(--glow), 0 4px 0 var(--ink-deep), 0 0 18px rgba(94, 242, 255, 0.12); }
  50% { transform: translateX(-50%) scale(1.04); box-shadow: inset 0 0 0 2px var(--glow), 0 4px 0 var(--ink-deep), 0 0 30px rgba(94, 242, 255, 0.32); }
}
@media (max-height: 460px) and (orientation: landscape) {
  #ready { bottom: calc(var(--safe-b) + 14px); font-size: 17px; padding: 9px 20px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #ready { animation: none; }
}

/* ---------- giveaway: a gold prize ticket, a $100 seal and a tidy countdown ---------- */
/* ticket: a gold patch with punched sides, stitched to the top corner of the start and game over cards */
.card > .gw-ticket {
  position: absolute;
  top: -22px; left: -8px;
  z-index: 4;
  min-height: 46px;
  min-width: 104px;
  padding: 5px 16px 6px 20px;
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
  border: 0;
  background: none;
  color: var(--space-bg);
  text-align: left;
  cursor: pointer;
  transform: rotate(-4deg);
  transition: transform 160ms var(--ease);
  filter: drop-shadow(0 4px 0 var(--ink-deep));
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}
.card > .gw-ticket[hidden] { display: none; }
.gw-ticket::before {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  border-radius: 10px;
  background: var(--gold);
  box-shadow: inset 0 -3px 0 var(--gold-deep);
  -webkit-mask: radial-gradient(circle 6px at 0 50%, transparent 95%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, transparent 95%, #000) right / 51% 100% no-repeat;
  mask: radial-gradient(circle 6px at 0 50%, transparent 95%, #000) left / 51% 100% no-repeat, radial-gradient(circle 6px at 100% 50%, transparent 95%, #000) right / 51% 100% no-repeat;
}
.gw-ticket::after {
  content: '';
  position: absolute;
  inset: 5px 9px 6px 11px;
  border: 1.5px dashed rgba(13, 11, 31, 0.32);
  border-radius: 6px;
  pointer-events: none;
}
.gw-ticket:hover { transform: rotate(-2deg) translateY(-1px); }
.gw-ticket:active { transform: rotate(-2deg) translateY(2px); }
.gw-ticket:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.gw-ticket-title { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1; white-space: nowrap; }
.gw-ticket-left { font-size: var(--text-xs); font-weight: 800; line-height: 1.2; letter-spacing: 0.04em; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.gw-ticket-left:empty, .gw-ticket-left[hidden] { display: none; }
.gw-ticket.is-ended { color: var(--cream); }
.gw-ticket.is-ended::before { background: var(--panel-3); box-shadow: inset 0 0 0 1.5px var(--rule); }
.gw-ticket.is-ended::after { border-color: var(--stitch); }
.gw-ticket.is-ended .gw-ticket-title { font-size: 15px; }
/* the game over card has no emblem, so give its screen room above the card for the ticket */
#screen-over:has(.gw-ticket:not([hidden])) { padding-top: 30px; }
#screen-over .card:has(> .gw-ticket:not([hidden])) { padding-top: 34px; }

/* the pop up */
.gw {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  padding: calc(var(--safe-t) + 34px) calc(var(--safe-r) + var(--space-4)) calc(var(--safe-b) + var(--space-4)) calc(var(--safe-l) + var(--space-4));
  background: rgba(7, 6, 26, 0.74);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  animation: screenIn 260ms var(--ease);
}
.gw[hidden] { display: none; }
.gw-card {
  width: min(100%, 368px);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
  user-select: text;
  -webkit-user-select: text;
}
.gw-card:focus { outline: none; }
/* only the inside scrolls, so the seal and the close button never leave the card */
.card > .gw-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 30px var(--space-6) var(--space-6);
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-3) transparent;
  /* soft edge where the inside scrolls under the top and bottom of the card; the fade sits inside the padding */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 12px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18px, #000 calc(100% - 12px), transparent 100%);
}
.gw-stamp {
  position: absolute !important;
  top: -22px; left: -12px;
  width: 80px; height: 80px;
  display: grid; place-items: center;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><polygon points='96.0,50.0 90.7,54.6 94.8,60.2 88.7,63.5 91.4,70.0 84.7,71.8 86.0,78.7 79.0,79.0 78.7,86.0 71.8,84.7 70.0,91.4 63.5,88.7 60.2,94.8 54.6,90.7 50.0,96.0 45.4,90.7 39.8,94.8 36.5,88.7 30.0,91.4 28.2,84.7 21.3,86.0 21.0,79.0 14.0,78.7 15.3,71.8 8.6,70.0 11.3,63.5 5.2,60.2 9.3,54.6 4.0,50.0 9.3,45.4 5.2,39.8 11.3,36.5 8.6,30.0 15.3,28.2 14.0,21.3 21.0,21.0 21.3,14.0 28.2,15.3 30.0,8.6 36.5,11.3 39.8,5.2 45.4,9.3 50.0,4.0 54.6,9.3 60.2,5.2 63.5,11.3 70.0,8.6 71.8,15.3 78.7,14.0 79.0,21.0 86.0,21.3 84.7,28.2 91.4,30.0 88.7,36.5 94.8,39.8 90.7,45.4' fill='%23ffd75e' stroke='%230d0b1f' stroke-width='3' stroke-linejoin='round'/><circle cx='50' cy='50' r='34' fill='none' stroke='%230d0b1f' stroke-width='1.6' stroke-dasharray='3.2 3.2' opacity='.45'/></svg>") center / contain no-repeat;
  filter: drop-shadow(0 4px 0 var(--ink-deep));
  transform: rotate(-12deg);
  z-index: 4;
  pointer-events: none;
  animation: stampIn 620ms var(--ease) 120ms both;
}
.gw-stamp span { font-family: var(--font-display); font-weight: 700; font-size: 23px; line-height: 1; letter-spacing: -0.01em; color: var(--space-bg); }
.gw-card.is-ended .gw-stamp { filter: drop-shadow(0 4px 0 var(--ink-deep)) saturate(0.35) brightness(0.85); }
@keyframes stampIn { 0% { transform: rotate(-40deg) scale(0.4); opacity: 0; } 60% { transform: rotate(-6deg) scale(1.08); opacity: 1; } 100% { transform: rotate(-12deg) scale(1); } }
.gw-close { position: absolute !important; top: 14px; right: 14px; z-index: 4; }
.gw-title {
  margin: 0 48px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  color: var(--cream);
  text-shadow: 0 3px 0 var(--coral-deep);
  text-wrap: balance;
}
/* gold rule with a star under the title, the same rocker as the game title */
.gw-title::after {
  content: '';
  display: block;
  width: 112px; height: 14px;
  margin: 10px auto 0;
  background:
    linear-gradient(var(--gold), var(--gold)) left center / 40px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right center / 40px 2px no-repeat,
    var(--gold);
  -webkit-mask: linear-gradient(#000, #000) left center / 40px 2px no-repeat, linear-gradient(#000, #000) right center / 40px 2px no-repeat, var(--star) center / 14px 14px no-repeat;
  mask: linear-gradient(#000, #000) left center / 40px 2px no-repeat, linear-gradient(#000, #000) right center / 40px 2px no-repeat, var(--star) center / 14px 14px no-repeat;
}
.gw-lead { margin: var(--space-3) 0 0; font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--cream); text-wrap: pretty; }
.gw-clock {
  margin: var(--space-4) 0 0;
  padding: 10px var(--space-3) 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border-radius: 20px;
  background: var(--space-bg);
  box-shadow: inset 0 0 0 2px var(--panel-3);
}
.gw-clock[hidden] { display: none; }
.gw-clock-label { font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.gw-left { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.05; color: var(--gold); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.gw-left:empty::before { content: '\00a0'; }
.gw-when { font-size: var(--text-sm); font-weight: 600; color: var(--muted); }
.gw-when:empty { display: none; }
.gw-leader { margin: var(--space-3) 0 0; font-size: 15px; font-weight: 700; color: var(--cream); overflow-wrap: anywhere; }
.gw-leader:empty { display: none; }
.gw-leader.is-mine {
  display: inline-block;
  padding: 4px 14px 5px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--space-bg);
}
.gw-leader[hidden] { display: none; }
.gw-how { margin: var(--space-3) 0 0; font-size: var(--text-sm); font-weight: 500; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.gw-how[hidden] { display: none; }
.gw-rules { margin: var(--space-1) 0 0; text-align: left; }
.gw-rules summary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  font-size: var(--text-sm); font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  user-select: none;
  -webkit-user-select: none;
}
.gw-rules summary::-webkit-details-marker { display: none; }
.gw-rules summary::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform 160ms var(--ease); }
.gw-rules[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.gw-rules summary:hover { color: var(--cream); }
.gw-rules summary:focus-visible { outline: 3px solid var(--glow); outline-offset: 2px; border-radius: 8px; }
.gw-rules[open] summary { color: var(--cream); }
/* one rule per line in the same dark inset box as the clock, so it reads as part of the card */
.gw-rules-list {
  list-style: none;
  margin: 0 0 var(--space-1);
  padding: 12px 14px 13px;
  display: grid; row-gap: 7px;
  border-radius: 18px;
  background: var(--space-bg);
  box-shadow: inset 0 0 0 2px var(--panel-3);
  font-size: 13px; line-height: 1.45; font-weight: 500;
  color: var(--muted);
  text-align: left;
}
.gw-rules-list li { position: relative; margin: 0; padding: 0 0 0 16px; }
.gw-rules-list li::before {
  content: '';
  position: absolute; left: 2px; top: 0.72em;
  width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%;
  background: var(--gold);
}
.gw-play { margin-top: var(--space-3); }

/* Venmo box for the player in first place, in the pop up and on the game over card */
.gw-venmo { margin-top: var(--space-3); text-align: left; }
.gw-venmo[hidden] { display: none; }
.gw-venmo:not([data-mode="onfile"]) {
  padding: var(--space-3) var(--space-3) var(--space-3);
  border-radius: 20px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1.5px rgba(255, 215, 94, 0.55);
}
.gw-venmo p { margin: 0; }
.gw-venmo-text, .gw-venmo-note { font-size: var(--text-sm); font-weight: 700; line-height: 1.35; color: var(--cream); text-wrap: pretty; }
.gw-venmo-text::before, .gw-venmo-note::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  margin: 0 6px -2px 0;
  background: var(--gold);
  -webkit-mask: var(--star) center / contain no-repeat;
  mask: var(--star) center / contain no-repeat;
}
.gw-venmo-quiet { font-size: var(--text-sm); font-weight: 700; color: var(--muted); text-align: center; }
.gw-venmo-form { margin-top: var(--space-2); }
.gw-venmo-form label { display: block; margin: 0 0 6px 4px; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.gw-venmo .name-row { gap: var(--space-2); }
.gw-venmo .name-row input { height: 48px; text-transform: none; letter-spacing: 0.01em; font-size: 17px; font-weight: 700; }
.gw-venmo .btn-dark { min-width: 72px; min-height: 48px; font-size: 18px; }
.gw-venmo-msg { margin-top: 6px !important; font-size: var(--text-sm); font-weight: 700; line-height: 1.35; color: var(--muted); }
.gw-venmo-msg:empty { display: none; }
.gw-venmo-msg.is-error { color: var(--danger); }

/* the game over card makes room for the Venmo box by showing fewer rows (the list still scrolls) */
/* the Venmo note already says first place, so the personal best badge and the field label step aside */
#screen-over .card:has(#gw-venmo-over:not([hidden])) .badge { display: none; }
#gw-venmo-over .gw-venmo-form label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
#screen-over .card:has(#gw-venmo-over:not([hidden])) .board-list { max-height: 104px; }
@media (max-height: 760px) {
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .board-list { max-height: 72px; }
  .gw { padding-top: calc(var(--safe-t) + 30px); }
  .card > .gw-scroll { padding: 26px var(--space-5) var(--space-5); }
  .gw-title { font-size: 40px; }
}
@media (max-height: 700px) and (orientation: portrait) {
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .board-list { max-height: 72px; }
}

/* landscape phones */
@media (max-height: 460px) and (orientation: landscape) {
  .card > .gw-ticket { top: -24px; }
  #screen-start .card:has(> .gw-ticket:not([hidden])), #screen-over .card:has(> .gw-ticket:not([hidden])) { padding-top: 28px; }
  #screen-start:has(.gw-ticket:not([hidden])), #screen-over:has(.gw-ticket:not([hidden])) { padding-top: calc(var(--safe-t) + 28px); }
  #screen-over .gw-venmo { grid-column: 1; }
  #screen-over .card:has(> .gw-ticket:not([hidden])) { padding-top: 26px; }
  #screen-over .card:has(> .gw-ticket:not([hidden])) .over-reason { margin-bottom: var(--space-2); }
  #screen-over .card:has(> .gw-ticket:not([hidden])) .btn-primary { margin-top: var(--space-2); }
  .gw { padding: calc(var(--safe-t) + 28px) calc(var(--safe-r) + 76px) calc(var(--safe-b) + 12px) calc(var(--safe-l) + 76px); }
  .gw-card { width: min(100%, 520px); }
  .card > .gw-scroll { padding: 20px var(--space-6) var(--space-4); }
  .gw-title { font-size: 34px; margin: 0 48px 0 52px; text-align: left; }
  .gw-title::after { width: 96px; }
  .gw-title::after { margin-left: 0; }
  .gw-scroll { text-align: left; }
  .gw-lead { font-size: 16px; }
  .gw-clock { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: var(--space-3); padding: 8px var(--space-4) 9px; }
  .gw-left { font-size: 28px; }
  .gw-rules summary { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .gw, .gw-stamp { animation: none; }
  .gw-ticket, .gw-rules summary::after { transition: none; }
}

/* the ended titles are longer than "Win $100": keep them to two lines on a phone */
.gw-card.is-ended .gw-title { font-size: 34px; }

/* ---------- maker credit: one quiet plain text line at the very bottom of the start and game over cards ---------- */
.card > .credit.credit {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
}
@media (max-height: 460px) and (orientation: landscape) {
  /* sits under the promo card in the right column; the promo moves up one line to make room */
  #screen-start .card > .credit.credit, #screen-over .card > .credit.credit {
    position: absolute; grid-column: 2 / 3; grid-row: auto;
    left: 0; right: 0; bottom: 16px; margin: 0;
  }
  #screen-start .card > .promo.promo, #screen-over .card > .promo.promo { bottom: 38px; }
  #screen-start .board, #screen-over .board { padding-bottom: 82px; }
  #screen-start .board-list { max-height: 178px; }
  #screen-over .board-list { max-height: 142px; }
}

/* =====================================================================
   Sponsor: Perkins Motors, built into the moon world.
   The wordmark artwork is used as is; the frame around it is a riveted hull plate with a crescent and its orbit.
   ===================================================================== */
.sp { text-decoration: none; color: var(--cream); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sp-mark { display: block; width: auto; height: 15px; max-width: 100%; }
.sp-moon { flex: none; display: block; width: 30px; height: 30px; overflow: visible; }
.sp-text { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.sp-label {
  display: block;
  font-size: 10px; font-weight: 800; line-height: 1; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
/* the hull plate: deep space fill, a cyan keyline, four rivets, a stitched inner line */
.sp-plate {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px;
  padding: 6px 18px 6px 14px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 7px 7px, var(--faint) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 7px) 7px, var(--faint) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 7px calc(100% - 7px), var(--faint) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), var(--faint) 0 1.6px, transparent 2.2px),
    linear-gradient(180deg, #15122f, var(--space-bg));
  box-shadow: inset 0 0 0 1.5px rgba(94, 242, 255, 0.45), 0 3px 0 var(--ink-deep);
  transition: box-shadow 140ms var(--ease), transform 140ms var(--ease);
}
.sp-plate::before {
  content: ''; position: absolute; inset: 4px 14px; border-top: 1px dashed rgba(94, 242, 255, 0.22); border-bottom: 1px dashed rgba(94, 242, 255, 0.22);
  pointer-events: none;
}
a.sp-plate:hover { box-shadow: inset 0 0 0 1.5px var(--glow), 0 3px 0 var(--ink-deep), 0 0 18px rgba(94, 242, 255, 0.18); }
a.sp-plate:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px var(--glow), 0 1px 0 var(--ink-deep); }
.sp:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.sp-plate .sp-moon { animation: spOrbit 9s linear infinite; }
@keyframes spOrbit { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }

/* start card: the plate is the rocker under the name */
#screen-start .title::after, #screen-start .title::before { display: none; }
.card > .sp-start { width: fit-content; margin: 10px auto 0; }
.sp-start .sp-mark { height: 16px; }

/* game over card: a plate under the score, far from Play again */
.card > .sp-over { width: fit-content; margin: var(--space-3) auto 0; min-height: 44px; padding-block: 4px; }
.sp-over .sp-mark { height: 14px; }
.sp-over .sp-label { letter-spacing: 0.1em; }

/* pause card: one quiet line */
.card > .sp-line {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; margin: var(--space-3) auto -8px; width: fit-content; padding: 0 8px;
  border-radius: 12px;
}
.sp-line .sp-moon { width: 22px; height: 22px; }
.sp-line .sp-mark { height: 12px; }
.sp-line .sp-label { font-size: 9.5px; }
.sp-line:hover .sp-label { color: var(--cream); }

/* giveaway pop up: a plaque with the deal line and a visible link */
.gw-scroll > .sp-gw {
  display: block;
  margin: var(--space-4) 0 0;
  padding: 10px 14px 12px;
  border-radius: 16px;
  text-align: left;
  background:
    radial-gradient(circle at 8px 8px, var(--faint) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 8px) 8px, var(--faint) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at 8px calc(100% - 8px), var(--faint) 0 1.6px, transparent 2.2px),
    radial-gradient(circle at calc(100% - 8px) calc(100% - 8px), var(--faint) 0 1.6px, transparent 2.2px),
    linear-gradient(180deg, #15122f, var(--space-bg));
  box-shadow: inset 0 0 0 1.5px rgba(94, 242, 255, 0.45);
}
.sp-gw:hover { box-shadow: inset 0 0 0 1.5px var(--glow); }
.sp-gw-top { display: flex; align-items: center; gap: 10px; }
.sp-gw .sp-mark { height: 15px; }
.sp-deal { display: block; margin-top: 8px; text-wrap: pretty; font-size: var(--text-sm); font-weight: 600; line-height: 1.3; color: var(--cream); }
.sp-visit {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: var(--text-sm); font-weight: 800; color: var(--glow);
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.sp-visit::after { content: ''; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12h13M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12h13M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / contain no-repeat; }
.gw-card.is-ended .sp-gw { opacity: 1; }

/* HUD: a small stitched tag in the top band while flying; never clickable */
.hud-sp {
  flex: 0 1 auto; min-width: 0;
  align-self: flex-start;
  display: flex; align-items: center; gap: 7px;
  margin: 4px 10px 0;
  padding: 6px 11px 6px 8px;
  border-radius: 12px;
  background: rgba(13, 11, 31, 0.62);
  box-shadow: inset 0 0 0 1px rgba(94, 242, 255, 0.32);
  pointer-events: none;
  opacity: 0.92;
  transition: opacity 240ms var(--ease);
}
.hud-sp .sp-moon { width: 20px; height: 20px; }
.hud-sp .sp-text { gap: 3px; min-width: 0; }
.hud-sp .sp-label { font-size: 8.5px; letter-spacing: 0.14em; }
.hud-sp .sp-mark { width: 115px; height: auto; max-width: 100%; }
.hud-sp .sp-text { flex: 0 1 auto; }
#app[data-mode="loading"] .hud-sp, #app[data-mode="menu"] .hud-sp, #app[data-mode="over"] .hud-sp { opacity: 0; }
@media (max-width: 400px) {
  .hud-sp { margin-inline: 6px; padding-inline: 7px 8px; gap: 6px; }
  .hud-sp .sp-moon { width: 18px; height: 18px; }
  .hud-sp .sp-mark { width: 104px; }
}

/* the perk card: an incoming transmission from mission control */
.perk {
  position: absolute; inset: 0; z-index: 25;
  display: flex;
  padding: calc(var(--safe-t) + var(--space-4)) calc(var(--safe-r) + var(--space-4)) calc(var(--safe-b) + var(--space-4)) calc(var(--safe-l) + var(--space-4));
  background: rgba(7, 6, 26, 0.8);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: screenIn 220ms var(--ease);
}
.perk[hidden] { display: none; }
.perk-card {
  width: min(100%, 340px);
  padding: 30px var(--space-6) var(--space-5);
  background:
    repeating-linear-gradient(0deg, rgba(94, 242, 255, 0.035) 0 1px, transparent 1px 4px),
    var(--panel);
  user-select: text; -webkit-user-select: text;
}
.perk-card:focus { outline: none; }
.perk-signal {
  display: block; width: 64px; height: 64px; margin: -64px auto 6px;
  border-radius: 50%; background: var(--panel);
  box-shadow: inset 0 0 0 3px var(--glow), 0 0 0 5px var(--space-bg), 0 6px 0 5px var(--ink-deep);
}
.perk-signal svg { display: block; width: 100%; height: 100%; padding: 8px; }
.perk-wave { animation: perkPulse 1.6s var(--ease) infinite; }
.perk-wave-2 { animation-delay: 0.25s; }
@keyframes perkPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.perk-kicker {
  margin: 0; font-size: var(--text-xs); font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--glow);
}
.perk-title {
  margin: 6px 0 0; font-family: var(--font-display); font-weight: 700; font-size: 32px; line-height: 1.05;
  color: var(--cream); text-shadow: 0 3px 0 var(--coral-deep); text-wrap: balance;
}
.card > .perk-plate { width: fit-content; margin: var(--space-4) auto 0; padding-inline: 16px 20px; }
.perk-plate .sp-mark { height: 17px; }
.perk-lead { margin: var(--space-4) auto 0; max-width: 30ch; font-size: var(--text-base); font-weight: 600; line-height: 1.4; color: var(--cream); text-wrap: pretty; }
.card > .perk-go { margin-top: var(--space-5); font-size: 20px; text-decoration: none; text-align: center; }
.card > .perk-close { margin-top: var(--space-3); min-height: 48px; font-size: 18px; box-shadow: none; color: var(--muted); }
.card > .perk-close:hover { color: var(--cream); background: var(--panel-2); }
@media (max-height: 460px) and (orientation: landscape) {
  .perk { padding-top: calc(var(--safe-t) + 40px); padding-bottom: calc(var(--safe-b) + 8px); }
  .perk-card { width: min(100%, 520px); padding: 22px var(--space-6) var(--space-4); display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-5); align-items: center; }
  .perk-card > * { grid-column: 1; }
  .perk-signal { grid-column: 1 / -1; margin-top: -54px; margin-bottom: 2px; width: 56px; height: 56px; }
  .perk-kicker, .perk-title { grid-column: 1 / -1; }
  .perk-title { font-size: 28px; }
  .card > .perk-plate { grid-column: 1; margin-top: var(--space-3); }
  .perk-lead { grid-column: 1; margin-top: var(--space-3); font-size: 15px; }
  .card > .perk-go { grid-column: 2; grid-row: 4; margin-top: var(--space-3); align-self: end; }
  .card > .perk-close { grid-column: 2; grid-row: 5; margin-top: var(--space-2); align-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-plate .sp-moon, .perk-wave { animation: none; }
  .sp-plate { transition: none; }
}

/* =====================================================================
   Start card fits with no scrolling: the card rises into the top band (the mute button sits beside the emblem),
   spacing is tighter, and the board takes whatever height is left (three rows and a peek on short screens).
   ===================================================================== */
@media (min-height: 461px), (orientation: portrait) {
  #screen-start.screen { border-top-width: 0; padding-top: calc(var(--safe-t) + 66px); padding-bottom: calc(var(--safe-b) + 8px); }
  #screen-start .card { padding-top: 22px; padding-bottom: 16px; }
  #screen-start .patch-mark { margin-top: -58px; margin-bottom: 2px; }
  #screen-start .title { font-size: 60px; }
  #screen-start .tagline { margin: 10px auto 14px; }
  #screen-start .hint { margin-top: 8px; }
  #screen-start .skins { margin-top: 12px; padding-top: 8px; }
  #screen-start .board { margin-top: 10px; }
  #screen-start .board-head { margin-bottom: 4px; }
  #screen-start .card > .promo { margin-top: 10px; min-height: 50px; padding-block: 4px; }
  #screen-start .card > .credit.credit { margin-top: 6px; }
  /* the card is a column that may not grow past the screen; only the board list gives up height */
  #screen-start .card { display: flex; flex-direction: column; max-height: 100%; }
  #screen-start .card > * { flex: none; }
  #screen-start .card > .board { flex: 0 1 auto; min-height: 148px; display: flex; flex-direction: column; }
  #screen-start .board-list { flex: 0 1 auto; min-height: 116px; max-height: 328px; }
}
@media (max-height: 700px) and (orientation: portrait), (max-height: 700px) and (min-height: 461px) {
  #screen-start .title { font-size: 52px; }
  #screen-start .tagline { font-size: 17px; margin: 8px auto 12px; }
  #screen-start .hint-touch { display: none; }
  #screen-start .promo-line { display: none; }
}
@media (max-height: 460px) and (orientation: landscape) {
  /* landscape phones: the plate takes the tagline's place under the name */
  #screen-start .card > .sp-start { margin: 8px 0 0; }
  #screen-start .tagline { display: none; }
  #screen-start .btn-primary { margin-top: 14px; }
  #screen-start .board-list { max-height: 148px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  /* with the notch insets on both sides the card is about 600px wide: keep both columns inside it */
  #screen-start .card, #screen-over .card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; padding-left: 20px; padding-right: 20px; }
  #screen-start .skins { flex-direction: column; align-items: flex-start; gap: 2px; }
  #screen-start .skin-list { margin-left: -6px; }
  .board-head { gap: 8px; }
  .board-head h2 { font-size: 20px; }
  .board-me { font-size: 12px; }
}

/* game over card: same idea as the start card; the board gives up height first so Play again stays on screen */
@media (min-height: 461px), (orientation: portrait) {
  #screen-over.screen, #screen-over.screen:has(.gw-ticket:not([hidden])) { border-top-width: 0; padding-top: calc(var(--safe-t) + 70px); padding-bottom: calc(var(--safe-b) + 8px); }
  #screen-over .card { display: flex; flex-direction: column; max-height: 100%; padding-bottom: 16px; }
  #screen-over .card > * { flex: none; }
  #screen-over .card > .board { flex: 0 1 auto; min-height: 112px; display: flex; flex-direction: column; margin-top: 12px; }
  #screen-over .board-head { margin-bottom: 4px; }
  #screen-over .board-list { flex: 0 1 auto; min-height: 80px; max-height: 208px; }
  #screen-over .card > .promo { margin-top: 12px; min-height: 50px; padding-block: 4px; }
  #screen-over .card > .credit.credit { margin-top: 6px; }
}
@media (min-height: 461px), (orientation: portrait) {
  #screen-over .over-reason { font-size: 22px; margin-bottom: 10px; text-wrap: balance; }
  #screen-over .over-stat { padding: 8px 8px 6px; }
  #screen-over .over-num { font-size: 38px; }
  #screen-over .badge { margin-top: 10px; }
  #screen-over .name-form { margin-top: 10px; }
}
@media (max-height: 700px) and (orientation: portrait), (max-height: 700px) and (min-height: 461px) {
  #screen-over .over-num { font-size: 34px; }
  #screen-over .card > .sp-over { margin-top: 10px; }
  #screen-over .promo-line { display: none; }
  #screen-over .card > .promo { min-height: 46px; }
}
@media (min-height: 461px), (orientation: portrait) {
  /* the card never squeezes below its content; if it truly cannot fit, the screen scrolls instead */
  #screen-over .card:has(#gw-venmo-over:not([hidden])) > .board { min-height: 104px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .board-list { min-height: 72px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .promo-line { display: none; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) > .promo { min-height: 46px; margin-top: 10px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) > .btn-primary { margin-top: 12px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) > .sp-over { margin-top: 10px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .over-status { margin-top: 6px; }
}
@media (min-height: 461px), (orientation: portrait) {
  /* the card may only shrink down to its content with the board at its smallest; below that the screen scrolls */
  #screen-start .card { max-height: max(100%, var(--card-min, 650px)); }
  #screen-over .card { max-height: max(100%, var(--card-min, 656px)); }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) { --card-min: 682px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .over-num { font-size: 34px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .over-stat { padding: 6px 8px 4px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) .over-reason { margin-bottom: 8px; }
  #screen-over .card:has(> .gw-ticket:not([hidden])):has(#gw-venmo-over:not([hidden])) { padding-top: 30px; }
  #screen-over #gw-venmo-over:not([data-mode="onfile"]) { padding: 10px; }
  #screen-over #gw-venmo-over .gw-venmo-form { margin-top: 6px; }
  #screen-over #gw-venmo-over .name-row input, #screen-over #gw-venmo-over .btn-dark { height: 46px; min-height: 46px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) > .credit.credit { margin-top: 4px; }
}
@media (max-height: 700px) and (orientation: portrait), (max-height: 700px) and (min-height: 461px) {
  #screen-start .card { --card-min: 570px; }
  #screen-over .card { --card-min: 640px; }
  #screen-over .card:has(#gw-venmo-over:not([hidden])) { --card-min: 690px; }
}
@media (min-height: 461px), (orientation: portrait) {
  #screen-over .card:has(#gw-venmo-over:not([hidden])) > .sp-over { margin-top: 8px; }
}
@media (min-height: 461px) and (min-width: 700px) {
  /* wide screens: the mute button is far off to the right, so the cards can use the top band */
  #screen-start.screen { padding-top: calc(var(--safe-t) + 48px); }
  #screen-over.screen, #screen-over.screen:has(.gw-ticket:not([hidden])) { padding-top: calc(var(--safe-t) + 32px); }
  #screen-start .card { --card-min: 624px; }
  #screen-over .card { --card-min: 658px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  /* game over: the plate heads the right column above the board, well away from Play again */
  #screen-over .card > .sp-over.sp-over { position: absolute; grid-column: 2 / 3; grid-row: auto; top: 20px; left: 0; right: 0; margin: 0; width: auto; }
  #screen-over .card:has(> .gw-ticket:not([hidden])) > .sp-over.sp-over { top: 26px; }
  #screen-over .card > .board { padding-top: 58px; }
  .sp-over .sp-label { font-size: 9px; letter-spacing: 0.06em; }
  #screen-over .over-reason { font-size: 20px; margin-bottom: 8px; }
  /* compact score row: label and number side by side */
  #screen-over .over-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 6px 12px 5px; border-radius: 14px; }
  #screen-over .over-num { font-size: 28px; line-height: 1.1; }
  #screen-over .badge { margin-top: 8px; padding-block: 4px 5px; }
  #screen-over .name-form { margin-top: 8px; }
  #screen-over .name-form label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  #screen-over .name-row input { height: 48px; }
  #screen-over .name-row .btn-dark { min-height: 48px; }
  #screen-over .card > .btn-primary { margin-top: 8px; }
  #screen-over .over-status { margin-top: 6px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  #screen-over .board-list { max-height: 100px; }
  #screen-start .hint { margin-top: 6px; }
  #screen-start .skins { margin-top: 8px; padding-top: 6px; }
}

/* On very wide, shallow windows the top band of rock gets thin, so the HUD tag steps aside there.
   The plate on the floor rock still carries the sponsor during the flight. */
@media (min-aspect-ratio: 5/2), (max-height: 330px) {
  .hud-sp { display: none; }
}

/* The giveaway pop up takes the stage: put the card behind it away so its edges do not peek out around it. */
.screen[data-gw-inert] > * { visibility: hidden; }

/* ---------- crew drawing (the module styles itself in crew.css; this is only how it sits on Wobble's cards) */
/* on Wobble's start card the entry point is a sticker beside the title, so the card does not grow */
#screen-start .card > #crew-start { position: absolute; z-index: 3; top: 45px; right: -10px; margin: 0; }
#screen-start #crew-start .crew-tag {
  flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 82px; min-height: 50px;
  padding: 6px 6px 7px;
  border-radius: 14px;
  background: var(--glow);
  color: var(--space-bg);
  box-shadow: 0 0 0 3px var(--space-bg), 0 5px 0 3px var(--ink-deep);
  transform: rotate(5deg);
  text-align: center;
}
#screen-start #crew-start .crew-tag::before {
  content: ''; position: absolute; inset: 4px; border: 1.5px dashed rgba(13, 11, 31, 0.35); border-radius: 10px; pointer-events: none;
}
#screen-start #crew-start .crew-tag::after { display: none; }
#screen-start #crew-start .crew-tag:hover { background: #8af6ff; transform: rotate(3deg) translateY(-1px); }
#screen-start #crew-start .crew-tag:active { transform: rotate(3deg) translateY(2px); }
#screen-start #crew-start .crew-tag-icon { display: none; }
#screen-start #crew-start .crew-tag-text { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; }
#screen-start #crew-start .crew-tag-title, #screen-start #crew-start .crew-tag-sub { display: none; }
#screen-start #crew-start .crew-tag-short { display: block; font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1; white-space: nowrap; }
#screen-start #crew-start .crew-tag-mini { display: block; font-size: 11px; font-weight: 800; line-height: 1.2; letter-spacing: 0.02em; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
@media (max-height: 760px) { #screen-start .card > #crew-start { top: 33px; } }
@media (max-height: 700px) and (orientation: portrait) { #screen-start .card > #crew-start { top: 21px; } }
@media (max-width: 360px) {
  #screen-start #crew-start .crew-tag { width: 78px; }
  #screen-start #crew-start .crew-tag-short { font-size: 15px; }
}
@media (max-height: 460px) and (orientation: landscape) {
  #screen-start .card > #crew-start { top: 27px; right: calc(50% + 10px); }
}
/* the second way to win, under the giveaway pop up's Play button */
.gw-crew {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  min-height: 44px;
  margin: 20px 0 0; /* clear of the Play button's drop edge, so the two do not read as one block */
  padding: 3px 14px 3px 10px;
  border: 0;
  border-radius: 18px;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1.5px rgba(94, 242, 255, 0.55);
  color: var(--cream);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms var(--ease);
}
.gw-crew:hover { background: var(--panel-3); }
.gw-crew:focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; }
.gw-crew-icon { flex: none; width: 28px; height: 18px; color: var(--glow); }
.gw-crew-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gw-crew-label { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--glow); line-height: 1.2; }
.gw-crew-name { font-size: 14px; font-weight: 800; line-height: 1.2; text-wrap: balance; }
.gw-crew::after { content: ''; flex: none; width: 7px; height: 7px; border: solid var(--muted); border-width: 2px 2px 0 0; transform: rotate(45deg); }
.gw-crew[hidden], .gw-card.is-ended .gw-crew { display: none; }
.gw-card:not(.is-ended):has(.gw-crew:not([hidden])) .gw-clock,
.gw-card:not(.is-ended):has(.gw-crew:not([hidden])) .gw-scroll > .sp-gw { margin-top: 12px; }
/* shorter screens: the extra air above the row comes out of the spacing higher up, so the pop up is no taller than before */
@media (max-height: 760px) {
  .gw-card:not(.is-ended):has(.gw-crew:not([hidden])) .gw-play { margin-top: 4px; }
  .gw-card:not(.is-ended):has(.gw-crew:not([hidden])) .gw-how { margin-top: 8px; }
}
