/* The Last Lantern: page, lobby, camcorder HUD, menu, lost-signal screen.
   No external fonts or assets. The lantern yellow is the only warm accent. */

:root {
  --ink: #040605;
  --fog: #0b100d;
  --fog-lift: #18211b;
  --moss: #2f3a24;
  --bone: #c8ccbe;
  --bone-dim: #8b9086;
  --bone-faint: #5a5f57;
  --line: rgba(200, 210, 195, 0.16);
  --accent: #ffb347;
  --rust: #c06a52;
  --rec: #e0412f;
  --osd: rgba(238, 241, 230, 0.88);
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', 'DejaVu Sans Mono', monospace;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--bone); }
body {
  font: 14px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(255, 179, 71, 0.3); }

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
  background: var(--fog);
}
body.locked, body.locked * { cursor: none !important; }

.noscript { position: fixed; inset: auto 0 40%; text-align: center; color: var(--bone-dim); }

/* --- shared bits: grain, scanlines, vignette, buttons, fields ---------------------------- */

.grain {
  position: absolute;
  inset: -60%;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='.33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 0 1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
  opacity: 0.075;
  animation: grain 0.6s steps(1, end) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  16% { transform: translate(-7%, 4%); }
  33% { transform: translate(5%, -6%); }
  50% { transform: translate(-3%, -9%); }
  66% { transform: translate(8%, 7%); }
  83% { transform: translate(-9%, 2%); }
}
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
  opacity: 0.55;
}
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.55) 75%, rgba(0, 0, 0, 0.92) 100%);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 44px;
  padding: 0 1.25em;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(10, 14, 12, 0.55);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s, box-shadow 0.25s;
}
.btn:hover { border-color: rgba(200, 210, 195, 0.42); color: #e6e9de; }
.btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-primary {
  border-color: rgba(255, 179, 71, 0.55);
  color: var(--accent);
  background: rgba(255, 179, 71, 0.05);
}
.btn-primary:hover {
  border-color: var(--accent);
  color: #ffd29a;
  background: rgba(255, 179, 71, 0.1);
  box-shadow: 0 0 22px rgba(255, 179, 71, 0.16), inset 0 0 12px rgba(255, 179, 71, 0.08);
}
.btn-primary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 7px solid currentColor;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

.field { display: grid; gap: 6px; text-align: left; }
.field-label {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.field input {
  width: 100%;
  height: 44px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(200, 210, 195, 0.28);
  border-radius: 0;
  background: transparent;
  color: #e3e6da;
  font-size: 18px;
  letter-spacing: 0.06em;
  caret-color: var(--accent);
  outline: none;
  transition: border-color 0.2s;
}
.field input::placeholder { color: #3f443e; }
.field input:focus { border-bottom-color: rgba(255, 179, 71, 0.75); }
.field input:disabled { opacity: 0.5; }

/* --- lobby ----------------------------------------------------------------------------------- */

.lobby {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  overflow: clip;   /* hidden still scrolls when a script scrolls a field into view */
  background:
    radial-gradient(120% 55% at 50% 78%, #17201a 0%, #0d130f 38%, transparent 70%),
    radial-gradient(90% 60% at 50% 0%, #070a08 0%, transparent 70%),
    var(--ink);
  transition: opacity 1.6s ease, filter 1.6s ease;
}
.lobby.leaving { opacity: 0; filter: blur(2px); pointer-events: none; }

.lobby-fog {
  position: absolute;
  inset: -25% -25% -10%;
  pointer-events: none;
  background:
    radial-gradient(36% 18% at 26% 68%, rgba(150, 170, 150, 0.075), transparent 70%),
    radial-gradient(30% 16% at 74% 60%, rgba(140, 160, 145, 0.065), transparent 70%),
    radial-gradient(46% 20% at 52% 80%, rgba(130, 150, 135, 0.07), transparent 72%);
  filter: blur(12px);
  animation: fog-drift 46s ease-in-out infinite alternate;
}
.lobby-fog.far {
  inset: -30% -40% 0;
  opacity: 0.8;
  animation-duration: 71s;
  animation-direction: alternate-reverse;
}
@keyframes fog-drift {
  from { transform: translate3d(-4%, 1%, 0) scale(1); }
  to { transform: translate3d(5%, -2%, 0) scale(1.08); }
}

.lobby-reeds {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  width: 100%;
  pointer-events: none;
}
.lobby-reeds .sway { transform-box: view-box; transform-origin: 50% 100%; animation: sway 7s ease-in-out infinite alternate; }
.lobby-reeds .sway:nth-of-type(2n) { animation-duration: 9.5s; animation-delay: -3s; }
.lobby-reeds .sway:nth-of-type(3n) { animation-duration: 11s; animation-delay: -6s; }
.lobby-reeds .shiver { animation: shiver 1.8s ease-in-out 1; }
@keyframes sway {
  from { transform: skewX(-0.7deg); }
  to { transform: skewX(0.9deg); }
}
@keyframes shiver {
  0% { transform: skewX(0deg); }
  14% { transform: skewX(-2.6deg); }
  30% { transform: skewX(2.2deg); }
  48% { transform: skewX(-1.6deg); }
  66% { transform: skewX(0.9deg); }
  100% { transform: skewX(0deg); }
}

.lobby-reeds .ember { animation: ember 3.7s ease-in-out infinite; }
@keyframes ember {
  0%, 100% { opacity: 0.86; }
  18% { opacity: 1; }
  31% { opacity: 0.7; }
  47% { opacity: 0.95; }
  63% { opacity: 0.76; }
  82% { opacity: 0.98; }
}

.lobby-frame { position: absolute; inset: clamp(14px, 3.2vmin, 34px); pointer-events: none; }
.corner { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(220, 228, 214, 0.32); }
.corner.tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.osd-small {
  position: absolute;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(220, 228, 214, 0.42);
  text-shadow: 0 0 6px rgba(220, 228, 214, 0.18);
}
.lobby-frame .osd-small.tl { top: 14px; left: 40px; }
.lobby-frame .osd-small.tr { top: 14px; right: 40px; }
.lobby-frame .osd-small.br { bottom: 14px; right: 40px; }
.stby-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 9px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
  animation: blink 2s steps(1, end) infinite;
}

.lobby-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: clamp(40px, 7vh, 72px) 24px;
}
.lobby-panel {
  width: min(1100px, 100%);
  text-align: center;
  animation: panel-in 1.4s ease both;
}
.lobby-form { width: min(440px, 100%); margin: 0 auto; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: #cfd3c5;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow:
    0 0 1px rgba(230, 236, 222, 0.5),
    0 0 26px rgba(170, 190, 170, 0.16),
    2px 0 0 rgba(255, 70, 50, 0.13),
    -2px 0 0 rgba(70, 170, 255, 0.11);
  animation: title-flicker 9s linear infinite;
}
.title-the {
  display: block;
  margin-bottom: 0.55em;
  font-size: clamp(13px, 1.6vw, 17px);
  letter-spacing: 0.9em;
  padding-left: 0.9em;
  color: var(--bone-dim);
}
.title-main {
  display: block;
  font-size: clamp(30px, 7.4vw, 96px);
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  white-space: nowrap;
}
@keyframes title-flicker {
  0%, 100% { opacity: 0.94; }
  41% { opacity: 0.94; }
  42% { opacity: 0.62; }
  43% { opacity: 0.9; }
  44.5% { opacity: 0.7; }
  46% { opacity: 0.94; }
  78% { opacity: 0.9; }
  79% { opacity: 0.78; }
  80% { opacity: 0.94; }
}
.tagline {
  margin: 26px 0 38px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 1.7vw, 18px);
  letter-spacing: 0.02em;
  color: var(--bone-dim);
}

.lobby-form { display: grid; gap: 18px; }
.lobby-form .btn-primary { width: 100%; min-height: 50px; font-size: 14px; }
.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 -2px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.alt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.alt-row.single { grid-template-columns: 1fr; }
.join-row .field input { font-size: 20px; letter-spacing: 0.42em; text-transform: uppercase; }
.join-row .field input::placeholder { letter-spacing: 0.42em; }
.field-code { min-width: 0; }

.status {
  min-height: 1.5em;
  margin: 2px 0 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--bone-dim);
}
.status[data-kind='error'] { color: var(--rust); }
.status[data-kind='busy']::after {
  content: '';
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}

.hints {
  width: min(680px, 100%);
  margin: 34px auto 0;
  display: grid;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--bone-faint);
}
.hints p { margin: 0; }
.hints kbd {
  font-family: inherit;
  color: var(--bone-dim);
}
.hints .players { color: var(--bone-dim); letter-spacing: 0.14em; text-transform: uppercase; }

/* --- in-game: camcorder HUD ------------------------------------------------------------------- */

.hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  overflow: clip;
  pointer-events: none;
  color: var(--osd);
  font-family: var(--mono);
  font-size: clamp(13px, 1.45vw, 21px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow:
    0 0 1px rgba(255, 255, 255, 0.55),
    0 0 7px rgba(225, 235, 220, 0.28),
    1px 0 0 rgba(255, 80, 60, 0.2),
    -1px 0 0 rgba(80, 180, 255, 0.16);
  animation: osd-jitter 7.3s steps(1, end) infinite;
  transition: opacity 1.2s ease;
}
/* The tape's soft edge, on each readout and not on .hud: a filter on the whole screen made the
   compositor blur every pixel every frame, about 12% of a frame on a slow graphics chip. */
.hud-tl, .hud-tr, .hud-bl, .hud-br, .hud-frame .corner, .prompt, .look-hint, .flock-list { filter: blur(0.25px); }
.hud.fade-in { opacity: 0; }
@keyframes osd-jitter {
  0% { transform: none; }
  61% { transform: translate(1px, 0); }
  62% { transform: none; }
  88% { transform: translate(-1px, 1px); }
  89% { transform: translate(0, -1px); }
  90.5% { transform: none; }
}
.hud-frame { position: absolute; inset: 3.2vmin; opacity: 0.55; }
.hud-frame .corner { width: 3.2vmin; height: 3.2vmin; border-color: rgba(238, 241, 230, 0.55); }
.hud-tl, .hud-tr, .hud-bl, .hud-br { position: absolute; display: grid; gap: 0.35em; }
.hud-tl { top: 6.4vmin; left: 6.4vmin; }
.hud-tr { top: 6.4vmin; right: 6.4vmin; text-align: right; justify-items: end; }
.hud-bl { bottom: 6.4vmin; left: 6.4vmin; }
.hud-br { bottom: 6.4vmin; right: 6.4vmin; text-align: right; justify-items: end; }

.rec { display: inline-flex; align-items: center; gap: 0.55em; font-weight: 600; }
.rec-dot {
  width: 0.72em;
  height: 0.72em;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0.5em rgba(224, 65, 47, 0.75);
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0; }
}
.tape, .date, .flock-tag, .oil-sub { font-size: 0.72em; opacity: 0.82; }
/* the role tag and Quiet share a row, so Quiet coming and going never moves the role */
.hud-tags { display: flex; gap: 0.6em; justify-self: start; margin-top: 0.35em; }
.quiet-tag, .role-tag, .can-tag {
  padding: 0.05em 0.45em;
  border: 1.5px solid currentColor;
  font-size: 0.72em;
}
.can-tag { justify-self: start; }
.clock { font-size: 1.12em; }

/* MIC: how far my own noise carries, five camcorder level bars, the top two in REC red */
.mic { display: inline-flex; align-items: flex-end; gap: 0.55em; font-size: 0.72em; opacity: 0.86; }
.mic-bars { display: inline-flex; align-items: flex-end; gap: 0.18em; height: 0.92em; }
.mic-bars i { width: 0.34em; background: currentColor; opacity: 0.14; transition: opacity 0.08s; }
.mic-bars i:nth-child(1) { height: 28%; }
.mic-bars i:nth-child(2) { height: 46%; }
.mic-bars i:nth-child(3) { height: 64%; }
.mic-bars i:nth-child(4) { height: 82%; }
.mic-bars i:nth-child(5) { height: 100%; }
.mic-bars i.on { opacity: 1; }
.mic-bars i:nth-child(n + 4) { background: var(--rec); }
.mic-bars i:nth-child(n + 4).on { box-shadow: 0 0 0.45em rgba(224, 65, 47, 0.6); }

.brood { font-size: 0.82em; }
.brood.drop { animation: blink 0.9s steps(1, end) 3; }

.oil { display: flex; align-items: center; gap: 0.7em; }
.battery {
  position: relative;
  display: inline-flex;
  gap: 0.14em;
  width: 2.5em;
  height: 1.12em;
  padding: 0.14em;
  border: 2px solid currentColor;
  box-shadow: 0 0 6px rgba(225, 235, 220, 0.2);
}
.battery::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -0.32em;
  width: 0.2em;
  height: 0.45em;
  transform: translateY(-50%);
  background: currentColor;
}
.battery i { flex: 1; background: currentColor; transition: opacity 0.3s; }
.battery i.off { opacity: 0.08; }
.oil.low .battery, .oil.low .oil-text { animation: blink 0.9s steps(1, end) infinite; }
.oil.out .battery i { opacity: 0.08; }
.lantern-state { font-size: 0.82em; }
.lantern-state.alert { animation: blink 1.1s steps(1, end) infinite; }

.prompt {
  position: absolute;
  left: 50%;
  bottom: 19vh;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.8em;
  padding: 0.3em 0.75em 0.3em 0.4em;
  background: rgba(0, 0, 0, 0.42);
  white-space: nowrap;
  font-size: 0.86em;
}
.prompt kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  height: 1.7em;
  border: 1.5px solid currentColor;
  font-family: inherit;
  font-weight: 600;
}
/* M3: a rescue's progress fills the prompt's words (the only progress shown anywhere); a spirit's
   flicker that is cooling greys out */
.prompt[data-hold] .prompt-text {
  color: transparent;
  background: linear-gradient(90deg, var(--osd) calc(var(--hold, 0) * 100%), rgba(238, 241, 230, 0.34) 0);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: none;
}
.prompt[data-cool] { opacity: 0.42; }
/* M3: taken, the tape goes black (the REC dot keeps blinking over it); out for the night, the REC
   dot is hollow: the camcorder still runs, nobody is in front of it */
.veil { position: absolute; inset: 0; background: #000; }
.hud[data-spirit] .rec-dot {
  box-sizing: border-box;
  background: transparent;
  border: 1.5px solid var(--rec);
  box-shadow: none;
}
.look-hint {
  position: absolute;
  left: 50%;
  top: calc(6.4vmin + 0.2em);
  transform: translateX(-50%);
  font-size: 0.66em;
  letter-spacing: 0.24em;
  white-space: nowrap;
  animation: breathe 2.8s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.78; }
}

.flock-list {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  min-width: min(440px, 86vw);
  padding: 1.1em 1.4em 1.2em;
  border: 1px solid rgba(238, 241, 230, 0.28);
  background: rgba(4, 6, 5, 0.68);
  font-size: 0.82em;
}
.flock-head {
  display: flex;
  justify-content: space-between;
  gap: 2em;
  padding-bottom: 0.6em;
  margin-bottom: 0.5em;
  border-bottom: 1px solid rgba(238, 241, 230, 0.22);
  opacity: 0.85;
}
.flock-row {
  display: grid;
  grid-template-columns: 1.1em 1fr auto;
  align-items: center;
  gap: 0.9em;
  padding: 0.38em 0;
}
.swatch {
  width: 0.9em;
  height: 0.9em;
  border: 1px solid rgba(238, 241, 230, 0.6);
}
.flock-row .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flock-row .you { opacity: 0.55; margin-left: 0.6em; }
.flock-row .meta { opacity: 0.8; font-size: 0.86em; display: inline-flex; gap: 1em; }
.flock-row .has-lantern { color: var(--accent); text-shadow: 0 0 8px rgba(255, 179, 71, 0.45); }
.flock-row .followers { opacity: 0.72; }
.brood-line {
  margin-top: 0.5em;
  padding-top: 0.6em;
  border-top: 1px solid rgba(238, 241, 230, 0.22);
  opacity: 0.8;
  font-size: 0.9em;
}

.toasts {
  position: fixed;
  z-index: 12;
  top: 13vh;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.5em;
  pointer-events: none;
  font-family: var(--mono);
  font-size: clamp(12px, 1.2vw, 17px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--osd);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5), 0 0 8px rgba(225, 235, 220, 0.3), 0 1px 2px rgba(0, 0, 0, 0.9);
}
.toast {
  padding: 0.2em 0.7em;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-4px);
  filter: blur(2px);
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: none; filter: none; }
.toast.leaving { opacity: 0; filter: blur(3px); transition-duration: 1.2s; }

/* --- debug overlay --------------------------------------------------------------------------- */

.debug {
  position: fixed;
  z-index: 15;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 8px 11px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b4c2b0;
  font: 11px/1.45 var(--mono);
  white-space: pre;
  pointer-events: none;
}

/* --- menu (Esc) ------------------------------------------------------------------------------ */

.menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: rgba(3, 5, 4, 0.8);
  backdrop-filter: blur(3px) saturate(0.7);
  -webkit-backdrop-filter: blur(3px) saturate(0.7);
  animation: menu-in 0.25s ease both;
}
@keyframes menu-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.menu-panel {
  width: min(860px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 48px;
}
.menu h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.7vw, 34px);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #d6d9cd;
  text-wrap: balance;
}
.menu .sub { margin: 0 0 30px; color: var(--bone-dim); font-size: 13px; }
.menu .section-label {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bone-faint);
}
.room-code {
  margin: 0 0 22px;
  font-size: clamp(44px, 6vw, 68px);
  line-height: 1;
  letter-spacing: 0.32em;
  color: #e7eadf;
  text-shadow: 0 0 18px rgba(200, 215, 200, 0.18);
  user-select: all;
}
.invite { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 8px; }
.invite input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--bone);
  font-size: 13px;
  outline: none;
}
.invite input:focus { border-color: rgba(255, 179, 71, 0.6); }
.invite-local { margin: 0 0 4px; font-size: 11.5px; color: var(--bone-faint); overflow-wrap: anywhere; }
.invite-local span { color: var(--bone-dim); user-select: all; }
.copy-note { min-height: 1.4em; margin: 0 0 26px; font-size: 12px; color: var(--bone-dim); }
.menu-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.menu-actions .btn-primary { min-width: 170px; }

.controls-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px 18px;
  margin: 0 0 30px;
  font-size: 13px;
}
.controls-list dt { color: #dfe2d6; letter-spacing: 0.06em; white-space: nowrap; }
.controls-list dd { margin: 0; color: var(--bone-dim); }

.setting { display: grid; gap: 8px; margin-bottom: 20px; }
.setting-head { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim); }
.setting-head output { color: #dfe2d6; letter-spacing: 0.06em; }
.setting input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.setting input[type='range']::-webkit-slider-runnable-track { height: 2px; background: rgba(200, 210, 195, 0.25); }
.setting input[type='range']::-moz-range-track { height: 2px; background: rgba(200, 210, 195, 0.25); }
.setting input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 18px;
  margin-top: -8px;
  border: 1px solid #dfe2d6;
  border-radius: 1px;
  background: #0b100d;
}
.setting input[type='range']::-moz-range-thumb { width: 12px; height: 18px; border: 1px solid #dfe2d6; border-radius: 1px; background: #0b100d; }
.setting input[type='range']:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.segmented { display: inline-grid; grid-auto-flow: column; border: 1px solid var(--line); border-radius: 2px; width: max-content; }
.segmented button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--bone-dim);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--line); }
.segmented button[aria-pressed='true'] { background: rgba(200, 210, 195, 0.1); color: #e6e9de; }
.segmented button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.setting .note { font-size: 11.5px; color: var(--bone-faint); }

/* --- lost the signal ------------------------------------------------------------------------- */

.lost {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  overflow: clip;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 3, 3, 0.93);
  animation: menu-in 0.6s ease both;
}
.lost .grain { opacity: 0.075; mix-blend-mode: screen; filter: contrast(1.8); animation-duration: 0.3s; }
.lost-panel { position: relative; text-align: center; max-width: 820px; }
.lost-kicker { margin: 0 0 18px; font-size: 12px; letter-spacing: 0.4em; color: var(--bone-faint); }
.lost-title {
  margin: 0;
  font-size: clamp(26px, 5vw, 58px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-wrap: balance;
  color: #e9ece2;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.6), 0 0 22px rgba(220, 230, 215, 0.25), 3px 0 0 rgba(255, 70, 50, 0.25), -3px 0 0 rgba(70, 170, 255, 0.2);
  animation: lost-glitch 4.2s steps(1, end) infinite;
}
@keyframes lost-glitch {
  0% { transform: none; opacity: 1; }
  71% { transform: translate(-3px, 0) skewX(-6deg); opacity: 0.8; }
  72% { transform: translate(2px, 1px); opacity: 1; }
  73.5% { transform: none; }
  90% { opacity: 0.55; }
  91% { opacity: 1; }
}
.lost-text { margin: 22px auto 34px; max-width: 420px; color: var(--bone-dim); font-family: var(--serif); font-style: italic; font-size: 17px; }
.lost-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.lost-code { margin: 30px 0 0; font-size: 11px; letter-spacing: 0.26em; color: var(--bone-faint); text-transform: uppercase; }

/* --- small screens, reduced motion ------------------------------------------------------------ */

@media (max-width: 760px) {
  .menu-panel { grid-template-columns: 1fr; gap: 28px; }
  .hud-frame { display: none; }
}
@media (max-height: 640px) {
  .tagline { margin: 16px 0 24px; }
  .hints { margin-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .lobby-fog, .lobby-reeds .sway, .lobby-reeds .shiver, .lobby-reeds .ember, .title, .hud, .lost-title { animation: none !important; }
}

/* --- M4: the night's screens (#night): the dusk card and the summary ------------------------- */

.night {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  color: var(--osd);
  font-family: var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5), 0 0 7px rgba(225, 235, 220, 0.26), 0 1px 2px rgba(0, 0, 0, 0.9);
}
.night[data-screen="dusk"] ~ .toasts { top: 30vh; }
.hud .tape .ff { margin-left: 0.6em; letter-spacing: -0.1em; }

.dusk-card {
  position: absolute;
  top: 4.5vmin;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 52em);
  padding: 0.6em 1em 0.5em;
  display: grid;
  gap: 0.15em;
  font-size: clamp(11px, 1.05vw, 15px);
  background: rgba(4, 6, 5, 0.42);
  border-top: 1px solid rgba(238, 241, 230, 0.32);
  border-bottom: 1px solid rgba(238, 241, 230, 0.32);
}
.dusk-title { margin-bottom: 0.25em; color: var(--osd); }
.dusk-row {
  display: grid;
  grid-template-columns: 1.2em 13em 1fr 5.5em minmax(0, 14em);
  gap: 0.5em;
  color: var(--bone-dim);
  white-space: nowrap;
}
.dusk-row[data-lean] { color: var(--osd); }
.dusk-words, .dusk-lost { text-transform: none; letter-spacing: 0.06em; }
.dusk-count { overflow: hidden; text-overflow: ellipsis; text-transform: none; }
.dusk-who { display: flex; justify-content: space-between; gap: 1em; margin-top: 0.25em; }
.dusk-roles { text-transform: none; }
.dusk-waiting { color: var(--bone-dim); text-transform: none; }
.dusk-hint { color: var(--bone-faint); text-transform: none; letter-spacing: 0.06em; }
.dusk-spare:empty { display: none; }

.night-summary {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.2em;
  padding: 6vmin;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  font-size: clamp(12px, 1.15vw, 16px);
}
.summary-title { margin: 0; font: inherit; font-size: 1.15em; color: var(--osd); text-align: center; }
.summary-body {
  display: grid;
  gap: 0.35em;
  width: min(92vw, 56em);
  text-transform: none;
  letter-spacing: 0.05em;
  color: var(--bone);
}
.summary-line { display: flex; justify-content: space-between; gap: 1.5em; flex-wrap: wrap; }
.summary-flock { color: var(--osd); }
.summary-rows { display: grid; gap: 0.2em; margin-top: 0.5em; }
.summary-duck { display: grid; grid-template-columns: 9em 1fr; gap: 0.8em; }
.summary-who { text-transform: uppercase; color: var(--osd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.summary-what { color: var(--bone-dim); }
.summary-rule { border-top: 1px solid var(--line); margin: 0.4em 0 0.2em; }
.summary-award { color: var(--bone); }
.summary-failed { margin-top: 0.4em; color: var(--bone-dim); font-style: italic; }
.summary-foot { display: flex; align-items: center; gap: 1.4em; width: min(92vw, 56em); justify-content: flex-end; }
.summary-next { text-transform: uppercase; letter-spacing: 0.1em; }
.summary-ready { color: var(--bone-dim); }

@media (max-width: 640px) {
  .dusk-row { grid-template-columns: 1.2em 1fr 4.5em; }
  .dusk-words { display: none; }
  .dusk-count { grid-column: 2 / -1; }
  .summary-duck { grid-template-columns: 1fr; gap: 0; }
}

/* --- M5: voices. Tape text on translucent black, nothing warm but the REC dot's red; only ever shown
   in a voice room. No looping animation, and the wheel's ring is placed with transforms. ---------- */

/* the MIC label: a still red dot before it while I am sending to anyone */
.mic[data-tx="1"] .mic-label::before {
  content: '';
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.45em;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0.5em rgba(224, 65, 47, 0.75);
}
.flock-row .voice-flag { opacity: 0.72; }

/* what a wheel call said */
.captions {
  position: absolute;
  left: 50%;
  bottom: 11vh;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.2em;
  max-width: 76vw;
  font-size: 0.86em;
  filter: blur(0.25px);
}
.caption {
  max-width: 100%;
  padding: 0.1em 0.6em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.42);
}

/* the quack wheel: a point in the middle of the screen, everything placed from it */
.wheel {
  position: fixed;
  z-index: 13;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  color: #fff;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 2px #000, 0 1px 2px #000, 0 0 5px rgba(0, 0, 0, 0.8);
}
.wheel-disc {
  position: absolute;
  width: 380px;
  height: 380px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
}
.wheel-hub {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 11px;
  white-space: nowrap;
  opacity: 0.55;
}
.wheel[data-pick]:not([data-pick="-1"]) .wheel-hub { visibility: hidden; }
.wheel-item {
  position: absolute;
  padding: 0.15em 0.5em;
  white-space: nowrap;
}
.wheel-item::before {
  content: attr(data-key);
  margin-right: 0.5em;
  font-size: 0.8em;
  opacity: 0.6;
}
.wheel-item.picked { background: #fff; color: #000; text-shadow: none; }

/* the card that says voice exists: the dusk card's look, for rooms with no dusk */
.voice-card {
  position: fixed;
  z-index: 11;
  top: calc(6.4vmin + 2em);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 52em);
  padding: 0.5em 1em;
  display: grid;
  gap: 0.2em;
  pointer-events: none;
  font-family: var(--mono);
  font-size: clamp(11px, 1.05vw, 15px);
  letter-spacing: 0.06em;
  color: var(--osd);
  text-shadow: 0 0 1px rgba(255, 255, 255, 0.5), 0 1px 2px rgba(0, 0, 0, 0.9);
  background: rgba(4, 6, 5, 0.42);
  border-top: 1px solid rgba(238, 241, 230, 0.32);
  border-bottom: 1px solid rgba(238, 241, 230, 0.32);
}
.voice-card:not([hidden]) ~ .toasts { top: 24vh; }
.voice-card-row { display: flex; flex-wrap: wrap; gap: 0.2em 1.2em; }
.voice-card-label { letter-spacing: 0.1em; }
.voice-card-tip { margin-left: auto; color: var(--bone-dim); }
.voice-card-copy { color: var(--bone-dim); }
.invite-voice { margin: 0 0 4px; font-size: 11.5px; color: var(--bone-dim); }
.dusk-spare { color: var(--bone-dim); text-transform: none; letter-spacing: 0.06em; white-space: pre-wrap; }
.summary-voice-note { flex: 1; order: -1; color: var(--bone-dim); text-transform: none; letter-spacing: 0.05em; }
.summary-voice-note:empty { display: none; }

/* the Esc menu: the voice lines of the controls list show only with a Voice section */
.controls-list .voice-only { display: none; }
.menu-panel:has(.voice-panel) .controls-list .voice-only { display: block; }
.menu-panel > .voice-panel { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); }
.voice-panel ::selection { background: rgba(200, 210, 195, 0.3); }
.voice-panel :focus-visible,
.voice-panel .segmented button:focus-visible,
.voice-panel .setting input[type='range']:focus-visible { outline: 1px solid var(--osd); outline-offset: 2px; }
.voice-panel .segmented button:disabled { opacity: 0.4; cursor: default; }
.voice-panel .note { display: block; font-size: 11.5px; color: var(--bone-faint); }
.voice-btn {
  justify-self: start;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--bone-dim);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
}
.voice-btn:hover:not(:disabled) { border-color: rgba(200, 210, 195, 0.42); color: #e6e9de; }
.voice-btn:disabled { opacity: 0.45; cursor: default; }
.voice-btn[aria-pressed='true'] { background: rgba(200, 210, 195, 0.1); color: #e6e9de; }
.voice-select {
  max-width: 100%;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--fog);
  color: var(--bone);
  font-size: 12px;
}
.voice-level { height: 6px; overflow: hidden; background: rgba(200, 210, 195, 0.14); }
.voice-level i { display: block; height: 100%; background: var(--bone); transform-origin: left center; }
.voice-check label { display: flex; align-items: center; gap: 0.7em; font-size: 13px; color: var(--bone); cursor: pointer; }
.voice-check input { margin: 0; accent-color: var(--bone); }
.voice-flock { display: grid; gap: 10px; margin-bottom: 20px; }
.voice-nobody { margin: 0; }
.voice-peer { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(90px, 1fr) 3.4em 6.5em 7em; align-items: center; gap: 6px 12px; font-size: 13px; }
.voice-peer .voice-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-status { display: block; font-size: 11.5px; color: var(--bone-faint); white-space: normal; }
.voice-peer-slider { margin-bottom: 0; }
.voice-peer > .voice-btn { justify-self: stretch; padding: 0 6px; }
.voice-peer-volume { color: var(--bone-dim); font-size: 12px; text-align: right; }
.voice-report { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.voice-report label { display: inline-flex; align-items: center; gap: 0.6em; font-size: 12px; color: var(--bone-dim); }
.voice-privacy { margin: 0; line-height: 1.55; }
@media (max-width: 760px) {
  .voice-peer { grid-template-columns: minmax(0, 1fr) 3.4em 6.5em 7em; }
  .voice-peer .voice-who { grid-column: 1 / -1; }
}
