/* ==========================================================================
   The Convince - v3 ("party game")
   --------------------------------------------------------------------------
   A from-scratch stylesheet for index.html. It does not load app.css.
   Direction: a card game you play on the sofa. The face
   fills the screen, the question sits on a sticker-style card underneath,
   thick ink outlines and hard offset shadows make every control feel pressable.

   Contract with app.js (unchanged): the app shows and hides panels with the
   [hidden] attribute plus an inline display value, toggles .is-open on the
   drawer, .is-visible on modals, .is-recording on the main button, .is-active
   on tabs/belief buttons and .is-truth / .is-lie on the verdict badge.
   ========================================================================== */

:root {
  --cream: #fbf6ef;
  --paper: #ffffff;
  --ink: #1d1433;
  --ink-2: #4a3d63;
  --muted: #6f6385;
  --line: #e9dfef;

  --violet: #6c3cf0;
  --violet-2: #8b5cf6;
  --violet-tint: #efe8ff;
  --pink: #ff4f8b;
  --pink-tint: #ffe3ee;
  --lemon: #ffd84d;
  --lemon-tint: #fff5cc;
  --mint: #22c993;
  --mint-ink: #0c7f5a;
  --mint-tint: #dcf7ec;
  --sky: #5ec8ff;
  --sky-tint: #e1f4ff;
  --tangerine: #ff8a3d;
  --red: #ff3b5c;
  --warn-ink: #9a5a00;

  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --bw: 2px;                          /* outline width */
  --pop: 0 4px 0 var(--ink);          /* hard sticker shadow */
  --pop-sm: 0 3px 0 var(--ink);
  --r-card: 24px;
  --r-btn: 18px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--violet); }
:focus-visible { outline: 3px solid var(--violet-2); outline-offset: 2px; }
h2, h3, h4, p { margin: 0; }

/* ---------- Shared pieces: sticker buttons ---------- */
.btn-hud-primary, .btn-pop-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-btn);
  background: var(--violet);
  color: #fff;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--pop);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), opacity 160ms;
}
.btn-hud-secondary, .btn-consent-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  box-shadow: var(--pop);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), opacity 160ms;
}
:is(.btn-hud-primary, .btn-pop-action, .btn-hud-secondary, .btn-consent-secondary, .btn-belief, .preset-btn, .hud-shutter-btn):not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
:is(.btn-hud-primary, .btn-pop-action, .btn-hud-secondary, .btn-consent-secondary):disabled {
  opacity: 0.4;
  box-shadow: none;
}

.hud-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px; /* 16px stops iOS from zooming in */
  outline: none;
  transition: box-shadow 160ms;
}
.hud-input::placeholder { color: #a497b6; }
.hud-input:focus { box-shadow: 0 0 0 4px var(--violet-tint); border-color: var(--violet); }

/* ==========================================================================
   App frame
   ========================================================================== */
.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  /* The parked drawer below the screen gives .app hidden scroll room; with
     plain hidden, any scroll-into-view (focus, assistive tech, automation)
     could slide the whole app up. clip makes it impossible to scroll. */
  overflow: clip;
  background: var(--cream);
}

.stage {
  position: relative;
  display: grid;
  height: 100%;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(200px, 1fr) auto auto;
  grid-template-areas: "cam" "sheet" "nav";
}

/* ==========================================================================
   Camera (fills everything the sheet does not need)
   ========================================================================== */
.cam-layer {
  grid-area: cam;
  position: relative;
  margin-bottom: -30px; /* runs under the sheet's rounded top */
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 40%, #3a2a5c 0%, #1d1433 70%);
}
.cam-source {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* same mirroring as the previous design */
}
.cam-preview, .cam-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Before the game starts: a bright "stage is set" poster instead of black */
.v3-idle-art {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 112px 24px 48px;
  background:
    radial-gradient(60% 50% at 20% 25%, rgb(255 216 77 / 0.55), transparent 70%),
    radial-gradient(55% 45% at 85% 70%, rgb(94 200 255 / 0.5), transparent 70%),
    linear-gradient(160deg, var(--violet) 0%, #b43cdc 50%, var(--pink) 100%);
  color: #fff;
  text-align: center;
  transition: opacity 400ms var(--ease);
}
.v3-started .v3-idle-art { opacity: 0; pointer-events: none; }
.v3-idle-title {
  font-family: var(--display);
  font-size: clamp(44px, 13vw, 64px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 0 rgb(29 20 51 / 0.35);
}
.v3-idle-title em {
  font-style: normal;
  color: var(--lemon);
}
.v3-idle-sub {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}
/* Stickers sit in a row above the title, never over the top bar or the text */
.v3-idle-stickers { display: flex; gap: 6px; margin-bottom: 18px; }
.v3-sticker {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
  font-size: 27px;
  box-shadow: var(--pop);
}
.v3-sticker.s1 { transform: rotate(-10deg); background: var(--lemon); }
.v3-sticker.s2 { transform: rotate(4deg) translateY(-6px); }
.v3-sticker.s3 { transform: rotate(-4deg); background: var(--sky-tint); }
.v3-sticker.s4 { transform: rotate(9deg) translateY(-4px); background: var(--pink-tint); }
@media (prefers-reduced-motion: no-preference) {
  .v3-sticker { animation: v3-bob 4.2s ease-in-out infinite; }
  .v3-sticker.s2 { animation-delay: -1.1s; }
  .v3-sticker.s3 { animation-delay: -2.2s; }
  .v3-sticker.s4 { animation-delay: -3.1s; }
}
@keyframes v3-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

/* Camera problem notice */
.cam-notice {
  position: absolute;
  inset: auto 16px 50% 16px;
  transform: translateY(50%);
  z-index: 3;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  box-shadow: var(--pop);
}
.cam-notice-icon { font-size: 30px; }
.cam-notice-text { font-size: 14px; color: var(--ink-2); }

/* Face guide */
.face-frame {
  grid-area: cam;
  place-self: center;
  z-index: 1;
  /* Sized from the free camera space below the top bar and above the sheet */
  height: clamp(0px, calc(100% - 170px), 380px);
  aspect-ratio: 3 / 4;
  margin-top: 74px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 400ms var(--ease);
}
.v3-started .face-frame { opacity: 1; }
.face-oval {
  width: 100%;
  height: 100%;
  border: 2.5px dashed rgb(255 255 255 / 0.75);
  border-radius: 50%;
}
.v3-live .face-oval { border-color: rgb(255 59 92 / 0.9); border-style: solid; }
.face-scan-beam { display: none; }

/* ---------- Live chips on the camera ---------- */
.v3-live-chip, .v3-heart-chip {
  grid-area: cam;
  align-self: end;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  margin-bottom: 46px;
  padding: 0 13px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
  pointer-events: none;
}
.v3-live-chip {
  justify-self: start;
  margin-left: 16px;
  background: var(--red);
  color: #fff;
  border: var(--bw) solid var(--ink);
}
.v3-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.v3-live .v3-live-chip { opacity: 1; transform: none; }
.v3-heart-chip {
  justify-self: end;
  margin-right: 16px;
  background: rgb(29 20 51 / 0.45);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.v3-heart { color: var(--pink); }
.v3-has-bpm .v3-heart-chip { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .v3-live .v3-live-dot { animation: v3-blink 1s steps(2, start) infinite; }
  .v3-heart { animation: v3-beat 1s ease-in-out infinite; display: inline-block; }
}
@keyframes v3-blink { to { opacity: 0.2; } }
@keyframes v3-beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.3); } 30% { transform: scale(1); } }

/* ---------- "What they said" speech bubble ---------- */
.transcript-ticker {
  grid-area: cam;
  align-self: end;
  /* With a full sheet the camera area is short; "safe" then pins the bubble
     below the top bar instead of letting it run under it. */
  align-self: safe end;
  justify-self: center;
  z-index: 3;
  flex-direction: column;
  gap: 2px;
  width: calc(100% - 32px);
  margin-top: calc(env(safe-area-inset-top, 0px) + 116px);
  margin-bottom: 92px;
  padding: 10px 14px;
  overflow: hidden;
  border: var(--bw) solid var(--ink);
  border-radius: 18px 18px 18px 6px;
  background: var(--paper);
  box-shadow: var(--pop-sm);
}
.ticker-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet);
}
.ticker-text {
  font-size: 14px;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Short phones: three lines would reach under the sheet */
@media (max-height: 700px) {
  .ticker-text { -webkit-line-clamp: 2; }
}
/* v3-ui.js sets .v3-cramped when the bubble had to drop over the chips. While
   recording the bubble only says "Listening…", so it gives way to the timer;
   otherwise the transcript stays and the heart chip (also in the drawer) goes. */
.v3-cramped.v3-live .transcript-ticker { visibility: hidden; }
.v3-cramped:not(.v3-live) .v3-heart-chip { opacity: 0; }

/* ==========================================================================
   Top bar
   ========================================================================== */
.top-bar {
  grid-area: cam;
  align-self: start;
  z-index: 6;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "left seat right" "steps steps steps";
  align-items: center;
  column-gap: 10px;
  row-gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 0;
}
.top-controls-left { grid-area: left; display: flex; gap: 8px; }
.top-actions { grid-area: right; display: flex; gap: 8px; }

.btn-icon-hud {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgb(29 20 51 / 0.4);
  color: #fff;
  border: 1.5px solid rgb(255 255 255 / 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 160ms, transform 120ms;
}
.btn-icon-hud:active { transform: scale(0.94); }
.btn-icon-hud[aria-expanded="true"] { background: var(--paper); color: var(--ink); }
.hud-ico { width: 20px; height: 20px; }
.v3-hunch-ico { font-size: 20px; line-height: 1; }
#btnTesterSuspicion.is-suspicious {
  background: var(--lemon);
  border: var(--bw) solid var(--ink);
}

/* Who is playing */
.v3-seat {
  grid-area: seat;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: rgb(29 20 51 / 0.4);
  border: 1.5px solid rgb(255 255 255 / 0.28);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.v3-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--lemon);
  color: var(--ink);
  border: var(--bw) solid var(--ink);
  font-family: var(--display);
  font-weight: 800;
  font-size: 15px;
}
.v3-seat-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.v3-seat-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-seat-sub { font-size: 11.5px; opacity: 0.85; white-space: nowrap; }
.v3-live .v3-seat { background: rgb(255 59 92 / 0.75); }

/* Stage pills + warm-up dashes */
.phase-stepper {
  grid-area: steps;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.phase-track {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgb(29 20 51 / 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.phase-seg {
  padding: 4px 11px;
  border-radius: 999px;
  color: rgb(255 255 255 / 0.75);
  font-size: 12px;
  font-weight: 700;
  transition: background-color 250ms, color 250ms;
}
.phase-seg.is-active { background: var(--paper); color: var(--ink); }
.phase-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.v3-dashes { display: flex; gap: 6px; }
.v3-dashes i {
  width: 30px;
  height: 6px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.35);
  transition: background-color 300ms, width 300ms var(--ease);
}
.v3-dashes i.is-done { background: var(--lemon); }
.v3-dashes i.is-now { background: #fff; width: 40px; }

/* Hunch popover */
.suspicion-wrap { position: relative; }
.suspicion-pop {
  position: absolute;
  top: 52px;
  left: -50px;
  z-index: 30;
  width: min(290px, calc(100vw - 28px));
  padding: 16px;
  border: var(--bw) solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--pop);
}
.pop-title { font-family: var(--display); font-size: 19px; font-weight: 800; }
.pop-desc { margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.pop-state {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--lemon-tint);
  font-size: 12px;
  font-weight: 700;
}
.suspicion-pop .btn-pop-action { width: 100%; margin-top: 12px; min-height: 46px; font-size: 15px; }

/* ==========================================================================
   Play sheet
   ========================================================================== */
.v3-sheet {
  grid-area: sheet;
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 64vh;
  max-height: 64dvh;
  padding: 18px 16px 12px;
  border-radius: 28px 28px 0 0;
  background: var(--cream);
  box-shadow: 0 -12px 30px rgb(29 20 51 / 0.22);
}
.v3-sheet::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 40px;
  height: 4px;
  margin-left: -20px;
  border-radius: 999px;
  background: var(--line);
}

.center-banner {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 -16px;
  padding: 2px 16px 8px;
  overflow-y: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Cards scrolling past the edges fade out instead of being cut */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 10px, #000 calc(100% - 18px), transparent 100%);
}
.center-banner::-webkit-scrollbar { display: none; }

/* Card base */
.question-box, .instant-verdict-card, .transition-banner, .interrogation-desk {
  flex: none;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: var(--pop);
}
@media (prefers-reduced-motion: no-preference) {
  .question-box, .instant-verdict-card, .transition-banner, .interrogation-desk {
    animation: v3-deal 380ms var(--ease) both;
  }
}
@keyframes v3-deal {
  from { opacity: 0; transform: translateY(14px) rotate(-1deg); }
  to { opacity: 1; transform: none; }
}

/* ---------- Question card ---------- */
.question-box { padding: 16px 18px 18px; }
.q-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: var(--lemon);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.q-num { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-prompt {
  margin-top: 12px;
  font-family: var(--display);
  font-size: clamp(22px, 6.2vw, 27px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.q-rationale { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* Your read */
.examiner-belief-bar {
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px dashed var(--line);
}
.belief-title { font-weight: 700; font-size: 15px; }
.belief-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-belief {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 54px;
  padding: 0 8px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-btn);
  font-family: var(--display);
  font-size: 15px;
  white-space: nowrap;
  font-weight: 700;
  box-shadow: var(--pop);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
#btnBelieveAnswer { background: var(--mint-tint); }
#btnDisbelieveAnswer { background: var(--pink-tint); }
#btnBelieveAnswer.is-active { background: var(--mint); }
#btnDisbelieveAnswer.is-active { background: var(--pink); }
.belief-ico { font-size: 18px; }

/* ---------- How to play ---------- */
.v3-howto {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.v3-started .v3-howto { display: none; }
.v3-howto li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  border: var(--bw) solid var(--ink);
  border-radius: 18px;
  text-align: center;
}
.v3-howto li:nth-child(1) { background: var(--lemon-tint); }
.v3-howto li:nth-child(2) { background: var(--sky-tint); }
.v3-howto li:nth-child(3) { background: var(--pink-tint); }
.v3-howto span { font-size: 24px; line-height: 1.2; }
.v3-howto b { font-family: var(--display); font-size: 15px; }
.v3-howto small { font-size: 11.5px; line-height: 1.3; color: var(--ink-2); }

/* ---------- Per-answer read ---------- */
.instant-verdict-card {
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
}
.instant-verdict-card:has(.verdict-badge.is-truth) { background: var(--mint-tint); }
.instant-verdict-card:has(.verdict-badge.is-lie) { background: var(--pink-tint); }
.verdict-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.verdict-badge { font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.verdict-score {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.verdict-score:empty { display: none; }
.verdict-reason { font-size: 14px; color: var(--ink-2); }
.verdict-reason:empty { display: none; }
.verdict-contra {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--lemon-tint);
  border: 1.5px solid var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

/* Fib-o-meter bar (v3-ui.js sets --v from the score text) */
.v3-meter { position: relative; padding-bottom: 18px; }
.v3-meter::before {
  content: "";
  display: block;
  height: 14px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint) 0%, var(--lemon) 50%, var(--pink) 100%);
}
.v3-meter-fill {
  position: absolute;
  top: 7px;
  left: clamp(9px, calc(var(--v, 0) * 1%), calc(100% - 9px));
  width: 24px;
  height: 24px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transform: translate(-50%, -50%);
  box-shadow: var(--pop-sm);
  transition: left 600ms var(--ease);
}
.v3-meter-ends {
  position: absolute;
  inset: auto 2px 0 2px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- Warm-up finished ---------- */
.transition-banner {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 18px 20px;
  background: var(--lemon);
  text-align: center;
}
.v3-confetti { font-size: 40px; line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .v3-confetti { animation: v3-pop 700ms var(--ease) both 150ms; }
}
@keyframes v3-pop { from { transform: scale(0.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.trans-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  font-size: 12px;
  font-weight: 800;
}
.trans-title { font-family: var(--display); font-size: 25px; font-weight: 800; line-height: 1.1; letter-spacing: -0.015em; }
.trans-desc { font-size: 14px; color: var(--ink-2); }
.transition-banner .btn-hud-primary { width: 100%; margin-top: 8px; }

/* ---------- Your own questions ---------- */
.interrogation-desk {
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.desk-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.desk-badge { font-family: var(--display); font-size: 19px; font-weight: 800; }
.desk-info { font-size: 12.5px; color: var(--muted); }
.desk-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 12px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  box-shadow: var(--pop-sm);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.preset-btn span { font-size: 22px; }
.preset-btn:nth-child(1) { background: var(--sky-tint); }
.preset-btn:nth-child(2) { background: var(--lemon-tint); }
.preset-btn:nth-child(3) { background: var(--violet-tint); }
.preset-btn:nth-child(4) { background: var(--pink-tint); }
.desk-custom-row { display: flex; gap: 8px; }
.desk-custom-row .hud-input { flex: 1; min-width: 0; }
.desk-custom-row .btn-hud-primary { flex: none; padding: 0 18px; }

/* ---------- Background analysis chip ---------- */
.analysis-pending {
  flex: none;
  display: inline-flex;
  align-self: center;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--violet-tint);
  color: var(--violet);
  font-size: 13px;
  font-weight: 700;
}
.pending-spin {
  width: 14px;
  height: 14px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: v3-spin 800ms linear infinite;
}
@keyframes v3-spin { to { transform: rotate(360deg); } }

/* ---------- Main action ---------- */
.bottom-bar {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}
.status-msg {
  min-height: 19px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
}
.control-actions { display: flex; }
.hud-shutter-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 60px;
  border: var(--bw) solid var(--ink);
  border-radius: 20px;
  background: linear-gradient(100deg, var(--violet) 0%, #a23de0 60%, var(--pink) 100%);
  color: #fff;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: var(--pop);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease), background 200ms;
}
.shutter-chevron { width: 22px; height: 22px; }
.shutter-pulse {
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  pointer-events: none;
}
.hud-shutter-btn.is-recording { background: var(--red); }
.hud-shutter-btn.is-recording .shutter-chevron { display: none; }
.hud-shutter-btn.is-recording .shutter-text::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border-radius: 4px;
  background: #fff;
  vertical-align: -1px;
}
@media (prefers-reduced-motion: no-preference) {
  .hud-shutter-btn.is-recording .shutter-pulse { animation: v3-ring 1.4s ease-out infinite; }
}
@keyframes v3-ring {
  0% { box-shadow: 0 0 0 0 rgb(255 59 92 / 0.55); }
  100% { box-shadow: 0 0 0 14px rgb(255 59 92 / 0); }
}

.sub-controls:has(#btnReport[hidden]) { display: none; }
#btnReport {
  width: 100%;
  min-height: 48px;
  background: var(--lemon);
  color: var(--ink);
  font-size: 16px;
}

/* ==========================================================================
   Measurements drawer
   ========================================================================== */
.telemetry-drawer-backdrop {
  position: absolute;
  inset: 0;
  z-index: 39;
  background: rgb(29 20 51 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms;
}
.stage:has(.telemetry-container.is-open) .telemetry-drawer-backdrop { opacity: 1; pointer-events: auto; }

.telemetry-container {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  max-height: 84%;
  padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 16px);
  border-radius: 28px 28px 0 0;
  background: var(--cream);
  transform: translateY(105%);
  visibility: hidden;
  transition: transform 340ms var(--ease), visibility 0s linear 340ms;
}
.telemetry-container.is-open {
  transform: none;
  visibility: visible;
  transition: transform 340ms var(--ease), visibility 0s;
}
.telemetry-grab { width: 40px; height: 4px; margin: 0 auto 8px; border-radius: 999px; background: var(--line); }
.telemetry-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.telemetry-head-title { font-family: var(--display); font-size: 22px; font-weight: 800; }
.telemetry-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 22px;
  line-height: 1;
}
.mobile-quick-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.hud-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.hud-pill.p-heart { background: var(--pink-tint); }
.hud-pill.p-voice { background: var(--lemon-tint); }
.hud-pill.p-eyes { background: var(--sky-tint); }
.hud-pill.p-face { background: var(--violet-tint); }
.pill-emo { font-size: 18px; }
.pill-au { font-size: 11px; color: var(--ink-2); }

.v3-tele-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.telemetry-panel { display: flex; flex-direction: column; gap: 10px; }
.panel-header { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.panel-icon { font-size: 18px; }
.panel-title { font-family: var(--display); font-size: 18px; font-weight: 800; }
.panel-note { font-size: 13px; color: var(--muted); margin-top: -6px; }
.gauge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gauge-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
}
.gauge-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.gauge-val-row { display: flex; align-items: baseline; gap: 4px; }
.gauge-val { font-family: var(--display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gauge-unit { font-size: 12px; color: var(--muted); font-weight: 600; }
.gauge-sub { font-size: 12px; color: var(--muted); }
.scope-card {
  padding: 10px 12px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  background: var(--ink);
  color: #fff;
}
.scope-header { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; opacity: 0.85; margin-bottom: 4px; }
.scope-canvas { display: block; width: 100%; height: 56px; }
.au-bars { display: flex; flex-direction: column; gap: 8px; }
.au-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; }
.meter-bar { height: 12px; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); overflow: hidden; }
.meter-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--violet-2), var(--pink));
  transition: width 300ms var(--ease);
}

/* ==========================================================================
   History and profile
   ========================================================================== */
.tab-view {
  grid-row: 1 / 3;
  grid-column: 1;
  z-index: 20;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 22px) 16px 24px;
  background: var(--cream);
}
.tab-view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tab-view-title { font-family: var(--display); font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.tab-view-sub {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--lemon);
  border: var(--bw) solid var(--ink);
  font-size: 12.5px;
  font-weight: 700;
}
.tab-view-sub:empty { display: none; }
.tab-view-body { display: flex; flex-direction: column; gap: 12px; }
.tab-empty {
  padding: 28px 20px;
  border: 2px dashed var(--line);
  border-radius: var(--r-card);
  color: var(--muted);
  text-align: center;
}
.history-item {
  padding: 14px 16px;
  border: var(--bw) solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--pop-sm);
}
.history-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.history-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--violet-tint);
  color: var(--violet);
  font-size: 12px;
  font-weight: 800;
}
.history-verdict { font-size: 13px; font-weight: 700; }
.history-verdict.is-truth { color: var(--mint-ink); }
.history-verdict.is-lie { color: #c81e57; }
.history-q { font-family: var(--display); font-size: 17px; font-weight: 700; line-height: 1.25; }
.history-a {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 14px 14px 14px 4px;
  background: var(--cream);
  font-size: 14px;
  color: var(--ink-2);
}
.history-a.is-empty { font-style: italic; color: var(--muted); }
.history-meta { margin-top: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

.profile-card {
  border: var(--bw) solid var(--ink);
  border-radius: 20px;
  background: var(--paper);
  overflow: hidden;
}
.profile-card .tab-empty { border: 0; }
.profile-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1.5px solid var(--line); font-size: 14px; }
.profile-row:last-child { border-bottom: 0; }
.profile-key { color: var(--muted); font-weight: 600; }
.profile-val { font-weight: 700; text-align: right; word-break: break-all; }
.btn-danger {
  min-height: 50px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-btn);
  background: var(--paper);
  color: #c81e57;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  box-shadow: var(--pop-sm);
}
.btn-danger:disabled { opacity: 0.45; box-shadow: none; }
.profile-note { font-size: 12.5px; color: var(--muted); text-align: center; }

/* ==========================================================================
   Bottom navigation
   ========================================================================== */
.mobile-nav {
  grid-area: nav;
  position: relative;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 12px calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: var(--cream);
  border-top: 1.5px solid var(--line);
}
.mobile-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  transition: color 160ms;
}
.tab-ico {
  width: 46px;
  height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  transition: background-color 200ms;
}
.mobile-tab.is-active { color: var(--ink); }
.mobile-tab.is-active .tab-ico { background: var(--lemon); }
.tab-dot {
  position: absolute;
  top: 4px;
  left: calc(50% + 12px);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink);
  border: 2px solid var(--cream);
}

/* ==========================================================================
   Modals (bottom sheets)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgb(29 20 51 / 0.5);
}
.modal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow: hidden;
  border-radius: 28px 28px 0 0;
  background: var(--cream);
}
@media (prefers-reduced-motion: no-preference) {
  .modal-backdrop:not([hidden]) .modal-card { animation: v3-rise 380ms var(--ease) both; }
}
@keyframes v3-rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header { display: flex; align-items: center; gap: 10px; padding: 18px 18px 10px; }
.modal-header h3 { flex: 1; font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: -0.015em; }
.modal-icon { font-size: 24px; }
.modal-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font-size: 22px;
  line-height: 1;
}
.modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 16px; }
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 14px);
  border-top: 1.5px solid var(--line);
}
.modal-footer > * { flex: 1; }
.consent-input-row { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-weight: 600; }

/* ---------- Welcome (name prompt) ---------- */
#nameModal {
  align-items: stretch;
  background:
    radial-gradient(70% 40% at 15% 10%, rgb(255 216 77 / 0.45), transparent 70%),
    radial-gradient(60% 40% at 95% 30%, rgb(255 79 139 / 0.28), transparent 70%),
    radial-gradient(70% 40% at 50% 100%, rgb(108 60 240 / 0.22), transparent 70%),
    var(--cream);
}
.name-card {
  justify-content: center;
  gap: 12px;
  max-height: none;
  height: 100%;
  overflow-y: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  border-radius: 0;
  background: transparent;
}
.v3-welcome-art { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.v3-welcome-art span {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: var(--bw) solid var(--ink);
  border-radius: 22px;
  font-size: 38px;
  box-shadow: var(--pop);
}
.v3-welcome-art .w1 { background: var(--mint-tint); transform: rotate(-10deg) translateY(6px); }
.v3-welcome-art .w2 { background: var(--lemon); transform: translateY(-4px); z-index: 1; }
.v3-welcome-art .w3 { background: var(--pink-tint); transform: rotate(10deg) translateY(6px); }
.v3-brand {
  text-align: center;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}
.name-title {
  font-family: var(--display);
  font-size: clamp(34px, 10vw, 44px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: center;
}
.name-title em {
  font-style: normal;
  background: linear-gradient(transparent 58%, var(--lemon) 58%, var(--lemon) 92%, transparent 92%);
}
.name-desc { text-align: center; color: var(--ink-2); font-size: 15.5px; margin-bottom: 6px; }
.name-input { min-height: 58px; font-size: 18px; font-weight: 600; text-align: center; box-shadow: var(--pop-sm); }
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
  cursor: pointer;
}
.consent-check input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--violet);
}
.consent-check.is-locked { opacity: 0.5; cursor: not-allowed; }
.consent-status {
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--mint-tint);
  color: var(--mint-ink);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}
#btnSaveName { min-height: 58px; font-size: 19px; margin-top: 4px; }
.btn-name-skip {
  min-height: 44px;
  color: var(--ink-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-name-skip:disabled { opacity: 0.4; }

/* ---------- Consent notice ---------- */
.consent-card { padding-top: 18px; }
.consent-card > .name-title { font-size: 24px; text-align: left; padding: 0 18px 10px; line-height: 1.15; }
.consent-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 18px;
  padding: 4px 16px 16px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  font-size: 13.5px;
  color: var(--ink-2);
}
.consent-scroll h4 { margin: 14px 0 4px; font-family: var(--display); font-size: 15.5px; color: var(--ink); }
.consent-scroll ul { padding-left: 18px; margin: 6px 0; }
.consent-scroll p { margin: 4px 0; }
.consent-actions { display: flex; flex-direction: column; gap: 10px; padding: 12px 18px calc(env(safe-area-inset-bottom, 0px) + 14px); }
.consent-hint {
  align-self: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--lemon-tint);
  font-size: 12.5px;
  font-weight: 700;
}
.consent-question { font-weight: 700; font-size: 14px; }
.consent-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Results ---------- */
#reportModal .modal-card { height: 94vh; height: 94dvh; }
.report-summary-banner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "dial verdict" "conf conf";
  align-items: center;
  gap: 14px 16px;
  padding: 16px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: var(--pop);
  --dial-c: var(--violet);
}
.report-summary-banner:has(#reportRiskLevel[style*="124, 255, 196"]) { --dial-c: var(--mint); background: var(--mint-tint); }
.report-summary-banner:has(#reportRiskLevel[style*="255, 211, 106"]) { --dial-c: var(--tangerine); background: var(--lemon-tint); }
.report-summary-banner:has(#reportRiskLevel[style*="255, 82, 119"]) { --dial-c: var(--pink); background: var(--pink-tint); }

.v3-dial {
  grid-area: dial;
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  background: conic-gradient(var(--dial-c) calc(var(--p, 0) * 1%), #efe7f7 0);
}
.v3-dial-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 78px;
  border: var(--bw) solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  line-height: 1;
}
.v3-dial-inner b { font-family: var(--display); font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums; }
.v3-dial-inner small { margin-top: 3px; font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.verdict-col { grid-area: verdict; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.verdict-label { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.verdict-title { font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }
#reportRiskLevel[style*="255, 82, 119"] { color: #c81e57 !important; }
#reportRiskLevel[style*="255, 211, 106"] { color: var(--warn-ink) !important; }
#reportRiskLevel[style*="124, 255, 196"] { color: var(--mint-ink) !important; }
.verdict-col .verdict-score { align-self: flex-start; margin-top: 6px; }
.conf-col {
  grid-area: conf;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "label val" "sub val";
  align-items: center;
  padding-top: 12px;
  border-top: 2px dashed rgb(29 20 51 / 0.15);
}
.conf-label { grid-area: label; font-weight: 700; font-size: 14px; }
.conf-sub { grid-area: sub; font-size: 12.5px; color: var(--muted); }
.conf-val { grid-area: val; font-family: var(--display); font-size: 28px; font-weight: 800; }

.report-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 16px 0 12px;
  padding: 4px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  background: var(--paper);
}
.tab-btn {
  min-height: 40px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-2);
  transition: background-color 180ms, color 180ms;
}
.tab-btn.is-active { background: var(--ink); color: #fff; }

.modality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mod-card {
  padding: 12px 14px;
  border: var(--bw) solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  font-size: 14px;
}
.mod-card p { margin-top: 4px; }
.mod-card b { font-family: var(--display); font-size: 17px; }
.mod-title { font-family: var(--display); font-size: 16px; font-weight: 800; }
.modality-grid .mod-card:nth-child(1) { background: var(--pink-tint); }
.modality-grid .mod-card:nth-child(2) { background: var(--lemon-tint); }
.modality-grid .mod-card:nth-child(3) { background: var(--sky-tint); }
.modality-grid .mod-card:nth-child(4) { background: var(--violet-tint); }

.xai-box h4 { font-family: var(--display); font-size: 18px; margin-bottom: 8px; }
.xai-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.xai-list li {
  position: relative;
  padding: 10px 12px 10px 38px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  font-size: 14px;
}
.xai-list li::before { content: "💡"; position: absolute; left: 12px; top: 9px; }
.othello-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--lemon-tint);
  border: 1.5px solid var(--ink);
  font-size: 13.5px;
}
.othello-box:empty { display: none; }

.timeline-list { display: flex; flex-direction: column; gap: 10px; }
.timeline-list .q-meta { margin-bottom: 6px; }
.timeline-list .mod-card p[style*="#ffd36a"] { color: var(--warn-ink) !important; font-weight: 700; }
.timeline-list .mod-card p[style*="#7cffc4"] { color: var(--mint-ink) !important; font-weight: 700; }

/* ==========================================================================
   Wider screens: the phone layout sits centred on a playful backdrop
   ========================================================================== */
@media (min-width: 720px) {
  html, body {
    background:
      radial-gradient(40% 50% at 10% 20%, rgb(255 216 77 / 0.35), transparent 70%),
      radial-gradient(40% 50% at 90% 80%, rgb(255 79 139 / 0.22), transparent 70%),
      #f4ecf9;
  }
  .app {
    border-left: var(--bw) solid var(--ink);
    border-right: var(--bw) solid var(--ink);
    box-shadow: 0 0 60px rgb(29 20 51 / 0.18);
  }
  .modal-card { border: var(--bw) solid var(--ink); border-bottom: 0; }
  #nameModal .name-card { max-width: 440px; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
