/* I402 — per-screen layouts */

/* ====================== SPLASH (intro + login) ====================== */
#screen-splash {
  align-items: center;
  justify-content: center;
  padding: var(--space-32) var(--space-32);
  min-height: 100vh;
  flex-direction: column;
}

/* Once the intro stage is removed (display:none), shift the centering
   slightly upward so the login card sits higher than dead-centre — feels
   more inviting and matches the user's request to reduce top whitespace. */
#screen-splash:has(#introStage[style*="display: none"]) {
  justify-content: flex-start;
  padding-top: var(--space-80);
}

/* radial green spotlight behind the title */
#screen-splash::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 600px at 50% 35%, rgba(0, 197, 115, 0.10), transparent 70%),
    radial-gradient(1400px 800px at 50% 100%, rgba(0, 197, 115, 0.04), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.intro-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
}

/* phrase: "X402 insurance with AI agent" */
.intro-phrase {
  font-family: var(--font-circular);
  font-size: var(--text-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-medium);
  color: var(--color-whiteout);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 var(--space-32);
  opacity: 0;
  filter: blur(8px);
  transition: opacity 600ms ease, filter 600ms ease;
}
.intro-phrase.entered { opacity: 1; filter: blur(0); }

.intro-phrase .word { display: inline-flex; align-items: baseline; position: relative; }
.intro-phrase .word.w-x402 { color: var(--color-glow-green); text-shadow: 0 0 8px rgba(0,197,115,0.5), 0 0 24px rgba(0,197,115,0.3), 0 0 48px rgba(62,207,142,0.25); }
.intro-phrase .word.w-x402 .x { display: inline-block; transition: transform 700ms ease, color 700ms ease, opacity 700ms ease; }
.intro-phrase .word.w-x402 .rest402 { display: inline-block; }
.intro-phrase .word.w-insurance .i { display: inline-block; position: relative; }

/* responsive — keep tight on small viewports */
@media (max-width: 800px) {
  .intro-phrase { font-size: 44px; gap: 0 var(--space-16); }
}

/* sparkles */
.sparkles { position: absolute; inset: 0; pointer-events: none; }
.sparkle {
  position: absolute;
  width: 12px; height: 12px;
  background: var(--color-supabase-green);
  filter: drop-shadow(0 0 6px rgba(62,207,142,0.6));
  clip-path: polygon(50% 0%, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0% 50%, 40% 40%);
  opacity: 0;
  animation-name: sparkle-drift;
  animation-duration: 6s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}
.sparkle.s1 { top: 30%; left: 30%; animation-delay: 0.2s; }
.sparkle.s2 { top: 38%; left: 56%; animation-delay: 1.6s; }
.sparkle.s3 { top: 26%; left: 70%; animation-delay: 3.2s; }

/* intro-brand (I402) — initially hidden, sized to match phrase */
.intro-brand {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-circular);
  font-size: var(--text-mega);
  letter-spacing: -0.05em;
  line-height: 1;
  font-weight: var(--weight-bold);
  color: var(--color-whiteout);
}
.intro-brand .brand-i {
  display: inline-block;
  color: var(--color-whiteout);
  transition: color 200ms ease, text-shadow 200ms ease;
  transform-origin: bottom center;
}
.intro-brand .brand-i.lit {
  color: var(--color-glow-green);
  text-shadow: var(--shadow-glow-lg);
}
.intro-brand .brand-402 { color: var(--color-whiteout); }

.intro-tagline {
  position: absolute;
  bottom: -64px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: var(--tracking-wide);
  color: var(--color-mid-gray-text);
  text-transform: uppercase;
}

.intro-skip {
  position: absolute;
  top: var(--space-24);
  right: var(--space-24);
  z-index: 10;
  color: var(--color-mid-gray-text);
}

/* radial pulse used in phase 3 */
.radial-pulse {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,197,115,0.7), rgba(0,197,115,0));
  pointer-events: none;
  animation: radial-pulse 700ms ease-out forwards;
}

/* login card */
.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  padding: var(--space-32);
  background: var(--surface-1);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}
.login-title { font-size: var(--text-heading); font-weight: var(--weight-medium); }
.login-form { display: flex; flex-direction: column; gap: var(--space-16); }
.login-error { color: var(--color-red-alert); font-size: var(--text-body-sm); }
.login-hint { font-size: var(--text-caption); text-align: center; margin-top: var(--space-8); }
.hint-strong { color: var(--color-supabase-green); font-weight: var(--weight-medium); }

/* ====================== POST-LOGIN & generic centered cards ====================== */
.post-login,
#screen-premium,
#screen-cert {
  align-items: center;
  justify-content: center;
  padding: var(--space-96) var(--space-32);
}

.centered-card {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  align-items: flex-start;
  text-align: left;
}
.big-heading {
  font-size: var(--text-heading-lg);
  line-height: var(--lh-heading-lg);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-medium);
}
.lead { font-size: var(--text-subheading); line-height: 1.55; max-width: 580px; }
.cta-row { display: flex; gap: var(--space-16); flex-wrap: wrap; margin-top: var(--space-16); }

/* ====================== DASHBOARD ====================== */
.dashboard {
  align-items: stretch;
  padding: var(--space-48) var(--space-32);
  flex-direction: column;
}
.dashboard-grid {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-24);
}
@media (max-width: 800px) { .dashboard-grid { grid-template-columns: 1fr; } }

.agent-slot, .policy-card { min-height: 360px; }
.agent-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  padding: var(--space-64) var(--space-24);
  border: 2px dashed var(--color-carbon-border);
  border-radius: var(--radius-card);
  margin-top: var(--space-16);
}
.agent-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--color-carbon-border);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--color-mid-gray-text);
}
.agent-loaded { display: flex; flex-direction: column; gap: var(--space-16); margin-top: var(--space-16); }
.agent-loaded-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-16); }
.agent-name { font-size: var(--text-subheading); margin-top: var(--space-4); }
.agent-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12); margin: var(--space-16) 0 0 0; }
.agent-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--color-mid-gray-text); font-family: var(--font-mono); }
.agent-meta dd { margin: 4px 0 0 0; font-size: 13px; color: var(--color-whiteout); }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-actions { display: flex; justify-content: space-between; gap: var(--space-12); margin-top: var(--space-16); }

.policy-empty { padding: var(--space-32) 0; }
.policy-active { display: flex; flex-direction: column; gap: var(--space-12); }
.policy-head { display: flex; align-items: center; justify-content: space-between; }
.policy-premium, .policy-coverage { display: flex; justify-content: space-between; font-size: var(--text-body-sm); }
.policy-actions { display: flex; gap: var(--space-12); margin-top: var(--space-16); flex-wrap: wrap; }

/* ====================== FILE PICKER (Win-style) ====================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: var(--space-32);
}
.winwin {
  width: 720px; max-width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font-mono);
}
.winwin-titlebar {
  display: flex; align-items: center; gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.winwin-icon { color: var(--color-supabase-green); }
.winwin-title { flex: 1; color: var(--color-whiteout); }
.winwin-controls { display: flex; gap: 4px; }
.wc { width: 22px; height: 22px; display: grid; place-items: center; background: var(--surface-2); border-radius: 3px; font-size: 14px; color: var(--color-silver-highlight); cursor: pointer; }
.wc-x:hover { background: var(--color-red-alert); color: var(--color-whiteout); }
.winwin-toolbar { display: flex; gap: var(--space-16); padding: var(--space-8) var(--space-12); border-bottom: 1px solid var(--border); font-size: 12px; }
.winwin-body { display: grid; grid-template-columns: 200px 1fr; min-height: 320px; }
.winwin-tree { border-right: 1px solid var(--border); padding: var(--space-12); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.tree-item { color: var(--color-mid-gray-text); padding: 2px 0; }
.tree-item.child { padding-left: var(--space-16); }
.tree-item.open { color: var(--color-whiteout); }
.winwin-files { padding: var(--space-16); display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-16); align-content: start; }
.fp-file { display: flex; flex-direction: column; align-items: center; gap: var(--space-8); padding: var(--space-12); border-radius: 6px; cursor: pointer; border: 1px solid transparent; position: relative; }
.fp-file:hover { background: var(--surface-2); }
.fp-file.selected { background: rgba(0,197,115,0.12); border-color: rgba(0,197,115,0.4); }
.fp-download {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: rgba(0,0,0,0.2);
  color: var(--color-mid-gray-text);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.fp-file:hover .fp-download { opacity: 0.85; }
.fp-download:hover {
  opacity: 1;
  color: var(--color-supabase-green);
  border-color: rgba(0,197,115,0.4);
  background: rgba(0,197,115,0.1);
}
.fp-template {
  border: 1px solid rgba(0,197,115,0.25);
  background: rgba(0,197,115,0.04);
}
.fp-template:hover {
  background: rgba(0,197,115,0.12);
  border-color: rgba(0,197,115,0.55);
}
.fp-template-btn {
  margin-top: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(0,197,115,0.45);
  border-radius: 999px;
  background: rgba(0,197,115,0.1);
  color: var(--color-supabase-green);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  pointer-events: none; /* let parent tile receive the click */
}
.fp-template:hover .fp-template-btn {
  background: rgba(0,197,115,0.22);
  border-color: rgba(0,197,115,0.75);
}
.fp-file-icon { font-size: 36px; color: var(--color-glow-green); }
.fp-file-name { font-size: 11px; color: var(--color-whiteout); text-align: center; word-break: break-all; }
.fp-file-meta { font-size: 10px; color: var(--color-mid-gray-text); }
.fp-upload { border-style: dashed; border-color: rgba(0,197,115,0.35); }
.fp-upload .fp-file-icon { color: var(--color-supabase-green); opacity: 0.85; }
.fp-upload:hover { background: rgba(0,197,115,0.06); border-color: rgba(0,197,115,0.7); }
.winwin-statusbar { padding: var(--space-8) var(--space-12); border-top: 1px solid var(--border); font-size: 11px; color: var(--color-mid-gray-text); display: flex; justify-content: space-between; gap: var(--space-12); align-items: center; }
.fp-upload-error {
  flex: 1;
  text-align: right;
  white-space: pre-wrap;
  color: var(--color-red-alert);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  max-height: 64px;
  overflow-y: auto;
}

/* ====================== ARENA ====================== */
.arena {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  background: var(--color-midnight-abyss);
}
.arena-hud-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-24) var(--space-32);
  border-bottom: 1px solid var(--border);
}
.hud-left h3.hud-title { font-size: var(--text-heading); color: var(--color-supabase-green); letter-spacing: var(--tracking-wide); font-family: var(--font-mono); margin-top: 4px; }
.hud-vector { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vector-label { font-size: 10px; color: var(--color-mid-gray-text); letter-spacing: var(--tracking-wide); }
.vector-name { font-size: var(--text-subheading); color: var(--color-glow-green); font-family: var(--font-mono); letter-spacing: 0.05em; }
.arena-skip { color: var(--color-mid-gray-text); }

.arena-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  background: radial-gradient(ellipse at center, #0a0a0a 0%, #000 80%);
}
.arena-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(62, 207, 142, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 207, 142, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}
.arena-character {
  position: absolute;
  bottom: 80px;
  width: 200px;
  height: 240px;
}
.arena-character.defender { left: 12%; }
.arena-character.attacker { right: 12%; transform: scaleX(-1); }

.arena-fx { position: absolute; inset: 0; pointer-events: none; }

/* projectiles, shield flares, glitch overlay etc. */
.fx-projectile {
  position: absolute;
  width: 24px; height: 8px;
  background: var(--color-red-alert);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(239,68,68,0.8);
}
.fx-shield {
  position: absolute;
  width: 80px; height: 120px;
  border-radius: 50%;
  border: 2px solid var(--color-supabase-green);
  background: radial-gradient(circle at center, rgba(0,197,115,0.2), transparent 70%);
  box-shadow: 0 0 24px rgba(0,197,115,0.5);
  pointer-events: none;
}
.fx-particle {
  position: absolute;
  width: 4px; height: 4px;
  background: var(--color-supabase-green);
  border-radius: 50%;
}
.fx-beam {
  position: absolute;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--color-red-alert), transparent);
  box-shadow: 0 0 16px rgba(239,68,68,0.8);
}
.fx-bubble {
  position: absolute;
  background: var(--color-supabase-green);
  color: var(--color-midnight-abyss);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--weight-bold);
}
.fx-ripple {
  position: absolute;
  border: 2px solid var(--color-supabase-green);
  border-radius: 50%;
}

.arena-hud-bottom {
  padding: var(--space-24) var(--space-32);
  border-top: 1px solid var(--border);
}
.vector-ticker {
  display: flex; gap: var(--space-16); margin-bottom: var(--space-16);
  font-family: var(--font-mono); font-size: 12px;
  overflow-x: auto;
}
.vt-item {
  padding: var(--space-4) var(--space-12);
  border: 1px solid var(--color-carbon-border);
  border-radius: var(--radius-pill);
  color: var(--color-mid-gray-text);
  white-space: nowrap;
  transition: all 200ms ease;
}
.vt-item.active { border-color: var(--color-supabase-green); color: var(--color-supabase-green); background: rgba(0,197,115,0.08); }
.vt-item.done { color: var(--color-supabase-green); border-color: rgba(0,197,115,0.3); }
.vt-item.fail { color: var(--color-red-alert); border-color: rgba(239,68,68,0.3); }

.score-bar { display: flex; flex-direction: column; gap: var(--space-8); }
.score-bar-track { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.score-bar-fill { height: 100%; width: 0%; background: var(--color-red-alert); box-shadow: 0 0 12px rgba(239,68,68,0.55); transition: width 600ms ease; }
/* paper §5.6 verdict rule: ANY vector exceeding its threshold triggers
 * DECLINE — i.e. the WINNER bar must stay at exactly 0. The dashed line
 * marks that strict 0-fail threshold at the very left edge. */
.score-threshold { position: absolute; top: -4px; bottom: -4px; left: 0; width: 1px; border-left: 1px dashed var(--color-supabase-green); }
.score-label { font-size: 12px; }

/* ====================== RESULT ====================== */
.result { align-items: center; justify-content: center; }
.result-stage { text-align: center; display: flex; flex-direction: column; gap: var(--space-24); align-items: center; }
.result-headline {
  font-size: 144px;
  line-height: 1;
  letter-spacing: -0.06em;
  font-weight: var(--weight-black);
  color: var(--color-supabase-green);
  text-shadow: var(--shadow-glow-lg);
  animation: pop-in 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.result-headline.defeat {
  color: var(--color-red-alert);
  text-shadow: none;
  animation: rgb-split 280ms steps(2) infinite, judder 280ms steps(2) infinite;
}
.result-sub { font-size: var(--text-body); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  background: var(--color-supabase-green);
  animation: particle-arc 1.6s ease-out forwards;
  border-radius: 1px;
}
.result-actions { display: flex; gap: var(--space-16); margin-top: var(--space-32); }

/* ====================== NFT MINT ====================== */
.nft { align-items: center; justify-content: center; padding: var(--space-64) var(--space-32); flex-direction: column; }
.nft-stage { width: 100%; max-width: 760px; display: flex; flex-direction: column; gap: var(--space-32); }
.nft-step { display: flex; flex-direction: column; gap: var(--space-12); }
.nft-code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: var(--space-16);
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--color-whiteout);
  margin: 0;
  min-height: 64px;
}
.nft-pending { color: var(--color-mid-gray-text); font-size: var(--text-body-sm); }
.nft-pending-done { color: var(--color-supabase-green); }
.nft-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--color-supabase-green);
  color: #06120c;
  font-size: 11px;
  font-weight: var(--weight-bold);
  line-height: 1;
}
.nft-receipt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-16); }
.nft-meta { display: grid; grid-template-columns: 1fr; gap: var(--space-12); margin: var(--space-16) 0; }
.nft-meta > div { min-width: 0; }
.nft-meta dt { font-size: 11px; text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--color-mid-gray-text); font-family: var(--font-mono); }
.nft-meta dd { margin: 4px 0 0 0; font-size: 13px; font-family: var(--font-mono); color: var(--color-whiteout); white-space: nowrap; overflow: hidden; text-overflow: clip; }
.nft-meta dd a { color: inherit; }
.nft-mismatch-demo { padding: var(--space-16); background: var(--surface-2); border-radius: var(--radius-input); margin-top: var(--space-8); }
.mismatch-detail { margin-top: var(--space-12); }
.mismatch-detail pre { background: var(--color-midnight-abyss); border-radius: 4px; padding: var(--space-12); font-size: 12px; white-space: pre-wrap; color: var(--color-whiteout); margin: 0 0 var(--space-8) 0; }
.mismatch-detail .mismatch-hash-changed { color: var(--color-red-alert); font-weight: var(--weight-bold); }

.announce-banner {
  position: fixed;
  top: var(--space-24);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-1);
  border: 1px solid rgba(0,197,115,0.4);
  border-left: 3px solid var(--color-supabase-green);
  padding: var(--space-16) var(--space-24);
  border-radius: var(--radius-card);
  font-size: var(--text-body-sm);
  z-index: 90;
  animation: fade-in-up 480ms ease;
  max-width: 720px;
}
.announce-banner strong { color: var(--color-supabase-green); }

/* ====================== PREMIUM ====================== */
.premium-counter {
  font-family: var(--font-circular);
  font-weight: var(--weight-black);
  font-size: 160px;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--color-glow-green);
  text-shadow: var(--shadow-glow-md);
  display: flex;
  align-items: baseline;
  gap: var(--space-8);
  margin: var(--space-32) 0;
}
.premium-currency { font-size: 64px; line-height: 1; align-self: flex-start; margin-top: 8px; }
.premium-amount { display: inline-block; min-width: 0; line-height: 1; }
.premium-unit {
  font-size: 28px;
  line-height: 1;
  color: var(--color-mid-gray-text);
  font-family: var(--font-mono);
  margin-left: var(--space-8);
  white-space: nowrap;
}

/* ====================== CERT ====================== */
.cert-window { width: 100%; max-width: 580px; margin-top: var(--space-16); }
.cert-window-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-24); }
.cert-window-row > div { flex: 1; }
.cert-date { font-size: var(--text-subheading); color: var(--color-whiteout); margin-top: 4px; }
.cert-arrow { font-size: 32px; color: var(--color-glow-green); }
.cert-warning { margin-top: var(--space-24); padding-top: var(--space-16); border-top: 1px dashed var(--border); color: var(--color-mid-gray-text); font-size: 12px; line-height: 1.6; }

/* ====================== PAYMENT ====================== */
.payment { align-items: center; justify-content: center; padding: var(--space-64) var(--space-32); }
.payment-wrap { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: var(--space-24); }
.payment-card form { display: flex; flex-direction: column; gap: var(--space-16); }
.payment-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-16); }
.payment-summary { display: flex; justify-content: space-between; padding: var(--space-12) 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); margin-top: var(--space-8); }
.btn-full { width: 100%; }
.payment-result { display: flex; flex-direction: column; gap: var(--space-16); align-items: flex-start; padding-top: var(--space-16); }

/* ====================== TUTORIAL ====================== */
.tutorial-cursor {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  /* tip of the cursor SVG is at (6, 4) inside a 32×32 viewBox. We position
     this div so the SVG's (6,4) lands on the target's anchor point. */
  width: 28px;
  height: 28px;
  margin-left: -5px;  /* (6/32) * 28 ≈ 5.25 — pull left by ~tip x */
  margin-top: -3.5px; /* (4/32) * 28 ≈ 3.5  — pull up by ~tip y */
  transition: top 360ms cubic-bezier(0.5,0,0.2,1),
              left 360ms cubic-bezier(0.5,0,0.2,1),
              opacity 220ms ease;
  will-change: top, left, opacity;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55)) drop-shadow(0 0 4px rgba(0,197,115,0.4));
}
/* subtle pulse around the cursor so it's easy to spot */
.tutorial-cursor::after {
  content: "";
  position: absolute;
  top: -6px; left: -6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0, 197, 115, 0.6);
  animation: cursor-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes cursor-pulse {
  0%, 100% { transform: scale(0.6); opacity: 0.7; }
  50%      { transform: scale(1.4); opacity: 0; }
}
.tutorial-tooltip {
  position: fixed;
  z-index: 201;
  background: var(--surface-1);
  border: 1px solid var(--color-supabase-green);
  border-radius: var(--radius-card);
  padding: var(--space-16);
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  box-shadow: var(--shadow-glow-sm);
  transition: top 360ms cubic-bezier(0.5,0,0.2,1),
              left 360ms cubic-bezier(0.5,0,0.2,1),
              opacity 220ms ease;
  will-change: top, left, opacity;
}
/* Used during screen transitions: snap to new coordinates immediately. */
.tutorial-cursor.no-transition,
.tutorial-tooltip.no-transition {
  transition: opacity 220ms ease !important;
}
.tooltip-step { font-size: 10px; }
.tooltip-body { font-size: var(--text-body-sm); line-height: 1.5; }
.tooltip-actions { display: flex; justify-content: space-between; gap: var(--space-8); }

.tutorial-end-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-32);
  animation: fade-in-up 600ms ease;
}
.tutorial-end-heading {
  font-size: 120px;
  letter-spacing: -0.06em;
  font-weight: var(--weight-black);
  color: var(--color-supabase-green);
  text-shadow: var(--shadow-glow-md);
}
.tutorial-end-sub { font-size: var(--text-subheading); }

/* COVERAGE VOID overlay */
.void-overlay {
  position: fixed;
  inset: 0;
  background: rgba(40,0,0,0.92);
  backdrop-filter: blur(4px);
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-24);
  animation: judder 280ms steps(2) infinite;
}
.void-overlay h1 {
  font-size: 96px;
  letter-spacing: -0.06em;
  color: var(--color-red-alert);
  font-weight: var(--weight-black);
  animation: rgb-split 280ms steps(2) infinite;
}
.void-overlay p { font-size: var(--text-body); color: var(--color-whiteout); }
