/* ==========================================================================
   Pong — themed to the innomate design system
   (public/innomate-design-system: dark-first black surfaces, one steel-blue
   accent, Montserrat + Gridular numerals, pill buttons, hairline cards).
   ========================================================================== */

/* Gridular — the innomate accent/numeral face. Bundled as a webfont so the
   score renders identically on every device (e.g. the phone / Out of Home
   version), instead of only where Gridular happens to be installed locally
   (the desktop / Digital out of home screen). */
@font-face {
  font-family: 'Gridular';
  src: url('../assets/fonts/Gridular-Regular.woff2') format('woff2'),
       url('../assets/fonts/Gridular-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Surfaces — dark-first */
  --background: #000000;
  --ink-soft: #0D0D0D;
  --card: #0A0A0A;
  --muted: #141414;

  /* Text */
  --foreground: #FAFAFA;
  --muted-foreground: #A6A6A6;

  /* Brand — single blue accent */
  --primary: #5095B6;
  --primary-glow: #7FB0C9;
  --secondary: #052F4E;

  /* Lines & controls */
  --hairline: rgba(255, 255, 255, 0.08);
  --card-fill: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.15);

  /* Radius */
  --radius: 0.25rem;
  --radius-card: 16px;
  --radius-pill: 9999px;

  /* Elevation & motion */
  --shadow-glow: 0 0 80px hsl(201 38% 51% / 0.35);
  --shadow-elegant: 0 30px 80px -20px hsl(0 0% 0% / 0.7);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);

  /* Type */
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
  --font-accent: 'Gridular', 'Montserrat', ui-monospace, monospace; /* numerals */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* Display heading — Montserrat, tight tracking (per DS typography). */
.title,
.landing h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--foreground);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 60px hsl(201 38% 51% / 0.35);
}

/* ---------- Game stage (mobile + host) ---------- */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--background);
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
}

/* Overlay panels drawn in HTML on top of the canvas. */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  gap: 20px;
  padding: 24px;
}
.overlay.hidden { display: none; }
.overlay.scrolls {
  justify-content: flex-start;
  overflow-y: auto;
  padding-top: max(env(safe-area-inset-top, 0px), 7vh);
  padding-bottom: 7vh;
}

.overlay .title { font-size: clamp(30px, 8vw, 56px); }
.overlay .sub { font-size: 16px; color: var(--muted-foreground); }

/* Persistent innomate wordmark — pinned top-centre. */
.brand-mark {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 32px);
  left: 50%;
  transform: translateX(-50%);
  height: clamp(16px, 2.6vh, 24px);
  width: auto;
  opacity: 0.82;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.85));
}

.controller .brand-mark {
  position: static;
  transform: none;
  align-self: center;
  height: 16px;
  opacity: 0.7;
  margin-top: 16px;
  margin-bottom: 12px;
}

/* Hairline content card (DS card). */
.panel {
  pointer-events: auto;
  background: rgba(10, 10, 10, 0.8);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-elegant);
  min-width: 240px;
}
.panel .row {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  font-size: 15px;
  margin: 8px 0;
  color: var(--muted-foreground);
}
.panel .row b {
  font-family: var(--font-accent);
  font-weight: 600;
  color: var(--primary-glow);
}

/* Pill button — DS primary (white → brand-blue on hover). */
.btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #000;
  background: var(--foreground);
  border: 0;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}
.btn:hover { background: var(--primary); color: #000; box-shadow: 0 0 60px hsl(201 38% 51% / 0.35); }
.btn:active { transform: translateY(1px); }
.btn.secondary {
  color: var(--foreground);
  background: transparent;
  border: 1px solid var(--input-border);
}
.btn.secondary:hover { background: transparent; border-color: rgba(255, 255, 255, 0.4); box-shadow: none; }

/* Ready hint — eyebrow-style caption, legible over the table. */
.hint {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--foreground);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.5} 50%{opacity:1} }

/* Small legend of what's what, shown on the ready overlay. */
.legend {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--foreground);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Landing / mode selector ---------- */
.landing {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px;
  background:
    radial-gradient(90% 60% at 50% 0%, hsl(201 38% 51% / 0.14), transparent 60%),
    var(--background);
  color: var(--foreground);
}
.landing h1 { font-size: clamp(34px, 9vw, 62px); margin: 0; }
.landing p {
  max-width: 520px;
  text-align: center;
  line-height: 1.6;
  margin: 0;
  font-size: 16px;
  color: var(--muted-foreground);
}
.cards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.card {
  background: var(--card-fill);
  color: var(--foreground);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 22px;
  width: 260px;
  text-decoration: none;
  transition: all 0.3s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover {
  transform: translateY(-4px);
  border-color: hsl(201 38% 51% / 0.5);
  box-shadow: var(--shadow-glow);
}
.card .emoji { font-size: 26px; opacity: 0.9; }
.card h2 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--foreground); }
.card small { color: var(--muted-foreground); line-height: 1.5; font-size: 13px; }

/* ---------- Host (desktop) lobby ---------- */
.lobby {
  pointer-events: auto;
  background: rgba(10, 10, 10, 0.82);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 360px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-elegant);
  color: var(--muted-foreground);
}
.lobby > div:first-child { font-size: 13px; }
.lobby .qr {
  background: #fff;
  padding: 14px;
  border-radius: 12px;
  line-height: 0;
  box-shadow: var(--shadow-glow);
}
.lobby .qr canvas, .lobby .qr img { display: block; width: 232px; height: 232px; }
.lobby .qr img[hidden] { display: none; }

.qr-loading {
  width: 232px;
  height: 232px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  line-height: normal;
}
.qr-loading[hidden] { display: none; }
.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(80, 149, 182, 0.25);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.qr-loading-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #52708a;
}
.lobby .url { font-size: 12px; opacity: 0.7; word-break: break-all; text-align: center; }

/* Status dot — brand blue when live, muted otherwise. */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted-foreground);
  margin-right: 8px; vertical-align: middle;
  transition: all 0.3s var(--ease-smooth);
}
.status-dot.on {
  background: var(--primary);
  box-shadow: 0 0 12px hsl(201 38% 51% / 0.9);
}

/* "N waiting" — DS badge (brand tint). */
.waiting-badge {
  position: absolute;
  top: 16px; right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: hsl(201 38% 51% / 0.1);
  border: 1px solid hsl(201 38% 51% / 0.3);
  color: var(--primary-glow);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 5;
}
.waiting-badge.hidden { display: none; }

/* ---------- Controller (phone) ---------- */
.controller {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(90% 50% at 50% 0%, hsl(201 38% 51% / 0.14), transparent 55%),
    var(--background);
  color: var(--foreground);
  padding: 18px;
}
.controller .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted-foreground);
}
.controller .top-right { display: flex; align-items: center; gap: 14px; }
.controller
.controller .score-badge {
  font-family: var(--font-accent);
  font-size: 22px; font-weight: 600; color: var(--primary-glow);
}

.toast {
  position: fixed;
  left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink-soft);
  border: 1px solid var(--hairline);
  color: var(--foreground);
  padding: 12px 18px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow-elegant);
  opacity: 0; transition: opacity 0.25s var(--ease-smooth); pointer-events: none;
  z-index: 30;
}
.toast.show { opacity: 1; }

/* ---------- Lead-capture form (demo mockup) ----------
   Shown once the game ends. UI mock only — it never submits anywhere, stores
   nothing, and sends nothing to any CRM. The copy in .lead-note says so. */
.lead-form {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lead-form.hidden { display: none; }

.controller .lead-form {
  position: static;
  inset: auto;
  flex: 1;
  margin: 12px 0;
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.lead-card {
  pointer-events: auto;
  width: 100%;
  max-width: 360px;
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 26px 24px;
  box-shadow: var(--shadow-elegant);
  text-align: left;
}
.controller .lead-card { max-width: 100%; }

.lead-card .lead-title {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--foreground);
}
.lead-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.lead-results .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 15px;
  color: var(--muted-foreground);
}
.lead-results .row b {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 18px;
  color: var(--primary-glow);
}

.lead-card form { display: flex; flex-direction: column; gap: 6px; }
.lead-label {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin: 12px 0 0;
}
.lead-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--foreground);
  font-size: 16px;
  font-family: var(--font-sans);
  outline: none;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.lead-input::placeholder { color: rgba(255, 255, 255, 0.3); }
.lead-input:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.lead-card .lead-submit {
  width: 100%;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--muted-foreground);
  box-shadow: none;
}
.lead-card .lead-submit:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--foreground);
  box-shadow: none;
}
.lead-card .lead-restart {
  width: 100%;
  margin-top: 10px;
  min-height: 42px;
  font-size: 14px;
}

.lead-note {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  color: var(--muted-foreground);
  background: hsl(201 38% 51% / 0.08);
  border: 1px solid hsl(201 38% 51% / 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 18px 0 0;
}
.lead-note .lock { flex: none; }

.lead-success {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--foreground);
  background: hsl(201 38% 51% / 0.14);
  border: 1px solid hsl(201 38% 51% / 0.4);
  border-radius: 10px;
  padding: 11px 13px;
  margin-top: 16px;
}
.lead-success .check { flex: none; }

/* ==========================================================================
   Pong-specific
   ========================================================================== */

/* Solo (mobile) start / result cards sit over the dimmed attract-mode court. */
.overlay .panel,
.overlay .lead-card,
.overlay .btn { pointer-events: auto; }
.overlay .tagline {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--foreground);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
}
.overlay .tagline.pulse { animation: pulse 1.6s ease-in-out infinite; }
.btn.large { min-height: 56px; padding: 0 38px; font-size: 17px; }

/* Segmented 1 / 2 player switch (host lobby). */
.mode-toggle {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
}
.mode-toggle button {
  min-height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}
.mode-toggle button:hover { color: var(--foreground); }
.mode-toggle button.on {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 40px hsl(201 38% 51% / 0.35);
}

/* One QR "slot" per player on the host lobby. */
.pong-lobby { max-width: none; gap: 18px; padding: 26px 30px; }
.qr-row { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 232px;
}
.slot .who {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-glow);
}
.slot .who small { font-weight: 500; color: var(--muted-foreground); letter-spacing: 0.1em; }
.slot .qr { transition: opacity 0.3s var(--ease-smooth); }
.slot .joined {
  display: none;
  width: 232px;
  height: 260px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid hsl(201 38% 51% / 0.4);
  border-radius: 12px;
  background: hsl(201 38% 51% / 0.1);
  color: var(--foreground);
  font-size: 15px;
  font-weight: 600;
}
.slot .joined .tick { font-size: 44px; color: var(--primary-glow); line-height: 1; }
.slot.connected .qr, .slot.connected .url { display: none; }
.slot.connected .joined { display: flex; }
.slot .url { max-width: 232px; }
.lobby .note { font-size: 12px; color: var(--muted-foreground); text-align: center; max-width: 44ch; line-height: 1.5; }

/* Host result card (big screen). */
.winner-line {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--foreground);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 0 50px hsl(201 38% 51% / 0.4);
}
.panel .row b.big { font-size: 22px; }

/* ---------- Controller pad (phone) ---------- */
.controller .who-badge {
  align-self: center;
  margin: 6px 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-glow);
  background: hsl(201 38% 51% / 0.1);
  border: 1px solid hsl(201 38% 51% / 0.3);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
}
.controller .vs {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  font-family: var(--font-accent);
  font-weight: 600;
}
.controller .vs .me { font-size: 54px; color: var(--foreground); text-shadow: 0 0 30px hsl(201 38% 51% / 0.55); }
.controller .vs .dash { font-size: 24px; color: var(--muted-foreground); }
.controller .vs .them { font-size: 36px; color: var(--primary-glow); opacity: 0.75; }
.controller .vs-label {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.slide-pad {
  position: relative;
  flex: 1;
  margin: 16px 0 6px;
  min-height: 160px;
  border-radius: 28px;
  border: 1px solid hsl(201 38% 51% / 0.4);
  background:
    linear-gradient(180deg, hsl(201 38% 51% / 0.20), hsl(201 38% 51% / 0.06)),
    var(--card);
  box-shadow: inset 0 1px 0 hsl(201 38% 65% / 0.3), 0 0 60px hsl(201 38% 51% / 0.18);
  touch-action: none;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}
.slide-pad.disabled { opacity: 0.45; filter: grayscale(0.6); }
.slide-pad .rail {
  position: absolute;
  left: 22px; right: 22px; top: 50%;
  height: 4px; margin-top: -2px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
}
.slide-pad .thumb {
  position: absolute;
  top: 50%; left: 50%;
  width: 96px; height: 28px;
  margin: -14px 0 0 -48px;
  border-radius: 14px;
  background: linear-gradient(90deg, #5095B6, #7FB0C9, #5095B6);
  box-shadow: 0 0 30px hsl(201 38% 51% / 0.7);
  pointer-events: none;
}
.slide-pad .pad-hint {
  position: absolute;
  left: 0; right: 0; bottom: 18px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--foreground);
  opacity: 0.7;
  pointer-events: none;
}
.slide-pad .arrows {
  position: absolute;
  left: 0; right: 0; top: 18px;
  display: flex; justify-content: space-between;
  padding: 0 24px;
  font-size: 22px;
  color: hsl(201 38% 71% / 0.6);
  pointer-events: none;
}

/* The court takes drags anywhere — stop the browser from scrolling/zooming. */
.stage { touch-action: none; }

/* Two-player ready chips under the single QR. */
.seats { display: flex; gap: 10px; }
.seats[hidden] { display: none; }
.seat {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted-foreground);
}
.seat .tick { opacity: 0.25; }
.seat.on {
  color: var(--foreground);
  border-color: hsl(201 38% 51% / 0.5);
  background: hsl(201 38% 51% / 0.14);
}
.seat.on .tick { opacity: 1; color: var(--primary-glow); }

/* ---------- Mode picker (first phone on the code) ---------- */
.mode-pick {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 8px 0 24px;
}
.mode-pick.hidden { display: none; }
.mode-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  text-shadow: 0 0 40px hsl(201 38% 51% / 0.35);
}
.mode-btn {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  padding: 22px 22px;
  text-align: left;
  color: var(--foreground);
  font-family: var(--font-sans);
  background: hsl(201 38% 51% / 0.12);
  border: 1px solid hsl(201 38% 51% / 0.4);
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
}
.mode-btn:active { transform: scale(0.98); background: hsl(201 38% 51% / 0.28); }
.mode-btn .mode-num {
  font-family: var(--font-accent);
  font-size: 56px;
  line-height: 1;
  color: var(--primary-glow);
  text-shadow: 0 0 30px hsl(201 38% 51% / 0.6);
  min-width: 44px;
  text-align: center;
}
.mode-btn .mode-label { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.mode-btn .mode-label small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted-foreground);
  line-height: 1.4;
}

/* ---------- "Waiting for the other player" (controller) ---------- */
.wait-banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 16px 0 6px;
  padding: 28px 22px;
  text-align: center;
  border-radius: 28px;
  border: 1px solid hsl(201 38% 51% / 0.5);
  background: hsl(201 38% 51% / 0.12);
  box-shadow: 0 0 60px hsl(201 38% 51% / 0.25);
  animation: waitGlow 1.8s ease-in-out infinite;
}
.wait-banner.hidden { display: none; }
.wait-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid rgba(80, 149, 182, 0.25);
  border-top-color: var(--primary-glow);
  animation: spin 0.9s linear infinite;
}
.wait-title {
  font-size: clamp(24px, 7vw, 32px);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--foreground);
  text-shadow: 0 0 40px hsl(201 38% 51% / 0.6);
}
.wait-sub { font-size: 14px; line-height: 1.5; color: var(--muted-foreground); max-width: 26ch; }
@keyframes waitGlow {
  0%, 100% { box-shadow: 0 0 30px hsl(201 38% 51% / 0.15); }
  50% { box-shadow: 0 0 70px hsl(201 38% 51% / 0.4); }
}

/* ---------- Intro slide (controller): your side + how to move ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.intro.hidden { display: none; }
.intro-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  padding: 26px 22px 22px;
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid hsl(201 38% 51% / 0.4);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elegant), 0 0 60px hsl(201 38% 51% / 0.2);
}
.intro-court {
  position: relative;
  width: 84px;
  height: 130px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.intro-court .mid {
  position: absolute; left: 6px; right: 6px; top: 50%;
  border-top: 2px dashed rgba(255, 255, 255, 0.16);
}
.intro-court .bar {
  position: absolute; left: 50%; width: 34px; height: 7px; margin-left: -17px;
  border-radius: 4px; background: rgba(255, 255, 255, 0.22);
}
.intro-court .bar.top { top: 14px; }
.intro-court .bar.bottom { bottom: 14px; }
.intro-court.is-bottom .bar.bottom,
.intro-court.is-top .bar.top {
  background: linear-gradient(90deg, #5095B6, #7FB0C9, #5095B6);
  box-shadow: 0 0 16px hsl(201 38% 51% / 0.9);
  animation: introSlide 1.6s ease-in-out infinite;
}
.intro-court .you-arrow {
  position: absolute; left: 0; right: 0;
  font-size: 15px; color: var(--primary-glow);
  animation: introBob 1s ease-in-out infinite;
}
.intro-court.is-bottom .you-arrow { bottom: 28px; }
.intro-court.is-top .you-arrow { top: 28px; }
@keyframes introSlide { 0%, 100% { transform: translateX(-14px); } 50% { transform: translateX(14px); } }
@keyframes introBob { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }
.intro-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--primary-glow);
}
.intro-title { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.intro-title { color: var(--primary-glow); text-shadow: 0 0 30px hsl(201 38% 51% / 0.7); }
.intro-how {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; width: 100%;
  font-size: 14px; line-height: 1.45; color: var(--muted-foreground);
  background: hsl(201 38% 51% / 0.08);
  border: 1px solid hsl(201 38% 51% / 0.25);
  border-radius: 12px;
}
.intro-how .finger { font-size: 30px; animation: fingerSlide 1.6s ease-in-out infinite; }
@keyframes fingerSlide { 0%, 100% { transform: translateX(-8px); } 50% { transform: translateX(8px); } }
.intro-goal { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-foreground); }
.intro-go { width: 100%; margin-top: 4px; }
