/* ─── BSL Kiosk · Design tokens ─────────────────────────────────────────────
 * 1920×1080 landscape, locked. WCAG AAA (7:1) on all decision UI.
 * Token names mirror the brief: --risk-*, --space-*, --type-*.
 * ──────────────────────────────────────────────────────────────────────────*/

/* Kiosk touch hardening — no double-tap zoom, no selection, no rubber-band */
html, body {
  touch-action: manipulation;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Touchscreen kiosk: hide the pointer entirely (added by app.jsx off ?dev).
   X shows an arrow at every touch point; there is no mouse in the booth. */
.kiosk-nocursor, .kiosk-nocursor * { cursor: none !important; }

/* Scrollable panels must accept a vertical finger-drag. Without pan-y the
   dense slider rows swallow the swipe and the panel feels frozen. */
.admin-body { touch-action: pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

:root {
  /* Neutral scale — warm paper white, never sterile */
  --bg:                oklch(98.4% 0.004 90);
  --surface:           oklch(96.5% 0.005 90);
  --surface-elevated:  oklch(99.0% 0.003 90);
  --border:            oklch(85% 0.008 90 / 0.55);
  --text-primary:      oklch(22% 0.015 250);   /* deep ink, ~14:1 on bg */
  --text-secondary:    oklch(40% 0.012 250);   /* ~8.5:1 */
  --text-muted:        oklch(55% 0.010 250);   /* ~5:1, meta only */

  /* Theme accent + CTA — overridable per-theme by <ThemeRoot> setting inline
     CSS vars on .kiosk-frame. Risk palette is independent and stays in its
     own [data-risk-palette] blocks below. */
  --accent: oklch(44% 0.130 32);
  --cta-bg: var(--text-primary);
  --cta-fg: var(--bg);

  /* Risk palette — pigment-inspired, AAA on --bg.
     Shapes carry meaning before color does. Three named palettes are
     swappable via the Tweaks panel; default is "pigment". */

  /* PIGMENT — sage / antique gold / terracotta. Sits inside the watercolor. */
  --risk-safe:          oklch(44% 0.070 170);
  --risk-safe-tint:     oklch(93% 0.030 170);
  --risk-caution:       oklch(50% 0.105 75);
  --risk-caution-tint:  oklch(93% 0.045 80);
  --risk-dangerous:     oklch(44% 0.130 32);
  --risk-dangerous-tint:oklch(93% 0.045 30);
}

/* Risk palette: Editorial — moodier, ink-on-paper. */
[data-risk-palette="editorial"] {
  --risk-safe:          oklch(40% 0.055 195);   /* deep teal-moss */
  --risk-safe-tint:     oklch(92% 0.028 195);
  --risk-caution:       oklch(52% 0.115 80);    /* mustard */
  --risk-caution-tint:  oklch(93% 0.050 85);
  --risk-dangerous:     oklch(40% 0.135 28);    /* rust */
  --risk-dangerous-tint:oklch(92% 0.050 28);
}

/* Risk palette: Original — the first pass, retained for comparison. */
[data-risk-palette="original"] {
  --risk-safe:          oklch(38% 0.110 150);
  --risk-safe-tint:     oklch(92% 0.055 150);
  --risk-caution:       oklch(46% 0.130 75);
  --risk-caution-tint:  oklch(92% 0.075 80);
  --risk-dangerous:     oklch(42% 0.170 25);
  --risk-dangerous-tint:oklch(91% 0.065 25);
}

/* Risk palette: BSL — coordinator-specified, default. Maps the 6-level wall
   chart onto 3: Žemesnė rizika (violet) · Pavojinga (gold) · Mirtina (red).
   Violet pulled from the Be Safe Lab brand mark. */
[data-risk-palette="bsl"] {
  --risk-safe:          oklch(48% 0.150 300);   /* violet — Žemesnė rizika */
  --risk-safe-tint:     oklch(93% 0.045 300);
  --risk-caution:       oklch(52% 0.130 85);    /* gold — Pavojinga */
  --risk-caution-tint:  oklch(93% 0.055 85);
  --risk-dangerous:     oklch(48% 0.190 27);    /* red — Mirtina */
  --risk-dangerous-tint:oklch(92% 0.055 27);
}

/* Ink UI — colour is reserved for the filled risk shape and top edge. */
[data-risk-palette="ink"] {
  --risk-safe:          #4b8f6a;
  --risk-safe-tint:     #ffffff;
  --risk-caution:       #c79126;
  --risk-caution-tint:  #ffffff;
  --risk-dangerous:     #b23b3b;
  --risk-dangerous-tint:#ffffff;
}

/* anchor for the editor — the rest of :root continues below */
:root {

  /* Spacing — 8px base, generous on kiosk */
  --space-xs:   8px;
  --space-sm:  16px;
  --space-md:  24px;
  --space-lg:  32px;
  --space-xl:  48px;
  --space-2xl: 64px;
  --space-3xl: 96px;
  --space-4xl: 128px;

  /* Type scale — kiosk-tuned, bigger than feels right on a laptop */
  --type-meta:        20px;   /* mono labels, footnotes */
  --type-body:        28px;   /* paragraph copy */
  --type-body-lg:     36px;   /* reveal note */
  --type-h3:          44px;
  --type-h2:          72px;
  --type-h1:          112px;  /* attract teaser, complete */
  --type-display:     176px;  /* drug name */

  /* Answer-correctness — green/red, deliberately separate from the risk
     palette so the two colour languages never collide. */
  --correct:        oklch(52% 0.150 150);
  --correct-deep:   oklch(42% 0.130 150);
  --correct-tint:   oklch(93% 0.060 150);
  --incorrect:      oklch(52% 0.190 27);
  --incorrect-deep: oklch(44% 0.170 27);
  --incorrect-tint: oklch(93% 0.060 27);

  /* "Nepamiršk!" reminder — sober wine break, ember accent, cream type. */
  --wine:   oklch(23% 0.075 18);
  --ember:  oklch(70% 0.170 50);
  --cream:  oklch(95% 0.025 85);

  --statement-frame-bg: oklch(96% 0.018 80);
  --statement-frame-border: oklch(70% 0.060 75 / 0.45);
  --statement-quote-mark: oklch(75% 0.090 80);
  --stamp-myth: oklch(44% 0.130 32);
  --stamp-fact: oklch(44% 0.070 170);
  --outcome-good: oklch(46% 0.060 165);
  --outcome-good-tint: oklch(94% 0.030 165);
  --outcome-bad: oklch(50% 0.105 45);
  --outcome-bad-tint: oklch(94% 0.045 45);
  --outcome-neutral: oklch(50% 0.012 250);
  --outcome-neutral-tint: oklch(94% 0.008 250);
  --chart-compound-primary: oklch(40% 0.012 250);
  --chart-compound-secondary: oklch(50% 0.105 75);
  --chart-compound-dangerous: var(--risk-dangerous);
  --chart-compound-trace: oklch(70% 0.010 250);

  /* Touch targets — non-negotiable */
  --touch-min:       80px;
  --touch-primary:  140px;

  /* Motion */
  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
}

/* Low-light tent variant — global ~15% luminance dampener applied as a
   filter on the whole frame so it composites cleanly with any theme.
   Replaces the earlier token-override approach which fought theme tokens. */
.kiosk-frame[data-lowlight="1"] {
  filter: brightness(0.85);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #0a0a0a;
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* Letterbox stage — scales the 1920×1080 canvas to any viewport */
.kiosk-stage {
  position: fixed; inset: 0;
  background: #0a0a0a;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.kiosk-frame {
  position: relative;
  width: 1920px; height: 1080px;
  background: var(--bg);
  transform-origin: center center;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}

/* Typography roles */
.t-display {
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: calc(var(--type-display) * var(--type-scale, 1));
  line-height: 0.92;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
.t-h1 {
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: calc(var(--type-h1) * var(--type-scale, 1));
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.t-h2 {
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
  font-size: calc(var(--type-h2) * var(--type-scale, 1));
  line-height: 1.0;
  letter-spacing: -0.015em;
}
.t-h3 {
  font-family: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: calc(var(--type-h3) * var(--type-scale, 1));
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.t-body-lg {
  font-size: calc(var(--type-body-lg) * var(--type-scale, 1));
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
.t-body {
  font-size: calc(var(--type-body) * var(--type-scale, 1));
  line-height: 1.45;
  font-weight: 400;
  text-wrap: pretty;
}
.t-meta {
  font-family: 'Geist Mono', ui-monospace, 'SF Mono', monospace;
  font-size: calc(var(--type-meta) * var(--type-scale, 1));
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Chrome bar — top-row persistent UI (lang toggle, round counter, info) */
.chrome {
  position: absolute; top: 0; left: 0; right: 0;
  height: 96px;
  padding: 0 var(--space-2xl);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 10;
}
.chrome-meta {
  display: flex; align-items: center; gap: var(--space-md);
  color: var(--text-secondary);
}

/* Language toggle */
.lang-toggle {
  display: inline-flex; align-items: center;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  height: var(--touch-min);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: calc(22px * var(--type-scale, 1)); font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
}
.lang-toggle button {
  appearance: none; border: 0; background: transparent;
  width: 80px; height: 56px;
  border-radius: 999px;
  font: inherit; color: var(--text-secondary);
  cursor: pointer;
}
.lang-toggle button[data-active="1"] {
  background: var(--text-primary);
  color: var(--bg);
}

/* Info button (circular "i") */
.info-btn {
  width: var(--touch-min); height: var(--touch-min);
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: calc(36px * var(--type-scale, 1));
  color: var(--text-secondary);
  cursor: pointer;
  font-style: italic;
}

/* Footer brand */
.kiosk-footer {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: var(--space-md) var(--space-2xl);
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-muted);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: calc(18px * var(--type-scale, 1));
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 5;
}
.kiosk-footer .brand {
  display: flex; align-items: center; gap: var(--space-sm);
  font-weight: 600;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: grid; place-items: center;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: calc(16px * var(--type-scale, 1)); font-weight: 800;
  font-style: italic;
}

/* Preserve the signed-off logo drawing in both UI treatments. Ink turns the
   violet artwork into a two-tone mark: dark ink plus the active paper colour. */
.brand-logo {
  isolation: isolate;
}
.brand-logo__art {
  display: block;
  width: 100%;
  height: 100%;
}
.brand-logo--ink .brand-logo__art {
  filter: grayscale(1) brightness(.68) contrast(3.4);
  mix-blend-mode: multiply;
  transform: scale(1.5);
}

/* Keyframes used across screens */
@keyframes slamLeft {
  from { transform: translateX(-180px) rotate(-2.5deg); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: translateX(0) rotate(0); opacity: 1; }
}
@keyframes slamRight {
  from { transform: translateX(180px) rotate(2.5deg); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: translateX(0) rotate(0); opacity: 1; }
}
@keyframes fadeUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.03); }
}
@keyframes shimmer {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}
/* Feedback flash — confident pop for "correct", a hair sharper for "wrong". */
@keyframes popIn {
  0%   { transform: scale(0.62); opacity: 0; }
  60%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes popInSharp {
  0%   { transform: scale(0.40); opacity: 0; }
  70%  { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes stampSlam {
  0%   { transform: translate(-50%, -50%) rotate(-12deg) scale(2.4); opacity: 0; }
  60%  { transform: translate(-50%, -50%) rotate(-12deg) scale(0.94); opacity: 1; }
  78%  { transform: translate(-50%, -50%) rotate(-12deg) scale(1.04); }
  100% { transform: translate(-50%, -50%) rotate(-12deg) scale(1.00); opacity: 1; }
}

@keyframes barSegmentFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@keyframes sampleSettle { from { opacity: 0; transform: translateY(-12px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@keyframes scenarioStep { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* Idle warning overlay */
.idle-warn {
  position: absolute; top: 0; left: 0; right: 0;
  padding: var(--space-md) var(--space-2xl);
  background: var(--risk-caution);
  color: #fff;
  text-align: center;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: calc(22px * var(--type-scale, 1)); font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  z-index: 100;
  animation: fadeIn 0.3s var(--ease-out);
}

/* Admin numpad */
.admin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 420px;
}
.admin-numpad button {
  appearance: none;
  border: 1.5px solid var(--border);
  background: var(--surface-elevated);
  height: 120px;
  border-radius: 24px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 52px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.admin-numpad button:active { transform: scale(0.97); }
.admin-numpad button[data-wide="1"] { font-size: 28px; }
.admin-pin-dot {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--text-primary);
  display: inline-block;
}
.admin-pin-dot[data-filled="1"] { background: var(--text-primary); }

/* Admin panel */
.admin-panel, .admin-pin, .osk { --type-scale: 1; }
.admin-panel {
  position: absolute; inset: 0;
  background: var(--bg);
  display: flex; flex-direction: column;
  z-index: 65;
}
.admin-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-lg) var(--space-2xl);
  border-bottom: 1.5px solid var(--border);
}
.admin-tabs {
  display: flex; gap: 12px;
  padding: var(--space-md) var(--space-2xl) 0;
  border-bottom: 1.5px solid var(--border);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  flex: 0 0 auto;
}
.admin-tabs button {
  appearance: none; border: 0; background: transparent;
  padding: 14px 22px; border-radius: 16px 16px 0 0;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary); cursor: pointer;
  border-bottom: 3px solid transparent;
  flex: 0 0 auto;
}
.admin-tabs button[data-active="1"] {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}
.admin-body { flex: 1; overflow-y: auto; padding: var(--space-2xl); }
.admin-game-switch {
  position: relative;
  width: 100%; min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px 16px 10px 20px;
  border: 1.5px solid var(--border); border-radius: 18px;
  background: var(--surface-elevated); color: var(--text-primary);
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700; font-size: 20px;
  cursor: pointer; touch-action: manipulation;
}
.admin-game-switch:focus-within {
  outline: 3px solid var(--text-primary);
  outline-offset: 2px;
}
.admin-game-switch > input {
  appearance: none;
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer; touch-action: manipulation;
}
.admin-row {
  display: flex; gap: var(--space-lg); align-items: flex-start;
  padding: var(--space-md);
  border-bottom: 1.5px solid var(--border);
}
.admin-field { display: flex; flex-direction: column; gap: 6px; }
.admin-field textarea, .admin-field input {
  font: inherit; font-family: 'Geist', sans-serif; font-size: 18px;
  padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface-elevated); color: var(--text-primary);
  min-width: 280px;
}
.admin-field textarea { min-height: 70px; resize: vertical; }
.admin-modified-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--risk-caution-tint); color: var(--risk-caution);
  border: 1.5px solid var(--risk-caution);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: 'Geist Mono', monospace; font-size: 14px;
  letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600;
}

/* Real sample photograph and kiosk touch lightbox. */
.sample-visual__photo-button {
  appearance: none;
  position: absolute;
  inset: 0 0 50px;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}
.sample-visual__photo-button:focus-visible {
  outline: 5px solid var(--chart-compound-secondary);
  outline-offset: -5px;
}
.sample-visual__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}
.sample-visual__zoom-hint {
  position: absolute;
  right: 13px;
  bottom: 12px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(22, 25, 27, .9);
  color: #fff;
  font: 700 11px/1.15 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .22);
}
.roulette-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 42px;
  background: rgba(7, 8, 10, .86);
  backdrop-filter: blur(9px);
  animation: fadeIn 180ms var(--ease-out) both;
}
.roulette-photo-lightbox__panel {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(1560px, 100%);
  height: min(920px, 100%);
  overflow: hidden;
  border: 1.5px solid rgba(255, 255, 255, .34);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 34px 120px rgba(0, 0, 0, .58);
}
.roulette-photo-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: #fff;
}
.roulette-photo-lightbox__caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 16px 26px;
  border-top: 1px solid #d8dadd;
  background: #f5f5f3;
  color: #24272a;
  font: 700 15px/1.3 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.roulette-photo-lightbox__caption span:nth-child(2) {
  flex: 1;
  color: #666a70;
  text-align: center;
}
.roulette-photo-lightbox__close {
  appearance: none;
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  padding: 0 0 4px;
  border: 2px solid rgba(255, 255, 255, .72);
  border-radius: 50%;
  background: rgba(22, 25, 27, .92);
  color: #fff;
  font: 400 48px/1 'Bricolage Grotesque', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .32);
}
.roulette-photo-lightbox__close:focus-visible {
  outline: 5px solid #fff;
  outline-offset: 4px;
}
.roulette-answer-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  margin-bottom: 14px;
  padding: 9px 16px;
  border: 1.5px solid;
  border-radius: 12px;
  font: 700 16px/1.2 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
  animation: fadeUp 350ms 120ms var(--ease-out) both;
}
.roulette-answer-status[data-correct="true"] {
  --status-accent: var(--correct-deep);
  --status-tint: var(--correct-tint);
  border-color: var(--correct);
  background: var(--correct-tint);
  color: var(--correct-deep);
}
.roulette-answer-status[data-correct="false"] {
  --status-accent: var(--incorrect-deep);
  --status-tint: var(--incorrect-tint);
  border-color: var(--incorrect);
  background: var(--incorrect-tint);
  color: var(--incorrect-deep);
}
.roulette-answer-status__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  color: #fff;
  font: 800 20px/1 'Bricolage Grotesque', sans-serif;
}
.roulette-answer-status[data-correct="true"] .roulette-answer-status__icon {
  background: var(--correct-deep);
}
.roulette-answer-status[data-correct="false"] .roulette-answer-status__icon {
  background: var(--incorrect-deep);
}
@media (max-width: 980px) {
  .roulette-photo-lightbox { padding: 20px; }
  .roulette-photo-lightbox__caption { align-items: flex-start; flex-direction: column; }
  .roulette-photo-lightbox__caption span:nth-child(2) { text-align: left; }
}

/* Admin-only review library for the real Drugchecking Berlin roulette cases. */
.admin-roulette-library {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: var(--space-2xl);
}
.admin-roulette-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-xl);
}
.admin-roulette-actions {
  display: flex;
  gap: 12px;
  flex: 0 0 auto;
}
.admin-roulette-action {
  appearance: none;
  min-height: 56px;
  padding: 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  font: 700 15px/1.15 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .035em;
  text-transform: uppercase;
  cursor: pointer;
}
.admin-roulette-action[data-primary="1"] {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg);
}
.admin-roulette-preview-note,
.admin-roulette-attribution {
  padding: 12px 16px;
  border-radius: 12px;
  font: 600 14px/1.4 'Geist Mono', ui-monospace, monospace;
}
.admin-roulette-preview-note {
  border: 1.5px solid var(--outcome-good);
  background: var(--outcome-good-tint);
  color: var(--outcome-good);
}
.admin-roulette-attribution {
  border-left: 4px solid var(--risk-caution);
  background: var(--risk-caution-tint);
  color: var(--text-secondary);
}
.admin-roulette-toolbar {
  position: sticky;
  top: -1px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 280px auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  background: var(--bg);
}
.admin-roulette-search,
.admin-roulette-select {
  width: 100%;
  min-height: 56px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface-elevated);
  color: var(--text-primary);
  font: 500 18px/1.25 'Geist', sans-serif;
}
.admin-roulette-count {
  min-width: 150px;
  padding: 17px 18px;
  border-radius: 999px;
  background: var(--text-primary);
  color: var(--bg);
  font: 700 14px/1 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .035em;
  text-align: center;
  white-space: nowrap;
}
.admin-roulette-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.admin-roulette-card {
  min-width: 0;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface-elevated);
}
.admin-roulette-photo-button {
  appearance: none;
  display: block;
  width: 100%;
  height: 280px;
  padding: 0;
  border: 0;
  border-bottom: 1.5px solid var(--border);
  background: #fff;
  cursor: zoom-in;
}
.admin-roulette-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.admin-roulette-card-body {
  display: grid;
  gap: 14px;
  padding: 17px;
}
.admin-roulette-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font: 700 11px/1.2 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.admin-roulette-label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font: 700 11px/1.2 'Geist Mono', ui-monospace, monospace;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.admin-roulette-claim {
  color: var(--text-primary);
  font: 700 26px/1.05 'Bricolage Grotesque', sans-serif;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.admin-roulette-results {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-roulette-results li {
  padding: 8px 10px;
  border-left: 3px solid var(--chart-compound-secondary);
  border-radius: 0 9px 9px 0;
  background: var(--surface);
  color: var(--text-primary);
  font: 600 14px/1.3 'Geist', sans-serif;
  overflow-wrap: anywhere;
}
.admin-roulette-results--large li { font-size: 18px; padding: 11px 13px; }
.admin-roulette-warning {
  color: var(--risk-caution);
  font: 700 14px/1.35 'Geist', sans-serif;
}
.admin-roulette-sample-meta {
  color: var(--text-muted);
  font: 500 12px/1.45 'Geist Mono', ui-monospace, monospace;
}
.admin-roulette-source {
  width: fit-content;
  color: var(--outcome-good);
  font: 700 12px/1.3 'Geist Mono', ui-monospace, monospace;
  text-underline-offset: 4px;
}
.admin-roulette-empty {
  grid-column: 1 / -1;
  padding: 72px 24px;
  border: 1.5px dashed var(--border);
  border-radius: 18px;
  color: var(--text-muted);
  font-size: 20px;
  text-align: center;
}
.admin-roulette-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 38px;
  background: rgba(9, 9, 12, .78);
  backdrop-filter: blur(7px);
}
.admin-roulette-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, .8fr);
  width: min(1440px, 100%);
  max-height: 900px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  background: var(--surface-elevated);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .45);
}
.admin-roulette-modal-photo {
  width: 100%;
  height: 100%;
  min-height: 700px;
  object-fit: contain;
  background: #fff;
}
.admin-roulette-modal-copy {
  display: grid;
  align-content: start;
  gap: 20px;
  padding: 28px;
  overflow-y: auto;
}
.admin-roulette-modal-title {
  color: var(--text-primary);
  font: 700 42px/1 'Bricolage Grotesque', sans-serif;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}
.admin-roulette-close {
  appearance: none;
  justify-self: end;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 1400px) {
  .admin-roulette-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-roulette-heading { flex-direction: column; }
}
@media (max-width: 980px) {
  .admin-roulette-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-roulette-toolbar { grid-template-columns: 1fr; }
  .admin-roulette-count { justify-self: start; }
  .admin-roulette-modal { grid-template-columns: 1fr; overflow-y: auto; }
  .admin-roulette-modal-photo { min-height: 0; max-height: 45vh; }
}

/* On-screen keyboard — admin only, docks at the bottom of the admin panel */
.osk {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  padding: 14px 18px 18px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 80;
  box-shadow: 0 -14px 44px -18px rgba(0,0,0,.4);
  animation: oskUp .18s var(--ease-out);
}
@keyframes oskUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.osk-row { display: flex; gap: 10px; justify-content: center; }
.osk-key {
  appearance: none;
  flex: 1 1 0; min-width: 0;
  height: 72px;
  border: 1.5px solid var(--border);
  background: var(--surface-elevated);
  border-radius: 14px;
  font-family: 'Geist', sans-serif;
  font-size: 30px; font-weight: 500;
  color: var(--text-primary);
  cursor: pointer; user-select: none;
}
.osk-key:active { transform: scale(0.96); }
.osk-key[data-mod="1"] {
  flex-grow: 1.4;
  font-family: 'Geist Mono', monospace;
  font-size: 24px;
  color: var(--text-secondary);
}
.osk-key[data-space="1"] { flex-grow: 6; }
.osk-key[data-active="1"] {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.osk-key[data-accent="1"] {
  background: var(--text-primary); color: var(--bg); border-color: var(--text-primary);
}
.osk--num { align-items: center; padding-bottom: 22px; }
.osk--num .osk-key { flex: 0 0 170px; height: 84px; font-size: 40px; }

/* Semantic feedback follows the foreground treatment, not the background
   theme. Classic keeps each legacy tint; Ink reserves colour for the signal. */
.semantic-status-screen {
  background: var(--status-tint);
}
.feedback-status-title {
  color: var(--status-deep);
}
.feedback-status-caption {
  color: var(--status-accent);
}
.friend-outcome-status {
  background: var(--status-tint);
  color: var(--status-accent);
  border: 2px solid var(--status-accent);
}
.friend-outcome-status .semantic-callout__icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  background: var(--status-accent);
  color: #fff;
  font-size: 0;
}
.scenario-complete__status {
  color: var(--status-accent);
}
.scenario-complete__status .semantic-callout__icon {
  display: none;
}
.scenario-complete__status-label {
  margin-left: 18px;
}
.idle-warn .semantic-callout__icon {
  display: none;
}

[data-ui-style="ink"] .semantic-status-screen {
  background: transparent;
}
[data-ui-style="ink"] .semantic-callout {
  position: relative;
  overflow: hidden;
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 2px solid var(--border);
}
[data-ui-style="ink"] .semantic-callout::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--status-accent);
}
[data-ui-style="ink"] .semantic-callout--hero {
  min-width: 820px;
  padding: 64px 92px 70px;
  border-radius: 30px;
  box-shadow: 0 28px 70px -34px rgba(0,0,0,.36);
}
[data-ui-style="ink"] .feedback-status-title {
  color: var(--text-primary);
}
[data-ui-style="ink"] .feedback-status-caption {
  color: var(--text-secondary);
}
[data-ui-style="ink"] .roulette-answer-status {
  padding-top: 13px;
  border-color: var(--border);
  background: var(--surface-elevated);
  color: var(--text-primary);
}
[data-ui-style="ink"] .friend-outcome-status {
  padding-top: 18px !important;
  border-radius: 18px !important;
}
[data-ui-style="ink"] .friend-outcome-status .semantic-callout__icon,
[data-ui-style="ink"] .scenario-complete__status .semantic-callout__icon,
[data-ui-style="ink"] .idle-warn .semantic-callout__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: var(--status-accent);
  color: #fff;
  font: 800 20px/1 'Bricolage Grotesque', sans-serif;
}
[data-ui-style="ink"] .scenario-complete__status {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px 14px;
  border-radius: 16px;
}
[data-ui-style="ink"] .scenario-complete__dots {
  display: none;
}
[data-ui-style="ink"] .scenario-complete__status-label {
  margin-left: 0;
}
[data-ui-style="ink"] .idle-warn {
  top: 24px;
  left: var(--space-3xl);
  right: var(--space-3xl);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px var(--space-2xl) 18px;
  border-radius: 16px;
}
