/* ==========================================================================
   Cloak & Dagger — screens, seats, cards, timer
   ========================================================================== */

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-4);
  padding: var(--gap-4) 0;
  border-bottom: 1px solid var(--line-soft);
}

.masthead__title {
  font-size: 20px;
  letter-spacing: 0.01em;
}

.masthead__title em {
  font-style: normal;
  color: var(--brass-400);
}

.masthead__meta {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-low);
}

.pollen-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pollen-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brass-400);
}

.pollen-dot--live::before {
  background: var(--sage-400);
  animation: pulse-ring 2.4s infinite;
}

/* --------------------------------------------------------------------------
   Title screen
   -------------------------------------------------------------------------- */

.title {
  min-height: calc(100dvh - 90px);
  display: grid;
  align-content: center;
  gap: var(--gap-5);
  padding: var(--gap-6) 0;
}

.title__crest {
  width: 62px;
  height: 62px;
  color: var(--brass-400);
}

.title__name {
  font-size: clamp(42px, 9vw, 96px);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

.title__name span {
  display: block;
  color: var(--text-low);
  font-size: 0.185em;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-top: 1.2em;
  font-family: var(--font-body);
  font-weight: 400;
}

.title__lede {
  max-width: 54ch;
  font-size: clamp(16px, 2.1vw, 19px);
  color: var(--text-mid);
  line-height: 1.6;
}

.title__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-3);
  align-items: center;
}

.title__rule {
  height: 1px;
  background: linear-gradient(90deg, var(--brass-500), transparent);
  max-width: 320px;
}

.title__credits {
  font-size: 13px;
  color: var(--text-low);
}

.title__credits a {
  color: var(--brass-400);
  text-decoration-color: rgb(195 157 84 / 35%);
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Setup
   -------------------------------------------------------------------------- */

.setup {
  display: grid;
  gap: var(--gap-5);
  padding: var(--gap-6) 0 var(--gap-7);
  max-width: 720px;
}

.setup__grid {
  display: grid;
  gap: var(--gap-4);
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--gap-2);
}

.seat {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  transition: border-color 0.16s var(--ease);
}

.seat:focus-within {
  border-color: var(--brass-500);
}

.seat__num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-low);
  min-width: 16px;
}

.seat .input {
  background: transparent;
  border: none;
  padding: 2px 0;
  font-size: 15px;
}

.seat .input:focus {
  background: transparent;
}

.counter {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-3);
  background: var(--ink-900);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
}

.counter__value {
  font-family: var(--font-mono);
  font-size: 18px;
  min-width: 2ch;
  text-align: center;
  color: var(--brass-400);
}

.counter button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--ink-750);
  font-size: 17px;
  line-height: 1;
  transition: background 0.16s var(--ease);
}

.counter button:hover {
  background: var(--ink-600);
}

/* Pollen wallet / BYOP */

.wallet {
  display: grid;
  gap: var(--gap-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-900);
  overflow: hidden;
}

.wallet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-3);
  padding: var(--gap-3) var(--gap-4);
  background: var(--ink-800);
  border-bottom: 1px solid var(--line);
}

.wallet__body {
  padding: var(--gap-4);
  display: grid;
  gap: var(--gap-3);
}

.wallet[data-state="ready"] .wallet__head {
  background: linear-gradient(90deg, rgb(111 158 122 / 14%), var(--ink-800));
}

.wallet__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-low);
}

.wallet[data-state="ready"] .wallet__status {
  color: var(--sage-400);
}

.wallet__status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-low);
}

.wallet[data-state="ready"] .wallet__status::before {
  background: var(--sage-400);
}

.balance {
  display: flex;
  align-items: baseline;
  gap: var(--gap-2);
}

.balance__value {
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--brass-400);
  line-height: 1;
}

.balance__unit {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-low);
}

/* --------------------------------------------------------------------------
   Game stage
   -------------------------------------------------------------------------- */

.stage {
  display: grid;
  gap: var(--gap-4);
  padding: var(--gap-5) 0 var(--gap-7);
  animation: rise 0.5s var(--ease) both;
}

.stage__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gap-3);
  padding-bottom: var(--gap-3);
  border-bottom: 1px solid var(--line-soft);
}

.stage__title {
  font-size: clamp(28px, 5vw, 42px);
}

.stage__progress {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-low);
}

/* Narration: the AI host speaks here */

.narration {
  position: relative;
  display: grid;
  gap: var(--gap-3);
  padding: var(--gap-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgb(195 157 84 / 5%), transparent 55%),
    var(--ink-850);
  overflow: hidden;
}

.narration[data-speaking="true"]::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgb(195 157 84 / 30%);
}

.narration__speaker {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
}

.narration__portrait {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--brass-500);
  background: var(--ink-700);
  flex: none;
}

.narration__who {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-400);
}

.narration__text {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vw, 23px);
  line-height: 1.5;
  color: var(--text-hi);
  max-width: 68ch;
}

.narration__text p + p {
  margin-top: 0.8em;
}

.narration__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-2);
  align-items: center;
}

.speech-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--gap-2);
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-900);
  font-size: 13px;
  color: var(--text-mid);
  transition: border-color 0.16s var(--ease);
}

.speech-toggle[data-on="true"] {
  border-color: var(--brass-500);
  color: var(--brass-300);
}

/* Timer */

.timer {
  display: grid;
  gap: var(--gap-3);
  padding: var(--gap-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink-850);
}

.timer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-4);
}

.timer__clock {
  font-family: var(--font-mono);
  font-size: clamp(38px, 9vw, 62px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--brass-400);
  font-variant-numeric: tabular-nums;
}

.timer[data-urgent="true"] .timer__clock {
  color: var(--blood-300);
  animation: pulse-ring 1.1s infinite;
}

.timer__track {
  height: 3px;
  border-radius: 2px;
  background: var(--ink-600);
  overflow: hidden;
}

.timer__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass-500), var(--brass-300));
  transition: width 1s linear;
}

.timer[data-urgent="true"] .timer__fill {
  background: linear-gradient(90deg, var(--blood-500), var(--blood-300));
}

/* --------------------------------------------------------------------------
   Seats / player chips
   -------------------------------------------------------------------------- */

.seats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: var(--gap-2);
}

.chip {
  display: flex;
  align-items: center;
  gap: var(--gap-3);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-850);
  text-align: left;
  width: 100%;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.chip:hover:not(:disabled) {
  border-color: var(--ink-500);
  transform: translateY(-1px);
}

.chip[data-selected="true"] {
  border-color: var(--brass-500);
  background: rgb(195 157 84 / 9%);
}

.chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chip__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-900);
  background: var(--brass-400);
}

.chip__name {
  font-size: 14.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip__sub {
  font-size: 12px;
  color: var(--text-low);
}

/* Result variants */
.chip[data-verdict="culprit"] {
  border-color: var(--blood-400);
  background: rgb(168 50 47 / 12%);
}

.chip[data-verdict="vindicated"] {
  border-color: var(--sage-500);
  background: rgb(111 158 122 / 10%);
}

/* --------------------------------------------------------------------------
   Pass-the-device privacy curtain
   -------------------------------------------------------------------------- */

.curtain {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--gap-4);
  padding: var(--gap-5);
  text-align: center;
  background: radial-gradient(80% 60% at 50% 40%, var(--ink-800), var(--ink-900));
  animation: fade 0.28s var(--ease) both;
}

.curtain__title {
  font-size: clamp(26px, 6vw, 40px);
}

.curtain__note {
  max-width: 44ch;
  color: var(--text-mid);
}

.curtain__actions {
  display: grid;
  gap: var(--gap-2);
  justify-items: center;
}

/* The private card */

.dossier {
  width: min(560px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--brass-500);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-900));
  box-shadow: var(--shadow-deep);
  overflow: hidden;
}

.dossier__seal {
  display: grid;
  place-items: center;
  padding: var(--gap-5) var(--gap-4);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(60% 100% at 50% 0%, rgb(168 50 47 / 18%), transparent 70%),
    var(--ink-850);
}

.dossier__role {
  font-family: var(--font-display);
  font-size: clamp(30px, 7vw, 46px);
  line-height: 1;
  letter-spacing: -0.01em;
}

.dossier__role[data-role="culprit"] {
  color: var(--blood-300);
}

.dossier__role[data-role="innocent"] {
  color: var(--sage-400);
}

.dossier__body {
  padding: var(--gap-4);
  display: grid;
  gap: var(--gap-3);
  font-size: 15px;
  line-height: 1.6;
}

.dossier__brief {
  color: var(--text-mid);
  border-left: 2px solid var(--brass-500);
  padding-left: var(--gap-3);
}

.dossier__foot {
  padding: var(--gap-3) var(--gap-4) var(--gap-4);
}

/* --------------------------------------------------------------------------
   Verdict / awards
   -------------------------------------------------------------------------- */

.awards {
  display: grid;
  gap: var(--gap-2);
}

.award {
  display: flex;
  gap: var(--gap-3);
  padding: var(--gap-3) var(--gap-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-850);
  animation: rise 0.45s var(--ease) both;
}

.award__icon {
  font-size: 20px;
  flex: none;
  line-height: 1.4;
}

.award__title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-400);
}

.award__body {
  font-size: 14.5px;
  color: var(--text-mid);
  margin-top: 2px;
}

.tally {
  display: grid;
  gap: var(--gap-2);
}

.tally__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--gap-3);
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-850);
}

.tally__bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 2px;
  background: var(--ink-600);
  overflow: hidden;
}

.tally__bar span {
  display: block;
  height: 100%;
  background: var(--brass-500);
}

.tally__count {
  font-family: var(--font-mono);
  color: var(--brass-400);
}

/* Poster */

.poster {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  display: block;
  background: var(--ink-800);
}

/* --------------------------------------------------------------------------
   Toast + overlay
   -------------------------------------------------------------------------- */

.toast-rail {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: var(--gap-2);
  width: min(440px, calc(100vw - 32px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--gap-2);
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--ink-750);
  box-shadow: var(--shadow-lift);
  font-size: 14px;
  animation: rise 0.3s var(--ease) both;
}

.toast[data-kind="error"] {
  border-color: var(--blood-500);
}

.toast[data-kind="ok"] {
  border-color: var(--sage-500);
}

/* Busy overlay with honest, specific status text */

.busy {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--gap-4);
  padding: var(--gap-5);
  text-align: center;
  background: rgb(11 10 12 / 88%);
  backdrop-filter: blur(6px);
  animation: fade 0.2s var(--ease) both;
}

.busy__mark {
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink-600);
  border-top-color: var(--brass-400);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.busy__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass-400);
}

.busy__note {
  color: var(--text-mid);
  max-width: 40ch;
  font-size: 14.5px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.foot {
  padding: var(--gap-5) 0 var(--gap-6);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-3);
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-low);
}

.foot a {
  color: var(--brass-400);
  text-decoration-color: rgb(195 157 84 / 35%);
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 620px) {
  :root {
    --gap-5: 26px;
    --gap-6: 38px;
    --gap-7: 56px;
  }

  .shell,
  .shell--narrow {
    width: calc(100% - 32px);
  }

  .masthead {
    padding: var(--gap-3) 0;
  }

  .masthead__meta {
    font-size: 10.5px;
  }

  .seat-grid,
  .seats {
    grid-template-columns: 1fr;
  }
}