/* Build the Future — Moonshots idle game */

:root {
  --bg-0: #05060f;
  --bg-1: #0a0b1e;
  --bg-2: #12142e;
  --panel: rgba(20, 24, 55, 0.72);
  --panel-line: rgba(120, 140, 255, 0.18);
  --ink: #e9ecff;
  --ink-dim: #9aa1c9;
  --ink-mute: #6b7297;
  --accent: #7aa2ff;
  --accent-2: #b389ff;
  --gold: #ffd166;
  --green: #57e7a4;
  --red: #ff6b8a;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 20% -10%, #1b1f4a 0%, transparent 55%),
              radial-gradient(ellipse at 90% 110%, #2a1550 0%, transparent 50%),
              linear-gradient(180deg, var(--bg-0), var(--bg-1) 40%, var(--bg-2));
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  /* iOS safe-area: respect notch and home indicator */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Starfield */
#starfield {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 8% 12%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 22% 78%, #ccd 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 33%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 71% 61%, #aac 50%, transparent 100%),
    radial-gradient(1px 1px at 44% 88%, #eef 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 88% 18%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 3% 55%, #bbc 50%, transparent 100%),
    radial-gradient(1px 1px at 32% 27%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 65% 92%, #ccd 50%, transparent 100%);
  animation: twinkle 5s ease-in-out infinite alternate;
  opacity: 0.65;
}
@keyframes twinkle { from { opacity: 0.4; } to { opacity: 0.85; } }

/* Intro */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(10,12,40,0.85), rgba(5,6,15,0.98));
  backdrop-filter: blur(6px);
  padding: 24px;
  overflow-y: auto;
}
.intro.hidden { display: none; }
.intro-card {
  max-width: 520px; width: 100%;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 20px;
  padding: 32px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.intro-badge {
  display: inline-block; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 3px;
  color: var(--accent); background: rgba(122,162,255,0.1);
  border: 1px solid rgba(122,162,255,0.3);
  padding: 6px 12px; border-radius: 999px; margin-bottom: 20px;
}
.intro-title {
  font-size: clamp(30px, 8vw, 44px); margin: 0 0 12px; font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro-tagline { font-size: 17px; color: var(--ink-dim); margin: 0 0 22px; }
.intro-body { color: var(--ink); line-height: 1.55; font-size: 15px; margin: 0 0 18px; }
.intro-body strong { color: var(--accent); font-weight: 600; }
.intro-mtp { color: var(--ink-dim); font-size: 14px; margin: 0 0 26px; }
.intro-mtp em { color: var(--gold); font-style: normal; }
.intro-start { min-width: 200px; }

/* Sticky race HUD — wrapper keeps the era spine + progress riding along,
   and the header itself is sticky so it stays pinned (and reports sticky). */
.sticky-race-hud { position: sticky; top: 0; z-index: 30; }
.hud {
  position: sticky; top: 0; z-index: 31;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: linear-gradient(180deg, rgba(10,12,30,0.85), rgba(10,12,30,0.55));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-line);
  gap: 12px;
}
.race-clock { text-align: center; padding: 0 10px; }
.clock-value { font: 700 clamp(18px, 5vw, 26px)/1 'JetBrains Mono', monospace; color: #fff; }
.clock-value.paused { color: var(--gold); font-size: clamp(12px, 3.6vw, 18px); }
.best-time { margin-top: 3px; font: 700 9px/1 'JetBrains Mono', monospace; color: var(--accent); }
.hud-left { min-width: 0; }
.logo {
  font-weight: 800; font-size: 18px; letter-spacing: 0.3px;
  background: linear-gradient(90deg, #fff, var(--accent-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }

.impact-meter { text-align: right; min-width: 0; }
.impact-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 2px; color: var(--ink-mute); text-transform: uppercase;
}
.impact-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(20px, 5vw, 28px); font-weight: 700; color: var(--gold);
  line-height: 1.1;
}
.impact-rate {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--green);
}

/* MTP bar */
.mtp-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px; background: rgba(20, 24, 55, 0.45);
  border-bottom: 1px solid var(--panel-line);
  font-size: 13px;
}
.news-ticker {
  min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 8px 18px; color: var(--ink-dim); background: rgba(5,6,15,.72);
  border-bottom: 1px solid var(--panel-line); font-size: 12px; text-align: center;
}
.news-label { color: var(--green); font: 700 9px/1 'JetBrains Mono', monospace; letter-spacing: 1.5px; white-space: nowrap; }
#newsHeadline { animation: headline-in .45s ease; }
@keyframes headline-in { from { opacity: 0; transform: translateY(6px); } }
.mtp-text { min-width: 0; flex: 1; }
.mtp-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 2px; color: var(--gold);
  margin-right: 10px;
}
.mtp-progress {
  flex: 2; height: 8px; background: rgba(255,255,255,0.06);
  border-radius: 999px; overflow: hidden; min-width: 100px;
}
.mtp-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--gold));
  transition: width 0.6s ease;
}
.mtp-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--gold); font-weight: 700; min-width: 40px; text-align: right;
}

/* Layout */
.layout {
  display: grid; grid-template-columns: 1fr 340px;
  gap: 20px; max-width: 1200px; margin: 0 auto;
  /* bottom clearance for the fixed era spine */
  padding: 20px 22px calc(100px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; padding: 14px 14px calc(96px + env(safe-area-inset-bottom, 0px)); }
}

.col-title { margin: 0 0 4px; font-size: 15px; letter-spacing: 0.4px; }
.col-sub { margin: 0 0 14px; font-size: 12px; color: var(--ink-mute); }
.milestones { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 14px; }
.milestone { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; padding: 10px; border: 1px solid rgba(87,231,164,.22); border-radius: 10px; background: rgba(87,231,164,.06); }
.milestone span { grid-row: 1 / 3; color: var(--green); }
.milestone strong { font-size: 11px; }
.milestone small { color: var(--green); font: 700 8px/1 'JetBrains Mono', monospace; letter-spacing: 1px; }

/* Domain cards */
.domain {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}
.domain::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 0%, var(--_glow, transparent) 50%, transparent 100%);
  opacity: 0.35; pointer-events: none;
}
.domain[data-locked="true"] { opacity: 0.55; filter: grayscale(0.4); }
.domain-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px; position: relative;
}
.domain-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: var(--_bg, rgba(122,162,255,0.15));
  border: 1px solid var(--_border, rgba(122,162,255,0.3));
  flex-shrink: 0;
}
.domain-name-block { flex: 1; min-width: 0; }
.domain-name { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: 0.2px; }
.domain-sub { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.domain-output {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--green); text-align: right;
}
.domain-output .n { color: var(--gold); font-weight: 700; }

.domain-actions {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; position: relative;
}
@media (max-width: 700px) {
  .domain-actions { grid-template-columns: 1fr; }
  .btn-work {
    width: 100%; min-height: 220px; aspect-ratio: 4 / 3;
    border-radius: 14px;
  }
  .btn-work .lbl { font-size: 16px; }
  .btn-work .sub { font-size: 12px; }
}

.btn {
  border-radius: 10px; border: 1px solid var(--panel-line);
  padding: 10px 12px; font-family: inherit; font-size: 14px;
  cursor: pointer; background: rgba(30, 35, 70, 0.6); color: var(--ink);
  transition: all 0.12s ease; user-select: none; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: 2px;
}
.btn:hover:not(:disabled) { background: rgba(45, 52, 100, 0.75); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); background: rgba(60, 68, 120, 0.85); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn small { font-size: 11px; color: var(--ink-mute); font-family: 'JetBrains Mono', monospace; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none; color: #08091a; font-weight: 700;
  padding: 12px 20px; border-radius: 12px; font-size: 15px; cursor: pointer;
  min-height: 44px;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 24px rgba(122,162,255,0.35);
  font-family: inherit;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(122,162,255,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.btn-work {
  position: relative; isolation: isolate; overflow: hidden;
  background: linear-gradient(135deg, var(--_c1, #364a9c), var(--_c2, #6c46b8));
  border: none; color: #fff; font-weight: 700;
  align-items: center; justify-content: center; text-align: center;
  min-height: 180px; aspect-ratio: 3 / 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.95);
}
.btn-work::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(180deg, rgba(5,7,24,0.34), rgba(5,7,24,0.66)),
    var(--_art);
  background-size: cover; background-position: center;
  filter: grayscale(1) saturate(0) brightness(0.78);
  transition: transform 0.25s ease, filter 0.55s ease;
}
.btn.btn-work:hover:not(:disabled)::before {
  transform: scale(1.025);
  filter: grayscale(1) saturate(0) brightness(0.86);
}
.btn-work.is-activated::before {
  filter: grayscale(0) saturate(1) brightness(1);
}
.btn.btn-work.is-activated:hover:not(:disabled)::before {
  transform: scale(1.025); filter: grayscale(0) saturate(1) brightness(1.06);
}
.btn-work:disabled { background: rgba(60,60,90,0.5); color: var(--ink-mute); }
.btn-work:disabled::before { filter: grayscale(1) saturate(0.2) brightness(0.58); }
.btn-work .lbl, .btn-work .sub { position: relative; z-index: 1; }
.btn-work .lbl { font-size: 14px; }
.btn-work .sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; opacity: 0.9; margin-top: 2px;
}

.btn-ghost {
  background: transparent; border: 1px solid var(--panel-line);
  color: var(--ink-dim); font-size: 12px; padding: 8px 14px; border-radius: 8px;
  cursor: pointer; font-family: inherit;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
/* .btn.upgrade-buy keeps .btn's flex-column layout; just enforce the tap floor. */
.btn.upgrade-buy { min-height: 44px; justify-content: center; }
.btn-ghost:hover { color: var(--ink); border-color: var(--accent); }

.helpers-list { margin-top: 12px; display: grid; gap: 8px; }
.upgrade-buy { width: 100%; margin-top: 10px; align-items: center; text-align: center; border-color: rgba(255,209,102,.3); }
.upgrade-buy.owned { color: var(--green); border-color: rgba(87,231,164,.3); }
.helper {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05);
  font-size: 13px;
}
.helper-info { min-width: 0; }
.helper-name { font-weight: 600; font-size: 13px; }
.helper-desc {
  font-family: 'JetBrains Mono', monospace;
  color: var(--ink-mute); font-size: 11px; margin-top: 1px;
}
.helper-owned { color: var(--green); font-weight: 700; }
.helper-buy {
  border-radius: 8px; border: 1px solid var(--panel-line);
  padding: 6px 10px; font-size: 12px; cursor: pointer;
  background: rgba(80, 90, 160, 0.4); color: var(--ink); font-family: inherit;
  min-width: 74px; min-height: 44px; text-align: center;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
}
.helper-buy:hover:not(:disabled) { background: rgba(100, 110, 180, 0.55); }
.helper-buy:disabled { opacity: 0.4; cursor: not-allowed; }
.helper-buy .cost { display: block; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--gold); }

.next-domain {
  padding: 14px 16px; border: 1px dashed var(--panel-line); border-radius: var(--radius);
  color: var(--ink-mute); font-size: 13px; text-align: center;
  margin-top: 6px;
}
.next-domain strong { color: var(--accent); }

/* Powerups */
.powerups-col { position: relative; }
.powerup {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px;
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center;
  cursor: pointer; transition: transform 0.15s ease, background 0.15s ease;
  user-select: none;
  position: relative; overflow: hidden;
}
.powerup:hover:not(.disabled) { transform: translateY(-1px); background: rgba(30, 34, 70, 0.85); }
.powerup.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(255,209,102,0.35);
}
.powerup.disabled { opacity: 0.55; cursor: not-allowed; }
.powerup-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #08091a;
  background: linear-gradient(135deg, var(--_c1, #fff), var(--_c2, #ccc));
  flex-shrink: 0;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.15);
}
.powerup-body { min-width: 0; }
.powerup-name { font-size: 13px; font-weight: 700; }
.powerup-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--ink-mute); letter-spacing: 1px; text-transform: uppercase;
}
.powerup-desc { font-size: 12px; color: var(--ink-dim); margin-top: 3px; line-height: 1.35; }
.powerup-cooldown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--ink-mute); text-align: right; min-width: 44px;
}
.powerup-cooldown.ready { color: var(--green); font-weight: 700; }
.powerup-cooldown.active { color: var(--gold); font-weight: 700; }

.side-actions { margin-top: 18px; display: flex; justify-content: flex-end; }
.credit {
  margin-top: 16px; font-size: 11px; color: var(--ink-mute); text-align: center; line-height: 1.5;
}

/* "Buy me tokens" — Jon's support link (buymeacoffee, reframed as tokens, not coffee) */
.tip-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: fit-content; margin: 14px auto 0; padding: 8px 16px; min-height: 40px;
  border: 1px solid rgba(255, 209, 102, 0.35); border-radius: 999px;
  background: rgba(255, 209, 102, 0.06); color: var(--gold);
  font-size: 12px; font-weight: 700; text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.tip-link:hover {
  background: rgba(255, 209, 102, 0.14); border-color: var(--gold); transform: translateY(-1px);
}

.win-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.tip-cta {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--gold); font-size: 13px; font-weight: 700; text-decoration: none;
  padding: 6px 12px; border-radius: 8px; transition: transform 0.15s ease;
}
.tip-cta:hover { transform: translateY(-1px); text-decoration: underline; }
.leaderboard-card { margin-top: 18px; padding: 14px; border: 1px solid var(--panel-line); border-radius: var(--radius); background: var(--panel); }
.leaderboard-head { display: flex; justify-content: space-between; align-items: center; }
.leaderboard-head span { color: var(--accent); font: 700 9px/1 'JetBrains Mono', monospace; letter-spacing: 1px; }
.leaderboard { margin: 10px 0 0; padding-left: 28px; color: var(--ink-dim); }
.leaderboard li { padding: 5px 0 5px 4px; border-bottom: 1px solid rgba(255,255,255,.05); font: 700 12px/1.4 'JetBrains Mono', monospace; }
.leaderboard li::marker { color: var(--gold); }
.leaderboard-empty { list-style: none; margin-left: -28px; color: var(--ink-mute); font: 400 12px/1.5 'Sora', sans-serif !important; }

/* Toasts */
.toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 50; pointer-events: none; align-items: center; width: min(92vw, 380px);
}
.toast {
  background: rgba(20, 24, 55, 0.95);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  padding: 10px 16px; font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.3s ease, toast-out 0.4s ease forwards;
  animation-delay: 0s, 3.4s;
  max-width: 100%;
  text-align: center;
}
.toast.win { border-color: var(--gold); color: var(--gold); }
.toast.mentor { border-color: var(--accent-2); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/* Win overlay */
.win-overlay {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: clamp(10px, 2vw, 24px); overflow-y: auto;
  background:
    radial-gradient(circle at 50% 5%, rgba(91,76,180,.32), transparent 48%),
    rgba(3,5,16,.97);
  backdrop-filter: blur(10px);
}
.win-overlay.hidden { display: none; }
.win-card {
  position: relative; width: min(1180px, 100%); max-height: calc(100dvh - 32px);
  margin: auto; overflow-y: auto; overflow-x: hidden;
  border: 1px solid rgba(255,209,102,.76); border-radius: 28px;
  background: linear-gradient(160deg, rgba(18,22,54,.995), rgba(7,10,27,.995));
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 32px 100px rgba(0,0,0,.68), 0 0 72px rgba(255,209,102,.12);
}
.win-card.enter { animation: win-enter .72s cubic-bezier(.2,.9,.3,1.12) both; }
@keyframes win-enter {
  from { opacity: 0; transform: scale(.92) translateY(26px); }
  to { opacity: 1; transform: none; }
}
.win-hero {
  position: relative; min-height: 480px; aspect-ratio: 16 / 8.1;
  overflow: hidden; isolation: isolate; background: #0b1127;
}
.win-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 1; transition: opacity 0.26s ease; }
.win-hero-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4,7,20,.28), transparent 58%, rgba(4,7,20,.2)),
    linear-gradient(0deg, #0c1129 0%, rgba(12,17,41,.7) 11%, transparent 45%);
}
.win-topline {
  position: absolute; z-index: 3; inset: 24px 28px auto;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.win-eyebrow, .win-badge {
  color: var(--gold); background: rgba(7,10,27,.72); border: 1px solid rgba(255,209,102,.55);
  border-radius: 999px; padding: 8px 13px; backdrop-filter: blur(10px);
  font: 800 9px/1.15 'JetBrains Mono', monospace; letter-spacing: 2.2px; text-transform: uppercase;
}
.win-badge { color: #fff0b8; }
.win-title {
  position: absolute; z-index: 3; left: clamp(26px, 5vw, 58px); right: 34%; bottom: 36px;
  text-shadow: 0 8px 28px rgba(0,0,0,.85);
}
.win-title h2 {
  margin: 0; color: #fff; font-size: clamp(43px, 6.1vw, 76px); line-height: .94;
  font-weight: 850; letter-spacing: -.055em; text-wrap: balance;
}
.win-title p { margin: 12px 0 0; color: #ddd6ff; font-size: clamp(15px, 2vw, 23px); font-weight: 700; }
.borg-portrait--hero {
  position: absolute; z-index: 4; right: 2.5%; bottom: -2%;
  width: min(31%, 340px); height: 92%; object-fit: contain; object-position: bottom center;
  border: 0; border-radius: 0; filter: drop-shadow(0 20px 28px rgba(0,0,0,.62));
}
.win-command {
  display: grid; grid-template-columns: 190px minmax(0,1fr) minmax(210px,260px);
  align-items: center; gap: 22px; padding: 22px 28px 24px;
  background:
    linear-gradient(90deg, rgba(255,209,102,.025) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(rgba(255,209,102,.025) 1px, transparent 1px) 0 0 / 38px 38px;
}
.win-stats { min-width: 0; text-align: center; border-right: 1px solid rgba(255,255,255,.12); padding-right: 20px; }
.win-eff-num {
  color: #75dfdf; font: 800 clamp(44px, 5.2vw, 68px)/.9 'JetBrains Mono', monospace;
  letter-spacing: -4px;
}
.win-card[data-branch="reject"] .win-eff-num { color: #ff626b; }
.win-card[data-branch="colony"] .win-eff-num { color: #72e4cd; }
.win-eff-cap {
  margin-top: 11px; color: var(--ink-mute);
  font: 700 8px/1.3 'JetBrains Mono', monospace; letter-spacing: 1.7px; text-transform: uppercase;
}
.win-when { margin-top: 9px; color: var(--gold); font-size: 10px; line-height: 1.35; font-weight: 700; }
.borg-msg { min-width: 0; text-align: left; }
.borg-heading {
  color: #b996ff; font: 800 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.7px;
}
.win-verdict {
  display: inline-flex; margin-top: 7px; padding: 6px 9px; border: 1px solid rgba(117,223,223,.4);
  border-radius: 7px; color: #75dfdf; background: rgba(117,223,223,.06);
  font: 800 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.2px;
}
.win-card[data-branch="reject"] .win-verdict { color: #ff626b; border-color: rgba(255,98,107,.48); background: rgba(255,98,107,.07); }
.win-card[data-branch="colony"] .win-verdict { color: var(--gold); border-color: rgba(255,209,102,.48); background: rgba(255,209,102,.07); }
.borg-text { position: relative; min-height: 100px; margin-top: 10px; overflow: hidden; }
.borg-text p {
  position: absolute; inset: 0; margin: 0; opacity: 0;
  color: var(--ink); font-size: 13.5px; line-height: 1.52;
  animation: alex-transmission 24s ease-in-out infinite;
  animation-delay: calc(var(--message-index) * 8s);
}
.borg-text p em { color: var(--gold); font-style: italic; }
.borg-text p strong { color: #fff; font-weight: 800; }
@keyframes alex-transmission {
  0% { opacity: 0; transform: translateY(10px); }
  4%, 29% { opacity: 1; transform: none; }
  33%, 100% { opacity: 0; transform: translateY(-8px); }
}
.borg-msg:hover .borg-text p { animation-play-state: paused; }
.borg-message-dots { display: flex; gap: 5px; margin-top: 5px; }
.borg-message-dots i {
  width: 18px; height: 2px; border-radius: 9px; background: rgba(255,255,255,.13);
  animation: transmission-dot 24s linear infinite;
}
.borg-message-dots i:nth-child(2) { animation-delay: 8s; }
.borg-message-dots i:nth-child(3) { animation-delay: 16s; }
@keyframes transmission-dot { 0%, 33% { background: var(--gold); } 34%, 100% { background: rgba(255,255,255,.13); } }
.win-actions { display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
.win-actions .btn-primary { min-height: 62px; padding: 12px 18px; font-size: 15px; }
.win-actions .btn-primary.arming { opacity: .5; cursor: default; }
.win-note { margin: 0; color: var(--ink-mute); text-align: center; font-size: 9px; line-height: 1.35; }
.win-actions .tip-cta { justify-content: center; font-size: 10px; }
.win-card[data-branch="reject"] .win-actions .btn-primary {
  background: linear-gradient(90deg, #b94155, #ef6470); color: #fff;
}
.win-card[data-branch="colony"] .win-actions .btn-primary {
  background: linear-gradient(90deg, #7aa2ff, #b389ff); color: #090c22;
}

@media (max-width: 780px) {
  .win-overlay { display: block; padding: 10px; }
  .win-card { max-height: calc(100dvh - 20px); border-radius: 20px; }
  .win-hero { min-height: 370px; aspect-ratio: auto; }
  .win-topline { inset: 14px 15px auto; }
  .win-eyebrow { max-width: calc(100% - 108px); font-size: 7px; letter-spacing: 1px; }
  .win-badge { font-size: 7px; letter-spacing: 1px; }
  .win-title { left: 19px; right: 29%; bottom: 22px; }
  .win-title h2 { font-size: clamp(35px, 10vw, 54px); }
  .win-title p { max-width: 260px; font-size: 14px; }
  .borg-portrait--hero { right: -5%; width: min(45%, 245px); height: 78%; }
  .win-command { grid-template-columns: 1fr; gap: 15px; padding: 19px 18px 22px; }
  .win-stats {
    display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 14px;
    text-align: left; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1);
    padding: 0 0 13px;
  }
  .win-eff { grid-row: 1 / 3; }
  .win-eff-num { font-size: 48px; }
  .win-eff-cap { font-size: 7px; }
  .win-when { margin: 0; font-size: 10px; }
  .borg-text { min-height: 110px; }
  .win-actions .btn-primary { min-height: 56px; }
}
@media (max-width: 420px) {
  .win-hero { min-height: 330px; }
  .win-eyebrow { display: none; }
  .win-title { right: 24%; }
  .win-title h2 { font-size: 37px; }
  .win-title p { max-width: 210px; font-size: 12px; }
  .borg-portrait--hero { right: -10%; width: 49%; height: 73%; }
  .borg-text p { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .win-card.enter, .borg-text p, .borg-message-dots i { animation: none; }
  .borg-text { max-height: 180px; overflow-y: auto; }
  .borg-text p { position: static; opacity: 1; transform: none; margin-bottom: 8px; }
}
@media (max-width: 620px) {
  .hud { padding: 10px 12px; }
  .tagline, .impact-label { display: none; }
  .logo { font-size: 13px; max-width: 90px; }
  .impact-value { font-size: 18px; }
  .impact-rate { font-size: 9px; }
  .mtp-bar { padding: 8px 12px; gap: 8px; }
  .mtp-text { display: none; }
  .milestones { grid-template-columns: 1fr; }
  .news-ticker { justify-content: flex-start; overflow: hidden; }
}

/* Impact tick pulse */
.tick { animation: tick-pulse 0.25s ease; }
@keyframes tick-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); color: #fff; }
  100% { transform: scale(1); }
}

/* =========================================================================
   V3 — earned hosts, era spine, unlock bars, fanfare, Peter intro
   ========================================================================= */

/* --- Cinematic mentor intro --- */
.intro {
  padding: clamp(14px, 3vw, 34px);
  background:
    radial-gradient(ellipse at 50% 16%, rgba(64,54,132,0.5), transparent 54%),
    linear-gradient(180deg, rgba(5,6,18,0.93), rgba(4,5,14,0.99));
}
.intro-card.intro-peter {
  position: relative;
  width: min(100%, 960px); max-width: 960px;
  display: grid; grid-template-columns: 1fr; gap: 0;
  text-align: left; align-items: stretch; padding: 0;
  max-height: calc(100vh - 56px);
  max-height: calc(100dvh - 56px);
  overflow-y: auto; overflow-x: hidden;
  border: 1px solid rgba(255,209,102,0.34);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(24,28,65,0.98), rgba(10,12,32,0.99));
  box-shadow:
    0 0 0 1px rgba(122,162,255,0.14),
    0 28px 90px rgba(0,0,0,0.62),
    0 0 80px rgba(122,92,255,0.16);
}
.intro-card.intro-peter::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035);
}
.intro-hero-stage {
  position: relative; grid-column: 1 / -1;
  width: 100%; height: clamp(320px, 48dvh, 480px);
  overflow: hidden; isolation: isolate;
  background: #080d1c;
  border-bottom: 1px solid rgba(255,209,102,0.32);
  box-shadow: 0 18px 44px rgba(0,0,0,0.46);
  animation: intro-portrait-in 0.75s cubic-bezier(.2,.9,.3,1.08) both;
}
.intro-hero-stage::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3,7,17,0.62) 0%, rgba(3,7,17,0.28) 32%, transparent 58%),
    linear-gradient(0deg, rgba(3,6,16,0.4), transparent 32%);
}
.intro-hero {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block; border-radius: 0; margin: 0;
}
.intro-brand {
  position: absolute; z-index: 2; top: 50%; left: clamp(28px, 5.2vw, 58px);
  width: min(38%, 350px); transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-start;
  color: #fff; text-shadow: 0 3px 24px rgba(0,0,0,0.84);
}
.intro-brand-kicker {
  margin-bottom: 7px;
  color: var(--gold);
  font: 700 clamp(16px, 2.1vw, 23px)/1.05 'Sora', sans-serif;
  letter-spacing: -0.02em;
}
.intro-brand-title {
  font: 800 clamp(38px, 5.4vw, 62px)/0.92 'Sora', sans-serif;
  letter-spacing: -0.055em;
  text-wrap: balance;
}
.intro-brand-caption {
  margin-top: 17px; padding: 6px 0 5px;
  border-top: 1px solid rgba(255,209,102,0.72);
  border-bottom: 1px solid rgba(255,209,102,0.42);
  color: rgba(255,255,255,0.82);
  font: 700 9px/1 'JetBrains Mono', monospace;
  letter-spacing: 4px; text-transform: uppercase;
}
.intro-host {
  display: flex; align-items: flex-end; justify-content: center;
  padding: 18px 0 18px 22px;
  background: radial-gradient(circle at 55% 90%, rgba(122,162,255,0.13), transparent 68%);
}
.intro-portrait {
  width: 100%; max-width: 148px; height: auto; max-height: 230px; object-fit: contain;
  display: block;
  filter: drop-shadow(0 16px 25px rgba(0,0,0,0.55));
  animation: intro-portrait-in 0.7s cubic-bezier(.2,.9,.3,1.2) 0.08s both;
}
@keyframes intro-portrait-in { from { opacity: 0; transform: translateY(20px) scale(0.96); } }
.intro-copy {
  min-width: 0; grid-column: 1 / -1; align-self: center;
  padding: 24px clamp(22px, 4vw, 44px) 22px;
}
.intro-hostline {
  color: var(--gold); margin: 0 0 11px;
  font: 700 11px/1.2 'JetBrains Mono', monospace;
  letter-spacing: 2.4px; text-transform: uppercase;
}
.intro-copy .intro-body {
  color: var(--ink); font-size: 13.5px; line-height: 1.52;
  margin: 0 0 9px;
}
.intro-copy .intro-body strong { color: var(--accent); }
.intro-copy .intro-body em { color: #a9c3ff; font-style: italic; }
.intro-objective {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 13px 0 14px; padding: 10px 13px;
  color: var(--ink); font-size: 12.5px; line-height: 1.4;
  border: 1px solid rgba(255,209,102,0.25);
  border-left: 3px solid var(--gold); border-radius: 3px 10px 10px 3px;
  background: linear-gradient(90deg, rgba(255,209,102,0.09), rgba(122,162,255,0.045));
}
.intro-objective-label {
  color: var(--gold);
  font: 700 9px/1.2 'JetBrains Mono', monospace;
  letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap;
}
.intro-actions {
  display: flex; gap: 10px; align-items: center; margin-top: 2px; flex-wrap: wrap;
}
.intro-start { min-width: 190px; }
.intro-skip { padding: 9px 14px; }
.intro-disclaimer {
  font-size: 9px; color: var(--ink-mute);
  margin: 10px 0 0; line-height: 1.35;
}
@media (max-width: 700px) {
  .intro { padding: 10px; align-items: flex-start; }
  .intro-card.intro-peter {
    grid-template-columns: 1fr;
    width: 100%; max-height: calc(100dvh - 20px);
    border-radius: 18px;
  }
  .intro-hero-stage {
    grid-column: 1; height: auto;
    display: flex; flex-direction: column;
  }
  .intro-hero-stage::after { display: none; }
  .intro-hero {
    order: 2; width: 100%; height: auto; aspect-ratio: 4 / 3;
    object-fit: cover; object-position: 62% center;
  }
  .intro-brand {
    position: static; order: 1; width: 100%; transform: none;
    display: grid; grid-template-columns: auto 1fr; align-items: baseline;
    padding: 14px 18px 12px;
    background:
      radial-gradient(circle at 80% 0%, rgba(122,162,255,0.18), transparent 45%),
      linear-gradient(100deg, #080d1c, #101b35);
    text-shadow: none;
  }
  .intro-brand-kicker {
    grid-column: 1; margin: 0 7px 0 0;
    font-size: clamp(13px, 4.4vw, 18px);
  }
  .intro-brand-title {
    grid-column: 2;
    font-size: clamp(22px, 7.2vw, 34px); line-height: 1;
    letter-spacing: -0.045em; white-space: nowrap;
  }
  .intro-brand-caption {
    grid-column: 1 / -1;
    margin-top: 8px; padding: 0; border: 0;
    font-size: 7.5px; letter-spacing: 3px;
  }
  .intro-host {
    padding: 10px 0 0; min-height: 92px;
    align-items: flex-end;
  }
  .intro-portrait { max-width: 90px; max-height: 105px; }
  .intro-copy { padding: 8px 16px 16px; text-align: center; }
  .intro-hostline { margin-bottom: 8px; font-size: 10px; }
  .intro-copy .intro-body { font-size: 12.25px; line-height: 1.46; margin-bottom: 7px; }
  .intro-objective {
    justify-content: center; gap: 5px 8px;
    margin: 10px 0 11px; padding: 9px 10px;
    border-left-width: 1px; border-radius: 10px;
  }
  .intro-actions { justify-content: center; }
  .intro-start { flex: 1 1 190px; }
  .intro-disclaimer { font-size: 8.5px; }
}

/* --- Animated loading-page field guide --- */
.intro-tutorial {
  grid-column: 1 / -1; min-height: min(700px, calc(100dvh - 58px));
  padding: clamp(22px, 4vw, 42px); overflow: hidden;
  background:
    radial-gradient(circle at 88% 10%, rgba(122,162,255,.16), transparent 35%),
    linear-gradient(150deg, rgba(22,26,61,.99), rgba(8,11,29,.995));
}
.intro-tutorial.hidden { display: none; }
.tutorial-head {
  display: grid; grid-template-columns: 110px 1fr 110px; align-items: start;
  text-align: center; border-bottom: 1px solid rgba(255,255,255,.09); padding-bottom: 18px;
}
.tutorial-back {
  justify-self: start; border: 0; padding: 7px 0; color: var(--ink-dim);
  background: transparent; cursor: pointer; font: 700 10px/1.2 'JetBrains Mono', monospace;
}
.tutorial-back:hover { color: #fff; }
.tutorial-eyebrow {
  color: var(--gold); font: 800 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 2.2px;
}
.tutorial-head h2 { margin: 7px 0 0; font-size: clamp(25px, 4vw, 38px); letter-spacing: -.04em; }
.tutorial-stage { position: relative; min-height: 420px; }
.tutorial-step {
  position: absolute; inset: 0; display: none;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  align-items: center; gap: clamp(28px, 5vw, 64px); padding: 28px 8px 20px;
}
.tutorial-step.is-active { display: grid; animation: tutorial-step-in .48s cubic-bezier(.2,.9,.3,1.08) both; }
@keyframes tutorial-step-in {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}
.tutorial-visual {
  position: relative; min-height: 290px; overflow: hidden; border: 1px solid rgba(143,153,221,.25);
  border-radius: 22px; background:
    linear-gradient(90deg, rgba(122,162,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(122,162,255,.035) 1px, transparent 1px) 0 0 / 32px 32px,
    rgba(10,14,36,.82);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 20px 50px rgba(0,0,0,.25);
}
.tutorial-copy-block > span {
  color: var(--accent); font: 800 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.8px;
}
.tutorial-copy-block h3 { margin: 9px 0 11px; font-size: clamp(28px, 4vw, 44px); line-height: 1; letter-spacing: -.045em; }
.tutorial-copy-block p { margin: 0; color: var(--ink-dim); font-size: 15px; line-height: 1.58; }
.tutorial-copy-block p strong { color: #fff; }

/* Step 1: work button and click burst */
.tutorial-work-demo { display: grid; place-items: center; align-content: center; gap: 16px; }
.tutorial-domain-tag {
  color: var(--ink-dim); font: 750 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.4px;
}
.tutorial-work-demo button {
  width: min(78%, 390px); min-height: 118px; border: 0; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, #547cff, #8f65ff); pointer-events: none;
  font: 800 20px/1.2 'Sora', sans-serif; box-shadow: 0 16px 38px rgba(91,91,255,.32);
  animation: tutorial-button-press 2.4s ease-in-out infinite;
}
.tutorial-work-demo button strong { display: block; margin-top: 6px; font-size: 14px; }
.tutorial-tap {
  position: absolute; left: 60%; top: 58%; font-size: 28px;
  filter: drop-shadow(0 5px 7px rgba(0,0,0,.45)); animation: tutorial-tap 2.4s ease-in-out infinite;
}
.tutorial-impact-pop {
  position: absolute; left: 50%; top: 28%; color: var(--green);
  font: 850 11px/1 'JetBrains Mono', monospace; letter-spacing: 1px;
  animation: tutorial-impact-pop 2.4s ease-out infinite;
}
@keyframes tutorial-button-press { 46%,54% { transform: scale(.965); filter: brightness(1.18); } }
@keyframes tutorial-tap { 0%,35%,70%,100% { transform: translate(12px,18px); } 48%,56% { transform: translate(0,0) scale(.9); } }
@keyframes tutorial-impact-pop { 0%,50% { opacity: 0; transform: translate(-50%,12px); } 58%,82% { opacity: 1; transform: translate(-50%,-4px); } 100% { opacity: 0; transform: translate(-50%,-24px); } }

/* Step 2: automation rows */
.tutorial-leverage-demo { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 30px; }
.tutorial-helper {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px; border: 1px solid rgba(143,153,221,.22); border-radius: 14px; background: rgba(35,38,83,.72);
}
.tutorial-helper span { color: #fff; font-size: 14px; font-weight: 750; }
.tutorial-helper small { display: block; margin-top: 4px; color: var(--green); font: 700 10px/1.2 'JetBrains Mono', monospace; }
.tutorial-helper b {
  padding: 10px 12px; border: 1px solid rgba(122,162,255,.45); border-radius: 10px;
  color: var(--gold); font: 800 10px/1.2 'JetBrains Mono', monospace;
}
.tutorial-helper.hot { animation: tutorial-buy 2.8s ease-in-out infinite; }
.tutorial-rate-arrow {
  align-self: center; margin-top: 5px; color: var(--green);
  font: 800 10px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.5px;
  animation: tutorial-rate-rise 2.8s ease-in-out infinite;
}
@keyframes tutorial-buy { 45%,58% { transform: translateX(5px); border-color: var(--accent); box-shadow: 0 0 22px rgba(122,162,255,.2); } }
@keyframes tutorial-rate-rise { 0%,42% { opacity: .35; transform: translateY(5px); } 58%,85% { opacity: 1; transform: none; } }

/* Step 3: HUD indicators */
.tutorial-hud-demo {
  display: grid; grid-template-columns: repeat(2,1fr); align-content: center; gap: 12px; padding: 28px;
}
.tutorial-hud-chip {
  padding: 17px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(14,18,43,.9);
}
.tutorial-hud-chip small, .tutorial-goal span {
  display: block; color: var(--ink-mute); font: 750 8px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.3px;
}
.tutorial-hud-chip strong { display: block; margin-top: 6px; color: #fff; font: 800 22px/1 'JetBrains Mono', monospace; }
.tutorial-hud-chip.impact strong { color: var(--gold); }
.tutorial-hud-chip em { display: block; margin-top: 5px; color: var(--green); font: 700 9px/1.2 'JetBrains Mono', monospace; }
.tutorial-goal { grid-column: 1 / -1; position: relative; padding: 15px 16px 21px; border: 1px solid rgba(255,209,102,.25); border-radius: 14px; }
.tutorial-goal b { position: absolute; right: 15px; top: 12px; color: var(--gold); font: 800 12px/1 'JetBrains Mono', monospace; }
.tutorial-goal i {
  position: absolute; left: 16px; right: 16px; bottom: 9px; height: 4px; overflow: hidden;
  border-radius: 9px; background: rgba(255,255,255,.08);
}
.tutorial-goal i::after {
  content: ''; display: block; height: 100%; width: 34%; background: linear-gradient(90deg,var(--accent),var(--gold));
  animation: tutorial-progress 3.6s ease-in-out infinite alternate;
}
.tutorial-hud-notes { grid-column: 1 / -1; display: flex; justify-content: space-around; color: var(--ink-mute); font-size: 9px; }
@keyframes tutorial-progress { to { width: 58%; } }

/* Step 4: mentor choice */
.tutorial-mentor-demo { display: grid; place-items: center; align-content: center; gap: 17px; padding: 24px; }
.tutorial-mentor-faces { display: flex; justify-content: center; }
.tutorial-mentor-faces img {
  width: 78px; height: 78px; margin-left: -10px; border: 2px solid #171b3f; border-radius: 50%;
  object-fit: cover; object-position: top center; filter: grayscale(.55) brightness(.72);
  animation: tutorial-mentor-choice 4s ease-in-out infinite;
}
.tutorial-mentor-faces img:first-child { margin-left: 0; }
.tutorial-mentor-faces img:nth-child(2) { animation-delay: 1s; }
.tutorial-mentor-faces img:nth-child(3) { animation-delay: 2s; }
.tutorial-mentor-faces img:nth-child(4) { animation-delay: 3s; }
.tutorial-mentor-lock { color: var(--gold); font: 800 10px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.7px; }
.tutorial-choice-line { color: var(--green); font: 750 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.2px; }
@keyframes tutorial-mentor-choice {
  0%,18%,100% { transform: scale(1); filter: grayscale(.55) brightness(.72); }
  8% { transform: scale(1.12); filter: none; box-shadow: 0 0 24px rgba(255,209,102,.38); }
}

/* Step 5: Dyson finish */
.tutorial-finish-demo { display: grid; place-items: center; align-content: center; gap: 9px; }
.tutorial-sun { position: relative; z-index: 2; color: var(--gold); font-size: 76px; filter: drop-shadow(0 0 26px rgba(255,209,102,.65)); }
.tutorial-orbit { position: absolute; width: 230px; height: 230px; border: 1px solid rgba(122,162,255,.3); border-radius: 50%; animation: tutorial-orbit-spin 9s linear infinite; }
.tutorial-orbit i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.tutorial-orbit i:nth-child(1) { left: 50%; top: -5px; }
.tutorial-orbit i:nth-child(2) { right: -5px; top: 50%; }
.tutorial-orbit i:nth-child(3) { left: 50%; bottom: -5px; }
.tutorial-orbit i:nth-child(4) { left: -5px; top: 50%; }
.tutorial-finish-demo strong { position: relative; z-index: 2; margin-top: 14px; color: #fff; font: 850 13px/1.2 'JetBrains Mono', monospace; }
.tutorial-finish-demo > span { position: relative; z-index: 2; color: var(--gold); font: 800 10px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.8px; }
@keyframes tutorial-orbit-spin { to { transform: rotate(360deg); } }

.tutorial-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding-top: 17px; border-top: 1px solid rgba(255,255,255,.09);
}
.tutorial-dots { display: flex; gap: 7px; }
.tutorial-dots button {
  width: 27px; height: 4px; padding: 0; border: 0; border-radius: 99px;
  background: rgba(255,255,255,.14); cursor: pointer; transition: width .2s ease, background .2s ease;
}
.tutorial-dots button.is-active { width: 43px; background: linear-gradient(90deg,var(--accent),var(--gold)); }
.tutorial-buttons { display: flex; gap: 9px; }
.tutorial-buttons button { min-width: 100px; min-height: 43px; }
.tutorial-buttons button:disabled { opacity: .35; cursor: default; }

@media (max-width: 700px) {
  .intro-tutorial { min-height: calc(100dvh - 20px); padding: 18px 14px; }
  .tutorial-head { grid-template-columns: 76px 1fr 76px; padding-bottom: 13px; }
  .tutorial-head h2 { font-size: 25px; }
  .tutorial-eyebrow { font-size: 7.5px; letter-spacing: 1.3px; }
  .tutorial-back { font-size: 8.5px; }
  .tutorial-stage { min-height: 510px; }
  .tutorial-step {
    grid-template-columns: 1fr; align-content: start; gap: 17px; padding: 18px 0 12px;
  }
  .tutorial-visual { min-height: 275px; }
  .tutorial-copy-block { text-align: center; }
  .tutorial-copy-block h3 { margin: 6px 0 8px; font-size: 29px; }
  .tutorial-copy-block p { font-size: 12.5px; line-height: 1.48; }
  .tutorial-controls { display: grid; justify-items: center; gap: 13px; }
  .tutorial-buttons { width: 100%; }
  .tutorial-buttons button { flex: 1; }
}
@media (max-width: 390px) {
  .tutorial-stage { min-height: 500px; }
  .tutorial-visual { min-height: 245px; }
  .tutorial-leverage-demo, .tutorial-hud-demo { padding: 18px; }
  .tutorial-helper { padding: 12px; }
  .tutorial-mentor-faces img { width: 62px; height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .tutorial-step.is-active,
  .tutorial-work-demo button, .tutorial-tap, .tutorial-impact-pop,
  .tutorial-helper.hot, .tutorial-rate-arrow, .tutorial-goal i::after,
  .tutorial-mentor-faces img, .tutorial-orbit { animation: none; }
}

/* --- Era spine — pinned to the bottom of the viewport; the board scrolls behind it --- */
.era-spine {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 4px; padding: 10px 22px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 12, 30, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--panel-line);
}
.era-node {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
/* connector line between dots */
.era-node::before {
  content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px;
  background: rgba(255,255,255,0.1); z-index: 0;
}
.era-node:first-child::before { display: none; }
.era-node.lit::before { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.era-dot {
  position: relative; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: rgba(30, 35, 70, 0.85); border: 1px solid var(--panel-line);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.era-label {
  font: 700 9px/1 'JetBrains Mono', monospace; letter-spacing: 0.5px;
  color: var(--ink-mute); text-transform: uppercase; white-space: nowrap;
}
.era-here {
  font: 700 7px/1 'JetBrains Mono', monospace; letter-spacing: 1px;
  color: var(--gold); opacity: 0; transition: opacity 0.2s ease; white-space: nowrap;
}
.era-node.lit .era-dot { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.era-node.lit .era-label { color: var(--ink); }
.era-node.ghost { opacity: 0.42; filter: grayscale(0.5); }
.era-node.current .era-dot {
  transform: scale(1.18);
  box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(255,209,102,0.5);
  border-color: var(--gold);
}
.era-node.current .era-label { color: var(--gold); }
.era-node.current .era-here { opacity: 1; }
@media (max-width: 620px) {
  .era-spine { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .era-label { font-size: 8px; }
  .era-dot { width: 26px; height: 26px; font-size: 13px; }
  .era-node::before, .era-node.lit::before { top: 13px; }
}

/* --- Locked domain teasers with live unlock bars --- */
.domain-locked { opacity: 0.9; }
.domain-locked .domain-icon.locked-icon {
  background: rgba(255,255,255,0.05); border: 1px dashed var(--panel-line); font-size: 20px;
}
.domain-locked .domain-name { color: var(--ink-dim); }
.domain-locked::before { opacity: 0.12; }
.lock-req { font-size: 12.5px; color: var(--ink-dim); margin: 4px 0 8px; }
.lock-req strong { color: var(--accent); }
.lock-progress {
  height: 8px; background: rgba(255,255,255,0.07);
  border-radius: 999px; overflow: hidden;
}
.lock-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px; transition: width 0.4s ease;
}
.lock-progress.slim { height: 6px; margin: 6px 0 5px; }
.lock-eta {
  margin-top: 6px; font: 700 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 0.5px; color: var(--green); text-align: right;
}

/* --- Helper affordability progress bar --- */
.helper-progress {
  height: 3px; margin-top: 5px; background: rgba(255,255,255,0.06);
  border-radius: 999px; overflow: hidden; display: none;
}
.helper.locked .helper-progress { display: block; }
.helper-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.3s ease;
}
.helper-owned.pop { display: inline-block; animation: num-pop 0.4s cubic-bezier(.2,.9,.3,1.4); }
@keyframes num-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.6); color: #fff; }
  100% { transform: scale(1); }
}

/* --- Permanent mentor status --- */
.selected-mentor {
  --mentor-c1: #7aa2ff; --mentor-c2: #b389ff;
  position: relative; overflow: hidden; display: grid; grid-template-columns: 112px 1fr;
  min-height: 168px; border: 1px solid color-mix(in srgb, var(--mentor-c1) 52%, transparent);
  border-radius: 18px; background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--mentor-c1) 22%, transparent), transparent 44%),
    linear-gradient(145deg, rgba(31,34,76,.96), rgba(12,15,38,.98));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 18px 42px rgba(0,0,0,.25);
}
.selected-mentor::after {
  content: ''; position: absolute; inset: auto -15% -45% 32%; height: 100px;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--mentor-c2) 28%, transparent), transparent 68%);
  pointer-events: none;
}
.selected-mentor-portrait { align-self: stretch; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.selected-mentor-portrait img {
  width: 118%; height: 100%; object-fit: cover; object-position: top center; display: block;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,.46));
}
.selected-mentor-copy { position: relative; z-index: 1; padding: 18px 16px 16px 8px; }
.selected-mentor-copy > span {
  color: var(--mentor-c1); font: 700 9px/1.2 'JetBrains Mono', monospace; letter-spacing: 1.6px;
}
.selected-mentor-copy h3 { margin: 7px 0 1px; font-size: 21px; line-height: 1.05; }
.selected-mentor-copy > div { color: var(--ink-dim); font-size: 11px; font-weight: 700; }
.selected-mentor-copy p { margin: 10px 0 0; color: var(--green); font-size: 12px; line-height: 1.4; font-weight: 700; }
.selected-mentor-copy small {
  display: inline-block; margin-top: 8px; color: var(--gold);
  font: 700 9px/1.2 'JetBrains Mono', monospace; letter-spacing: .6px;
}
.mentor-locked {
  padding: 18px; border: 1px solid var(--panel-line); border-radius: 18px;
  background: linear-gradient(145deg, rgba(27,30,67,.8), rgba(12,15,37,.86)); text-align: center;
}
.mentor-locked-faces { display: flex; justify-content: center; margin-bottom: 13px; }
.mentor-locked-faces img {
  width: 58px; height: 58px; object-fit: cover; object-position: top center; border-radius: 50%;
  border: 2px solid #171a3d; margin-left: -10px; filter: grayscale(1) brightness(.52);
}
.mentor-locked-faces img:first-child { margin-left: 0; }
.mentor-locked strong {
  display: block; color: var(--ink-dim); font: 700 10px/1.3 'JetBrains Mono', monospace; letter-spacing: 1.3px;
}
.mentor-locked span { display: block; color: var(--ink-mute); font-size: 11px; margin-top: 6px; }
.mentor-locked i {
  display: block; width: 100%; height: 3px; margin-top: 12px; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent) var(--mentor-progress, 0%), rgba(255,255,255,.08) 0);
}

/* --- Screen flash --- */
.flash-layer {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 42%, var(--_c, #fff), transparent 68%);
}
.flash-layer.go { animation: flash-pulse 0.7s ease-out; }
@keyframes flash-pulse {
  0% { opacity: 0; }
  18% { opacity: var(--_i, 0.5); }
  100% { opacity: 0; }
}

/* --- Confetti --- */
.confetti-layer { position: fixed; inset: 0; z-index: 61; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px;
  opacity: 0.95; will-change: transform;
  animation: confetti-fall var(--dur, 2s) linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translate(0, -10vh) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx, 0), 112vh) rotate(var(--rot, 360deg)); opacity: 0.9; }
}

/* --- Host reveal cinematic --- */
.breakthrough-overlay {
  position: fixed; inset: 0; z-index: 145;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; overflow-y: auto;
}
.breakthrough-overlay.hidden { display: none; }
.breakthrough-backdrop {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(43,55,125,0.72), transparent 58%),
    rgba(4,6,18,0.94);
  backdrop-filter: blur(10px);
  animation: fade-in 0.25s ease;
}
.breakthrough-card {
  position: relative; z-index: 1;
  width: min(100%, 1120px); max-height: calc(100dvh - 36px);
  margin: auto; overflow-y: auto; overflow-x: hidden;
  border: 1px solid rgba(255,209,102,0.72); border-radius: 28px;
  background: linear-gradient(160deg, rgba(17,23,53,0.995), rgba(7,10,27,0.995));
  box-shadow: 0 36px 110px rgba(0,0,0,0.64), 0 0 72px rgba(91,108,255,0.15);
}
.breakthrough-card.go { animation: reveal-in 0.48s cubic-bezier(.2,.9,.3,1.12); }
.breakthrough-hero {
  position: relative; min-height: 480px; aspect-ratio: 16 / 8.2;
  overflow: hidden; isolation: isolate;
  background: #10162f;
}
.breakthrough-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
  opacity: 1; transition: opacity 0.26s ease;
}
/* Hide the persistent <img> while a new source decodes so the previous frame never
   flashes through (KEWL-2176). Applied by swapArt() in game.js. */
.art-loading { opacity: 0 !important; }
.breakthrough-hero::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(4,7,20,0.52), rgba(4,7,20,0.1) 55%, transparent 78%),
    linear-gradient(0deg, #0d1229 0%, rgba(13,18,41,0.82) 10%, transparent 43%);
}
.breakthrough-topbar {
  position: absolute; z-index: 2; inset: 24px 28px auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.breakthrough-eyebrow {
  display: inline-flex; align-items: center;
  padding: 9px 14px;
  color: var(--gold); background: rgba(8,12,30,0.76);
  border: 1px solid rgba(255,209,102,0.58); border-radius: 999px;
  backdrop-filter: blur(10px);
  font: 800 10px/1.15 'JetBrains Mono', monospace;
  letter-spacing: 2px; text-transform: uppercase;
}
.breakthrough-skip {
  border: 0; padding: 10px 2px; cursor: pointer;
  color: rgba(245,247,255,0.72); background: transparent;
  font: 750 10px/1 'JetBrains Mono', monospace;
  letter-spacing: 2px; text-transform: uppercase;
}
.breakthrough-skip:hover { color: #fff; }
.breakthrough-title-block {
  position: absolute; z-index: 2;
  left: clamp(26px, 4.8vw, 54px); right: 28px; bottom: 38px;
  text-shadow: 0 8px 32px rgba(0,0,0,0.76);
}
.breakthrough-card h2 {
  max-width: 94%; margin: 0;
  color: #fff; text-align: left;
  font-size: clamp(44px, 6.1vw, 78px); line-height: 0.93;
  font-weight: 850; letter-spacing: -0.055em;
  text-wrap: balance;
}
.breakthrough-tagline,
#breakthroughTagline {
  margin: 14px 0 0;
  color: #a99cff;
  font-size: clamp(19px, 2.35vw, 29px); line-height: 1.15;
  font-weight: 700;
}
.breakthrough-content {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 390px);
  align-items: center; gap: 32px;
  padding: 30px 38px 42px;
}
.breakthrough-copy { min-width: 0; }
.breakthrough-description {
  max-width: 690px; margin: 0;
  color: var(--ink); font-size: 16px; line-height: 1.55;
}
.breakthrough-moonshot {
  display: flex; align-items: baseline; gap: 13px;
  margin-top: 20px; padding-left: 15px;
  border-left: 3px solid var(--green);
}
.breakthrough-moonshot span {
  flex: 0 0 auto;
  color: var(--green);
  font: 850 9px/1.2 'JetBrains Mono', monospace;
  letter-spacing: 1.8px;
}
.breakthrough-moonshot strong {
  color: #eafcf5; font-size: 13.5px; line-height: 1.4;
}
.breakthrough-actions { margin: 0; display: block; }
.breakthrough-actions .btn-primary {
  width: 100%; min-height: 70px; padding: 14px 24px;
  border-radius: 16px; font-size: 18px;
  box-shadow: 0 13px 34px rgba(112,124,255,0.3);
}
.breakthrough-paused {
  position: absolute; right: 34px; bottom: 15px;
  color: rgba(176,186,219,0.56);
  font: 750 8px/1 'JetBrains Mono', monospace;
  letter-spacing: 1.5px;
}
@media (max-width: 700px) {
  .breakthrough-overlay { padding: 10px; align-items: flex-start; }
  .breakthrough-card {
    width: 100%; max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }
  .breakthrough-hero { min-height: 360px; aspect-ratio: auto; }
  .breakthrough-art { object-position: center; }
  .breakthrough-hero::after {
    background:
      linear-gradient(0deg, #0d1229 0%, rgba(13,18,41,0.76) 36%, transparent 76%),
      linear-gradient(90deg, rgba(4,7,20,0.25), transparent 62%);
  }
  .breakthrough-topbar { inset: 15px 16px auto; gap: 10px; }
  .breakthrough-eyebrow {
    max-width: calc(100% - 60px); padding: 7px 9px;
    font-size: 7.5px; letter-spacing: 1px;
  }
  .breakthrough-skip { font-size: 8px; letter-spacing: 1.2px; }
  .breakthrough-title-block { left: 20px; right: 18px; bottom: 23px; }
  .breakthrough-card h2 {
    max-width: 100%; font-size: clamp(36px, 11vw, 52px); line-height: 0.96;
  }
  #breakthroughTagline { margin-top: 8px; font-size: 17px; }
  .breakthrough-content {
    grid-template-columns: 1fr; gap: 21px;
    padding: 22px 20px 48px;
  }
  .breakthrough-description { font-size: 13.5px; line-height: 1.5; }
  .breakthrough-moonshot {
    display: grid; gap: 6px; margin-top: 16px;
  }
  .breakthrough-actions .btn-primary { min-height: 60px; font-size: 16px; }
  .breakthrough-paused { right: 20px; bottom: 14px; }
}
@media (max-width: 390px) {
  .breakthrough-hero { min-height: 330px; }
  .breakthrough-card h2 { font-size: clamp(32px, 10.5vw, 42px); }
  #breakthroughTagline { font-size: 15px; }
}

.mentor-selection {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center;
  padding: clamp(14px, 3vw, 34px); overflow-y: auto;
}
.mentor-selection.hidden { display: none; }
.mentor-selection-backdrop {
  position: fixed; inset: 0; background:
    radial-gradient(circle at 50% 5%, rgba(84,73,169,.42), transparent 42%),
    radial-gradient(circle at 12% 85%, rgba(44,119,139,.2), transparent 35%),
    rgba(4,6,20,.96);
  backdrop-filter: blur(12px); animation: fade-in .35s ease;
}
@keyframes fade-in { from { opacity: 0; } }
.mentor-selection-card {
  position: relative; z-index: 1; width: min(1180px, 100%); margin: auto;
  padding: clamp(22px, 3vw, 38px); border: 1px solid rgba(255,209,102,.65); border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(255,209,102,.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(rgba(255,209,102,.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(160deg, rgba(28,31,70,.98), rgba(8,11,29,.99));
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 0 80px rgba(255,209,102,.16), 0 28px 80px rgba(0,0,0,.56);
}
.mentor-selection-card.go { animation: mentor-council-in .65s cubic-bezier(.2,.9,.3,1.1); }
@keyframes mentor-council-in {
  from { opacity: 0; transform: translateY(32px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.mentor-selection-header { max-width: 760px; margin: 0 auto 24px; text-align: center; }
.mentor-selection-eyebrow {
  color: var(--gold); font: 700 10px/1.2 'JetBrains Mono', monospace; letter-spacing: 3.2px;
}
.mentor-selection-header h2 {
  margin: 10px 0 8px; font-size: clamp(34px, 5vw, 58px); line-height: .98; letter-spacing: -1.8px;
  background: linear-gradient(105deg, #fff 15%, #d9dcff 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.mentor-selection-header p {
  max-width: 650px; margin: 0 auto; color: var(--ink-dim); font-size: clamp(13px, 1.5vw, 16px); line-height: 1.55;
}
.mentor-choice-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.mentor-choice {
  --mentor-c1: #7aa2ff; --mentor-c2: #b389ff;
  appearance: none; position: relative; overflow: hidden; min-width: 0; padding: 0;
  color: var(--ink); text-align: left; cursor: pointer; border: 1px solid rgba(143,153,221,.28);
  border-radius: 18px; background: rgba(13,16,39,.92);
  box-shadow: inset 0 1px rgba(255,255,255,.05);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.mentor-choice:hover, .mentor-choice:focus-visible {
  transform: translateY(-5px); border-color: var(--mentor-c1); outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--mentor-c1) 20%, transparent), 0 22px 38px rgba(0,0,0,.38);
}
.mentor-choice-art {
  position: relative; height: clamp(150px, 20vh, 205px); overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--mentor-c1) 38%, transparent), transparent 48%),
    linear-gradient(160deg, color-mix(in srgb, var(--mentor-c2) 16%, #151838), #0d102a);
}
.mentor-choice-art::after {
  content: ''; position: absolute; inset: auto 0 0; height: 55%;
  background: linear-gradient(transparent, rgba(13,16,39,.98));
}
.mentor-choice-art img {
  width: 100%; height: 112%; object-fit: cover; object-position: top center; display: block;
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.48)); transition: transform .25s ease;
}
.mentor-choice:hover .mentor-choice-art img, .mentor-choice:focus-visible .mentor-choice-art img { transform: scale(1.035); }
.mentor-choice-copy { position: relative; padding: 0 16px 17px; margin-top: -22px; z-index: 1; }
.mentor-choice-playstyle {
  display: inline-block; margin-bottom: 9px; padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--mentor-c1) 48%, transparent);
  border-radius: 999px; color: var(--mentor-c1); background: rgba(9,11,29,.85);
  font: 700 8px/1 'JetBrains Mono', monospace; letter-spacing: 1.4px;
}
.mentor-choice-name { font-size: 20px; font-weight: 850; line-height: 1.1; }
.mentor-choice-role { min-height: 30px; margin-top: 4px; color: var(--ink-dim); font-size: 10.5px; font-weight: 700; }
.mentor-choice-copy p { min-height: 50px; margin: 9px 0; color: var(--ink-dim); font-size: 11.5px; line-height: 1.42; }
.mentor-choice-copy strong {
  display: block; min-height: 34px; color: var(--green); font-size: 12px; line-height: 1.4;
}
.mentor-choice-action {
  display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08);
  color: var(--gold); font: 700 10px/1.2 'JetBrains Mono', monospace; letter-spacing: .5px;
}
.mentor-selection-lock {
  margin: 20px 0 0; color: var(--ink-mute); text-align: center;
  font: 700 9px/1.4 'JetBrains Mono', monospace; letter-spacing: 1.7px;
}
@media (max-width: 960px) {
  .mentor-selection-card { width: min(740px, 100%); }
  .mentor-choice-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mentor-choice-art { height: 180px; }
}
@media (max-width: 560px) {
  .mentor-selection { display: block; padding: 10px; }
  .mentor-selection-card { border-radius: 20px; padding: 20px 13px 18px; }
  .mentor-selection-header { margin-bottom: 17px; }
  .mentor-selection-eyebrow { font-size: 8px; letter-spacing: 2px; }
  .mentor-selection-header h2 { font-size: 38px; }
  .mentor-choice-grid { grid-template-columns: 1fr; gap: 11px; }
  .mentor-choice { display: grid; grid-template-columns: 112px 1fr; min-height: 178px; }
  .mentor-choice-art { height: 100%; min-height: 178px; }
  .mentor-choice-copy { margin: 0; padding: 15px 13px 13px; }
  .mentor-choice-role, .mentor-choice-copy p, .mentor-choice-copy strong { min-height: 0; }
  .mentor-choice-copy p { margin: 7px 0; font-size: 10.5px; }
  .mentor-choice-copy strong { font-size: 11px; }
  .mentor-choice-action { margin-top: 9px; padding-top: 8px; }
  .mentor-selection-lock { margin-top: 14px; font-size: 8px; }
}

.side-actions { gap: 8px; flex-wrap: wrap; }
.btn-ghost.muted { color: var(--ink-mute); }

/* V5 action guidance: one quiet "try this next" pulse, plus a stronger signal for
   a newly opened frontier or mentor. Motion never hides or moves the control. */
.action-nudge {
  position: relative;
  z-index: 2;
  animation: action-nudge 1.8s ease-in-out infinite;
}
@keyframes action-nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(122,162,255,0.08); filter: brightness(1); }
  50% { box-shadow: 0 0 0 4px rgba(122,162,255,0.18), 0 0 22px rgba(122,162,255,0.42); filter: brightness(1.12); }
}
.major-nudge {
  position: relative;
  z-index: 3;
  animation: major-nudge 0.85s ease-in-out infinite;
}
@keyframes major-nudge {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255,209,102,0.45), 0 0 12px rgba(255,209,102,0.3); filter: brightness(1); }
  50% { box-shadow: 0 0 0 5px rgba(255,209,102,0.72), 0 0 34px rgba(255,209,102,0.8); filter: brightness(1.28); }
}
.powerup.major-nudge { border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .action-nudge, .major-nudge { animation: none; }
  .action-nudge { outline: 2px solid rgba(122,162,255,0.65); outline-offset: 2px; }
  .major-nudge { outline: 3px solid var(--gold); outline-offset: 3px; }
}

/* ---------- KEWL-2063: three-tier verdict + pause + floating reset ---------- */

/* Flat-rejection tier (< 50%) — warm-red, distinct from the green colony invite. */
.borg-msg[data-branch="reject"] { background: rgba(255, 107, 138, 0.08); border-color: rgba(255, 107, 138, 0.38); }
.borg-msg[data-branch="reject"] .borg-heading { color: var(--red); }

/* Floating controls, off to the side (pause bottom-left during play, reset bottom-right after finishing). */
.float-btn {
  /* rides above the bottom-pinned era spine */
  position: fixed; z-index: 140; bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 13px; cursor: pointer;
  border: 1px solid var(--panel-line); color: var(--ink);
  background: rgba(20, 24, 55, 0.9); backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.45); transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.float-btn[hidden] { display: none; }
.float-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
.float-btn:active { transform: translateY(0); }
.float-pause { left: calc(16px + env(safe-area-inset-left, 0px)); }
.float-reset {
  right: calc(16px + env(safe-area-inset-right, 0px));
  border-color: rgba(255, 209, 102, 0.5); color: var(--gold);
}

/* Board blur while paused — the play area softens behind the Paused card. */
body.is-paused .layout,
body.is-paused .news-ticker { filter: blur(5px); pointer-events: none; user-select: none; transition: filter 0.18s ease; }

/* Pause overlay */
.pause-overlay {
  position: fixed; inset: 0; z-index: 190;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  background: rgba(6, 8, 20, 0.55); backdrop-filter: blur(6px);
}
.pause-overlay.hidden { display: none; }
.pause-card {
  width: min(100%, 420px); text-align: center;
  background: linear-gradient(180deg, rgba(20,24,55,0.98), rgba(12,14,40,0.98));
  border: 1px solid var(--panel-line); border-radius: 18px; padding: 30px 26px;
  box-shadow: var(--shadow);
}
.pause-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 3px;
  color: var(--gold); margin-bottom: 10px;
}
.pause-card h2 { margin: 0 0 8px; font-size: 22px; }
.pause-reason { color: var(--ink-dim); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.pause-card .btn-primary { width: 100%; }
.pause-hint { margin: 14px 0 0; font-size: 12px; color: var(--ink-mute); }
.pause-hint kbd {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: rgba(255,255,255,0.08); border: 1px solid var(--panel-line);
  border-radius: 5px; padding: 1px 6px;
}

@media (prefers-reduced-motion: reduce) {
  body.is-paused .layout, body.is-paused .news-ticker { transition: none; }
  .float-btn { transition: none; }
}

/* ============================================================
   Hamburger menu button (in HUD) + slide-out drawer (KEWL-2063)
   ============================================================ */
.menu-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; margin-left: 2px;
  border: 1px solid var(--panel-line); border-radius: 12px;
  background: rgba(20, 24, 55, 0.55); cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.menu-btn:hover { border-color: var(--accent); background: rgba(20, 24, 55, 0.9); }
.menu-btn:active { transform: scale(0.95); }
.menu-bars { display: flex; flex-direction: column; gap: 4px; width: 18px; }
.menu-bars span {
  display: block; height: 2px; width: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.drawer-scrim {
  position: fixed; inset: 0; z-index: 190;
  background: rgba(4, 5, 14, 0.6); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 0.24s ease;
}
.drawer-scrim.is-open { opacity: 1; }
.drawer-scrim.hidden { display: none; }

.drawer {
  position: fixed; top: 0; right: 0; z-index: 200;
  width: min(92vw, 380px); height: 100dvh; height: 100vh;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(16, 19, 44, 0.98), rgba(10, 12, 30, 0.98));
  border-left: 1px solid var(--panel-line); box-shadow: -18px 0 48px rgba(0,0,0,0.5);
  transform: translateX(102%); transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }
.drawer.hidden { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-title {
  font-weight: 800; font-size: 16px; letter-spacing: 0.3px;
  background: linear-gradient(90deg, #fff, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.drawer-close {
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--panel-line); background: rgba(255,255,255,0.04);
  color: var(--ink-dim); font-size: 15px; line-height: 1;
}
.drawer-close:hover { border-color: var(--accent); color: var(--ink); }

.drawer-tabs { display: flex; gap: 8px; }
.drawer-tab {
  flex: 1; padding: 9px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--panel-line); background: rgba(255,255,255,0.03);
  color: var(--ink-mute); font: 700 12px/1 'Sora', sans-serif;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.drawer-tab.is-active {
  color: var(--ink); border-color: var(--accent);
  background: rgba(122, 162, 255, 0.12);
}
.drawer-panel { min-height: 40px; }
.drawer-panel.hidden { display: none; }

.about-body { font-size: 13.5px; line-height: 1.6; color: var(--ink-dim); margin: 10px 0 0; }
.about-body strong { color: var(--ink); }
.about-body em { color: var(--gold); font-style: italic; }
.about-fine { font-size: 11.5px; color: var(--ink-mute); margin-top: 12px; }

.how-to-play {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--panel-line);
}
.how-to-play h4 {
  margin: 0 0 10px; color: var(--ink);
  font-size: 14px; letter-spacing: 0.3px;
}
.how-to-play ol {
  display: grid; gap: 9px;
  margin: 0; padding-left: 22px;
  color: var(--ink-dim); font-size: 12.5px; line-height: 1.45;
}
.how-to-play li { padding-left: 3px; }
.how-to-play li::marker {
  color: var(--gold); font-family: 'JetBrains Mono', monospace; font-weight: 700;
}
.how-to-play strong { color: var(--ink); }

.drawer-actions {
  margin-top: auto; display: flex; flex-direction: column; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--panel-line);
}
.drawer-actions .tip-link { margin: 0; width: 100%; }
.drawer-reset { width: 100%; }

body.drawer-open { overflow: hidden; }

/* ============================================================
   Ending: big transparent Borg-Alex hero portrait (KEWL-2063)
   ============================================================ */
.borg-msg--hero { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.borg-portrait--hero {
  width: clamp(150px, 46vw, 220px); height: auto; flex: none;
  border: none; border-radius: 0; background: none; object-fit: contain;
  filter: drop-shadow(0 10px 26px rgba(120, 90, 220, 0.45));
}
.borg-msg--hero .borg-copy { width: 100%; }
.borg-msg--hero .borg-heading { text-align: center; }
.borg-msg--hero .borg-text p { text-align: left; }
.borg-msg--hero[data-branch="colony"] .borg-portrait--hero {
  filter: drop-shadow(0 10px 26px rgba(87, 231, 164, 0.45));
}
.borg-msg--hero[data-branch="reject"] .borg-portrait--hero {
  filter: drop-shadow(0 10px 26px rgba(255, 107, 138, 0.4));
}
@media (max-width: 400px) {
  .borg-portrait--hero { width: clamp(140px, 60vw, 200px); height: auto; flex-basis: auto; }
}
