/* ==========================================================================
   True / False Quiz — themed to the innomate design system
   (public/innomate-design-system: dark-first black surfaces, one steel-blue
   accent, Montserrat, pill buttons, hairline cards). True/False get their own
   green/red semantic accents for instant feedback.
   ========================================================================== */

: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;

  /* Semantic — used only for answer feedback */
  --true: #35B37E;
  --true-glow: rgba(53, 179, 126, 0.35);
  --false: #E5544B;
  --false-glow: rgba(229, 84, 75, 0.35);

  /* Lines & controls */
  --hairline: rgba(255, 255, 255, 0.08);
  --card-fill: rgba(255, 255, 255, 0.03);
  --input-bg: rgba(255, 255, 255, 0.05);
  --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;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: radial-gradient(120% 80% at 50% -10%, #0b1a22 0%, var(--background) 60%);
  color: var(--foreground);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
}

/* Persistent innomate brand mark — top-left on every surface. */
.brand-mark {
  position: fixed;
  top: 18px;
  left: 20px;
  height: 20px;
  width: auto;
  opacity: 0.9;
  z-index: 40;
  pointer-events: none;
}

/* ---------- Landing page (index.html) ---------- */
.landing {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(56px, 12vh, 120px) 22px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.landing h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(30px, 7vw, 48px);
  margin: 0 0 14px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 60px hsl(201 38% 51% / 0.35);
}
.landing p {
  color: var(--muted-foreground);
  font-weight: 300;
  line-height: 1.6;
  max-width: 52ch;
  margin: 0 0 40px;
}
.cards {
  display: grid;
  gap: 16px;
  width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  text-align: left;
  background: var(--card-fill);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  transition: transform .35s var(--ease-smooth), border-color .35s var(--ease-smooth), background .35s var(--ease-smooth);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: rgba(80, 149, 182, 0.07);
}
.card .emoji { font-size: 32px; line-height: 1; margin-bottom: 8px; }
.card h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.card small { color: var(--muted-foreground); font-size: 13px; line-height: 1.5; }

/* ---------- Shared stage (host + solo) ---------- */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 24px;
}

/* Status dot used in lobby + controller. */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--muted-foreground);
  vertical-align: middle;
  transition: background .3s var(--ease-smooth), box-shadow .3s var(--ease-smooth);
}
.status-dot.on { background: var(--true); box-shadow: 0 0 12px var(--true-glow); }

/* ---------- Overlays (lobby / results) ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 28px;
  text-align: center;
  background: radial-gradient(120% 80% at 50% -10%, #0b1a22 0%, var(--background) 60%);
  z-index: 20;
}
.overlay.hidden { display: none; }
.overlay .title {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: clamp(28px, 6vw, 46px);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55), 0 0 60px hsl(201 38% 51% / 0.35);
}
.overlay .hint { color: var(--muted-foreground); font-weight: 300; font-size: 15px; }

/* Lobby (host QR). */
.lobby {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.qr {
  width: 232px;
  height: 232px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-elegant);
  overflow: hidden;
}
.qr img { width: 100%; height: 100%; display: block; }
.qr-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #111820; }
.qr-loading[hidden] { display: none; }
.qr-loading-label { font-size: 13px; font-weight: 500; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(17, 24, 32, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.url {
  color: var(--muted-foreground);
  font-size: 13px;
  word-break: break-all;
  max-width: 320px;
}

/* ---------- Question card (host display + solo) ---------- */
.quiz {
  position: relative;
  z-index: 10;
  width: min(720px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.quiz.hidden { display: none; }

.progress {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.progress .score b { color: var(--foreground); }
.pips { display: flex; gap: 6px; }
.pip {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--hairline);
  transition: background .3s var(--ease-smooth), box-shadow .3s var(--ease-smooth);
}
.pip.right { background: var(--true); box-shadow: 0 0 8px var(--true-glow); }
.pip.wrong { background: var(--false); box-shadow: 0 0 8px var(--false-glow); }
.pip.current { background: var(--primary); box-shadow: 0 0 8px hsl(201 38% 51% / .5); }

.statement {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-size: clamp(26px, 4.4vw, 46px);
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

/* ---------- Countdown timer (host + solo + controller) ---------- */
.timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 340px;
}
.timer.hidden { display: none; }
.timer-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1;
  color: var(--primary-glow);
  transition: color .2s var(--ease-smooth), transform .15s var(--ease-smooth);
}
.timer-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--hairline);
  overflow: hidden;
}
.timer-fill {
  height: 100%;
  width: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary-glow), var(--primary));
  transform-origin: left center;
  /* width is set inline each tick; keep the shrink smooth between ticks. */
  transition: width .12s linear, background .25s var(--ease-smooth);
}
/* Last couple of seconds: turn urgent red and pulse. */
.timer.low .timer-num { color: var(--false); animation: timer-pulse .6s var(--ease-smooth) infinite; }
.timer.low .timer-fill { background: linear-gradient(90deg, #ff7a70, var(--false)); }
@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

/* The reveal banner shown under the statement on the display. */
.reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 92px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s var(--ease-smooth), transform .35s var(--ease-smooth);
}
.reveal.show { opacity: 1; transform: none; }
.verdict-badge {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hairline);
}
.verdict-badge.right { color: var(--true); border-color: var(--true); box-shadow: 0 0 24px var(--true-glow); }
.verdict-badge.wrong { color: var(--false); border-color: var(--false); box-shadow: 0 0 24px var(--false-glow); }
.reveal .fact {
  color: var(--muted-foreground);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.5;
  max-width: 46ch;
}
.reveal .answer-was b { color: var(--foreground); font-weight: 600; }

/* True / False answer buttons (solo page + shared button styling). */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 520px;
}
.answers.hidden { display: none; }
.tf-btn {
  appearance: none;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--foreground);
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(20px, 4vw, 26px);
  letter-spacing: 0.02em;
  padding: 26px 12px;
  border-radius: var(--radius-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .12s var(--ease-smooth), border-color .2s var(--ease-smooth), background .2s var(--ease-smooth), box-shadow .2s var(--ease-smooth);
}
.tf-btn .ic { font-size: 1.15em; }
.tf-btn.t:hover, .tf-btn.t.active { border-color: var(--true); background: rgba(53, 179, 126, .12); box-shadow: 0 0 26px var(--true-glow); }
.tf-btn.f:hover, .tf-btn.f.active { border-color: var(--false); background: rgba(229, 84, 75, .12); box-shadow: 0 0 26px var(--false-glow); }
.tf-btn:active { transform: scale(0.97); }
.tf-btn:disabled { cursor: default; opacity: 0.5; }
/* Reveal-state coloring on the answer buttons. */
.tf-btn.correct { border-color: var(--true); background: rgba(53, 179, 126, .18); color: var(--true); opacity: 1; box-shadow: 0 0 26px var(--true-glow); }
.tf-btn.incorrect { border-color: var(--false); background: rgba(229, 84, 75, .18); color: var(--false); opacity: 1; }
.tf-btn.dim { opacity: 0.4; }

/* Generic pill button (Next / Play again). */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  padding: 15px 30px;
  border-radius: var(--radius-pill);
  color: #051019;
  background: linear-gradient(180deg, var(--primary-glow), var(--primary));
  box-shadow: 0 10px 30px -12px hsl(201 38% 51% / 0.7);
  transition: transform .15s var(--ease-smooth), box-shadow .2s var(--ease-smooth), opacity .2s var(--ease-smooth);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn.secondary {
  color: var(--foreground);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  box-shadow: none;
}
.btn.hidden { display: none; }

/* Results panel (host display + solo). */
.results {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.score-big {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: clamp(52px, 12vw, 96px);
  line-height: 1;
}
.score-big span { color: var(--muted-foreground); font-weight: 600; font-size: 0.42em; }
.results .verdict-line { color: var(--muted-foreground); font-weight: 300; font-size: 16px; margin-bottom: 8px; }

/* ---------- Controller (phone) ---------- */
.controller {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 64px 22px 28px;
}
.controller .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted-foreground);
  margin-bottom: 10px;
}
.controller .top-right { display: flex; align-items: center; gap: 10px; }
.score-badge {
  font-weight: 700;
  color: var(--foreground);
  background: var(--input-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-size: 14px;
}

/* Controller mid-section: the countdown + a "watch the screen" cue. The phone
   deliberately shows NO question text — the big screen is the only place to
   read it. */
.ctrl-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 4px 10px;
}
.ctrl-cue {
  color: var(--muted-foreground);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-align: center;
}

/* The phone's decision pad fills the screen: two side-by-side buzzers —
   TRUE on the left, FALSE on the right. */
.pad {
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 14px;
  padding-top: 4px;
}
.pad.hidden { display: none; }
.pad .tf-btn {
  flex: 1;
  flex-direction: column;
  gap: 12px;
  font-size: clamp(24px, 7vw, 34px);
  padding: 0;
}
.pad .tf-btn .ic { font-size: 1.6em; }

/* Start button — big and centered, fills the space where the pad will be. */
.ctrl-start {
  width: 100%;
  margin: auto 0;
  padding: 22px 24px;
  font-size: 20px;
}
.ctrl-start.hidden { display: none; }

/* Toast. */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease-smooth), transform .25s var(--ease-smooth);
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Waiting-count badge on the host. */
.waiting-badge {
  position: fixed;
  top: 18px;
  right: 20px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: 13px;
  color: var(--muted-foreground);
  z-index: 40;
}
.waiting-badge.hidden { display: none; }

/* ---------- Lead-capture form (demo mockup only) ---------- */
.lead-form { width: 100%; max-width: 420px; }
.lead-form.hidden { display: none; }
.lead-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 22px;
  text-align: left;
  box-shadow: var(--shadow-elegant);
}
.lead-title { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin-bottom: 10px; text-align: center; }
.lead-note {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-foreground);
  background: var(--input-bg);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 0 0 16px;
}
.lead-note .lock { flex: none; }
.lead-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.lead-results .row, .panel .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  color: var(--muted-foreground);
}
.lead-results .row b, .panel .row b { color: var(--foreground); font-weight: 700; }
.lead-label { display: block; font-size: 13px; color: var(--muted-foreground); margin: 0 0 6px; }
.lead-input {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--foreground);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
  -webkit-user-select: text;
  user-select: text;
}
.lead-input:focus { outline: none; border-color: var(--primary); }
.lead-submit { width: 100%; }
.lead-restart { width: 100%; margin-top: 12px; }
.lead-success {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--true);
  background: rgba(53, 179, 126, 0.1);
  border: 1px solid rgba(53, 179, 126, 0.3);
  border-radius: var(--radius);
  padding: 11px 12px;
  margin-top: 14px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Let the results/lead card scroll on short phones. */
.overlay.scrolls { justify-content: flex-start; overflow-y: auto; padding-top: 68px; }
