/* Who Noticed — a kitchen at rest after breakfast.
 *
 * Morning window light on the left, teal tiles on the right. The picture
 * takes the middle of the television; phones stay dark until it is gone.
 */

:root {
  --bg: #0d0c0a;
  --surface: #1a1814;
  --surface-2: #262218;
  --ink: #f7f1e4;
  --paper: #f7f1e4;
  --muted: #9aa392;
  --line: rgba(247, 241, 228, .14);
  --coral: #3fb2a6;
  --aqua: #3fb2a6;
  --blue: #5a78ec;
  --yellow: #f0c14b;
  --gold-soft: #c9a24a;
  --green: #35c98a;
  --red: #ff6046;
  --backdrop: url("/assets/backdrops/who-noticed-kitchen.webp");
  --grain: .04;
  --glow: rgba(240, 193, 75, .2);
  --btn-top: #4ec4b8;
  --btn-base: #1f7a72;
  --btn-glow: rgba(63, 178, 166, .35);
  --join-radius: 12px;
  --join-bulbs: 0;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  position: relative;
  color: var(--ink);
  background: var(--bg);
  font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--backdrop) center / cover no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
  body::after { display: none; }
}

::selection { background: var(--yellow); color: #1b1206; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: "Space Grotesk", sans-serif; letter-spacing: -.06em; }
h1 { text-shadow: 0 0 60px var(--glow); }

.shell { width: min(calc(100% - 36px), 1120px); margin-inline: auto; }
.screen { display: none; padding-bottom: 60px; }
.screen.is-active { display: block; }

.top {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.top-right { display: flex; align-items: center; gap: 14px; }

.pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(247,239,227,.06);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.kicker::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 10px;
  background: var(--yellow);
  box-shadow: 0 0 12px var(--glow);
}

.button {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}
.button:disabled { opacity: .4; cursor: default; }
.button-primary {
  color: #fff;
  background: linear-gradient(180deg, var(--btn-top) 0%, var(--coral) 55%, var(--btn-base) 100%);
  box-shadow: 0 10px 30px var(--btn-glow);
}
.button-dark { color: #1b1206; background: var(--paper); }
.button-ghost { border: 1px solid var(--line); background: rgba(247,239,227,.08); color: var(--paper); }
.button-wide { width: 100%; }
.button-small { padding: 8px 16px; min-height: 0; font-size: 14px; }
.link-button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: underline;
}

/* ------------------------------------------------------------------ setup */
/* One centred column in the dark middle of the room, the same idea as
   Timeliner: Movies. A full-width settings grid left the headline sitting
   over a lamp and the actions wandering off to one side. */

.setup { padding-top: 52px; text-align: center; }
.setup .shell { width: min(calc(100% - 36px), 760px); }
/* Waiting lobbies: invite card | seats. Shared chrome owns the card look. */
#screen-lobby.setup .shell { width: min(calc(100% - 36px), 980px); }
.kicker .pill { letter-spacing: .04em; }
.setup h1 { margin-bottom: 16px; font-size: clamp(38px, 6vw, 62px); line-height: .96; }
.setup .kicker { justify-content: center; }
.lede { max-width: 52ch; margin-inline: auto; color: var(--muted); font-size: 18px; }

.setup-grid {
  margin: 38px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}
.setup-grid .field { width: min(100%, 480px); }
.field label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.hint { margin: 8px auto 0; max-width: 46ch; color: var(--muted); font-size: 14px; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 5px;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.segmented button {
  min-width: 56px;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 15px;
  font-weight: 800;
  color: var(--muted);
}
.segmented button.on { background: var(--yellow); color: #1b1206; }

.setup-actions { margin-top: 34px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.setup-actions .button { min-width: 210px; }
.note { margin: 22px auto 0; max-width: 48ch; color: var(--muted); font-size: 14px; }

.mode-chosen {
  margin: 0 0 26px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 15px;
}
.mode-chosen a { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }

.host-identity {
  margin: 0;
  min-height: 54px;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
}
.host-identity b { font-size: 17px; }
.host-identity a { margin-left: auto; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

.form-error {
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(224,64,46,.4);
  background: rgba(224,64,46,.14);
  color: #ff9b8b;
  font-weight: 700;
}
.join-form { max-width: 420px; margin-inline: auto; text-align: left; }
.join-form .field { margin-bottom: 16px; }
.join-form label { display: block; margin-bottom: 8px; font-weight: 800; font-size: 14px; }
.join-form input,
.text-input,
.name-fields input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--paper);
  font: inherit;
  font-size: 17px;
}
.name-fields { margin-top: 24px; display: grid; gap: 12px; }
.join-form input::placeholder, .text-input::placeholder { color: rgba(247,239,227,.35); }

.open-tables-title { margin: 40px 0 6px; font-size: 24px; }
.open-table-row { max-width: 560px; margin-inline: auto; text-align: left; }
.open-table-row b { flex: none; }
.open-table-row em { flex: 1; }
.table-join-btn { text-decoration: none; padding: 8px 16px; min-height: 0; }

/* ------------------------------------------------------------------ lobby */

.lobby-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-top: 10px;
  text-align: left;
}
.lobby-share { text-align: center; }
.lobby-cols .note { margin: 12px 0 0; max-width: none; }
.lobby-cols .setup-actions { justify-content: flex-start; margin-top: 18px; }
.join-code {
  position: relative;
  font-family: "Space Grotesk", sans-serif;
  font-size: 60px;
  letter-spacing: .16em;
  text-indent: .16em;
  padding: 26px;
  border-radius: var(--join-radius, 18px);
  border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 100%);
  color: var(--yellow);
  text-align: center;
  text-shadow: 0 0 28px var(--glow);
  box-shadow: inset 0 0 40px var(--glow), 0 20px 50px rgba(0,0,0,.45);
}
.join-code::before, .join-code::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 6px;
  background-image: radial-gradient(circle, var(--yellow) 40%, transparent 45%);
  background-size: 18px 6px;
  background-repeat: repeat-x;
  opacity: var(--join-bulbs, 1);
}
.join-code::before { top: 9px; }
.join-code::after { bottom: 9px; }

.qr-box { margin-top: 14px; display: flex; justify-content: center; }
.qr-box img { border-radius: 14px; border: 1px solid var(--line); background: #fff; margin-inline: auto; }

.lobby-seats { display: grid; gap: 8px; margin-bottom: 10px; }
/* A television with eight or ten empty seats must not push Start off the
   screen. The list scrolls; Start and Cancel stay in view. */
.board .lobby-seats {
  max-height: min(46vh, 24rem);
  overflow: auto;
}
.seat-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}
.seat-chip b { flex: 1; }
.seat-chip em { font-style: normal; font-weight: 700; color: var(--muted); font-size: 13px; }
.seat-chip.is-empty { color: var(--muted); border-style: dashed; background: transparent; justify-content: center; }
.seat-chip.is-in { border-color: rgba(53,201,138,.55); background: rgba(53,201,138,.14); }
.seat-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.glow-seat { outline: 3px solid var(--yellow); outline-offset: 0; }

/* -------------------------------------------------------------------- game */

body.playing::before { opacity: .55; }
.game-shell {
  min-height: calc(100dvh - var(--chrome-height));
  display: flex;
  flex-direction: column;
}
.screen.game .shell { width: min(calc(100% - 36px), 860px); }
.stage {
  flex: 1;
  padding: 6px 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
#duelBox, #soloBox {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.paused-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 12px;
  margin-bottom: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--yellow) 38%, transparent);
  background: color-mix(in srgb, var(--yellow) 10%, transparent);
  width: 100%;
}
.paused-bar strong { color: var(--yellow); }
.paused-bar span { color: rgba(247,239,227,.65); font-size: 14px; }

.duel-head { text-align: center; width: 100%; }
.duel-q {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(28px, 4.6vw, 46px);
  letter-spacing: -.04em;
  line-height: 1.02;
  text-shadow: 0 0 60px var(--glow);
}
.duel-sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.duel-clock {
  position: relative;
  height: 6px;
  margin: 0 auto;
  width: min(100%, 620px);
  border-radius: 999px;
  background: rgba(247,239,227,.1);
  overflow: hidden;
}
.duel-clock span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), var(--coral));
  transition: width .25s linear;
}
.duel-clock.is-low span { background: var(--red); }

/* Choice tiles: compact equal buttons, not More or Less photo cards. */
.choice-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
}
.choice-tiles .opt {
  min-width: 8.5rem;
  flex: 1 1 10rem;
  max-width: 16rem;
  min-height: 64px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--paper);
  text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.choice-tiles .opt:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(247,239,227,.34);
}
.choice-tiles .opt:disabled { cursor: default; }
.choice-tiles .opt-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.choice-tiles .opt-name {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(16px, 2vw, 20px);
  letter-spacing: -.02em;
  line-height: 1.2;
}
.choice-tiles .opt-value {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  color: var(--yellow);
}
.choice-tiles .opt.is-mine {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--yellow) 45%, transparent), 0 16px 40px rgba(0,0,0,.4);
}
.choice-tiles .opt.is-won {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(53,201,138,.5);
}
.choice-tiles .opt.is-lost { opacity: .55; }

.word-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}
.word-grid .opt {
  min-width: 0;
  max-width: none;
  min-height: 68px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--paper);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.word-grid .opt-name { font-size: 15px; }
.word-grid .opt.is-mine {
  border-color: var(--yellow);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--yellow) 45%, transparent);
}

.look-pic {
  display: block;
  width: 100%;
  max-width: 880px;
  max-height: 68vh;
  margin-inline: auto;
  object-fit: contain;
  border-radius: 16px;
  background: #111;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}

.used-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.used-line span {
  background: var(--surface-2);
  padding: .35rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}

.stage .join-form {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.stage .join-form .button { align-self: center; min-width: 210px; }
.waiting-note {
  margin: 0 auto;
  max-width: 46ch;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.payoff {
  margin: 0 auto;
  width: 100%;
  max-width: 62ch;
  padding: 20px 24px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--yellow) 30%, transparent);
  background:
    radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--yellow) 13%, transparent), transparent 62%),
    var(--surface);
  text-align: center;
  font-size: 18px;
}
.payoff p { margin: 0; }
.payoff .verdict {
  display: block;
  margin-bottom: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 22px;
  letter-spacing: -.02em;
}
.payoff .verdict.is-right { color: var(--green); }
.payoff .verdict.is-wrong { color: var(--red); }

.answer-strip {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.scoreboard {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 480px;
}
.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}
.score-row b { flex: 1; font-weight: 700; }
.score-row em {
  font-style: normal;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  color: var(--yellow);
}

/* ------------------------------------------------------------------ board */

.board .duel-q { font-size: clamp(34px, 4.4vw, 62px); }
.board .look-pic { max-height: 72vh; }
.board .word-grid { max-width: 880px; }
.board .choice-tiles .opt-name { font-size: clamp(18px, 2.2vw, 24px); }
.board .score-row { padding: 14px 20px; }
.board .score-row em { font-size: 24px; }

/* ----------------------------------------------------------------- finish */

.finish { padding-top: 52px; text-align: center; }
.finish .shell { width: min(calc(100% - 36px), 760px); }
.finish h1 { font-size: clamp(34px, 5vw, 54px); }
.finish-board {
  display: grid;
  gap: 10px;
  margin: 26px auto;
  text-align: left;
  max-width: 480px;
}
.finish-board .score-row { max-width: none; }
.finish-signup {
  margin: 22px 0 6px;
  padding: 26px 24px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--yellow) 34%, transparent);
  background:
    radial-gradient(120% 140% at 50% 0%, color-mix(in srgb, var(--yellow) 16%, transparent), transparent 62%),
    var(--surface);
  text-align: center;
}
.finish-signup h2 { margin: 0 0 8px; font-size: clamp(21px, 3.4vw, 27px); }
.finish-signup p { margin: 0 auto 18px; max-width: 46ch; color: var(--muted); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .lobby-cols { grid-template-columns: 1fr; }
  .join-code { font-size: 44px; }
  .choice-tiles .opt { max-width: none; }
  .word-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .word-grid .opt { min-height: 56px; padding: 8px 4px; }
  .word-grid .opt-name { font-size: 13px; }
  .payoff { padding: 16px; font-size: 16px; }
}

.join-code {
  box-shadow: inset 0 0 0 1px rgba(240,193,75,.2), 0 20px 50px rgba(0,0,0,.45);
}
.look-pic {
  border: 1px solid color-mix(in srgb, var(--aqua) 28%, transparent);
  box-shadow: 0 24px 80px rgba(63, 178, 166, .16);
}
