:root {
  --paper: #f3ece0;
  --paper-deep: #ebe2d2;
  --ink: #1a1612;
  --clay: #b54a1f;
  --muted: #6b6055;
  --rule: #1a1612;
  --white: #fffaf0;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --serif: "DM Serif Display", Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  --hand: Caveat, cursive;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
}

button.primary {
  background: var(--clay);
  border-color: var(--clay);
}

button.secondary,
button:disabled {
  background: transparent;
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea {
  width: 100%;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-bottom-color: var(--clay);
}

textarea {
  min-height: 150px;
  border: 1.5px solid var(--ink);
  padding: 14px;
  background: var(--white);
  resize: none;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.2;
}

textarea:focus {
  border-color: var(--clay);
  outline: none;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.03em;
}

h1 {
  margin-bottom: 0;
  font-size: 78px;
  line-height: 0.9;
}

h2 {
  margin-bottom: 14px;
  font-size: 42px;
  line-height: 0.96;
}

h3 {
  margin: 0 0 14px;
  font-size: 30px;
  line-height: 1;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.small-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

/* ===== PLAYER PHONE ===== */

.phone-body {
  background: #c4bbaa;
  min-height: 100vh;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
}

/* ── Top nav ── */
.p-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  background: var(--ink);
  border-bottom: 1.5px solid var(--ink);
  flex-shrink: 0;
}

.p-nav__title {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--paper);
}

/* ── Room code badge (used on screen/host views) ── */
.room-code,
.room-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1.5px solid var(--clay);
  padding: 5px 10px;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  transform: rotate(-1deg);
  background: var(--paper);
  flex-shrink: 0;
  margin: 0;
}

/* ── Join screen ── */
.p-join {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.p-join__hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 24px 32px;
  border-bottom: 1.5px solid var(--ink);
  background: linear-gradient(150deg, var(--paper) 0%, var(--paper-deep) 100%);
}

.p-kicker {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--clay);
}

.p-join__heading {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 62px;
  line-height: 0.88;
  letter-spacing: -0.03em;
}

.p-join__heading em {
  font-style: italic;
  color: var(--clay);
}

.p-join__flavor {
  margin: 0;
  font-family: var(--hand);
  font-size: 19px;
  color: var(--muted);
  line-height: 1.3;
}

.p-join__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

/* ── Field ── */
.p-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p-field label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}

/* ── Primary button ── */
.p-primary-btn {
  width: 100%;
  min-height: 52px;
  border: 1.5px solid var(--clay);
  border-radius: 0;
  padding: 0 20px;
  background: var(--clay);
  color: var(--white);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.1s, transform 0.08s;
}

.p-primary-btn:active {
  transform: scale(0.98);
  background: #9a3e1a;
}

.p-primary-btn--auto {
  width: auto;
  flex-shrink: 0;
}

/* ── Game section ── */
.p-game {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#status {
  flex: 1;
}

/* ── Answer form ── */
.p-answer-form {
  padding: 20px 24px 28px;
  border-top: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--paper-deep);
}

.p-answer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.p-char-count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted);
}

/* ── Vote form ── */
.p-vote-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.p-vote-list {
  padding: 14px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Screen states ── */
.p-screen {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  animation: p-enter 0.32s ease both;
}

@keyframes p-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.p-chip {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 18px;
  padding: 5px 10px;
  border: 1.5px solid var(--clay);
  color: var(--clay);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.p-prompt-text {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.p-prompt-text--sm {
  font-size: 24px;
  margin-bottom: 10px;
}

/* Lobby */
.p-screen--lobby {
  flex: 1;
  justify-content: center;
  gap: 0;
  min-height: 320px;
}

.p-badge {
  display: inline-flex;
  width: fit-content;
  padding: 7px 14px;
  background: var(--clay);
  border: 1.5px solid var(--clay);
  color: var(--white);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  transform: rotate(-1.5deg);
}

.p-lobby-name {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 52px;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.p-lobby-note {
  margin: 0 0 28px;
  font-family: var(--hand);
  font-size: 19px;
  color: var(--muted);
  line-height: 1.35;
}

.p-waiting-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.p-waiting-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--clay);
  animation: p-dot-pulse 1.4s ease-in-out infinite;
}

.p-waiting-dots span:nth-child(2) { animation-delay: 0.22s; }
.p-waiting-dots span:nth-child(3) { animation-delay: 0.44s; }

@keyframes p-dot-pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.75); }
  50%       { opacity: 1;    transform: scale(1); }
}

/* Waiting */
.p-screen--waiting {
  flex: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  min-height: 300px;
}

.p-waiting-label {
  margin: 0;
  font-family: var(--hand);
  font-size: 20px;
  color: var(--muted);
}

/* Can't vote for yourself */
.p-screen--no-vote {
  flex: 1;
  justify-content: center;
  gap: 14px;
  min-height: 280px;
}

.p-no-vote-heading {
  margin: 0;
  font-family: var(--serif);
  font-size: 44px;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.p-no-vote-note {
  margin: 0;
  font-family: var(--hand);
  font-size: 19px;
  color: var(--muted);
  line-height: 1.35;
}

/* Answering */
.p-screen--answering {
  gap: 0;
}

/* Voting */
.p-screen--voting {
  gap: 0;
  padding-bottom: 8px;
}

.p-vote-instruction {
  margin: 0 0 4px;
  font-family: var(--hand);
  font-size: 17px;
  color: var(--muted);
  line-height: 1.3;
}

/* ── Vote cards ── */
.p-vote-card {
  border: 1.5px solid var(--ink);
  background: var(--white);
  overflow: hidden;
  cursor: pointer;
  animation: p-enter 0.28s ease both;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.p-vote-card:active {
  background: var(--paper-deep);
}

.p-vote-card.selected {
  background: var(--ink);
  border-color: var(--ink);
}

.p-vote-card__answer {
  padding: 20px 18px;
  font-family: var(--serif);
  font-size: 23px;
  font-style: italic;
  line-height: 1.2;
  color: var(--ink);
}

.p-vote-card.selected .p-vote-card__answer {
  color: var(--paper);
}


/* ===== TV SCREEN ===== */

.screen-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: var(--ink);
}

.screen-only {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  /* On a 16:9 screen this fills perfectly.
     On any other ratio, clamp to 16:9 and letterbox with black bars. */
  max-width: calc(100vh * (16 / 9));
  max-height: calc(100vw * (9 / 16));
  overflow: hidden;
  padding: 0 52px;
  background: var(--paper);
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 72px;
  border-bottom: 2px solid currentColor;
  padding: 14px 0 12px;
  flex-shrink: 0;
}

.masthead h1 {
  margin: 0;
  font-size: 42px;
  line-height: 0.9;
}

.masthead h1 span {
  color: var(--clay);
}

.mast-meta {
  text-align: right;
}

/* Lobby: honoree name */
.mast-honoree {
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
  line-height: 1;
}

/* Non-lobby flavor text (results, leaderboard) */
.mast-subtitle {
  font-family: var(--serif);
  font-size: 24px;
  font-style: italic;
  line-height: 1;
  color: var(--muted);
}

/* Timer in masthead */
.mast-timer {
  font-size: 68px;
  line-height: 1;
  letter-spacing: -2px;
}

.screen-body[data-phase="prompt"] {
  background: var(--ink);
  color: var(--paper);
}

/* screen-only has its own background, so override it in prompt phase */
.screen-body[data-phase="prompt"] .screen-only {
  background: var(--ink);
}

.screen-body[data-phase="prompt"] .masthead,
.screen-body[data-phase="prompt"] .screen-footer {
  color: rgba(243, 236, 224, 0.6);
}

.screen-body[data-phase="prompt"] .mast-subtitle {
  color: rgba(243, 236, 224, 0.45);
}

.screen-body[data-phase="prompt"] .eyebrow {
  color: rgba(243, 236, 224, 0.55);
}

.screen-body[data-phase="prompt"] .text-prompt-note {
  color: rgba(243, 236, 224, 0.5);
}

.screen-body[data-phase="prompt"] .screen-footer span:nth-child(2) {
  color: rgba(243, 236, 224, 0.6);
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  padding: 20px 0 16px;
  display: flex;
  flex-direction: column;
}

.screen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid currentColor;
  padding: 10px 0 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.screen-footer span:nth-child(2) {
  color: var(--clay);
  font-weight: 800;
}

.screen-lobby {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  flex: 1;
}

.screen-lobby h2 {
  margin: 0;
  font-size: 104px;
  line-height: 0.85;
}

.screen-lobby h2 em,
.screen-submit h2 em {
  color: var(--clay);
  font-style: italic;
}

.lobby-right {
  display: flex;
  flex-direction: column;
}

.join-block--bottom {
  margin-top: auto;
  padding-top: 14px;
  justify-content: center;
}

.screen-lede {
  max-width: 640px;
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  line-height: 1.3;
}

.screen-rules {
  display: grid;
  gap: 8px;
  max-width: 620px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.24;
}

.screen-rules li {
  display: flex;
  gap: 14px;
}

.screen-rules span {
  min-width: 1.6em;
  flex-shrink: 0;
  color: var(--clay);
  font-style: italic;
}

.join-block {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-top: 24px;
}

.qr-box {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  border: 2px solid var(--ink);
  background: var(--white);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.join-url {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.join-room {
  margin-top: 4px;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 4px;
}

.section-rule {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.section-rule span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 1.5px;
}

.screen-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.screen-player-list span {
  border: 1.5px solid var(--ink);
  padding: 9px 16px;
  background: var(--paper-deep);
  font-family: var(--serif);
  font-size: 22px;
  font-style: italic;
  transform: rotate(var(--tilt, 0deg));
}

.screen-player-list span:nth-child(3n + 1) {
  background: var(--white);
}

.screen-player-list .waiting-chip {
  border-style: dashed;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  font-style: normal;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}


.screen-submit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  align-content: center;
  flex: 1;
}

.stamp-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stamp {
  display: inline-block;
  border: 2px solid var(--clay);
  padding: 4px 12px;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.stamp.alt {
  border-color: var(--ink);
  color: var(--ink);
  transform: rotate(2deg);
}

.screen-submit h2 {
  margin: 14px 0 0;
  font-size: 92px;
  line-height: 0.86;
}

.submit-counter {
  display: grid;
  justify-items: center;
  text-align: center;
}

.answer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-family: var(--serif);
  font-size: 210px;
  line-height: 0.72;
  letter-spacing: -0.04em;
  margin-top: 12px;
  margin-bottom: 22px;
}

.answer-count-number {
  display: inline-block;
  min-width: 0.72em;
  text-align: center;
}

.answer-count-slash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.36em;
  height: 0.88em;
  color: var(--clay);
  font-style: italic;
  line-height: 1;
  transform: translateY(0.02em);
}

.submit-counter p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.answer-count-caption {
  margin: 0 0 18px;
  position: relative;
  z-index: 1;
}

.dot-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 0 auto 14px;
}

.dot-grid span {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

.dot-grid .filled {
  background: var(--ink);
}

.screen-progress {
  width: min(420px, 80%);
  height: 6px;
  margin: 0 auto;
  background: var(--paper-deep);
}

.screen-progress span {
  display: block;
  height: 100%;
  background: var(--clay);
}

.video-state {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  color: var(--paper);
}

.video-frame {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  width: calc(100% - 40px);
  max-width: 1280px;
  margin: 14px auto 0;
  border: 2px solid rgba(243, 236, 224, 0.25);
  background: repeating-linear-gradient(135deg, #15110e 0 16px, #1f1814 16px 17px);
  overflow: hidden;
}

.video-frame video,
.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}


.video-subtitle {
  padding: 0 40px 24px;
  text-align: center;
}

.video-prompt-label {
  margin: 14px 0 8px;
  color: rgba(243, 236, 224, 0.55);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.video-subtitle > div {
  max-width: 1300px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: 52px;
  font-style: italic;
  line-height: 1.05;
}

.video-subtitle span {
  display: inline-block;
  animation: wordIn 0.35s both;
}

.text-prompt-state {
  display: grid;
  align-content: center;
  flex: 1;
  padding: 40px 0;
}

.text-prompt-state h2 {
  max-width: 1280px;
  margin: 0;
  font-family: var(--serif);
  font-size: 88px;
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.text-prompt-state .eyebrow {
  margin-bottom: 18px;
}

.text-prompt-note {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 24px;
  font-style: italic;
  line-height: 1.25;
}

@keyframes wordIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen-round {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.round-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}


.screen-prompt {
  max-width: 1320px;
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: 56px;
  line-height: 0.98;
  letter-spacing: -0.025em;
}


.answers-grid,
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 24px;
  flex: 1;
}

/* ── Shared answer card system ── */

/* Wrapper: creates space above card for author label */
.card-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Author name — appears ABOVE the card in results phase only */
.card-author {
  padding: 0 4px 6px;
  color: var(--clay);
  font-family: var(--serif);
  font-size: 18px;
  font-style: italic;
  line-height: 1;
  min-height: 28px;
  opacity: 0;
  animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* The card itself — identical across answers / voting / results */
.answer-card {
  position: relative;
  min-height: 140px;
  border: 1.5px solid var(--ink);
  padding: 12px 20px 40px;
  background: var(--paper-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* All cards uniform — no alternating backgrounds */

.card-text {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(16px, 2vw, 30px);
  font-style: italic;
  line-height: 1.2;
  text-align: center;
}

/* Bachelor ribbon — subtle top-right tag */
.bachelor-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 1px solid var(--clay);
  color: var(--clay);
  padding: 3px 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeUp 0.3s ease both;
}

/* Dot footer — used in voting (live) and results (animated) */
.card-dots {
  position: absolute;
  bottom: 14px;
  left: 24px;
  right: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}


/* Results: animated dot circles */
.result-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--ink);
  font-size: 9px;
  opacity: 0;
  animation: dotPop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.crown-dot {
  background: var(--clay);
  color: var(--paper);
  width: 20px;
  height: 20px;
}

@keyframes dotPop {
  from { opacity: 0; transform: scale(0) rotate(-12deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Winner: thick border + warm background */
@keyframes winnerBorder {
  from { border-color: var(--ink); border-width: 1.5px; background: var(--paper-deep); }
  to   { border-color: var(--clay); border-width: 4px; background: #fff8ee; box-shadow: 0 0 0 6px rgba(181,74,31,0.10); }
}

.answer-winner {
  animation: winnerBorder 0.5s ease forwards;
  animation-delay: var(--winner-delay, 0ms);
}

/* Placeholder for unrevealed cards */
.answer-placeholder {
  min-height: 140px;
  border: 1.5px dashed rgba(26, 22, 18, 0.18);
  background: transparent;
}

/* Reveal animation */
@keyframes answerEnter {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.answer-enter {
  animation: answerEnter 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}


/* Host console */
.host-body {
  overflow: auto;
  background: var(--paper);
}

.host-console {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(320px, 520px);
  gap: 22px;
  align-items: start;
  min-height: 100vh;
  padding: 36px;
}

.controls {
  border: 1.5px solid var(--ink);
  padding: 18px;
  background: var(--paper);
}

.host-status {
  margin-top: 16px;
  border: 1px solid var(--ink);
  padding: 16px;
  background: var(--paper-deep);
}

.host-status h2,
.host-status p {
  margin-bottom: 8px;
}

.control-grid,
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.control-grid button,
.demo-grid button {
  min-height: 42px;
  font-size: 11px;
}

.player-admin {
  display: grid;
  border: 1px solid var(--ink);
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--ink);
  padding: 10px 12px;
  background: var(--paper);
}

.player-row:last-child {
  border-bottom: 0;
}

.player-row button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 10px;
}

.download-link {
  display: block;
  margin-top: 16px;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

/* ── Countdown Timer ── */
.screen-timer {
  font-family: var(--mono);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--ink);
  text-align: right;
}

.screen-timer.negative {
  color: var(--clay);
}


/* ── Leaderboard two-column ── */
.lb-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  flex: 1;
}

.lb-section-label {
  margin: 0 0 10px;
  color: var(--clay);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
}

/* Front runners */
.lb-row--top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid rgba(26,22,18,0.12);
  padding: 14px 0;
}

.lb-rank--big {
  font-family: var(--serif);
  font-size: 64px;
  font-style: italic;
  line-height: 0.9;
  color: var(--clay);
  min-width: 52px;
  flex-shrink: 0;
}

.lb-name-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 4px;
}

.lb-name-group .lb-name {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 0.95;
}

.lb-delta {
  color: var(--clay);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.lb-row--top .lb-score {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -0.5px;
  padding-top: 10px;
  flex-shrink: 0;
}

/* The pack */
.lb-row--pack {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid rgba(26,22,18,0.10);
  padding: 7px 0;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
}

.lb-rank {
  color: var(--muted);
  font-style: italic;
  min-width: 28px;
  font-size: 17px;
}

.lb-row--pack .lb-name {
  flex: 1;
}

.lb-row--pack .lb-score {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 18px;
}

.lb-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 16px;
}

@media (max-width: 1000px) {
  .screen-body {
    overflow: auto;
  }

  .screen-only {
    min-height: 100vh;
    padding: 24px;
  }

  .screen-lobby,
  .screen-submit,
  .host-console {
    grid-template-columns: 1fr;
  }

  .screen-lobby h2,
  .screen-submit h2 {
    font-size: 70px;
  }

  .answer-count {
    font-size: 120px;
    gap: 16px;
  }

  .video-state {
    min-height: 620px;
  }

  .screen-prompt {
    font-size: 38px;
  }

  .text-prompt-state h2 {
    font-size: 54px;
  }
}

@media (max-width: 560px) {
  .phone-shell {
    border: 0;
  }

  .p-join__heading {
    font-size: 50px;
  }

  .p-lookup-heading {
    font-size: 48px;
  }

  .p-prompt-text {
    font-size: 26px;
  }

  .control-grid,
  .demo-grid {
    grid-template-columns: 1fr;
  }
}
