:root {
  --bg: #0b0a0f;
  --panel: #14121b;
  --panel-2: #1c1926;
  --ink: #ece8f5;
  --muted: #9a94ad;
  --gold: #c9a25a;
  --gold-2: #e6c885;
  --blood: #7c1f2b;
  --line: #2a2536;
  --radius: 14px;
  --font: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  /* Headings and display type. A pack whose long copy wants a readable face but
     whose titles want a heavy one sets these two differently. */
  --display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  /* Input wells and tiles: the recessed surface, a shade under --panel. */
  --field: #0e0c14;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #1a1524 0%, transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 680px; margin: 0 auto; padding: 24px 18px 64px; }
.gallery .wrap { max-width: 1100px; }
h1, h2, h3, .serif { font-family: var(--display); font-weight: 600; letter-spacing: .3px; }
h1 { font-size: clamp(30px, 6vw, 52px); margin: .2em 0 .1em; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .32em; font-size: 12px; font-family: var(--sans); }
.muted { color: var(--muted); }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px;
  margin: 16px 0;
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
}
.card h2 { margin-top: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input, select {
  width: 100%; padding: 13px 14px; font-size: 16px;
  background: var(--field); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }
button {
  appearance: none; cursor: pointer; font: inherit; font-weight: 600;
  padding: 13px 18px; border-radius: 10px; border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #221a08;
  width: 100%; margin-top: 16px; letter-spacing: .02em;
}
button.ghost { background: transparent; color: var(--gold-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; }
.pill { display: inline-block; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.pill.on { color: var(--gold-2); border-color: var(--gold); }
.brief { white-space: pre-wrap; font-family: var(--font); font-size: 18px; line-height: 1.6; }
.reveal { border-left: 3px solid var(--gold); padding-left: 14px; }
.reveal.locked { border-left-color: var(--blood); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tile { text-align: left; background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 12px; color: var(--ink); width: auto; margin: 0; }
.tile b { display: block; font-family: var(--display); font-size: 17px; }
/* A tile's supporting line stays quiet: .muted alone loses to .tile on
   source order, and button text inherits the button weight. */
.tile .muted { color: var(--muted); font-weight: 400; }
.big { font-size: clamp(40px, 9vw, 96px); font-family: var(--display); color: var(--gold-2); }
.err { color: #ff9c9c; font-size: 14px; margin-top: 10px; min-height: 1em; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 22px 0; }
.list { display: flex; flex-direction: column; gap: 8px; }
.barrow { display: grid; grid-template-columns: 1fr 3fr auto; gap: 10px; align-items: center; }
.bar { height: 12px; background: var(--field); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
a { color: var(--gold-2); }
footer { margin-top: 40px; color: var(--muted); font-size: 12px; text-align: center; }

/* In-world private note, every private drop, unlock, line, or hint uses this. */
.note {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 27px, rgba(201,162,90,.10) 28px),
    linear-gradient(180deg, #171320, #120f19);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 12px 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.note .kicker { font-family: var(--sans); font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); margin-bottom: 8px; }
.note .action { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-top: 10px; }
.note.secret { border-left-color: var(--blood); }
.note.secret .kicker { color: #e79aa4; }

/* Gallery narrator card, full-screen styled story beat. */
.narrator {
  text-align: center;
  font-family: var(--font);
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1.35;
  padding: 6vh 4vw;
  white-space: pre-wrap;
}
.narrator .beat { color: var(--gold-2); letter-spacing: .02em; }

/* Host persistent navigation. */
.nav { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.nav a, .nav button { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; }
.nav .spacer { flex: 1; }

.guidance { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.clock { font-variant-numeric: tabular-nums; }
.audio-btn { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; }

/* Collapsible host drawer on the player page (host's device only). */
details.card > summary {
  cursor: pointer; list-style: none; font-family: var(--display);
  font-size: 18px; color: var(--gold-2); letter-spacing: .02em;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸ '; }
details.card[open] > summary::before { content: '▾ '; }
details.card .row button { margin-top: 8px; }

/* The blackout: everything goes dark. */
#blackoutOverlay {
  position: fixed; inset: 0; background: #000; z-index: 999;
  display: none; align-items: center; justify-content: center;
  color: #2a2536; font-family: var(--font); font-size: 20px; letter-spacing: .1em;
}
#blackoutOverlay.on { display: flex; }

/* ---------------------------------------------------------------------------
   The guest phone: what is new, which phase this is, the two sheets, the mark.
   --------------------------------------------------------------------------- */

/* The strip that names what has arrived and not yet been seen. Sticky, so it
   is there whatever the scroll position; one line, one tap. */
.newstrip { position: sticky; top: 8px; z-index: 50; margin: 0 0 12px; }
.newstrip button {
  display: flex; align-items: center; gap: 10px; width: 100%; margin: 0;
  padding: 12px 14px; text-align: left; border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
}
.newstrip .badge {
  flex: 0 0 auto; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
  background: #221a08; color: var(--gold-2); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.newstrip #newHead { flex: 1; font-size: 15px; }
.newstrip .go { flex: 0 0 auto; font-size: 12px; text-transform: uppercase; letter-spacing: .18em; opacity: .8; }

.topbar { margin: 4px 0 10px; }
button.small { padding: 8px 12px; font-size: 13px; margin-top: 0; width: auto; }

/* The phase card: always the first card, always plain. */
.phasecard { border-color: var(--gold); }
.changed { font-family: var(--font); font-size: 18px; line-height: 1.5; margin: 0 0 8px; color: var(--ink); }

/* A card holding something not yet seen. */
.isnew { position: relative; box-shadow: 0 0 0 2px var(--gold), 0 20px 50px rgba(0,0,0,.35); }
.isnew::after {
  content: 'NEW'; position: absolute; top: -10px; right: 14px;
  background: var(--gold); color: #221a08; font-family: var(--sans); font-size: 11px;
  font-weight: 700; letter-spacing: .2em; padding: 3px 9px; border-radius: 999px;
}

/* The narrator's card sits under your lines, and reads as the room's voice. */
.note.narr { border-left-color: var(--muted); }
.note.narr .kicker { color: var(--muted); }
/* A thing the whole room was told, as opposed to a thing passed to you. */
.note.room { border-left-color: var(--ink); }
.note.room .kicker { color: var(--ink); }

/* The one-tap suspect mark on a roster tile. */
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; }
.tile .mark {
  width: auto; margin: 6px 0 0; padding: 6px 10px; font-size: 12px; letter-spacing: .04em;
  align-self: flex-start; background: transparent; color: var(--gold-2);
}
.tile.marked { border-color: var(--gold); }
.tile.marked .mark { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #221a08; }

/* Full-screen sheets: How this works, Your night so far. */
.sheet {
  position: fixed; inset: 0; z-index: 200; background: var(--bg); color: var(--ink);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.sheetbar {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line);
}
.sheetbody { max-width: 680px; margin: 0 auto; padding: 8px 18px 64px; }
.sheetbody h3 { margin: 22px 0 6px; color: var(--gold-2); }
.sheetbody p { font-family: var(--font); font-size: 18px; line-height: 1.55; margin: 0 0 10px; }
body.sheetopen { overflow: hidden; }
.howphase { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin: 8px 0; background: var(--panel); }
.howphase.now { border-color: var(--gold); }
.howphase p { font-size: 16px; margin: 4px 0 0; }
.recphase { padding: 14px 0 6px; border-top: 1px solid var(--line); margin-top: 8px; }
.recphase.now .eyebrow { color: var(--gold-2); }
.recitem { margin: 12px 0; padding: 10px 12px; border-left: 2px solid var(--line); font-family: var(--font); font-size: 17px; line-height: 1.5; white-space: pre-wrap; }
.recitem .kicker { font-family: var(--sans); font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
