:root {
  /* dark: command-centre steel (2026-11-12) */
  --bg: #020408; --panel: rgba(5, 9, 14, 0.9); --ink: #d3dbe4; --muted: #7f8c9a; --accent: #2ee6ff; --line: #2a3644;
  --btn: rgba(201,211,221,0.05); --btn-hover: rgba(46,230,255,0.12); --font: "IBM Plex Mono", "Consolas", "Lucida Console", monospace;
  /* Titanium frost (2026-11-15, Riley Command's look): translucent brushed metal, bevelled edge, 4 px radii */
  --panel: linear-gradient(180deg, rgba(34, 36, 40, 0.62), rgba(20, 21, 24, 0.62)); --line: rgba(185, 196, 207, 0.22);
  --raise: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -1px 0 rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.45);
  --brushed: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
  --sun: rgba(140, 210, 245, 0.55); --radius: 4px;
}
body[data-theme="dark"] .btn { border-radius: 2px; text-transform: uppercase; letter-spacing: 0.08em; }
body[data-theme="dark"] .topbar { border-bottom-color: #2ee6ff33; box-shadow: 0 1px 0 #000, 0 2px 12px rgba(46, 230, 255, 0.06); }
body[data-theme="light"] {
  --bg: #f5f1ee; --panel: rgba(255, 252, 250, 0.94); --ink: #232a3b; --muted: #5d6478; --accent: #4f74c0; --line: #d9d0cb;
  --btn: rgba(35,42,59,0.06); --btn-hover: rgba(35,42,59,0.12); --font: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --panel: linear-gradient(180deg, rgba(253, 253, 252, 0.72), rgba(242, 242, 240, 0.70)); --line: rgba(150, 148, 140, 0.42);
  --raise: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -1px 0 rgba(0, 0, 0, 0.05), 0 1px 2px rgba(60, 40, 20, 0.08), 0 8px 24px rgba(60, 40, 20, 0.10);
  --brushed: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.022) 0 1px, transparent 1px 3px);
  --sun: rgba(240, 170, 60, 0.7); --radius: 4px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); overflow: hidden; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

.topbar { position: fixed; top: 0; left: 0; right: 0; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--panel); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); font-size: 13px; z-index: 5; }
.topbar .brand { color: var(--muted); text-decoration: none; }
.topbar .brand:hover { color: var(--ink); }
.topbar .title { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.topbar .status { color: var(--muted); }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn { font: inherit; color: var(--ink); background: var(--btn); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.btn:hover { background: var(--btn-hover); }
.btn.primary { background: var(--accent); color: #06111c; border-color: transparent; font-weight: 700; }
body[data-theme="light"] .btn.primary { color: #ffffff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 8px; font-size: 12px; }

.gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--bg); z-index: 10; }
.gate-card { width: min(420px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 28px 22px; text-align: center; }
.gate-logo { height: 56px; margin-bottom: 8px; }
.gate h1 { margin: 6px 0 4px; letter-spacing: 0.14em; text-transform: uppercase; font-size: 20px; }
.gate p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.gate-msg { min-height: 20px; color: #e0a84a; }

.editor { position: fixed; top: 44px; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--panel); border-left: 1px solid var(--line);
  backdrop-filter: blur(8px); z-index: 6; display: flex; flex-direction: column; font-size: 13px; }
.editor-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.editor-body { padding: 12px 14px 20px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.editor label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); }
.editor input, .editor select { font: inherit; color: var(--ink); background: var(--btn); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
.editor input[type="color"] { padding: 0; height: 30px; width: 46px; }
.editor fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px 10px; }
.editor legend { color: var(--muted); padding: 0 6px; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slots label { gap: 2px; }
.slots label span { font-size: 11px; }
.titles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.colors label { align-items: center; font-size: 11px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.editor-actions { display: flex; gap: 8px; }

/* Titanium frost chrome: floating frosted bar, frosted editor / call panel / sign-in card */
.topbar { top: 10px; left: 12px; right: 12px; height: 46px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--brushed), var(--panel); box-shadow: var(--raise); backdrop-filter: blur(16px) saturate(1.15); }
.topbar .title { font-weight: 500; letter-spacing: 0.22em; }
.btn { border-radius: 3px; }
.btn:hover { box-shadow: 0 0 0 1px var(--sun), 0 0 18px -4px var(--sun); }
.editor, .callpanel, .gate-card { background: var(--brushed), var(--panel); box-shadow: var(--raise); backdrop-filter: blur(16px) saturate(1.15); border-radius: var(--radius); }
.editor { top: 64px; right: 12px; bottom: 12px; border: 1px solid var(--line); }
.panelopts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panelopts .range { display: flex; align-items: center; gap: 8px; }
.panelopts input[type="range"] { flex: 1; padding: 0; accent-color: var(--accent); }
.panelopts output { min-width: 34px; color: var(--ink); font-variant-numeric: tabular-nums; }
.help { position: fixed; left: 12px; bottom: 10px; color: var(--muted); font-size: 12px; opacity: 0.8; pointer-events: none; z-index: 4; }

/* Recent Calls pop-out: the call's details, rating summary, recording and transcript. It is page content that the
   script keeps over its place in the 3-D frame (left / top / width / height are set every frame). */
.callpanel { position: fixed; z-index: 4; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; background: var(--panel);
  border: 1px solid var(--line); border-top: 3px solid var(--cp-accent, var(--accent)); border-radius: 10px; backdrop-filter: blur(8px);
  font-size: 14px; line-height: 1.45; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.cp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cp-meta { color: var(--muted); }
.cp-meta strong { color: var(--ink); font-size: 17px; }
.cp-mood .score { font-weight: 700; margin-right: 10px; }
.cp-msg { color: var(--muted); font-size: 13px; }
.cp-audio { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.cp-audio audio { flex: 1 1 280px; min-width: 240px; height: 40px; }
body[data-theme="dark"] .callpanel { color-scheme: dark; }      /* dark scrollbar and player */
.cp-meta { font-size: 15px; color: var(--ink); }
.cp-turns { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 6px 2px 0; border-top: 1px solid var(--line); }
.turn { max-width: 84%; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line); }
.turn p { margin: 0; }
.turn .who { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.turn .at { margin-left: 8px; letter-spacing: 0; opacity: 0.8; }
.turn.riley { align-self: flex-start; background: var(--btn); }
.turn.caller { align-self: flex-end; background: color-mix(in srgb, var(--accent) 16%, transparent); }
/* live mode (Live Calls pop-out): listen controls instead of the rating and the recording */
.cp-listen { display: none; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.callpanel.live .cp-listen { display: flex; }
.callpanel.live .cp-mood, .callpanel.live .cp-audio { display: none; }
.callpanel.live .cp-meta::before { content: "\25CF  LIVE  "; color: var(--cp-accent, var(--accent)); font-weight: 700; letter-spacing: 0.06em; }
.cp-listen .cp-msg { flex: 1 1 220px; }
.turn.seek { cursor: pointer; }
.turn.seek:hover { border-color: var(--accent); }

/* ===================================================================== Round 9 "Blend" (owner's pick, 2026-11-16)
   Interactive titanium chrome, only with a mouse (arena.js sets the variables; touch screens never get them):
   a soft torch over the wall, the bar's edge glint, magnetic glowing bar buttons, the keys HUD that folds to a chip,
   and a glass Click tag tethered to the hand cursor. Sky blue in dark, warm gold in light.
   Design notes: design/DESIGN_NOTES.md "Round 9 · Blend"; preview layer design/mockups/r9/. */
body { --bl-spot: rgba(140, 210, 245, .12); --bl-edge: rgba(200, 236, 255, .85); --bl-blend: screen;
  --bl-glow: rgba(140, 210, 245, .22); --bl-glowline: rgba(170, 205, 245, .55); }
body[data-theme="light"] { --bl-spot: rgba(255, 196, 110, .34); --bl-edge: rgba(240, 170, 60, .95); --bl-blend: soft-light;
  --bl-glow: rgba(250, 175, 60, .30); --bl-glowline: rgba(240, 170, 60, .65); }

#arena-spot { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(560px circle at var(--blx, -999px) var(--bly, -999px), var(--bl-spot), transparent 70%);
  mix-blend-mode: var(--bl-blend); opacity: var(--blon, 0); transition: opacity .4s ease; }
#topbar::before, #help::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; z-index: -1;
  background: radial-gradient(200px circle at var(--blx, -999px) var(--bly, -999px), var(--bl-edge), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--blon, 0); transition: opacity .35s ease;
}
/* the bar's buttons lean a little toward the pointer, glow when pointed at, and press in */
body.bl-touch #topbar .btn { transform: translate(var(--blbx, 0px), var(--blby, 0px)) scale(var(--blbs, 1));
  transition: transform .4s cubic-bezier(.2, .9, .25, 1.2), box-shadow .2s, border-color .2s; }
#topbar .btn.bl-hover { border-color: var(--bl-glowline); box-shadow: 0 0 0 1px var(--bl-glowline), 0 0 16px var(--bl-glow); }

/* keys HUD: key caps instead of the hint sentence. The camera fit lets this line overlay the panel feet, so it only stays
   open for a moment (or while pointed at, or after ?), then folds to a small Keys chip */
#help.keyhud { position: fixed; left: 12px; bottom: 10px; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px;
  max-width: min(980px, calc(100vw - 24px)); box-sizing: border-box; padding: 6px 12px; border-radius: var(--radius, 4px);
  background: var(--brushed, none), var(--panel, rgba(20, 21, 24, .62)); border: 1px solid var(--line, rgba(185, 196, 207, .22));
  box-shadow: var(--raise, none); backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15);
  font: 11px/1.4 "IBM Plex Sans", "Segoe UI", sans-serif; color: var(--muted, #A3A3A0); isolation: isolate; opacity: 1; pointer-events: auto; }
#help.keyhud span { white-space: nowrap; }
#help.keyhud kbd, #click-tag kbd { font: 500 10.5px/1 "IBM Plex Mono", Consolas, monospace; color: var(--ink, #ECECEA); padding: 2px 6px 3px; margin-right: 3px;
  border: 1px solid var(--line, rgba(185, 196, 207, .22)); border-radius: 3px; background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 -1px 0 rgba(0, 0, 0, .4); }
body[data-theme="light"] #help.keyhud kbd, body[data-theme="light"] #click-tag kbd { background: rgba(255, 255, 255, .6); box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(0, 0, 0, .08); }
#help.keyhud .fold { display: none; font-weight: 400; }
#help.keyhud.folded span { display: none; }
#help.keyhud.folded .fold { display: inline; }
#gate:not(.hidden) ~ #help { display: none; }

/* a glass tag tethered to the pointer while the page shows the hand (something on the wall is clickable) */
#click-tag { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; display: flex; padding: 4px; border-radius: var(--radius, 4px);
  background: var(--brushed, none), var(--panel, rgba(20, 21, 24, .62)); border: 1px solid var(--bl-glowline);
  box-shadow: var(--raise, none), 0 0 14px var(--bl-glow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  opacity: 0; transition: opacity .18s; }
#click-tag kbd { margin-right: 0; }
#click-tag.on { opacity: 1; }
