/* ==========================================================================
   Neon Surge — "لافتة نيون" redesign (Nov 2026)
   Concept: Riyadh night-street neon signage. One loud element (the sign),
   everything else quiet. Colour carries meaning:
     cyan  = you / your actions      amber = rewards (cores, streak, missions)
     pink  = rivals, danger, records
   ========================================================================== */
:root {
  --ink: #0a0616;
  --ink-2: #140d24;
  --line: rgba(206, 190, 255, 0.12);
  --line-strong: rgba(206, 190, 255, 0.22);
  --text: #f4effc;
  --muted: #a297bd;

  --cyan: #3ef2ff;
  --amber: #ffb627;
  --pink: #ff2e7e;
  --green: #4cf59a;

  /* legacy names still referenced by game.js inline styles / older rules */
  --bg-color: var(--ink);
  --neon-cyan: var(--cyan);
  --neon-pink: var(--pink);
  --neon-yellow: var(--amber);
  --text-main: var(--text);
  --text-muted: var(--muted);

  --font-sign: 'Orbitron', system-ui, sans-serif;
  --font-display: 'Lalezar', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;

  --r-s: 8px;
  --r-m: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
input { user-select: text; -webkit-user-select: text; }

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

/* ---------- Stage ---------- */
#game-container {
  position: relative;
  width: 100vw;
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}
.hidden { display: none !important; }

/* ---------- HUD ---------- */
.hud-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: max(14px, env(safe-area-inset-top)) 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 10;
  pointer-events: none;
}
.hud-overlay button { pointer-events: auto; }
.hud-block { display: flex; flex-direction: column; align-items: flex-start; }
.hud-end { align-items: flex-end; }
.hud-label { font-size: 0.72rem; font-weight: 500; color: var(--muted); }
.hud-val {
  font-family: var(--font-sign);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(62, 242, 255, 0.55);
  font-variant-numeric: tabular-nums;
}
.hud-sub { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.hud-sub span { font-family: var(--font-sign); font-weight: 700; color: var(--text); margin-inline-start: 4px; }
.hud-val-sm { font-family: var(--font-sign); font-size: 1rem; font-weight: 700; color: var(--text); }
.hud-center { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.badge {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  background: rgba(62, 242, 255, 0.12);
  direction: rtl;
  white-space: nowrap;
}
.shield-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--amber);
  box-shadow: 0 0 14px rgba(255, 182, 39, 0.6);
}
.icon-btn {
  margin-top: 8px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(10, 6, 22, 0.55);
  backdrop-filter: blur(6px);
  font-size: 1.05rem;
  cursor: pointer;
}

/* ---------- Overlays ---------- */
.screen, .modal-screen {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 20;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 46, 126, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(10, 6, 22, 0.80), rgba(10, 6, 22, 0.94));
  backdrop-filter: blur(6px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal-screen { position: fixed; z-index: 40; align-items: center; background: rgba(10, 6, 22, 0.9); }

/* The "card" is now a column, not a box: no border, no glow. */
.neon-card {
  width: 100%;
  max-width: 420px;
  padding: max(28px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  text-align: right;
}
.modal-screen .neon-card {
  margin: 20px;
  padding: 20px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-m);
}

/* ---------- The sign (the one loud thing) ---------- */
.logo-box { text-align: center; margin-bottom: 22px; }
.sign {
  font-family: var(--font-sign);
  font-weight: 900;
  font-size: clamp(2.3rem, 12vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0.06em;
  color: #fff;
}
.sign-a, .sign-b { display: inline-block; }
.sign-a {
  color: #e9fdff;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--cyan), 0 0 28px var(--cyan), 0 0 56px rgba(62, 242, 255, 0.5);
  animation: tubeOn 1.4s steps(1, end) 0.15s both;
}
.sign-b {
  color: #ffe9f2;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--pink), 0 0 28px var(--pink), 0 0 56px rgba(255, 46, 126, 0.5);
  animation: tubeOn 1.4s steps(1, end) 0.55s both;
}
.sign-ar {
  font-family: var(--font-display);
  font-size: 1.55rem;
  line-height: 1.2;
  margin-top: 6px;
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 182, 39, 0.65);
  animation: tubeOn 1.2s steps(1, end) 0.95s both;
}
/* A neon tube catching: dark, sputter, sputter, on. Runs once. */
@keyframes tubeOn {
  0%   { opacity: 0.12; text-shadow: none; }
  18%  { opacity: 1; }
  24%  { opacity: 0.2; text-shadow: none; }
  40%  { opacity: 1; }
  46%  { opacity: 0.35; text-shadow: none; }
  60%  { opacity: 1; }
}
.game-tagline {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 32ch;
  margin: 12px auto 0;
  text-align: center;
}

/* ---------- Play zone ---------- */
.play-first { margin-bottom: 18px; }
.mode-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: 52px;
  padding: 6px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.mode-tag { font-weight: 700; font-size: 0.95rem; color: var(--muted); }
.mode-desc { font-size: 0.72rem; color: var(--muted); opacity: 0.8; }
.mode-btn.active { background: rgba(62, 242, 255, 0.14); box-shadow: inset 0 0 0 1px rgba(62, 242, 255, 0.55); }
.mode-btn.active .mode-tag { color: #fff; }
.mode-btn.active .mode-desc { color: var(--cyan); opacity: 1; }
#btn-mode-endless.active { background: rgba(255, 46, 126, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 46, 126, 0.6); }
#btn-mode-endless.active .mode-desc { color: var(--pink); }

.btn-primary {
  width: 100%;
  padding: 14px 16px 12px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--ink);
  background: var(--cyan);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset, 0 0 24px rgba(62, 242, 255, 0.45);
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-play-hero { font-size: 1.85rem; padding: 16px; }
.play-hint { font-size: 0.78rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* ---------- Today's champion strip ---------- */
.top-record-container {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label more" "display display";
  gap: 2px 12px;
  width: 100%;
  margin-bottom: 26px;
  padding: 12px 14px;
  text-align: right;
  cursor: pointer;
  border: 1px solid rgba(255, 46, 126, 0.35);
  border-radius: var(--r-m);
  background: linear-gradient(90deg, rgba(255, 46, 126, 0.12), rgba(255, 46, 126, 0.03));
}
.top-record-label { grid-area: label; font-size: 0.78rem; font-weight: 500; color: #ffb3cf; }
.top-record-more { grid-area: more; font-size: 0.78rem; color: var(--pink); font-weight: 700; }
.top-record-display { grid-area: display; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.top-runner-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.top-runner-score { font-family: var(--font-sign); font-weight: 700; font-size: 0.95rem; color: var(--pink); white-space: nowrap; direction: ltr; }
.live-indicator {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  margin-inline-end: 4px;
  vertical-align: middle;
}
.btn-mini-board { display: none; }

/* ---------- Quiet panels (streak / missions / ship) ---------- */
.panel { margin-bottom: 24px; text-align: right; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.panel-title { font-family: var(--font-display); font-weight: 400; font-size: 1.3rem; line-height: 1.2; color: var(--text); }

/* Streak — amber = reward */
.streak-count { font-weight: 700; font-size: 0.95rem; color: var(--amber); }
.streak-dots { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 8px; direction: rtl; }
.streak-dot {
  height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-family: var(--font-sign);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.streak-dot.on {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 10px rgba(255, 182, 39, 0.5);
}
.streak-dot.big { font-size: 0.95rem; }
.streak-hint { font-size: 0.85rem; color: var(--muted); }
.streak-box.pending .streak-hint { color: var(--text); }

/* Missions */
.missions-sub { font-size: 0.75rem; color: var(--muted); }
.mission-row { padding: 10px 0; border-top: 1px solid var(--line); }
.mission-row:first-child { border-top: 0; padding-top: 2px; }
.mission-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mission-text { font-size: 0.9rem; color: var(--text); line-height: 1.45; }
.mission-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.mission-count { font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mission-reward { font-size: 0.78rem; font-weight: 700; color: var(--amber); }
.mission-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin-top: 7px; }
.mission-fill { height: 100%; border-radius: 4px; background: var(--amber); }
.mission-row.done .mission-text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(76, 245, 154, 0.6); }
.mission-row.done .mission-count { color: var(--green); }
.mission-row.done .mission-fill { background: var(--green); }
.missions-reset { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }

/* Ship picker — the dot becomes the actual ship silhouette from the game */
.skin-cores-bank { font-weight: 700; font-size: 0.95rem; color: var(--amber); direction: ltr; }
.skin-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.skin-btn {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 4px 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.skin-preview-dot {
  display: block;
  width: 26px;
  height: 30px;
  margin-bottom: 8px;
  border-radius: 0 !important;
  clip-path: polygon(50% 0, 92% 100%, 50% 76%, 8% 100%);
  box-shadow: none !important;
}
.skin-ship { display: block; line-height: 0; }
.skin-btn.active { border-color: var(--cyan); background: rgba(62, 242, 255, 0.10); }
.skin-btn.active .skin-ship { filter: drop-shadow(0 0 7px var(--ship-glow, var(--cyan))); }
.skin-name { font-family: var(--font-sign); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; color: var(--text); }
.skin-cost { font-size: 0.72rem; color: var(--amber); margin-top: 2px; }
.skin-btn.active .skin-cost { color: var(--cyan); }
.skin-btn.locked .skin-preview-dot { opacity: 0.35; }
.skin-btn.locked .skin-name { color: var(--muted); }

/* Controls hint */
.instructions { display: grid; gap: 6px; margin-bottom: 18px; font-size: 0.82rem; color: var(--muted); }
.inst-item { display: flex; align-items: center; gap: 8px; }
.key-tag {
  flex: none;
  min-width: 64px;
  text-align: center;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

/* Install banner */
.install-app-banner {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(62, 242, 255, 0.4);
  border-radius: var(--r-m);
  cursor: pointer;
}
.install-text { font-size: 0.85rem; }
.install-btn-pill {
  flex: none;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--cyan);
  cursor: pointer;
}

/* ---------- Friend challenge banner ---------- */
.challenge-banner {
  margin-bottom: 18px;
  padding: 14px;
  border-radius: var(--r-m);
  border: 1px solid var(--pink);
  background: rgba(255, 46, 126, 0.12);
}
.challenge-title { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.25; color: #fff; }
.challenge-sub { font-size: 0.85rem; color: #ffc6dc; margin-top: 4px; }
.challenge-go {
  display: block; width: 100%;
  margin-top: 12px; padding: 10px;
  border: 0; border-radius: 10px;
  font-weight: 700; font-size: 1rem;
  color: #fff; background: var(--pink);
  cursor: pointer;
}

/* ---------- Game over ---------- */
.over-card { text-align: center; }
.game-over-header {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(255, 46, 126, 0.6);
  margin-bottom: 4px;
}
.final-score-box { margin-bottom: 20px; }
.stat-title { font-size: 0.8rem; color: var(--muted); }
.stat-big {
  font-family: var(--font-sign);
  font-size: clamp(3.4rem, 18vw, 4.6rem);
  font-weight: 900;
  line-height: 1.05;
  color: #eafdff;
  text-shadow: 0 0 6px #fff, 0 0 18px var(--cyan), 0 0 40px rgba(62, 242, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.final-rank { font-family: var(--font-display); font-size: 1.2rem; color: var(--amber); margin-top: 2px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-cell { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; }
.stat-cell + .stat-cell { border-inline-start: 1px solid var(--line); }
.cell-label { font-size: 0.72rem; color: var(--muted); }
.cell-val { font-family: var(--font-sign); font-weight: 700; font-size: 1rem; color: var(--text); }
.highlight { color: var(--amber); }

.action-buttons { display: grid; gap: 8px; margin-bottom: 20px; }
#btn-restart.btn-goal { font-size: 1.25rem; }
.btn-share {
  position: relative;
  width: 100%;
  padding: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 46, 126, 0.6);
  border-radius: 12px;
  cursor: pointer;
}
.btn-share.btn-share-reward { border-color: var(--amber); }
.share-reward-badge {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 999px;
  color: var(--ink);
  background: var(--amber);
}

/* Result notes share one quiet style; colour marks the kind */
.rank-progress-box, .streak-reward-box, .install-nudge-box, .missions-result-box, .leaderboard-entry-box {
  margin-bottom: 14px;
  padding: 12px 14px;
  text-align: right;
  border-radius: var(--r-m);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.rank-progress-box { display: grid; gap: 10px; border-color: rgba(62, 242, 255, 0.35); }
.rp-text { font-size: 0.88rem; font-weight: 500; color: var(--text); }
.rp-bar { height: 5px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; direction: rtl; }
.rp-fill { height: 100%; border-radius: 999px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.streak-reward-box { border-color: rgba(255, 182, 39, 0.5); background: rgba(255, 182, 39, 0.07); }
.streak-reward-title { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.3; color: var(--amber); }
.streak-reward-sub { font-size: 0.85rem; color: var(--text); margin-top: 2px; }

.missions-result-box .mission-row:first-of-type { border-top: 0; }
.missions-result-box.win { border-color: rgba(76, 245, 154, 0.5); background: rgba(76, 245, 154, 0.06); }
.missions-result-title { font-weight: 700; font-size: 0.92rem; color: var(--text); margin-bottom: 4px; }
.missions-result-box.win .missions-result-title { color: var(--green); }

.install-nudge-box { border-color: rgba(62, 242, 255, 0.4); }
.install-nudge-title { font-weight: 700; font-size: 0.92rem; }
.install-nudge-sub { font-size: 0.82rem; color: var(--cyan); margin-top: 2px; }
.install-steps { margin: 8px 0 4px; padding-inline-start: 20px; font-size: 0.82rem; line-height: 1.7; color: var(--text); }
.install-nudge-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.install-later { border: 0; background: transparent; color: var(--muted); font-size: 0.8rem; padding: 6px 8px; cursor: pointer; }

/* New record entry — pink = records */
.leaderboard-entry-box { border-color: var(--pink); background: rgba(255, 46, 126, 0.08); }
.new-record-badge { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.25; color: #fff; margin-bottom: 2px; }
.record-prompt { font-size: 0.85rem; color: #ffc6dc; margin-bottom: 10px; }
.record-form { display: flex; gap: 8px; }
.record-form input {
  flex: 1; min-width: 0;
  padding: 10px 12px;
  font: inherit; font-size: 1rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 46, 126, 0.5);
  border-radius: 10px;
  outline: none;
}
.record-form input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 46, 126, 0.25); }
.btn-submit-record {
  flex: none;
  padding: 0 14px;
  border: 0; border-radius: 10px;
  font-weight: 700; font-size: 0.85rem;
  color: #fff; background: var(--pink);
  cursor: pointer;
  white-space: nowrap;
}

.revive-container { margin-top: 6px; }
.btn-secondary {
  width: 100%;
  padding: 11px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
}
.btn-secondary:disabled { opacity: 0.7; cursor: progress; }
.revive-hint { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

/* ---------- Leaderboard modal ---------- */
.modal-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.leaderboard-header { font-family: var(--font-display); font-weight: 400; font-size: 1.6rem; line-height: 1.2; color: #fff; }
.close-x {
  width: 40px; height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  font-size: 1.4rem; line-height: 1;
  cursor: pointer;
}
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.lb-tabs:has(.lb-tab.hidden + .lb-tab.hidden) { display: none; }
.lb-tab { padding: 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 700; font-size: 0.9rem; cursor: pointer; }
.lb-tab.active { color: #fff; background: rgba(255, 46, 126, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 46, 126, 0.55); }
.leaderboard-subtitle { font-size: 0.82rem; color: var(--muted); margin-bottom: 6px; }
.lb-reset { font-size: 0.78rem; color: var(--pink); margin-bottom: 10px; }
.leaderboard-table { display: flex; flex-direction: column; margin: 8px 0 16px; }
.leaderboard-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
}
.leaderboard-row:first-child { border-top: 0; }
.row-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rank-badge { flex: none; width: 28px; text-align: center; font-family: var(--font-sign); font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.player-name { font-weight: 700; font-size: 1rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-score { font-family: var(--font-sign); font-weight: 700; font-size: 0.9rem; color: var(--text); direction: ltr; white-space: nowrap; }
.leaderboard-row.rank-1 {
  padding: 12px 10px;
  border: 1px solid rgba(255, 46, 126, 0.55);
  border-radius: 12px;
  background: rgba(255, 46, 126, 0.10);
}
.leaderboard-row.rank-1 + .leaderboard-row { border-top: 0; }
.rank-1 .player-name { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; }
.rank-1 .player-score { color: var(--pink); }
.lb-empty { padding: 16px; border: 1px dashed rgba(255, 46, 126, 0.45); border-radius: 12px; font-size: 0.9rem; text-align: center; }
.mt-3 { margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  color: var(--ink);
  background: var(--cyan);
  box-shadow: 0 0 20px rgba(62, 242, 255, 0.45);
  z-index: 50;
  direction: rtl;
  animation: popToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popToast { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Wider screens: menu splits into play column + today column ---------- */
@media (min-width: 860px) {
  .menu-card {
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 64px;
    align-items: start;
    padding-top: 56px;
  }
  .menu-card > .logo-box,
  .menu-card > .challenge-banner,
  .menu-card > .install-app-banner { grid-column: 1 / -1; }
  .menu-card > .logo-box { margin-bottom: 40px; }
  .sign { font-size: 4.2rem; }
  .sign-ar { font-size: 1.9rem; margin-top: 14px; }
  .over-card { max-width: 440px; padding-top: 48px; }
}

/* Mobile: instructions sit after the ship picker, not mid-flow */
@media (max-width: 859px) {
  .menu-card { display: flex; flex-direction: column; }
  .menu-play, .menu-today { display: contents; }
  .menu-play > .instructions { order: 10; }
  .menu-card > .install-app-banner { order: 11; }
}

@media (prefers-reduced-motion: reduce) {
  .sign-a, .sign-b, .sign-ar, .toast { animation: none; }
}
