/* mapzi.io. Dark navy shell, light political map, one violet country.
   Tokens first; then home, play, results. Phones first, wider screens added below each part.
   Speed on phones: nothing in the play screen uses backdrop blur or animated shadows; anything that moves every
   frame moves with transform or opacity only. */

/* The mapzi wordmark (owner's logo, Nov 12): Fredoka, SIL Open Font Licence. */
@font-face {
  font-family: 'Fredoka';
  src: url('fonts/fredoka-latin-wght-normal.woff2') format('woff2-variations'), url('fonts/fredoka-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('fonts/sora-latin-wght-normal.woff2') format('woff2-variations'), url('fonts/sora-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-2: #111827;
  --ink: #f4f6ff;
  --muted: #a3acc2;
  --dim: #6f7a95;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(14, 20, 40, 0.74);
  --glass-2: rgba(255, 255, 255, 0.05);
  --violet: #7c3aed;
  --violet-2: #a78bfa;
  --violet-3: #c4b5fd;
  --green: #22c55e;
  --green-2: #4ade80;
  --amber: #f59e0b;
  --amber-2: #fbbf24;
  --red: #ef4444;
  --red-2: #f87171;
  --blue: #60a5fa;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: 'Sora', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
body.playing { overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2.5px solid var(--violet-3); outline-offset: 3px; }
a { color: var(--violet-3); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

/* The sky behind everything: two soft glows and faint stars. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 85% -8%, rgba(124, 58, 237, 0.34), transparent 62%),
    radial-gradient(760px 520px at -12% 18%, rgba(59, 130, 246, 0.22), transparent 60%),
    radial-gradient(700px 600px at 50% 120%, rgba(124, 58, 237, 0.16), transparent 60%),
    var(--bg);
}
.sky::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.4px 1.4px at 38% 62%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 88% 48%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 22% 84%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1.2px 1.2px at 58% 34%, rgba(255, 255, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 94% 82%, rgba(255, 255, 255, 0.45), transparent 60%);
  background-size: 420px 420px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--glass-2);
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.08); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 10px 26px -10px rgba(124, 58, 237, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn.primary:hover { background: linear-gradient(135deg, #9b6dff, #7434e6); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass-2);
  color: var(--ink);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.small { width: 36px; height: 36px; border-radius: 12px; }
.icon-btn.small svg { width: 18px; height: 18px; }
.sound-btn .i-off { display: none; }
.sound-btn[aria-pressed='false'] .i-on { display: none; }
.sound-btn[aria-pressed='false'] .i-off { display: block; }
.sound-btn[aria-pressed='false'] { color: var(--dim); }

/* ---------------------------------------------------------------- HOME */
.home, .results, .profile, .friends-view { max-width: 1180px; margin: 0 auto; padding: 0 18px calc(40px + var(--safe-b)); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(14px + var(--safe-t)) 0 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: block; filter: drop-shadow(0 6px 16px rgba(124, 58, 237, 0.5)); }
/* "mapzi" in Fredoka, the i's dot in violet (a dotless i with a drawn dot, as in the logo). */
.brand-name { font-family: 'Fredoka', var(--font); font-size: 30px; font-weight: 600; letter-spacing: 0.01em; line-height: 1; color: #fff; }
.brand-name .dot-i { position: relative; display: inline-block; }
.brand-name .dot-i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0.13em;
  width: 0.22em;
  height: 0.2em;
  border-radius: 50%;
  background: #a855f7;
  transform: translateX(-50%);
}

.hero { display: grid; gap: 8px; align-items: center; padding-top: 4px; }
.hero-globe { position: relative; order: -1; width: min(86vw, 380px); aspect-ratio: 1; margin: 0 auto; }
.hero-globe::before {
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.45), transparent 66%);
  filter: blur(26px);
}
.hero-globe canvas { position: relative; width: 100%; height: 100%; display: block; }
.globe-tag {
  position: absolute;
  left: 50%;
  bottom: 4%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(14, 20, 40, 0.8);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  animation: tagIn 0.4s var(--spring);
}
.globe-tag b { color: var(--violet-3); }

.hero-copy { text-align: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass-2);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.chip b { color: var(--ink); font-weight: 700; }
.chip-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: live 2s infinite; }
.hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(36px, 9.6vw, 66px);
  line-height: 1.02;
  font-weight: 750;
  letter-spacing: -0.04em;
}
.grad {
  background: linear-gradient(92deg, #ddd6fe 0%, #a78bfa 45%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede { margin: 0 auto 22px; max-width: 30ch; color: var(--muted); font-size: 16px; }
.lede b { color: var(--ink); font-weight: 600; }

.cta-wrap { display: grid; justify-items: center; gap: 10px; }
.cta {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  min-height: 64px;
  padding: 0 28px;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(135deg, #9061f9 0%, #7c3aed 45%, #5b21b6 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 18px 40px -14px rgba(124, 58, 237, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08) inset, inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.18s var(--ease), box-shadow 0.25s, opacity 0.2s;
}
.cta svg { width: 22px; height: 22px; transition: transform 0.25s var(--ease); }
.cta:hover svg { transform: translateX(4px); }
.cta:active { transform: scale(0.975); }
.cta:disabled { opacity: 0.6; cursor: default; }
.cta::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-120%) skewX(-18deg);
  animation: shimmer 3.4s ease-in-out 1.2s infinite;
  will-change: transform;
}
.cta:disabled::after { animation: none; }
.cta-sub { margin: 0; font-size: 14px; color: var(--muted); min-height: 20px; }
.cta-sub b { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

.done-card {
  max-width: 440px;
  margin: 0 auto;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.16), rgba(255, 255, 255, 0.03));
  text-align: left;
}
.done-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.done-score { font-size: 40px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.done-score { white-space: nowrap; }
.done-score small { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.done-squares { display: flex; gap: 4px; }
.done-squares i { width: 14px; height: 14px; border-radius: 4px; background: var(--dim); }
.done-squares i.hi { background: var(--green); }
.done-squares i.mid { background: var(--amber); }
.done-squares i.lo { background: #475569; }
.done-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.next-in { font-size: 14px; color: var(--muted); }
.next-in b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Unlimited */
.inf { font-size: 1.35em; line-height: 1; font-weight: 700; }
.cta-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 400px;
  min-height: 52px;
  margin-top: 4px;
  padding: 0 22px;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: rgba(124, 58, 237, 0.12);
  color: var(--violet-3);
  font-size: 16px;
  font-weight: 600;
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s;
}
.cta-alt b { color: #fff; }
.cta-alt:hover { background: rgba(124, 58, 237, 0.22); border-color: var(--violet-2); }
.cta-alt:active { transform: scale(0.98); }
.keep-cta { margin-top: 16px; max-width: none; min-height: 58px; font-size: 17px; }
.u-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  font-size: 14px;
  color: var(--muted);
}
.u-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.u-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--violet-3); font-size: 13px; }
.again-cta { max-width: none; margin-bottom: 12px; }
.keep-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px solid rgba(167, 139, 250, 0.45);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(59, 130, 246, 0.12));
  text-align: left;
  transition: transform 0.15s var(--ease), border-color 0.2s;
}
.keep-btn:hover { border-color: var(--violet-2); }
.keep-btn:active { transform: scale(0.985); }
.keep-btn .inf { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; background: linear-gradient(135deg, #9061f9, #6d28d9); color: #fff; font-size: 24px; }
.keep-btn > span:nth-child(2) { flex: 1; }
.keep-btn b { display: block; font-size: 17px; }
.keep-btn small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.keep-btn svg { width: 22px; height: 22px; flex: none; color: var(--violet-3); }
.res-ustats { display: grid; gap: 14px; margin-top: 26px; }
.daily-nudge { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(255, 255, 255, 0.03)); }
.daily-nudge h2 { font-size: 17px; margin-bottom: 4px; }
.daily-nudge p { margin: 0; font-size: 14px; }
.results[data-mode='unlimited'] .share-actions .btn.primary { background: transparent; border: 1px solid var(--line-2); box-shadow: none; }

/* Cards */
.panels { display: grid; gap: 14px; margin-top: 30px; }
.card {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card h2 { font-size: 17px; font-weight: 650; }
.streak { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: rgba(245, 158, 11, 0.14); color: var(--amber-2); border: 1px solid rgba(245, 158, 11, 0.28); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); text-align: center; }
.stat-v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.spark-wrap { margin-top: 16px; }
.spark-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.spark { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; align-items: end; height: 64px; }
.spark i {
  display: block;
  min-height: 4px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.9), rgba(124, 58, 237, 0.55));
}
.spark i.none { background: rgba(255, 255, 255, 0.08); min-height: 4px; height: 4px; }
.spark i.today { background: linear-gradient(180deg, #c4b5fd, #8b5cf6); box-shadow: 0 0 14px rgba(167, 139, 250, 0.6); }

.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 15px;
}
.board .rk { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: rgba(255, 255, 255, 0.07); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.board li:nth-child(1) .rk { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; }
.board li:nth-child(2) .rk { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.board li:nth-child(3) .rk { background: linear-gradient(135deg, #fdba74, #c2410c); color: #2a1100; }
.board .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.board li.me { background: rgba(124, 58, 237, 0.2); border: 1px solid rgba(167, 139, 250, 0.35); }
.board .empty { display: block; text-align: center; color: var(--muted); background: transparent; padding: 14px; }

/* How it works */
.how { margin-top: 38px; }
.how > h2 { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
.how-grid { display: grid; gap: 12px; }
.how-card {
  position: relative;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  grid-template-columns: 112px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 14px;
}
.how-art { grid-row: span 2; height: 84px; border-radius: 14px; overflow: hidden; align-self: center; }
.how-n { position: absolute; top: 12px; right: 14px; font-size: 12px; font-weight: 700; color: var(--dim); }
.how-card h3 { font-size: 16px; font-weight: 650; margin: 2px 0 4px; }
.how-card p { margin: 0; font-size: 14px; color: var(--muted); }
.art-map { background: #b9d0e8; }
.art-map canvas { width: 100%; height: 100%; display: block; }
.art-points { background: rgba(255, 255, 255, 0.04); padding: 10px 10px 8px; display: grid; gap: 6px; align-content: center; }
.ap-num { font-size: 24px; font-weight: 750; color: var(--green-2); line-height: 1; font-variant-numeric: tabular-nums; }
.ap-num span { animation: drain 4s linear infinite; display: inline-block; }
.ap-bar { position: relative; height: 7px; border-radius: 99px; overflow: hidden; display: flex; }
.ap-bar i.g { width: 30%; background: rgba(34, 197, 94, 0.7); }
.ap-bar i.a { flex: 1; background: rgba(245, 158, 11, 0.6); }
.ap-bar b { position: absolute; top: -2px; bottom: -2px; width: 3px; background: #fff; border-radius: 3px; animation: head 4s linear infinite; }
.ap-cap { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); letter-spacing: 0.02em; }
.art-wrong { background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; position: relative; }
.aw-field { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; border: 1.5px solid var(--red-2); background: rgba(239, 68, 68, 0.12); font-size: 13px; font-weight: 600; animation: shakeLoop 3s infinite; }
.aw-field i { color: var(--red-2); font-style: normal; font-weight: 700; }
.aw-minus { position: absolute; top: 6px; right: 10px; color: var(--red-2); font-weight: 800; font-size: 16px; animation: minusLoop 3s infinite; }

.foot { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; }
.foot p { margin: 6px auto; max-width: 64ch; }
.foot .copy { font-size: 13px; color: var(--dim); }

@media (min-width: 760px) {
  .panels { grid-template-columns: 1.1fr 1fr; }
  .how-grid { grid-template-columns: repeat(3, 1fr); }
  .how-card { grid-template-columns: 1fr; grid-template-rows: auto; }
  .how-art { grid-row: auto; height: 110px; margin-bottom: 14px; }
  .how-n { display: none; }
}
@media (min-width: 960px) {
  .home, .results { padding-left: 28px; padding-right: 28px; }
  .hero { grid-template-columns: 1.15fr 1fr; gap: 24px; min-height: min(620px, 72vh); }
  .hero h1 { font-size: clamp(48px, 4.4vw, 62px); }
  .hero-globe { order: 0; width: min(100%, 540px); }
  .hero-copy { text-align: left; }
  .lede { margin-left: 0; font-size: 18px; }
  .cta-wrap { justify-items: start; }
  .done-card { margin: 0; }
}

/* ---------------------------------------------------------------- PLAY */
.play {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-top, 0px);
  height: var(--vv-h, 100dvh);
  overflow: hidden;
  background: #0b1020;
  touch-action: manipulation;
  z-index: 10;
}
.stage { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.stage:active { cursor: grabbing; }
.glow-layer.moving { opacity: 0 !important; animation: none !important; }
/* Zoom buttons on the right edge of the map. */
.zoom-ctl {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(14, 20, 40, 0.9);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 26px -12px rgba(0, 0, 0, 0.8);
}
.zoom-ctl button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink); }
.zoom-ctl button + button { border-top: 1px solid var(--line); }
.zoom-ctl button:active { background: rgba(255, 255, 255, 0.08); }
.zoom-ctl svg { width: 18px; height: 18px; }
@media (max-width: 759px) {
  .zoom-ctl { right: 8px; border-radius: 12px; }
  .zoom-ctl button { width: 36px; height: 36px; }
}
@media (max-height: 430px) { .zoom-ctl { display: none; } }
.stage canvas, .stage .overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage .overlay { pointer-events: none; overflow: visible; }
.stage::after {
  /* Darkens the very top and bottom a touch so the panels read well over a light map. */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 16, 32, 0.35), transparent 22%, transparent 74%, rgba(11, 16, 32, 0.45));
}

.tgt-fill { fill: var(--violet); stroke: #3b0f8c; stroke-width: 1; stroke-linejoin: round; transition: fill 0.35s var(--ease), stroke 0.35s; }
.glow-layer { opacity: 0.85; will-change: opacity; }
.tgt-glow { fill: none; stroke: #a78bfa; stroke-width: 8; stroke-linejoin: round; }
.glow-layer[data-state='active'] { animation: glow 1.5s ease-in-out infinite; }
.glow-layer[data-state='none'] { opacity: 0; }
.tgt[data-state='active'] .tgt-fill { animation: tgtIn 0.38s var(--spring) both; transform-box: fill-box; transform-origin: center; }
.tgt[data-state='correct'] .tgt-fill { fill: var(--green); stroke: #14532d; animation: win 0.5s var(--spring); transform-box: fill-box; transform-origin: center; }
.glow-layer[data-state='correct'] .tgt-glow { stroke: #4ade80; }
.glow-layer[data-state='correct'] { animation: glowWin 0.9s ease-out both; }
.tgt[data-state='missed'] .tgt-fill { fill: #8b5cf6; }
.glow-layer[data-state='missed'] .tgt-glow { stroke: #fbbf24; }
.glow-layer[data-state='missed'] { opacity: 0.7; }
.tgt-ring { fill: none; stroke: var(--violet); stroke-width: 2.5; animation: ring 1.4s ease-out infinite; }
.tgt[data-state='correct'] .tgt-ring { stroke: var(--green); }
.tgt[data-state='missed'] .tgt-ring { stroke: var(--amber); }
.map-label {
  position: absolute;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px -6px rgba(15, 23, 42, 0.45);
  border: 2px solid var(--violet);
  animation: labelIn 0.35s var(--spring) both;
}
.map-label::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 2px solid var(--violet);
  border-bottom: 2px solid var(--violet);
  transform: translateX(-50%) rotate(45deg);
}
.map-label.correct, .map-label.correct::after { border-color: var(--green); }
.map-label.missed, .map-label.missed::after { border-color: var(--amber); }

/* The panel at the top: round, total, points, clock. */
.hud {
  position: absolute;
  top: calc(var(--safe-t) + var(--bar-gap, 0px) + 8px);
  left: 10px;
  right: 10px;
  max-width: 640px;
  margin: 0 auto;
  padding: 10px 14px 12px;
  border-radius: var(--r-lg);
  background: rgba(14, 20, 40, 0.93);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px -16px rgba(0, 0, 0, 0.7);
  z-index: 3;
  contain: layout;
}
.hud-top { display: flex; align-items: center; gap: 8px; }
.hud-home { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: transparent; color: var(--muted); flex: none; }
.hud-home svg { width: 18px; height: 18px; }
.round-pill { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; font-size: 13px; color: var(--muted); }
.rp-daily { font-weight: 650; color: var(--ink); white-space: nowrap; }
.rp-dots { display: flex; gap: 5px; }
.rp-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); transition: background 0.3s, transform 0.3s var(--spring); }
.rp-dots i.now { background: var(--violet-2); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25); transform: scale(1.15); }
.rp-dots i.hi { background: var(--green); }
.rp-dots i.mid { background: var(--amber); }
.rp-dots i.lo { background: #64748b; }
.total-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: 17px;
  flex: none;
}
.tp-l { font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.total-pill.bump { animation: bump 0.7s var(--ease); }
.hud-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 8px; }
.pts-l { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.pts-v { font-size: 46px; line-height: 1; font-weight: 750; letter-spacing: -0.02em; color: var(--green-2); transition: color 0.25s; }
.pts[data-phase='drain'] .pts-v { color: var(--amber-2); }
.pts[data-phase='urgent'] .pts-v { color: #fb7185; }
.pts[data-phase='zero'] .pts-v { color: var(--dim); }
.pts[data-phase='won'] .pts-v { color: var(--green-2); }
.pts[data-phase='lost'] .pts-v { color: var(--dim); }
.pts.hit .pts-v { animation: hit 0.35s var(--ease); }
.pts.won .pts-v { animation: wonPop 0.5s var(--spring); }
.odo { display: inline-flex; align-items: baseline; line-height: 1; font-variant-numeric: tabular-nums; }
.odo-col { display: inline-block; height: 1em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }
.odo-strip span { display: block; height: 1em; line-height: 1em; width: 0.64em; text-align: center; }
.odo-sep { display: inline-block; width: 0.3em; text-align: center; }
.fixed-digits { display: inline-flex; font-variant-numeric: tabular-nums; }
.fixed-digits .fd { display: inline-block; width: 0.64em; text-align: center; }
.fixed-digits .fd.lead { width: 0; }
.clock { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.clock-v { font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.clock-v small { font-size: 14px; color: var(--muted); margin-left: 2px; font-weight: 600; }
.clock-v { will-change: opacity; }
.clock.urgent .clock-v { color: #fb7185; animation: tickPulse 1s ease-in-out infinite; }
.giveup {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.giveup { display: inline-flex; align-items: center; gap: 6px; }
.giveup svg { width: 14px; height: 14px; flex: none; }
.giveup:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.3); }
.pts-unit { display: none; }
/* Round levels: easy green, medium blue, hard amber, very hard pink. */
.lvl, .lvl-tag { font-weight: 700; }
.hud[data-level='easy'] .lvl { color: var(--green-2); }
.hud[data-level='medium'] .lvl { color: var(--blue); }
.hud[data-level='hard'] .lvl { color: var(--amber-2); }
.hud[data-level='veryhard'] .lvl { color: #f472b6; }
.pts-l .lvl { letter-spacing: 0.14em; }
.lvl-tag { display: inline-block; padding: 1px 7px; margin-right: 4px; border-radius: 6px; font-size: 11px; letter-spacing: 0.04em; background: rgba(255, 255, 255, 0.06); }
.lvl-tag[data-level='easy'] { color: var(--green-2); }
.lvl-tag[data-level='medium'] { color: var(--blue); }
.lvl-tag[data-level='hard'] { color: var(--amber-2); }
.lvl-tag[data-level='veryhard'] { color: #f472b6; }
.level-pill {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(14, 20, 40, 0.94);
  border: 1px solid var(--line-2);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  white-space: nowrap;
}
.level-pill b { font-size: 20px; letter-spacing: 0.02em; }
.level-pill span { font-size: 14px; color: var(--muted); font-weight: 600; }
.level-pill[data-level='easy'] b { color: var(--green-2); }
.level-pill[data-level='medium'] b { color: var(--blue); }
.level-pill[data-level='hard'] b { color: var(--amber-2); }
.level-pill[data-level='veryhard'] b { color: #f472b6; }
.level-pill.pop { animation: pillPop 0.35s var(--spring); }
@keyframes pillPop { from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.rp-dots-m, .lvl-m { display: none; }
.giveup:disabled { opacity: 0.35; cursor: default; }
.bar { position: relative; height: 8px; margin-top: 12px; }
.bar-track { position: absolute; inset: 0; display: flex; border-radius: 99px; overflow: hidden; gap: 2px; }
.bar-full { width: 30%; background: linear-gradient(90deg, #16a34a, #4ade80); border-radius: 99px 2px 2px 99px; }
.bar-drain { flex: 1; background: linear-gradient(90deg, #fbbf24, #f97316 70%, #ef4444); border-radius: 2px 99px 99px 2px; }
.bar-used { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 99px 0 0 99px; background: rgba(11, 16, 32, 0.72); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
.bar-head {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25), 0 0 14px rgba(255, 255, 255, 0.8);
  will-change: transform;
}
.sound-mini { position: absolute; right: 10px; bottom: -48px; }
.sound-mini .icon-btn { background: rgba(14, 20, 40, 0.9); }

/* The panel at the bottom: suggestions, feedback, the answer box. */
.dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + var(--kb-safe, var(--safe-b)));
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3;
}
.suggest { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; padding: 2px 10px; -webkit-overflow-scrolling: touch; }
.suggest::-webkit-scrollbar { display: none; }
.suggest:empty { display: none; }
.sg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(14, 20, 40, 0.95);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
  animation: sgIn 0.18s var(--ease) both;
}
.sg:hover, .sg.on { border-color: var(--violet-2); background: rgba(124, 58, 237, 0.38); }
.sg kbd { font: inherit; font-size: 11px; color: var(--violet-3); opacity: 0.85; }
.feedback {
  min-height: 0;
  font-size: 14px;
  font-weight: 600;
  padding: 0 4px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.feedback:empty { display: none; }
.feedback .fb { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 12px; background: rgba(14, 20, 40, 0.86); border: 1px solid var(--line); animation: sgIn 0.18s var(--ease) both; }
.feedback .fb.bad { color: #fecaca; border-color: rgba(239, 68, 68, 0.5); background: rgba(69, 10, 10, 0.86); }
.feedback .fb.hint { color: #fde68a; border-color: rgba(245, 158, 11, 0.4); }
.feedback .fb.info { color: var(--muted); }
.feedback .fb + .fb { margin-left: 6px; }
.feedback .fb.clue { color: #ede9fe; border-color: rgba(167, 139, 250, 0.5); background: rgba(46, 16, 101, 0.92); }
.feedback .fb.clue b { color: #fff; font-size: 15px; }
.pattern { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.22em; font-weight: 700; color: #fff; }
/* A wrong guess lands like a hit: the screen edges flash red for a moment (opacity only, so it costs nothing). */
.hit-flash { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; box-shadow: inset 0 0 70px 14px rgba(239, 68, 68, 0.55); will-change: opacity; }
.hit-flash.on { animation: hitFlash 0.38s ease-out; }
@keyframes hitFlash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
.answer { display: flex; gap: 8px; }
.field { position: relative; flex: 1; min-width: 0; }
.field input {
  width: 100%;
  height: 58px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1.5px solid var(--line-2);
  background: rgba(10, 14, 28, 0.96);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  caret-color: var(--violet-2);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 10px 30px -14px rgba(0, 0, 0, 0.8);
}
.field input::placeholder { color: var(--dim); font-weight: 500; }
.field input:focus { border-color: var(--violet-2); box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.28), 0 10px 30px -14px rgba(0, 0, 0, 0.8); }
.field.bad input { border-color: var(--red); background: rgba(80, 12, 18, 0.92); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.28); }
.field.shake { animation: shake 0.32s var(--ease); }
.field.good input { border-color: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.25); }
.field.nudge { animation: nudge 0.3s var(--ease); }
.submit {
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #9061f9, #6d28d9);
  color: #fff;
  box-shadow: 0 12px 26px -10px rgba(124, 58, 237, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s var(--ease), min-width 0.25s var(--ease), background 0.25s;
}
.submit:active { transform: scale(0.95); }
.submit svg { width: 24px; height: 24px; }
.submit .sb-next { display: none; align-items: center; gap: 4px; padding: 0 18px 0 22px; font-weight: 700; font-size: 17px; }
.submit .sb-next svg { width: 20px; height: 20px; }
.answer.next .submit { min-width: 128px; background: linear-gradient(135deg, #f8fafc, #cbd5e1); color: #111827; }
.answer.next .sb-go { display: none; }
.answer.next .sb-next { display: inline-flex; }
.answer.next .field input { color: var(--dim); }
.answer.wait .submit { opacity: 0.6; }

.reveal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(14, 20, 40, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.9);
  animation: revealIn 0.32s var(--spring) both;
}
.rv-icon { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 20px; font-weight: 800; }
.reveal.correct .rv-icon { background: rgba(34, 197, 94, 0.2); color: var(--green-2); }
.reveal.missed .rv-icon { background: rgba(245, 158, 11, 0.16); color: var(--amber-2); }
.rv-text { flex: 1; min-width: 0; }
.rv-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-sub { font-size: 13px; color: var(--muted); }
.rv-badge { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.reveal.correct .rv-badge { color: var(--green-2); }
.reveal.missed .rv-badge { color: var(--dim); }
.rv-badge small { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; text-align: right; color: var(--amber-2); font-weight: 700; }

.layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.floater {
  position: absolute;
  will-change: transform, opacity;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.55);
  animation: floatUp 0.95s var(--ease) both;
}
.floater.from-right { transform: translate(0, -50%); animation-name: floatUpRight; }
.floater.plus { color: var(--green-2); }
.floater.minus { color: #ff6b6b; font-size: 32px; animation-duration: 0.8s; }
.floater.perfect { color: var(--amber-2); font-size: 16px; letter-spacing: 0.18em; animation-delay: 0.15s; }

.countdown {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 4px;
  pointer-events: none;
}
.cd-num {
  font-size: 128px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 10px 50px rgba(124, 58, 237, 0.9), 0 0 2px rgba(0, 0, 0, 0.4);
  animation: cdPop 0.7s var(--ease) both;
}
.cd-cap { font-size: 15px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.8); }
.net-wait {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(14, 20, 40, 0.94);
  border: 1px solid var(--line-2);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
  animation: sgIn 0.2s var(--ease) both;
}
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--violet-3); animation: spin 0.8s linear infinite; will-change: transform; }
@keyframes spin { to { transform: rotate(360deg); } }
.play-error { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; background: rgba(11, 16, 32, 0.86); }
.pe-card { max-width: 360px; padding: 22px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line-2); text-align: center; }
.pe-card h2 { font-size: 20px; margin-bottom: 8px; }
.pe-card p { color: var(--muted); margin: 0 0 16px; }

/* Short screens (a phone with the keyboard up): smaller panels so the map keeps its room. */
@media (max-height: 560px) {
  .hud { padding: 8px 12px 10px; top: calc(var(--bar-gap, 0px) + 6px); }
  .hud-main { margin-top: 4px; }
  .pts-v { font-size: 34px; }
  .clock-v { font-size: 22px; }
  .clock { flex-direction: row-reverse; align-items: center; gap: 10px; }
  .giveup { min-height: 30px; }
  .bar { margin-top: 8px; height: 6px; }
  .field input, .submit { height: 50px; }
  .submit { min-width: 50px; }
  .sound-mini { display: none; }
  .reveal { padding: 8px 12px; }
  .rv-icon { width: 34px; height: 34px; }
  .cd-num { font-size: 88px; }
}
@media (max-height: 430px) {
  .pts-l, .tp-l { display: none; }
  .hud-top .round-pill .rp-daily { display: none; }
}
@media (min-width: 760px) {
  .pts-v { font-size: 56px; }
  .clock-v { font-size: 30px; }
  .hud { padding: 14px 18px 16px; top: calc(var(--safe-t) + var(--bar-gap, 0px) + 16px); }
  .dock { bottom: calc(22px + var(--safe-b)); }
  .sound-mini { right: -50px; bottom: auto; top: 0; }
}

/* Phones: the top panel is two slim rows (about 70 px instead of 150) so the map gets the screen.
   Row 1: back, points, clock, total, give up. Row 2: round dots, time bar, sound. The wrappers step aside
   (display: contents) so the same elements can be laid out on one grid. */
@media (max-width: 759px) {
  .hud {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      'back pts clock . total give'
      'track track track track track sound';
    align-items: center;
    column-gap: 8px;
    row-gap: 7px;
    top: calc(var(--safe-t) + var(--bar-gap, 0px) + 6px);
    left: 8px;
    right: 8px;
    padding: 7px 10px 8px 8px;
    border-radius: 18px;
  }
  .hud-top, .hud-main, .round-pill, .clock { display: contents; }
  .hud-home { grid-area: back; width: 30px; height: 30px; border-radius: 10px; }
  .rp-daily, .pts-l, .tp-l { display: none; }
  .round-pill .rp-dots { display: none; }
  .hud-track { grid-area: track; display: flex; align-items: center; gap: 10px; min-width: 0; }
  .rp-dots-m { display: flex; flex: none; gap: 4px; }
  .rp-dots i { width: 7px; height: 7px; }
  .rp-dots i.now { box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.3); transform: none; }
  .pts { grid-area: pts; display: flex; align-items: baseline; gap: 3px; }
  .pts-v { font-size: 30px; }
  .pts-unit { display: inline; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; }
  .lvl-m { display: inline; flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
  .clock-v { grid-area: clock; font-size: 18px; color: var(--soft); }
  .clock-v small { font-size: 12px; }
  .total-pill { grid-area: total; padding: 4px 9px; font-size: 15px; border-radius: 10px; }
  .giveup { grid-area: give; min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 10px; white-space: nowrap; }
  .bar { flex: 1; min-width: 0; margin: 0; height: 6px; }
  .bar-head { width: 12px; height: 12px; margin: -6px 0 0 -6px; }
  .sound-mini { grid-area: sound; position: static; }
  .sound-mini .icon-btn { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); }
  .sound-mini .icon-btn svg { width: 17px; height: 17px; }
  .dock { left: 8px; right: 8px; bottom: calc(8px + var(--kb-safe, var(--safe-b))); gap: 7px; }
  .field input, .submit { height: 52px; border-radius: 16px; }
  .submit { min-width: 52px; }
  .field input { font-size: 17px; }
  .sg { min-height: 38px; padding: 0 14px; font-size: 14px; }
  .reveal { padding: 9px 12px; gap: 10px; }
  .rv-icon { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
  .rv-title { font-size: 17px; }
  .rv-badge { font-size: 21px; }
}
/* Small phones (iPhone SE and similar): icon-only give up, no "pts". */
@media (max-width: 369px) {
  .hud { column-gap: 6px; padding-left: 6px; padding-right: 8px; }
  .pts-unit, .giveup span { display: none; }
  .giveup { width: 30px; padding: 0; justify-content: center; }
  .pts-v { font-size: 28px; }
  .clock-v { font-size: 16px; }
  .total-pill { font-size: 14px; padding: 4px 7px; }
}
.floater.from-below { transform: translate(-50%, 0); animation-name: floatBelow; }
@keyframes floatBelow { 0% { opacity: 0; transform: translate(-50%, 6px) scale(0.8); } 20% { opacity: 1; transform: translate(-50%, -4px) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -22px) scale(1); } }

/* ---------------------------------------------------------------- RESULTS */
.res-hero { position: relative; text-align: center; padding: 18px 0 8px; }
.res-score {
  margin-top: 6px;
  font-size: clamp(64px, 19vw, 104px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 30%, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 40px rgba(124, 58, 237, 0.45));
}
.res-score small { font-size: 0.24em; letter-spacing: -0.01em; -webkit-text-fill-color: var(--muted); color: var(--muted); font-weight: 600; margin-left: 6px; }
.res-title { margin-top: 10px; font-size: 22px; font-weight: 700; color: var(--violet-3); letter-spacing: -0.01em; animation: fadeUp 0.5s var(--ease) 0.9s both; }
.res-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px auto 0; max-width: 560px; animation: fadeUp 0.5s var(--ease) 1.05s both; }
.res-chips .chip { color: var(--ink); font-weight: 600; }
.res-chips .chip span { color: var(--muted); font-weight: 500; }
.share-box { max-width: 420px; margin: 22px auto 0; animation: fadeUp 0.5s var(--ease) 1.2s both; }
.share-preview {
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  text-align: left;
}
.share-actions { display: flex; gap: 10px; }
.share-actions .btn.primary { flex: 1; min-height: 54px; font-size: 17px; border-radius: 16px; }
.share-actions .btn.ghost { min-height: 54px; border-radius: 16px; }
.share-note { min-height: 20px; margin-top: 8px; font-size: 14px; color: var(--green-2); }

.res-rounds { margin-top: 30px; }
.res-rounds h2, .res-grid h2 { font-size: 18px; font-weight: 650; }
.res-rounds > h2 { margin-bottom: 12px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tile {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  animation: fadeUp 0.45s var(--ease) both;
}
.tile canvas { width: 92px; height: 68px; border-radius: 12px; display: block; background: #c3d6ea; }
.tile .tn { font-size: 16px; font-weight: 650; }
.tile .td { font-size: 13px; color: var(--muted); }
.tile .tp { font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.tile.hi .tp { color: var(--green-2); }
.tile.mid .tp { color: var(--amber-2); }
.tile.lo .tp { color: var(--dim); }
.tile .tp small { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.res-grid { display: grid; gap: 14px; margin-top: 26px; }
.dist { display: grid; grid-template-columns: repeat(var(--buckets, 16), 1fr); gap: 4px; align-items: end; height: 120px; padding-top: 18px; position: relative; }
.dist i { display: block; border-radius: 5px 5px 2px 2px; background: rgba(167, 139, 250, 0.35); min-height: 3px; position: relative; }
.dist i.me { background: linear-gradient(180deg, #c4b5fd, #7c3aed); box-shadow: 0 0 16px rgba(167, 139, 250, 0.6); }
.dist i.me::after { content: 'You'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--violet-3); font-style: normal; }
.dist-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.dist-empty { padding: 18px 6px; text-align: center; color: var(--muted); font-size: 14px; }
.dist-empty b { color: var(--ink); }
.name-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.name-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(10, 14, 28, 0.8); font-size: 16px; outline: none; }
.name-row input:focus { border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); }
.name-msg { min-height: 18px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.name-msg.bad { color: var(--red-2); }
.name-msg.good { color: var(--green-2); }

.res-more { margin-top: 14px; }
.more-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(59, 130, 246, 0.1)); }
.more-card h2 { font-size: 17px; margin-bottom: 4px; }
.more-card p { margin: 0; font-size: 14px; }
.more-card .btn.done { border-color: rgba(74, 222, 128, 0.5); color: var(--green-2); }
.next-big { text-align: center; margin: 26px 0 8px; color: var(--muted); font-size: 15px; }
.next-big b { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 18px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }

@media (min-width: 760px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .res-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------- MOTION */
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes shimmer { 0% { transform: translateX(-120%) skewX(-18deg); } 55%, 100% { transform: translateX(400%) skewX(-18deg); } }
@keyframes tagIn { from { opacity: 0; transform: translate(-50%, 8px) scale(0.92); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes artPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
@keyframes drain { 0%, 30% { opacity: 1; } 100% { opacity: 0.35; } }
@keyframes head { from { left: 0; } to { left: calc(100% - 3px); } }
@keyframes shakeLoop { 0%, 60%, 100% { transform: translateX(0); } 64% { transform: translateX(-5px); } 68% { transform: translateX(5px); } 72% { transform: translateX(-3px); } 76% { transform: translateX(2px); } }
@keyframes minusLoop { 0%, 60% { opacity: 0; transform: translateY(6px); } 66% { opacity: 1; transform: translateY(0); } 90% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes glowWin { 0% { opacity: 1; } 40% { opacity: 1; } 100% { opacity: 0.6; } }
@keyframes tgtIn { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: scale(1); } }
@keyframes win { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes ring { 0% { opacity: 0.95; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.9); } }
@keyframes labelIn { from { opacity: 0; transform: translate(-50%, -80%) scale(0.85); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.1); background: rgba(34, 197, 94, 0.28); border-color: rgba(74, 222, 128, 0.6); } 100% { transform: scale(1); } }
@keyframes hit { 0% { transform: translateY(0); } 30% { transform: translateY(3px); color: #ff6b6b; } 100% { transform: translateY(0); } }
@keyframes wonPop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes tickPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 35% { transform: translateX(-3px); } 70% { transform: translateX(3px); } }
@keyframes sgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes revealIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.7); } 18% { opacity: 1; transform: translate(-50%, -60%) scale(1.12); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes floatUpRight { 0% { opacity: 0; transform: translate(-6px, -30%) scale(0.7); } 18% { opacity: 1; transform: translate(0, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(4px, -170%) scale(1); } }
@keyframes cdPop { 0% { opacity: 0; transform: scale(1.6); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; transform: scale(0.96); } 100% { opacity: 0; transform: scale(0.8); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .cta::after { display: none; }
  .tgt-glow { opacity: 0.8; }
  .floater { animation: fadeOnly 0.8s linear both !important; animation-duration: 0.8s !important; }
  .field.bad input { transition: none; }
}
@keyframes fadeOnly { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* ---------------------------------------------------------------- ACCOUNTS AND ADS */
.top-actions { display: flex; align-items: center; gap: 8px; }
.acct-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  max-width: 190px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--glass-2);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.acct-btn:hover { border-color: rgba(255, 255, 255, 0.28); }
.acct-btn.in { padding: 0 12px 0 6px; }
.acct-btn #acctBtnText { overflow: hidden; text-overflow: ellipsis; }
.acct-av {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #9061f9, #5b21b6);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}
.acct-av.big { width: 52px; height: 52px; border-radius: 16px; font-size: 22px; }
@media (max-width: 420px) {
  .acct-btn.in #acctBtnText { display: none; }
  .acct-btn.in { padding: 0 6px; }
}

/* The small "Ad" mark on buttons that start an extra game. */
.ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 8px;
  padding: 2px 7px 2px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.ad-badge svg { width: 11px; height: 11px; }
.keep-btn b .ad-badge { font-size: 10px; }

/* Sheets: a panel from the bottom on phones, a centred card on wider screens. */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(5, 8, 18, 0.72); animation: fadeIn 0.2s var(--ease) both; }
.sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  padding: 26px 22px calc(22px + var(--safe-b));
  border-radius: 24px 24px 0 0;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-bottom: 0;
  box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, 0.9);
  animation: sheetUp 0.28s var(--ease) both;
}
@media (min-width: 600px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 24px; border-bottom: 1px solid var(--line-2); padding-bottom: 24px; }
}
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet h2 { font-size: 23px; margin: 0 34px 6px 0; }
.sheet-lede { margin: 0 0 18px; font-size: 15px; }
.sheet-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--glass-2);
  color: var(--muted);
  font-size: 15px;
}
.sheet .seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); }
.sheet .seg button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.sheet .seg button[aria-selected='true'] { background: rgba(124, 58, 237, 0.35); color: #fff; }
.acct-form { display: grid; gap: 12px; }
.fld { display: grid; gap: 6px; }
.fld > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.fld > span i { font-style: normal; font-weight: 400; color: var(--dim); }
.fld input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.25);
  font-size: 16px;
}
.fld input:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3); }
.fld small { color: var(--dim); font-size: 12px; }
.form-msg { padding: 10px 12px; border-radius: 12px; background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(248, 113, 113, 0.4); color: #fecaca; font-size: 14px; }
.form-msg.good { background: rgba(34, 197, 94, 0.14); border-color: rgba(74, 222, 128, 0.4); color: #bbf7d0; }
.btn.wide { width: 100%; }
.acct-who { display: flex; align-items: center; gap: 14px; margin: 14px 0 16px; }
.acct-who b { font-size: 18px; }
.acct-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); font-size: 14px; }
.acct-row span { color: var(--muted); }
#acctIn .btn { margin-top: 6px; }
.acct-nudge { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(255, 255, 255, 0.03)); }
.acct-nudge h2 { font-size: 17px; margin-bottom: 4px; }
.acct-nudge p { margin: 0; font-size: 14px; }

.ad-sheet { text-align: center; }
.ad-sheet h2 { margin: 0 0 6px; }
.ad-ico { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 20px; background: linear-gradient(135deg, #9061f9, #5b21b6); color: #fff; font-size: 34px; font-weight: 700; box-shadow: 0 14px 30px -12px rgba(124, 58, 237, 0.9); }
.ad-go { max-width: none; margin-bottom: 10px; }
.ad-go .i-play { width: 22px; height: 22px; }
.ad-go[aria-busy='true'] { opacity: 0.7; pointer-events: none; }
.link-btn { margin-top: 10px; border: 0; background: none; color: var(--violet-3); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.ad-free-note { margin: 6px 0 0; }

/* The pretend ad (ADS_PROVIDER=demo). */
.demo-ad { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #05070f; color: #fff; animation: fadeIn 0.2s both; }
.demo-ad-top { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t)) 16px 0; }
.demo-ad-tag { padding: 3px 8px; border-radius: 6px; background: #fbbf24; color: #111; font-size: 12px; font-weight: 800; }
.demo-ad-left { flex: 1; font-size: 14px; color: var(--muted); }
.demo-ad.done .demo-ad-left { color: var(--green-2); font-weight: 600; }
.demo-ad-close { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 16px; }
.demo-ad-body { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.demo-ad-body h2 { font-size: 30px; }
.demo-ad-body p { max-width: 34ch; margin: 0; color: var(--muted); }
.demo-ad-art { width: 120px; height: 120px; border-radius: 32px; background: conic-gradient(from 200deg, #f59e0b, #ef4444, #7c3aed, #3b82f6, #22c55e, #f59e0b); animation: spin 6s linear infinite; }
.demo-ad-bar { height: 4px; background: rgba(255, 255, 255, 0.12); }
.demo-ad-bar i { display: block; height: 100%; background: #fbbf24; transform: scaleX(0); transform-origin: left; }
@media (prefers-reduced-motion: reduce) { .demo-ad-art { animation: none; } }
body.sheet-open { overflow: hidden; }

/* ---------------------------------------------------------------- PROFILES AND ACHIEVEMENTS */
/* A player's picture, or their initial on their chosen colour. */
.av {
  --av: #7c3aed;
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--av);
  background: linear-gradient(135deg, color-mix(in srgb, var(--av) 70%, #fff), var(--av));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.av i { font-style: normal; line-height: 1; }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av-s { width: 32px; height: 32px; font-size: 14px; }
.av-xl { width: 96px; height: 96px; font-size: 40px; box-shadow: 0 0 0 4px var(--bg-2); }
.av[data-c='violet'], [data-c='violet'] { --av: #7c3aed; }
.av[data-c='blue'], [data-c='blue'] { --av: #2563eb; }
.av[data-c='teal'], [data-c='teal'] { --av: #0d9488; }
.av[data-c='green'], [data-c='green'] { --av: #16a34a; }
.av[data-c='amber'], [data-c='amber'] { --av: #d97706; }
.av[data-c='orange'], [data-c='orange'] { --av: #ea580c; }
.av[data-c='red'], [data-c='red'] { --av: #dc2626; }
.av[data-c='pink'], [data-c='pink'] { --av: #db2777; }
/* Supporters (ad-free): a gold ring that slowly shines. */
.av.supporter { box-shadow: 0 0 0 2px var(--bg-2); }
.av.supporter::before {
  content: '';
  position: absolute;
  inset: -4px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from var(--ring, 0deg), #fde68a, #f59e0b, #fbbf24, #fff7cc, #f59e0b, #fde68a);
  animation: ringTurn 6s linear infinite;
}
.av-xl.supporter { box-shadow: 0 0 0 4px var(--bg-2); }
.av-xl.supporter::before { inset: -7px; }
@property --ring { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ringTurn { to { --ring: 360deg; } }
@media (prefers-reduced-motion: reduce) { .av.supporter::before { animation: none; } }
.acct-btn .av { margin-left: -2px; }

/* Leaderboards with pictures. */
.board li { grid-template-columns: 30px 32px minmax(0, 1fr) auto; }
.board .bd { font-size: 14px; margin-left: 2px; }

/* Home: the way into achievements. */
.ach-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: rgba(251, 191, 36, 0.07);
  text-align: left;
}
.ach-link:hover { border-color: rgba(251, 191, 36, 0.5); }
.ach-link-i { font-size: 24px; }
.ach-link > span:nth-child(2) { flex: 1; }
.ach-link b { display: block; font-size: 15px; }
.ach-link small { display: block; color: var(--muted); font-size: 13px; }
.ach-link svg { width: 20px; height: 20px; color: var(--muted); flex: none; }

/* Results: what this game unlocked. */
.ach-new { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 4px; }
.ach-pop {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(124, 58, 237, 0.18));
  text-align: left;
  animation: achIn 0.5s var(--spring) both;
}
.ach-pop .ach-i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); font-size: 22px; }
.ach-pop small { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #fcd34d; }
.ach-pop b { display: block; font-size: 15px; }
@keyframes achIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } to { opacity: 1; transform: none; } }

/* The profile page. */
.prof-card {
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  border: 1px solid var(--line-2);
}
.prof-banner { height: 92px; background: var(--av); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--av) 85%, #fff) 0%, var(--av) 45%, color-mix(in srgb, var(--av) 40%, #0b1020) 100%); }
.prof-main { display: flex; align-items: flex-end; gap: 16px; padding: 0 20px; margin-top: -48px; }
.prof-av-wrap { position: relative; }
.prof-cam {
  position: absolute;
  right: -4px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--bg-2);
  background: #fff;
  color: #111;
}
.prof-cam svg { width: 18px; height: 18px; }
.prof-id { min-width: 0; padding-bottom: 4px; }
.prof-id h1 { font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.prof-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; vertical-align: middle; white-space: nowrap; }
.prof-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.prof-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 18px 20px 20px; }
.prof-stats div { padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); text-align: center; }
.prof-stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.prof-stats span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.prof-guest { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(255, 255, 255, 0.03)); }
.prof-guest h2 { font-size: 17px; margin-bottom: 4px; }
.prof-guest p { margin: 0; font-size: 14px; }
.prof-guest-btns { display: flex; gap: 8px; }
.prof-edit { margin-top: 14px; }
.edit-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; align-items: start; padding: 14px 0; border-top: 1px solid var(--line); }
.edit-row:first-of-type { border-top: 0; padding-top: 0; }
.edit-l { font-weight: 600; font-size: 14px; padding-top: 10px; }
.edit-c p { margin: 6px 0 0; }
.photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 4px; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; background: var(--av); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15); }
.sw[aria-checked='true'] { border-color: #fff; box-shadow: 0 0 0 3px var(--av); }
.badge-pick { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.bp { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--glass-2); font-size: 13px; font-weight: 600; }
.bp[aria-checked='true'] { border-color: var(--violet-2); background: rgba(124, 58, 237, 0.3); color: #fff; }
@media (max-width: 640px) {
  .edit-row { grid-template-columns: minmax(0, 1fr); }
  .edit-l { padding-top: 0; }
  .prof-main { padding: 0 16px; gap: 12px; }
  .av-xl { width: 84px; height: 84px; font-size: 34px; }
  .prof-id h1 { font-size: 21px; }
  .prof-stats { padding: 14px 16px 16px; gap: 6px; }
  .prof-stats b { font-size: 17px; }
}

.ach-sec { margin-top: 24px; }
.ach-sec > .card-head h2 { font-size: 22px; }
.ach-g { margin: 18px 0 10px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ach-t { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.ach-t .ach-i { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); font-size: 24px; filter: grayscale(1); opacity: 0.45; }
.ach-t.done { border-color: rgba(251, 191, 36, 0.4); background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(255, 255, 255, 0.03)); }
.ach-t.done .ach-i { filter: none; opacity: 1; background: rgba(251, 191, 36, 0.16); }
.ach-b { min-width: 0; flex: 1; }
.ach-b b { display: block; font-size: 15px; }
.ach-b small { display: block; color: var(--muted); font-size: 13px; }
.ach-t:not(.done) .ach-b b { color: var(--muted); }
.ach-bar { height: 6px; margin: 8px 0 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--violet-2)); transform-origin: left; }
.ach-f { margin-top: 4px; font-variant-numeric: tabular-nums; }
.ach-t.done .ach-f { color: #fcd34d; }
.prof-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- MAPS (World, US States, continents, Continents) */
.maps { margin: 4px -18px 6px; }
.maps-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 18px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.maps-row::-webkit-scrollbar { display: none; }
.map-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 40px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--glass-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  scroll-snap-align: center;
  transition: background 0.2s, border-color 0.2s, transform 0.15s var(--ease);
}
.map-chip:hover { border-color: rgba(255, 255, 255, 0.3); }
.map-chip:active { transform: scale(0.97); }
.map-chip.on { background: linear-gradient(135deg, #8b5cf6, #6d28d9); border-color: transparent; box-shadow: 0 8px 20px -10px rgba(124, 58, 237, 0.9); }
.mc-i { font-size: 18px; line-height: 1; }
.mc-done { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--green); color: #052e12; font-size: 11px; font-weight: 800; }
.map-tag { color: var(--muted); font-weight: 600; }
#dailyMap { font-weight: 700; color: #fff; margin-right: 2px; }
@media (min-width: 900px) {
  .maps-row { flex-wrap: wrap; justify-content: center; overflow: visible; }
}

/* ---------------------------------------------------------------- LIVE (a class or group playing together) */
/* The big buttons under Play (owner, Nov 13: "make it a little more bold ... to be able to see it"): practice solo,
   play live with a class or group, friends. Each its own colour, large text, a clear arrow. */
.modes { display: grid; gap: 12px; width: 100%; max-width: 440px; margin: 22px auto 0; }
.mode {
  --c: 96, 165, 250;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 82px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 2px solid rgba(var(--c), 0.75);
  background: linear-gradient(135deg, rgba(var(--c), 0.3), rgba(var(--c), 0.1) 70%);
  box-shadow: 0 10px 28px -14px rgba(var(--c), 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--ink);
  text-align: left;
  transition: transform 0.18s var(--ease), border-color 0.18s, box-shadow 0.18s;
}
.mode:hover { transform: translateY(-2px); border-color: rgb(var(--c)); box-shadow: 0 16px 34px -14px rgba(var(--c), 1), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.mode:active { transform: translateY(0) scale(0.99); }
.mode:focus-visible { outline: 3px solid rgb(var(--c)); outline-offset: 3px; }
.mode-practice { --c: 52, 211, 153; }
.mode-live { --c: 251, 191, 36; }
.mode-friends { --c: 96, 165, 250; }
.mode-i { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px; font-size: 28px; background: rgba(var(--c), 0.28); box-shadow: inset 0 0 0 1px rgba(var(--c), 0.5); }
.mode-t { flex: 1; min-width: 0; }
.mode-t b { display: flex; align-items: center; gap: 2px; font-size: 18px; font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; }
.mode-t small { display: block; margin-top: 3px; color: #d5dbea; font-size: 13.5px; line-height: 1.35; }
.mode-go { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 999px; background: rgb(var(--c)); color: #0b1020; }
@media (min-width: 900px) { .hero-copy .modes { margin-left: 0; } }

.live { max-width: 1180px; margin: 0 auto; padding: 0 18px calc(40px + var(--safe-b)); }
.lv-pane { margin-top: 10px; }
.lv-pane h1 { font-size: clamp(28px, 6vw, 44px); margin-bottom: 8px; }
.lv-lede { max-width: 60ch; margin: 0 0 18px; }
.lv-two { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); max-width: 820px; }
.lv-card { display: grid; gap: 12px; align-content: start; padding: 20px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line-2); }
.lv-card h2 { font-size: 20px; }
.lv-card p { margin: 0; }
#lvCode { font-size: 24px; letter-spacing: 0.15em; font-variant-numeric: tabular-nums; text-align: center; }

.lv-setup { max-width: 760px; }
.lv-field { margin: 18px 0; }
.lv-label { display: block; font-weight: 700; margin-bottom: 8px; }
.lv-label small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.lv-maps, .lv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-width: 52px; min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.opt.on { background: rgba(124, 58, 237, 0.4); border-color: var(--violet-2); color: #fff; }
.opt:disabled { opacity: 0.35; cursor: not-allowed; }
.opt.lvl-1.on { background: rgba(34, 197, 94, 0.3); border-color: var(--green-2); }
.opt.lvl-2.on { background: rgba(245, 158, 11, 0.3); border-color: var(--amber-2); }
.opt.lvl-3.on { background: rgba(239, 68, 68, 0.3); border-color: var(--red-2); }
.opt.lvl-4.on { background: rgba(168, 85, 247, 0.35); border-color: #c084fc; }
#lvMax { width: 100%; max-width: 420px; accent-color: var(--violet); }
.lv-check { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.lv-check input { width: 20px; height: 20px; accent-color: var(--violet); }
.lv-host-name { display: block; margin-top: 10px; width: 100%; max-width: 320px; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, 0.25); font-size: 16px; }
.lv-setup .cta { margin-top: 10px; }

/* The waiting room: made for a projector. */
.lv-lobby { text-align: center; }
.lv-joinbox { display: inline-block; padding: 18px 30px 20px; border-radius: 26px; background: #fff; color: #111827; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.8); }
.lv-join-at { font-size: clamp(16px, 2.6vw, 24px); }
.lv-code { font-size: clamp(54px, 12vw, 120px); font-weight: 800; letter-spacing: 0.06em; line-height: 1.05; font-variant-numeric: tabular-nums; color: #4c1d95; }
.lv-meta { color: #4b5563; font-size: 15px; }
.lv-count { margin: 22px 0 12px; font-size: 22px; color: var(--muted); }
.lv-count b { font-size: 40px; color: #fff; }
.lv-people { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 1000px; }
.lv-people li { display: inline-flex; align-items: center; gap: 6px; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); font-weight: 700; font-size: 18px; animation: achIn 0.35s var(--spring) both; }
.lv-kick { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--muted); font-size: 12px; }
.lv-kick:hover { background: rgba(239, 68, 68, 0.3); color: #fff; }
.lv-empty { margin: 20px 0; }
.lv-btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.lv-btns .cta { width: auto; min-width: 220px; }
.lv-wait { text-align: center; padding-top: 10vh; }
.lv-you { display: inline-block; padding: 8px 18px; border-radius: 999px; background: rgba(124, 58, 237, 0.3); font-weight: 800; font-size: 22px; margin-bottom: 14px; }
.lv-wait-map { color: var(--muted); font-size: 14px; }

/* A round. */
.lv-play { margin-top: 6px; }
.lv-top { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; font-weight: 700; }
.lv-round { font-size: 15px; }
.lv-level { padding: 3px 10px; border-radius: 999px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; background: rgba(34, 197, 94, 0.25); color: var(--green-2); }
.lv-level[data-level='2'] { background: rgba(245, 158, 11, 0.22); color: var(--amber-2); }
.lv-level[data-level='3'] { background: rgba(239, 68, 68, 0.22); color: var(--red-2); }
.lv-level[data-level='4'] { background: rgba(168, 85, 247, 0.25); color: #d8b4fe; }
.lv-answered { color: var(--muted); font-size: 14px; }
.lv-score { color: var(--violet-3); }
.lv-clock { margin-left: auto; min-width: 54px; text-align: right; font-size: 30px; font-variant-numeric: tabular-nums; }
.lv-clock.low { color: var(--red-2); }
.lv-time { height: 8px; margin: 8px 0 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.lv-time i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--amber), var(--red)); transform-origin: left; }
.lv-stage { position: relative; height: min(62vh, 640px); min-height: 260px; border-radius: var(--r-lg); overflow: hidden; background: #a8c3df; }
.lv-stage canvas, .lv-stage .overlay { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lv-stage .overlay { pointer-events: none; overflow: visible; }
.lv-cd { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; background: rgba(11, 16, 32, 0.6); }
.lv-cd b { font-size: 110px; line-height: 1; animation: achIn 0.4s var(--spring) both; }
.lv-cd span { font-size: 18px; font-weight: 700; color: var(--violet-3); }
.lv-form { margin-top: 10px; }
.lv-row { display: flex; gap: 8px; }
.lv-row input { flex: 1; min-width: 0; height: 56px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line-2); background: #0f1529; font-size: 18px; }
.lv-row input:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3); }
.lv-row input:disabled { opacity: 0.55; }
.lv-row .submit { width: 56px; height: 56px; border: 0; border-radius: 16px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; display: grid; place-items: center; }
.lv-row .submit svg { width: 24px; height: 24px; }
.lv-form .suggest { margin-bottom: 8px; }
.lv-fb { min-height: 22px; margin-top: 6px; font-weight: 600; }
.lv-fb.good { color: var(--green-2); }
.lv-fb.bad { color: var(--red-2); }
.lv-fb.hint { color: var(--muted); }
.lv-host-ctl { margin-top: 10px; text-align: right; }

/* After a round. */
.lv-reveal { text-align: center; }
.lv-was { font-size: clamp(22px, 4vw, 34px); margin: 14px 0 6px; }
.lv-was b { color: #fff; }
.lv-mine { display: inline-block; margin: 6px 0; padding: 10px 18px; border-radius: 16px; font-size: 20px; font-weight: 700; }
.lv-mine small { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }
.lv-mine.good { background: rgba(34, 197, 94, 0.16); color: var(--green-2); }
.lv-mine.bad { background: rgba(239, 68, 68, 0.14); color: var(--red-2); }
.lv-stats { color: var(--muted); margin: 4px 0 14px; }
.lv-top5-h { font-size: 18px; margin-bottom: 8px; }
.lv-board { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 8px; max-width: 640px; }
.lv-board li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); font-size: 18px; text-align: left; animation: achIn 0.35s var(--spring) both; }
.lv-board .rk { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); font-weight: 800; }
.lv-board li:nth-child(1) .rk { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2300; }
.lv-board li:nth-child(2) .rk { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.lv-board li:nth-child(3) .rk { background: linear-gradient(135deg, #fdba74, #c2410c); color: #2a1100; }
.lv-board .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-board .dl { color: var(--green-2); font-size: 14px; font-weight: 700; }
.lv-board .sc { font-weight: 800; font-variant-numeric: tabular-nums; }
.lv-next { margin: 20px auto 0; }
.lv-waitnext { margin-top: 16px; }

/* The podium. */
.lv-final { text-align: center; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; max-width: 640px; margin: 18px auto 20px; }
.pd { display: grid; gap: 6px; justify-items: center; animation: achIn 0.6s var(--spring) both; }
.pd-1 { animation-delay: 0.6s; }
.pd-2 { animation-delay: 0.3s; }
.pd-name { font-weight: 800; font-size: clamp(15px, 2.6vw, 22px); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-score { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-block { width: 100%; display: grid; place-items: start center; padding-top: 10px; border-radius: 14px 14px 0 0; font-size: 34px; font-weight: 800; }
.pd-1 .pd-block { height: 170px; background: linear-gradient(180deg, #fbbf24, #b45309); color: #3b2300; }
.pd-2 .pd-block { height: 120px; background: linear-gradient(180deg, #e5e7eb, #6b7280); color: #1f2937; }
.pd-3 .pd-block { height: 90px; background: linear-gradient(180deg, #fdba74, #9a3412); color: #2a1100; }
.pd.empty { visibility: hidden; }
#lvFinalMine { display: block; margin: 0 auto 16px; max-width: 520px; background: rgba(124, 58, 237, 0.18); color: #fff; }
@media (max-width: 640px) {
  .lv-stage { height: 46vh; }
  .lv-board li { font-size: 16px; padding: 9px 12px; }
  .lv-cd b { font-size: 80px; }
}

/* ---------------------------------------------------------------- FRIENDS AND 1v1 */
.nm-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nm-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.board .nm { display: flex; align-items: center; gap: 4px; min-width: 0; }

.person-box { margin-top: 14px; display: grid; gap: 12px; }
.person-rel { font-weight: 600; }
.person-record { padding: 10px 14px; border-radius: 14px; background: rgba(124, 58, 237, 0.16); border: 1px solid rgba(167, 139, 250, 0.3); }
.person-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.profile[data-mode='person'] .prof-edit { display: none; }

.friends-sec { margin-top: 14px; }
.friends-sec .card-head { flex-wrap: wrap; }
.friends-help { margin: -4px 0 12px; }
.friends-group h3 { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: 14px 0 8px; }
.friends { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.friends li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); }
.fr-name { flex: 1; min-width: 0; display: grid; }
.fr-name b { overflow: hidden; text-overflow: ellipsis; }
.fr-name small { color: var(--muted); font-size: 12px; font-weight: 500; }
.fr-btns { display: flex; gap: 6px; flex: none; }

/* A challenge for you. */
.duel-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + var(--safe-b));
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 18px;
  background: #1b1640;
  border: 1px solid rgba(167, 139, 250, 0.6);
  box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  animation: bannerUp 0.4s var(--spring) both;
}
@keyframes bannerUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.db-text { flex: 1; min-width: 0; font-size: 15px; }
.db-text small { display: block; color: var(--muted); font-size: 13px; }
.db-btns { display: flex; gap: 6px; flex: none; }
@media (max-width: 480px) {
  .duel-banner { flex-wrap: wrap; }
  .db-btns { width: 100%; justify-content: flex-end; }
}

.lv-duelwait { text-align: center; padding-top: 8vh; }
.duel-vs { font-size: 64px; margin-bottom: 8px; animation: achIn 0.6s var(--spring) both; }
.lv-duelwait p { max-width: 46ch; margin: 0 auto 12px; }
.friends-link { margin-top: 14px; background: rgba(96, 165, 250, 0.08); border-color: rgba(96, 165, 250, 0.35); }
.friends-link:hover { border-color: rgba(96, 165, 250, 0.5); }
.req-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 800; vertical-align: middle; }
.friends-guest p { margin: 0 0 12px; }

/* The Friends page (mapzi.io/friends). */
.friends-view .card { max-width: 720px; margin-left: auto; margin-right: auto; }
.fr-hero { max-width: 720px; margin: 10px auto 6px; }
.fr-hero h1 { display: flex; align-items: center; gap: 10px; font-size: clamp(28px, 6vw, 40px); letter-spacing: -0.02em; margin: 0 0 4px; }
.fr-hero-i { font-size: 0.9em; }
.fr-hero p { margin: 0; }
.friends-guest { margin-top: 14px; background: linear-gradient(135deg, rgba(96, 165, 250, 0.18), rgba(255, 255, 255, 0.03)); }
.friends-guest h2 { font-size: 18px; margin: 0 0 6px; }
.fr-requests { border-color: rgba(239, 68, 68, 0.45); background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(255, 255, 255, 0.02)); }
.fr-requests h2 { display: flex; align-items: center; }
.friends-view .friends li { padding: 10px 12px; }
.fr-empty { display: grid; gap: 4px; padding: 18px 14px; border-radius: 14px; border: 1px dashed var(--line-2); text-align: center; }
.fr-loading { margin: 0; }
.fr-steps { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 6px; color: #d5dbea; }
.fr-add .btn.primary { width: 100%; max-width: 320px; }
.fr-add #friendsHelp { margin: 12px 0 0; }
.fr-add .name-msg:empty { display: none; }
.fr-add .name-msg { margin-top: 10px; word-break: break-all; }
/* Buttons stay beside the name when they fit, and go under it (on the right) when they don't. */
.friends-view .friends li { flex-wrap: wrap; row-gap: 8px; }
.friends-view .fr-name { flex: 1 1 110px; }
.friends-view .fr-btns { margin-left: auto; }

/* Practice solo: the note under the settings title. */
.lv-setup-note { margin: -4px 0 16px; max-width: 560px; }

/* After a round in a live game (owner, Nov 13: "put the next round below the correct thing ... they are not even"):
   the result, then Next round right under it, the same width, centred; then how everyone did. */
.lv-reveal .lv-mine, .lv-reveal .lv-next { display: block; width: min(100%, 420px); max-width: 420px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.lv-reveal .lv-mine { margin-top: 8px; margin-bottom: 0; }
.lv-reveal .lv-next { margin-top: 12px; }
.lv-reveal .lv-waitnext { margin: 12px 0 0; }
.lv-reveal .lv-stats { margin: 18px 0 10px; }
.lv-reveal .lv-mine[hidden] + .lv-next { margin-top: 4px; }

/* Long practice games: "12 / 50" in place of the round dots. */
.rp-count { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-count b { color: var(--ink); }

/* Practice results: no sharing, no leaderboard; Play again and Change settings. */
.results[data-mode='practice'] .share-preview, .results[data-mode='practice'] .share-actions, .results[data-mode='practice'] .share-note { display: none; }
.practice-edit { width: 100%; margin: 0 0 12px; display: block; }
