/* Flaro — shared styles for the host screen and the phone player page. */

:root {
  --bg: #12111a;
  --surface: #1c1a27;
  --surface-2: #262337;
  --line: #34304a;
  --text: #f4f1ea;
  --muted: #a39fb5;
  --good: #2fbf71;
  --bad: #ef5350;
  --c0: #ff6b57;
  --c1: #17a898;
  --c2: #eaa630;
  --c3: #7c64f2;
  --radius: 16px;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark {
  width: 22px; height: 23px; flex: none;
  background: url(/brand/flaro-mark.svg) center / contain no-repeat;
}
.brand-logo { display: block; height: 30px; width: auto; }
.brand-logo.big { height: 52px; align-self: center; }
.brand.big { font-size: 30px; gap: 12px; }
.brand.big .brand-mark { width: 32px; height: 33px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 600; cursor: pointer; transition: transform .08s, background .15s, opacity .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #2f2b43; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--text); color: var(--bg); border-color: transparent; }
.btn.primary:hover { background: #fff; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon { width: 38px; min-height: 38px; padding: 0; font-size: 16px; }
.btn.big { min-height: 56px; padding: 0 28px; font-size: 18px; border-radius: 14px; }
.danger { color: #ff8a80; }
:focus-visible { outline: 3px solid var(--c2); outline-offset: 2px; }

/* ---------- toast + banner ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: var(--c2); color: #1a1408; text-align: center; padding: 8px 16px; font-weight: 600; font-size: 14px;
}

/* =========================================================
   HOST — library + editor
   ========================================================= */
.page { max-width: 880px; margin: 0 auto; padding: 20px 20px 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 28px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-title { font-size: 34px; letter-spacing: -0.02em; margin-bottom: 6px; }
.quiz-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.quiz-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
}
.quiz-card h2 { font-size: 20px; letter-spacing: -0.01em; margin-bottom: 2px; }
.quiz-card-actions { display: flex; gap: 8px; align-items: center; }
.empty { margin-top: 40px; text-align: center; color: var(--muted); }

.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 160px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  display: grid; box-shadow: 0 12px 30px rgba(0,0,0,.4);
}
.menu-pop button { text-align: left; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.menu-pop button:hover { background: #34304a; }

.title-input {
  width: 100%; background: transparent; border: 0; border-bottom: 2px solid var(--line);
  font-size: 32px; font-weight: 700; letter-spacing: -0.02em; padding: 6px 0 10px; margin-bottom: 24px;
}
.title-input:focus { outline: none; border-color: var(--text); }
.q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.q-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.q-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.q-num { font-weight: 700; }
.time-select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-left: auto; }
.time-select select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.q-tools { display: flex; gap: 6px; }
.q-card textarea {
  width: 100%; resize: vertical; min-height: 64px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; font-size: 18px; font-weight: 500;
}
.q-card textarea:focus, .choice-edit input[type=text]:focus { outline: none; border-color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.choice-edit {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 2px solid transparent;
  border-radius: 12px; padding: 6px 10px 6px 6px;
}
.choice-edit.is-correct { border-color: var(--good); }
.choice-edit input[type=text] { flex: 1; min-width: 0; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 8px 6px; }
.choice-edit .correct-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.choice-edit.is-correct .correct-toggle { color: var(--good); font-weight: 600; }
.choice-edit input[type=radio] { width: 18px; height: 18px; accent-color: var(--good); cursor: pointer; }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.add-q { width: 100%; margin-top: 16px; min-height: 56px; border-style: dashed; }

.tile {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px;
  font-weight: 800; color: #fff; font-size: 17px;
}
.c0 .tile, .tile.c0 { background: var(--c0); }
.c1 .tile, .tile.c1 { background: var(--c1); }
.c2 .tile, .tile.c2 { background: var(--c2); }
.c3 .tile, .tile.c3 { background: var(--c3); }

/* =========================================================
   HOST — presenter stage (made for a TV or projector)
   ========================================================= */
.stage { min-height: 100vh; display: flex; flex-direction: column; padding: clamp(16px, 3vw, 40px); gap: clamp(16px, 3vh, 32px); }
.stage-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; }

.join-panel {
  display: flex; align-items: center; justify-content: space-between; gap: clamp(20px, 4vw, 60px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 3vw, 40px);
}
.join-url { font-size: clamp(22px, 3vw, 40px); font-weight: 700; margin: 4px 0 20px; word-break: break-all; }
.pin { font-size: clamp(56px, 9vw, 120px); font-weight: 800; letter-spacing: .04em; line-height: 1; font-variant-numeric: tabular-nums; }
.qr { width: clamp(150px, 20vw, 260px); aspect-ratio: 1; background: #fff; border-radius: 16px; padding: 10px; flex: none; }
.lan-note { margin-top: 16px; font-size: 14px; }

.players-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.players-head h2 { font-size: 24px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px;
  font-size: 20px; font-weight: 600; cursor: pointer; animation: pop .35s cubic-bezier(.2,1.6,.4,1);
}
.chip:hover { border-color: #ff8a80; text-decoration: line-through; }
.chip.offline { opacity: .45; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.waiting { font-size: 20px; }
.waiting::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.switch input { width: 20px; height: 20px; accent-color: var(--text); }

.pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 600; }
.q-text { font-size: clamp(28px, 4.2vw, 60px); line-height: 1.15; letter-spacing: -0.02em; text-align: center; max-width: 1200px; margin: 0 auto; }

.timer { position: relative; width: clamp(90px, 10vw, 140px); aspect-ratio: 1; margin: 0 auto; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 8; }
.timer .track { stroke: var(--surface-2); }
.timer .ring { stroke: var(--text); stroke-linecap: round; transition: stroke .3s; }
.timer.low .ring { stroke: var(--c0); }
.timer span { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(32px, 4vw, 52px); font-weight: 800; font-variant-numeric: tabular-nums; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.5vw, 18px); margin-top: auto; }
.answer {
  display: flex; align-items: center; gap: 16px; border-radius: 18px; padding: clamp(16px, 2vw, 26px);
  font-size: clamp(20px, 2.4vw, 32px); font-weight: 700; color: #fff; min-height: clamp(70px, 10vh, 120px);
  transition: opacity .3s, transform .3s;
}
.answer.c0 { background: var(--c0); } .answer.c1 { background: var(--c1); }
.answer.c2 { background: var(--c2); } .answer.c3 { background: var(--c3); }
.answer .tile { background: rgba(0,0,0,.22); width: clamp(40px, 4vw, 56px); height: clamp(40px, 4vw, 56px); font-size: clamp(18px, 2vw, 26px); }
.answer .check { margin-left: auto; font-size: 1.2em; }
.answers.revealed .answer.dim { opacity: .28; }
.answers.revealed .answer.correct { box-shadow: inset 0 0 0 4px var(--text); }
.stage.reveal { gap: clamp(10px, 2vh, 24px); }
.stage.reveal .q-text { font-size: clamp(24px, 3.2vw, 46px); }
.stage.reveal .bars { height: clamp(100px, 30vh, 280px); margin-top: auto; }
.stage.reveal .answer { min-height: clamp(52px, 8vh, 96px); padding: clamp(10px, 1.4vw, 20px) clamp(14px, 2vw, 24px); font-size: clamp(18px, 2vw, 28px); }

.bars { display: flex; justify-content: center; align-items: flex-end; gap: clamp(14px, 3vw, 40px); height: clamp(140px, 26vh, 280px); }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: clamp(60px, 9vw, 120px); gap: 8px; }
.bar-count { font-size: clamp(22px, 2.6vw, 34px); font-weight: 800; }
.bar { width: 100%; border-radius: 12px 12px 4px 4px; height: calc(var(--h) * 100%); min-height: 8px; animation: grow .7s cubic-bezier(.2,.8,.2,1); transform-origin: bottom; }
.bar-col.c0 .bar { background: var(--c0); } .bar-col.c1 .bar { background: var(--c1); }
.bar-col.c2 .bar { background: var(--c2); } .bar-col.c3 .bar { background: var(--c3); }
.bar-col.dim { opacity: .35; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.stage-title { font-size: clamp(36px, 5vw, 64px); letter-spacing: -0.02em; text-align: center; }
.board { list-style: none; padding: 0; margin: 0 auto; width: min(100%, 820px); display: grid; gap: 12px; }
.board li {
  display: flex; align-items: center; gap: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 22px; font-size: clamp(20px, 2.4vw, 30px); font-weight: 700;
  animation: slide .45s both cubic-bezier(.2,.8,.2,1);
}
.board li:nth-child(2) { animation-delay: .06s; } .board li:nth-child(3) { animation-delay: .12s; }
.board li:nth-child(4) { animation-delay: .18s; } .board li:nth-child(5) { animation-delay: .24s; }
@keyframes slide { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.board .rank { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; }
.board .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .gain { color: var(--good); font-size: .7em; }
.board .score { font-variant-numeric: tabular-nums; }
.board.rest li { font-size: 20px; padding: 12px 20px; }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 2vw, 24px); margin-top: 12px; }
.place { display: flex; flex-direction: column; align-items: center; gap: 10px; width: clamp(120px, 18vw, 240px); }
.place .who { font-size: clamp(20px, 2.4vw, 32px); font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.place .pts { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.place .block {
  width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: start center; padding-top: 14px;
  font-size: clamp(40px, 5vw, 64px); font-weight: 800; color: rgba(255,255,255,.92);
  animation: grow .8s cubic-bezier(.2,.8,.2,1) both;
}
.place.p1 .block { height: clamp(120px, 22vh, 240px); background: var(--c2); animation-delay: .5s; }
.place.p2 .block { height: clamp(90px, 16vh, 175px); background: var(--c1); animation-delay: .25s; }
.place.p3 .block { height: clamp(66px, 11vh, 125px); background: var(--c0); }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }

/* =========================================================
   PLAYER — phone screens
   ========================================================= */
body.player { overscroll-behavior: none; }
.phone-screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
}
.phone-screen.join { justify-content: center; gap: 36px; }
.phone-screen.join .brand { align-self: center; }
.join-form { display: grid; gap: 16px; }
.join-form label { display: grid; gap: 6px; font-weight: 600; color: var(--muted); font-size: 14px; }
.join-form input {
  background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 16px;
  font-size: 22px; font-weight: 700; color: var(--text); text-align: center;
}
.join-form input:focus { outline: none; border-color: var(--text); }
.join-form .btn { width: 100%; margin-top: 4px; }
.form-error { color: #ff8a80; font-weight: 600; text-align: center; }
.host-link { color: var(--muted); text-align: center; font-size: 14px; }

.phone-screen.status { justify-content: center; align-items: center; text-align: center; gap: 14px; }
.status h1 { font-size: 32px; letter-spacing: -0.02em; }
.status-icon {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center;
  font-size: 44px; font-weight: 800; background: var(--surface-2); margin-bottom: 6px;
  animation: pop .45s cubic-bezier(.2,1.6,.4,1);
}
.status-icon.ok { background: var(--good); color: #fff; }
.name-tag { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 18px; font-weight: 700; font-size: 20px; }
.tile.huge { width: 104px; height: 104px; border-radius: 26px; font-size: 48px; animation: pop .4s cubic-bezier(.2,1.6,.4,1); }

.phone-screen.play { gap: 14px; }
.play-bar { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-weight: 700; }
.phone-timer { font-variant-numeric: tabular-nums; color: var(--text); font-size: 20px; }
.phone-q { font-size: 22px; line-height: 1.25; letter-spacing: -0.01em; }
.phone-answers { flex: 1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 12px; }
.phone-answers.with-text { grid-template-columns: 1fr; }
.phone-answer {
  border: 0; border-radius: 18px; color: #fff; font-weight: 700; font-size: 19px; cursor: pointer;
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-align: left;
  touch-action: manipulation; transition: transform .08s, opacity .2s;
}
.phone-answers:not(.with-text) .phone-answer { justify-content: center; }
.phone-answers:not(.with-text) .phone-answer .tile { width: 72px; height: 72px; border-radius: 20px; font-size: 36px; }
.phone-answer:active { transform: scale(.96); }
.phone-answer:disabled { opacity: .35; }
.phone-answer.c0 { background: var(--c0); } .phone-answer.c1 { background: var(--c1); }
.phone-answer.c2 { background: var(--c2); } .phone-answer.c3 { background: var(--c3); }
.phone-answer .tile { background: rgba(0,0,0,.22); }
.phone-answer .label { overflow-wrap: anywhere; }
.phone-progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.phone-progress div { height: 100%; background: var(--text); width: 100%; transform-origin: left; }

.result { justify-content: center; align-items: center; text-align: center; gap: 12px; }
.result.correct { background: radial-gradient(circle at 50% 35%, rgba(47,191,113,.35), transparent 60%); }
.result.wrong, .result.none { background: radial-gradient(circle at 50% 35%, rgba(239,83,80,.28), transparent 60%); }
.result .status-icon { background: var(--bad); color: #fff; }
.result.correct .status-icon { background: var(--good); }
.result.none .status-icon { background: var(--surface-2); }
.result .points { font-size: 22px; font-weight: 700; background: rgba(0,0,0,.25); border-radius: 999px; padding: 6px 16px; }
.result .answer-was { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 600; }
.score-line { margin-top: 18px; display: grid; gap: 2px; }
.score-line b { font-size: 36px; font-variant-numeric: tabular-nums; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .quiz-card { flex-direction: column; align-items: stretch; }
  .quiz-card-actions .btn:not(.icon) { flex: 1; }
  .choice-grid { grid-template-columns: 1fr; }
  .join-panel { flex-direction: column-reverse; text-align: center; }
  .answers { grid-template-columns: 1fr; }
  .stage-foot .btn.big { width: 100%; }
}

/* =========================================================
   HOST on a sideways phone (e.g. an iPhone mirrored to a TV)
   Everything fits on one screen with no scrolling.
   ========================================================= */
.stage {
  padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left));
  padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right));
}
@media (max-height: 520px) and (orientation: landscape) {
  .stage {
    height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
    padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom));
    gap: 6px;
  }
  .stage-bar .brand { font-size: 15px; }
  .stage-bar .btn { min-height: 32px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
  .stage-bar .btn.big { min-height: 36px; padding: 0 16px; font-size: 15px; }
  .stage-bar .pill { padding: 5px 12px; font-size: 14px; }
  .eyebrow { font-size: 11px; }

  /* lobby: join info left, players right */
  .stage.lobby { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; column-gap: 14px; }
  .stage.lobby > .stage-bar, .stage.lobby > .stage-foot { grid-column: 1 / -1; }
  .join-panel { padding: 12px 16px; gap: 14px; border-radius: 16px; min-height: 0; }
  .join-url { font-size: clamp(15px, 4.2vh, 20px); margin: 0 0 6px; }
  .pin { font-size: clamp(40px, 15vh, 70px); }
  .qr { width: min(34vh, 150px); padding: 6px; border-radius: 10px; }
  .lan-note { margin-top: 6px; font-size: 11px; }
  .stage.lobby > section:not(.join-panel) { min-height: 0; overflow-y: auto; }
  .players-head { margin-bottom: 8px; gap: 8px; flex-wrap: wrap; }
  .players-head h2 { font-size: 17px; }
  .players-head .muted { font-size: 12px; }
  .chips { gap: 6px; }
  .chip { font-size: 14px; padding: 5px 12px; }
  .waiting { font-size: 15px; }
  .stage-foot { margin-top: 0; gap: 10px; }
  .stage-foot .btn.big { min-height: 40px; font-size: 16px; padding: 0 22px; width: auto; }
  .switch { font-size: 14px; }

  /* question + reveal */
  .q-text { font-size: clamp(17px, 6.4vh, 28px); line-height: 1.15; }
  .stage.question .q-text { font-size: clamp(19px, 8.6vh, 38px); margin-top: auto; }
  .timer { width: clamp(42px, 14vh, 70px); }
  .stage.question .timer { width: clamp(52px, 21vh, 100px); margin-bottom: auto; }
  .stage.question .timer span { font-size: clamp(20px, 8vh, 38px); }
  .timer circle { stroke-width: 9; }
  .timer span { font-size: clamp(16px, 5.5vh, 26px); }
  .answers { gap: 6px; }
  .answer, .stage.reveal .answer { min-height: clamp(38px, 13vh, 60px); padding: 6px 12px; font-size: clamp(14px, 4.6vh, 20px); border-radius: 12px; gap: 10px; }
  .answer .tile { width: 28px; height: 28px; font-size: 14px; border-radius: 8px; }
  .stage.reveal { gap: 5px; }
  .stage.reveal .q-text { font-size: clamp(15px, 5.2vh, 22px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .stage.reveal .bars { height: clamp(52px, 22vh, 110px); gap: clamp(10px, 3vw, 28px); }
  .bar-col { width: clamp(36px, 8vw, 80px); gap: 2px; }
  .bar-count { font-size: clamp(13px, 4.4vh, 20px); }
  .bar { border-radius: 8px 8px 3px 3px; }
  .answers.revealed .answer.correct { box-shadow: inset 0 0 0 3px var(--text); }

  /* leaderboard + final results */
  .stage-title { font-size: clamp(20px, 7vh, 32px); }
  .board { gap: 5px; }
  .board li { padding: 4px 14px; font-size: clamp(14px, 4.6vh, 19px); border-radius: 10px; gap: 12px; }
  .board .rank { width: 26px; }
  .podium { margin-top: 0; gap: 10px; }
  .place { gap: 2px; width: clamp(90px, 16vw, 170px); }
  .place .who { font-size: clamp(14px, 4.6vh, 20px); }
  .place .pts { font-size: 12px; }
  .place .block { padding-top: 4px; font-size: clamp(18px, 7vh, 30px); border-radius: 10px 10px 4px 4px; }
  .place.p1 .block { height: 24vh; }
  .place.p2 .block { height: 17vh; }
  .place.p3 .block { height: 11vh; }
  .board.rest { min-height: 0; overflow-y: auto; flex: 1; }
  .board.rest li { font-size: 14px; padding: 3px 14px; }
}

/* =========================================================
   GAME NIGHT — home, lobby game picker, rules card
   ========================================================= */
.hero-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(135deg, rgba(255,107,87,.18), rgba(124,100,242,.16)), var(--surface);
  border: 1px solid var(--line); border-radius: 24px; padding: 28px;
}
.hero-card p { max-width: 460px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 40px; }
.section-head h2 { font-size: 22px; }
.section-head + .quiz-list { margin-top: 16px; }

.stage.lobby .stage-foot { display: grid; gap: 12px; justify-content: stretch; }
.game-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.game-pick {
  display: grid; gap: 4px; text-align: left; cursor: pointer; color: #fff;
  border: 0; border-radius: 18px; padding: 18px 20px; min-height: 92px;
  transition: transform .1s, opacity .2s, box-shadow .2s;
}
.game-pick:hover { box-shadow: 0 0 0 3px var(--text); }
.game-pick:active { transform: scale(.98); }
.game-pick:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.game-pick .game-name { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; letter-spacing: -0.01em; }
.game-pick .game-blurb { font-size: 15px; font-weight: 500; opacity: .9; }
.game-pick.g-quiz { background: var(--c1); }
.game-pick.g-impasta { background: var(--c0); }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(8,7,12,.7);
  display: grid; place-items: center; padding: 20px;
}
.sheet {
  width: min(640px, 100%); max-height: 85vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 24px; padding: 22px;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 26px; }
.sheet .quiz-list { margin-top: 16px; }

.intro-body { margin: auto; display: grid; gap: 18px; justify-items: center; text-align: center; max-width: 980px; }
.rules { list-style: none; counter-reset: r; padding: 0; margin: 8px 0 0; display: grid; gap: 14px; text-align: left; }
.rules li {
  counter-increment: r; display: flex; align-items: center; gap: 18px;
  font-size: clamp(20px, 2.6vw, 34px); font-weight: 600; animation: slide .45s both;
}
.rules li:nth-child(2) { animation-delay: .15s; } .rules li:nth-child(3) { animation-delay: .3s; }
.rules li::before {
  content: counter(r); flex: none; display: grid; place-items: center;
  width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--surface-2); font-weight: 800;
}

/* =========================================================
   IMPASTA — TV
   ========================================================= */
.ip-prompt { display: grid; justify-items: center; gap: 14px; }
.subject-tag {
  background: var(--c0); color: #fff; border-radius: 999px; padding: 6px 20px;
  font-weight: 800; font-size: clamp(18px, 2.2vw, 28px);
}
.ip-prompt.small .q-text { font-size: clamp(22px, 2.8vw, 40px); }
.ip-prompt.small .subject-tag { font-size: clamp(14px, 1.6vw, 20px); padding: 4px 14px; }
.ip-instructions { text-align: center; color: var(--muted); font-size: clamp(18px, 2vw, 26px); margin-top: auto; }
.ip-instructions b { color: var(--text); }

.ip-options {
  list-style: none; padding: 0; margin: 0 auto; width: min(100%, 1100px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px;
}
.ip-option {
  display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 20px; font-size: clamp(18px, 2.2vw, 28px); font-weight: 700;
  animation: slide .45s both; animation-delay: calc(var(--d) * .08s);
}
.ip-num {
  flex: none; display: grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 10px;
  background: var(--surface-2); color: var(--muted); font-size: .85em; font-weight: 800;
}
.ip-reveal .ip-option { flex-direction: column; align-items: flex-start; gap: 6px; animation-delay: calc(var(--d) * .6s); }
.ip-reveal .ip-meta { font-size: .6em; font-weight: 500; color: var(--muted); }
.ip-reveal .ip-meta b { color: var(--c2); }
.ip-option.is-real { border: 3px solid var(--good); background: rgba(47,191,113,.14); }
.ip-option.is-real .truth { color: var(--good); text-transform: uppercase; letter-spacing: .06em; }
.ip-matched { color: var(--c2); font-weight: 700; font-size: 18px; }

/* =========================================================
   PHONE — text entry and voting
   ========================================================= */
.role-tag {
  align-self: flex-start; background: var(--surface-2); border-radius: 999px; padding: 4px 14px;
  font-weight: 700; font-size: 14px; color: var(--c2);
}
.role-tag.real { background: var(--c0); color: #fff; }
.ip-head { display: grid; gap: 8px; }
.phone-q.small { font-size: 19px; }
.text-form { display: grid; gap: 10px; }
.text-form textarea {
  width: 100%; resize: none; background: var(--surface); border: 2px solid var(--line); border-radius: 16px;
  padding: 14px 16px; font-size: 20px; font-weight: 600; color: var(--text);
}
.text-form textarea:focus { outline: none; border-color: var(--text); }
.text-foot { display: flex; justify-content: flex-end; font-size: 13px; }
.text-form .btn { width: 100%; }
.vote-list { flex: 1; display: grid; gap: 10px; align-content: start; overflow-y: auto; }
.vote-option {
  display: flex; align-items: center; gap: 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px;
  font-size: 18px; font-weight: 600; touch-action: manipulation; transition: transform .08s;
}
.vote-option:active { transform: scale(.97); border-color: var(--text); }
.vote-option:disabled { opacity: .4; }
.vote-option .label { flex: 1; overflow-wrap: anywhere; }
.vote-option .mine { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
.picked { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.fooled-line { color: var(--c2); font-weight: 700; }

@media (max-width: 640px) {
  .hero-card { flex-direction: column; align-items: stretch; }
  .ip-options { grid-template-columns: 1fr; }
}

/* sideways phone hosting on a TV */
@media (max-height: 520px) and (orientation: landscape) {
  .stage.lobby .stage-foot { gap: 6px; }
  .stage.lobby .stage-foot > .eyebrow { display: none; }
  .game-picks { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .game-pick { min-height: 0; padding: 8px 14px; border-radius: 12px; }
  .game-pick .game-name { font-size: 18px; }
  .game-pick .game-blurb { display: none; }
  .rules li { font-size: clamp(14px, 5vh, 22px); gap: 12px; }
  .rules { gap: 6px; }
  .intro-body { gap: 8px; }
  .subject-tag { font-size: 14px; padding: 3px 12px; }
  .ip-prompt { gap: 6px; }
  .ip-instructions { font-size: 14px; }
  .ip-options { gap: 6px; grid-template-columns: 1fr 1fr; }
  .ip-option { padding: 6px 12px; font-size: clamp(13px, 4.4vh, 18px); border-radius: 10px; gap: 8px; }
  .ip-reveal .ip-option { gap: 0; }
  .ip-matched { font-size: 13px; }
}

/* polish */
.ip-head .role-tag { justify-self: start; }
@media (min-height: 521px) {
  .stage.lobby { gap: clamp(12px, 2.2vh, 28px); }
  .stage.lobby .join-panel { padding: clamp(16px, 2.4vw, 36px); }
  .stage.lobby .pin { font-size: clamp(56px, min(9vw, 13vh), 120px); }
  .stage.lobby .qr { width: clamp(140px, min(20vw, 30vh), 260px); }
  .stage.lobby .game-pick { min-height: 0; padding: 14px 18px; }
}

/* =========================================================
   YOU SAID IT
   ========================================================= */
.game-pick.g-yousaidit { background: var(--c3); }
.ysi-prompt { color: var(--muted); font-size: clamp(18px, 2vw, 26px); font-weight: 600; }
.ysi-quote {
  margin: 0 auto; max-width: 1100px; text-align: center; position: relative;
  font-size: clamp(34px, 5vw, 72px); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
  padding: 0 .6em; animation: pop .45s cubic-bezier(.2,1.6,.4,1);
}
.ysi-quote::before, .ysi-quote::after { color: var(--c3); font-size: 1.2em; line-height: 0; position: relative; top: .25em; }
.ysi-quote::before { content: '\201C'; margin-right: .08em; }
.ysi-quote::after { content: '\201D'; margin-left: .08em; }
.ysi-quote.small { font-size: clamp(26px, 3.4vw, 48px); }
.ysi-guess .timer { margin-top: auto; }
.ysi-author { display: grid; justify-items: center; gap: 10px; margin-top: 8px; }
.subject-tag.big { font-size: clamp(30px, 4vw, 56px); padding: 8px 32px; background: var(--c3); animation: pop .5s .3s both cubic-bezier(.2,1.6,.4,1); }
.ysi-result { font-size: clamp(18px, 2.2vw, 28px); color: var(--muted); }
.ysi-result b { color: var(--good); }
.ysi-wrong { list-style: none; padding: 0; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ysi-wrong li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; color: var(--muted); font-weight: 600; }

.phone-quote {
  margin: 4px 0; background: var(--surface); border-left: 4px solid var(--c3); border-radius: 12px;
  padding: 14px 16px; font-size: 21px; font-weight: 700; overflow-wrap: anywhere;
}
.vote-list.suspects .vote-option { justify-content: center; font-size: 20px; font-weight: 700; min-height: 60px; }

@media (max-height: 520px) and (orientation: landscape) {
  .ysi-quote { font-size: clamp(18px, 8vh, 34px); }
  .ysi-quote.small { font-size: clamp(16px, 6vh, 26px); }
  .ysi-prompt, .ysi-result { font-size: 14px; }
  .subject-tag.big { font-size: 20px; padding: 4px 18px; }
  .ysi-author { gap: 2px; margin-top: 0; }
  .ysi-wrong li { font-size: 12px; padding: 3px 10px; }
}

/* =========================================================
   MY DRAWN LIFE
   ========================================================= */
.game-pick.g-drawnlife { background: var(--c2); }

/* TV: drawing on the left, stories on the right */
.dl-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: clamp(16px, 3vw, 40px); align-items: center; }
.dl-frame { margin: 0; display: grid; gap: 10px; justify-items: center; }
.dl-frame img {
  height: min(68vh, 44vw); aspect-ratio: 1; background: #fff; border-radius: 20px;
  box-shadow: 0 0 0 6px var(--surface-2), 0 20px 50px rgba(0,0,0,.45); animation: pop .5s cubic-bezier(.2,1.4,.4,1);
}
.dl-frame figcaption { color: var(--muted); font-size: clamp(14px, 1.5vw, 20px); text-align: center; max-width: min(68vh, 44vw); }
.dl-frame figcaption b { color: var(--text); }
.dl-side { display: grid; gap: clamp(10px, 2vh, 20px); align-content: center; }
.dl-headline { font-size: clamp(32px, 4.4vw, 64px); letter-spacing: -0.02em; line-height: 1.05; }
.ip-instructions.left { text-align: left; margin-top: 0; }
.dl-side .timer { margin: 0; }
.ip-options.one-col { grid-template-columns: 1fr; width: 100%; }
.dl-split .ip-option { font-size: clamp(16px, 1.9vw, 26px); padding: 12px 18px; }

/* Phone: drawing pad */
.draw-screen { gap: 10px; }
.pad-wrap { width: 100%; max-width: min(100%, 58dvh); margin: 0 auto; aspect-ratio: 1; }
#pad {
  width: 100%; height: 100%; display: block; background: #fff; border-radius: 16px;
  touch-action: none; cursor: crosshair; box-shadow: 0 0 0 2px var(--line);
}
.pad-tools { display: grid; gap: 8px; }
.swatches { display: flex; justify-content: space-between; gap: 4px; }
.swatch {
  flex: 1; max-width: 36px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line);
  background: var(--sw); cursor: pointer; padding: 0; transition: transform .1s;
}
.swatch.on { transform: scale(1.18); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--text); }
.pad-actions { display: flex; gap: 8px; align-items: center; }
.size {
  width: 44px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.size i { display: block; width: var(--s); height: var(--s); border-radius: 50%; background: var(--text); }
.size.on { border-color: var(--text); background: #34304a; }
.pad-actions .btn.icon { margin-left: auto; }
.pad-actions .btn.icon + .btn.icon { margin-left: 0; }
.story-input {
  width: 100%; background: var(--surface); border: 2px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 18px; font-weight: 600; color: var(--text);
}
.story-input:focus { outline: none; border-color: var(--text); }
.phone-drawing { width: min(100%, 34dvh); aspect-ratio: 1; align-self: center; background: #fff; border-radius: 14px; }

@media (max-height: 520px) and (orientation: landscape) {
  .dl-frame img { height: min(62vh, 40vw); border-radius: 12px; box-shadow: 0 0 0 3px var(--surface-2); }
  .dl-frame figcaption { font-size: 11px; }
  .dl-headline { font-size: 24px; }
  .dl-side { gap: 6px; }
  .ip-options.one-col { grid-template-columns: 1fr; }
  .dl-split .ip-option { font-size: 13px; padding: 4px 10px; }
  .dl-split .ip-meta { font-size: 10px; }
}

/* =========================================================
   CORNFUSED
   ========================================================= */
.game-pick.g-cornfused { background: #c9a227; }
.cf-main { font-size: clamp(26px, 3.4vw, 50px); }
.cf-board {
  list-style: none; padding: 0; margin: 0 auto; width: min(100%, 1200px);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px;
}
.cf-card {
  display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 18px; animation: slide .45s both; animation-delay: calc(var(--d) * .08s);
}
.cf-name { color: var(--muted); font-weight: 700; font-size: clamp(13px, 1.3vw, 17px); text-transform: uppercase; letter-spacing: .05em; }
.cf-answer { font-size: clamp(20px, 2.4vw, 32px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.cf-votes { color: var(--muted); font-size: 14px; font-weight: 500; }
.cf-card.is-odd { border: 3px solid #c9a227; background: rgba(201,162,39,.16); }
.cf-card.is-odd .cf-name { color: #e8c547; }
.cf-odd-name { color: #e8c547; }
.cf-prompts { color: var(--muted); font-size: clamp(16px, 1.8vw, 24px); }
.cf-prompts b { color: var(--text); }
.cf-prompts b.odd { color: #e8c547; }
.cf-foot { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 24px; }
.cf-foot .ip-instructions { margin: 0; }
.cf-foot .timer { margin: 0; width: clamp(70px, 8vw, 110px); }
.cf-q { color: var(--text); }
.cf-pick { flex-direction: column; align-items: flex-start; gap: 2px; }
.cf-pick-name { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }

/* =========================================================
   PRETENDER
   ========================================================= */
.game-pick.g-pretender { background: #d9467a; }
.ysi-quote.pt::before, .ysi-quote.pt::after { color: #f06a9b; }
.subject-tag.big.pt { background: #d9467a; }
.pt-by { color: var(--muted); font-size: clamp(16px, 1.8vw, 22px); }
.pt-by b { color: var(--text); }
.pt-card {
  display: grid; gap: 2px; justify-items: start; background: linear-gradient(135deg, #d9467a, #7c64f2);
  border-radius: 18px; padding: 14px 18px; color: #fff;
}
.pt-card .eyebrow { color: rgba(255,255,255,.8); font-size: 12px; }
.pt-target { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
.phone-quote.pt { border-left-color: #d9467a; }

@media (max-height: 520px) and (orientation: landscape) {
  .cf-main { font-size: clamp(16px, 6vh, 24px); }
  .cf-board { gap: 6px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .cf-card { padding: 6px 10px; border-radius: 10px; gap: 0; }
  .cf-answer { font-size: clamp(13px, 4.4vh, 18px); }
  .cf-name, .cf-votes { font-size: 10px; }
  .cf-prompts { font-size: 12px; }
  .cf-foot { gap: 10px; }
  .cf-foot .timer { width: 46px; }
  .pt-by { font-size: 12px; }
}

/* six games: a tidy 3 x 2 grid on wide screens */
@media (min-width: 900px) and (min-height: 521px) {
  .game-picks { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stage.lobby .game-pick { padding: 10px 16px; gap: 2px; }
  .stage.lobby .game-pick .game-name { font-size: clamp(20px, 2vw, 26px); }
  .stage.lobby .game-pick .game-blurb { font-size: 13px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .game-picks { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .game-pick { padding: 6px 10px; }
  .game-pick .game-name { font-size: 15px; }
}

/* =========================================================
   QUIZ PHOTOS
   ========================================================= */
/* editor */
.q-main { display: flex; gap: 10px; align-items: stretch; }
.q-main textarea { flex: 1; }
.add-photo { flex: none; min-height: 64px; border-style: dashed; border-color: var(--line); }
.q-thumb { position: relative; flex: none; width: 120px; height: 90px; }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.q-thumb .btn { position: absolute; top: 4px; right: 4px; width: 28px; min-height: 28px; font-size: 12px; background: rgba(18,17,26,.85); }
.c-photo {
  flex: none; width: 36px; height: 36px; border-radius: 8px; border: 1px dashed var(--line);
  background: transparent; cursor: pointer; font-size: 16px; opacity: .7;
}
.c-photo:hover { opacity: 1; border-color: var(--muted); }
.c-thumb { position: relative; flex: none; width: 44px; height: 36px; }
.c-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.c-thumb button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: var(--bad); color: #fff; font-size: 10px; cursor: pointer; padding: 0;
}

/* TV */
.answer { flex-direction: column; align-items: stretch; justify-content: center; }
.answer-row { display: flex; align-items: center; gap: 16px; width: 100%; }
.answer-photo {
  width: 100%; height: clamp(90px, 20vh, 220px); object-fit: contain; border-radius: 12px;
  background: rgba(0,0,0,.18); margin-bottom: 10px;
}
.answers.has-photos { grid-template-columns: repeat(4, 1fr); }
.answers.has-photos .answer { padding: 12px; font-size: clamp(16px, 1.8vw, 24px); }
.q-media { display: flex; align-items: center; justify-content: center; gap: clamp(16px, 3vw, 40px); min-height: 0; }
.q-media img {
  max-height: 38vh; max-width: min(70vw, 900px); border-radius: 18px; object-fit: contain;
  box-shadow: 0 16px 40px rgba(0,0,0,.4); animation: pop .45s cubic-bezier(.2,1.4,.4,1);
}
.q-media .timer { margin: 0; flex: none; }
.stage.question.has-q-photo .q-text { font-size: clamp(24px, 3.2vw, 46px); }
.stage.question.has-q-photo.has-a-photos .q-media img { max-height: 26vh; }
.stage.question.has-q-photo.has-a-photos .answer-photo { height: clamp(70px, 16vh, 170px); }
.stage.reveal.has-a-photos .bars { height: clamp(70px, 16vh, 160px); }
.stage.reveal.has-a-photos .answer-photo { height: clamp(60px, 15vh, 160px); }

/* phone */
.phone-answer-row { display: flex; align-items: center; gap: 14px; }
.phone-answers:not(.with-text) .phone-answer-row { justify-content: center; }
.phone-q-photo { width: 100%; max-height: 30dvh; object-fit: contain; border-radius: 14px; background: var(--surface); }
.phone-answers.with-photos { grid-template-columns: 1fr 1fr; }
.phone-answers.with-photos .phone-answer { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 10px; gap: 8px; }
.phone-answers.with-photos .phone-answer .tile { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
.phone-answer-photo { width: 100%; flex: 1; min-height: 0; max-height: 22dvh; object-fit: contain; border-radius: 10px; background: rgba(0,0,0,.18); }
.phone-answers.with-photos .label { font-size: 15px; }

@media (max-width: 640px) {
  .q-main { flex-direction: column; }
  .add-photo { min-height: 44px; }
  .answers.has-photos { grid-template-columns: 1fr 1fr; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .answer-photo, .stage.reveal.has-a-photos .answer-photo { height: 18vh; margin-bottom: 4px; }
  .q-media img { max-height: 30vh; border-radius: 10px; }
  .stage.question.has-q-photo .q-text { font-size: clamp(15px, 5.5vh, 24px); }
  .stage.question.has-q-photo .q-text, .stage.question.has-a-photos .q-text { margin-top: 0; }
}

/* photo polish */
.choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-edit { min-width: 0; }
.phone-answers.with-photos .phone-answer-photo { max-height: none; height: 100%; }
.answers.has-photos .answer { justify-content: flex-start; }
.answers.has-photos .answer-row { margin-top: auto; }
@media (max-width: 640px) { .choice-grid { grid-template-columns: minmax(0, 1fr); } }

/* =========================================================
   BRAND — logos, lobby tiles, rules card (v6)
   ========================================================= */
:root {
  --flaro: #f43c3c;
  --cream: #fdf3df;
  --spark: #f9d84a;
  --display: 'Fredoka', 'Outfit', system-ui, sans-serif;
}
.page-title, .stage-title, .lobby-heading, .join-pin, .status h1, .dl-headline, .pin { font-family: var(--display); font-weight: 700; letter-spacing: 0; }

/* A game's logo at any size: set --side on a parent. */
.logo-art {
  display: block; width: var(--side, 120px); height: var(--side, 120px); object-fit: cover;
  border-radius: calc(var(--side, 120px) * .14); flex: none;
}
.logo-art.lettered {
  position: relative; display: grid; place-items: center; grid-auto-flow: column; align-content: center; justify-content: center;
  background: #1f9e6a; color: var(--cream); font-family: var(--display); font-weight: 700;
  font-size: calc(var(--side, 120px) * .3); line-height: 1;
}
.logo-art.lettered b { color: var(--spark); font-weight: 700; margin-left: .04em; }
.logo-art.lettered .sparks { position: absolute; top: 22%; right: 16%; width: 16%; height: 16%; }
.logo-art.lettered .sparks i {
  position: absolute; left: 50%; bottom: 0; width: 12%; height: 70%; background: var(--spark); border-radius: 99px;
  transform-origin: 50% 160%; transform: translateX(-50%) rotate(var(--r));
}
.logo-art.lettered .sparks i:nth-child(1) { --r: -40deg; }
.logo-art.lettered .sparks i:nth-child(2) { --r: 0deg; }
.logo-art.lettered .sparks i:nth-child(3) { --r: 40deg; }

/* ---------- home ---------- */
.hero-card { align-items: center; }
.hero-logo { width: 112px; height: 112px; border-radius: 26px; flex: none; box-shadow: 0 10px 30px rgba(244,60,60,.35); }
.hero-card > div { flex: 1; }

/* ---------- lobby ---------- */
.stage.lobby2 {
  display: grid; grid-template-columns: minmax(300px, 34%) minmax(0, 1fr);
  padding: 0; gap: 0; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden;
}
.lobby-side {
  background: var(--flaro); color: var(--cream); min-height: 0;
  display: flex; flex-direction: column; gap: clamp(10px, 2.2vh, 22px);
  padding: clamp(14px, 3vh, 32px) clamp(16px, 2.4vw, 34px);
  padding-left: max(clamp(16px, 2.4vw, 34px), env(safe-area-inset-left));
}
.lobby-logo { width: min(100%, 26vh); align-self: center; margin: calc(-1 * clamp(4px, 2vh, 20px)) 0 calc(-1 * clamp(4px, 2.6vh, 26px)); }
.join-card {
  background: var(--cream); color: #2b1416; border-radius: 22px; padding: clamp(10px, 2vh, 20px) clamp(12px, 1.4vw, 20px);
  display: flex; align-items: center; justify-content: space-between; gap: clamp(10px, 1.2vw, 18px);
  box-shadow: 0 14px 34px rgba(80,0,0,.28);
}
.join-text { min-width: 0; }
.join-label { color: #7b4b4b; font-size: clamp(13px, 1.25vw, 18px); font-weight: 500; }
.join-label b { color: #2b1416; word-break: break-all; }
.join-pin { font-size: clamp(38px, 5.2vw, 84px); line-height: 1; color: #2b1416; font-variant-numeric: tabular-nums; margin: 4px 0 2px; white-space: nowrap; }
.join-note { color: #9b6a6a; font-size: 12px; font-weight: 600; }
.join-qr { width: clamp(84px, 17vh, 168px); aspect-ratio: 1; flex: none; background: #fff; border-radius: 12px; padding: 5px; }
.lobby-players { flex: 1; min-height: 0; overflow-y: auto; }
.lobby-players h2 { font-family: var(--display); font-size: clamp(18px, 1.9vw, 26px); margin-bottom: 10px; }
.lobby-players .chips { gap: 8px; }
.lobby-players .chip {
  background: rgba(255,255,255,.17); border: 0; color: var(--cream); font-size: clamp(15px, 1.5vw, 20px); padding: 8px 16px;
}
.lobby-players .chip:hover { background: rgba(0,0,0,.2); border: 0; }
.lobby-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lobby-tools .switch { font-size: 14px; }
.lobby-tools .switch input { accent-color: var(--cream); }
.lobby-tools .btn.ghost { color: var(--cream); border-color: rgba(253,243,223,.45); min-height: 36px; }
.lobby-tools .btn.ghost:hover { background: rgba(0,0,0,.15); }

.lobby-games {
  min-height: 0; display: flex; flex-direction: column; gap: clamp(8px, 2vh, 20px);
  padding: clamp(14px, 3vh, 32px) clamp(16px, 2.6vw, 40px);
  padding-right: max(clamp(16px, 2.6vw, 40px), env(safe-area-inset-right));
}
.lobby-heading { font-size: clamp(24px, 2.8vw, 40px); color: var(--cream); }
.tiles {
  --gap-x: clamp(12px, 1.6vw, 24px); --gap-y: clamp(10px, 2vh, 22px); --cap: 34px;
  flex: 1; min-height: 0; container-type: size;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--gap-y) var(--gap-x); align-items: center; justify-items: center;
}
.game-tile {
  --side: min(calc((100cqw - 2 * var(--gap-x)) / 3), calc((100cqh - var(--gap-y)) / 2 - var(--cap)));
  position: relative; border: 0; padding: 0; background: none; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: pop .45s both cubic-bezier(.2,1.4,.4,1); animation-delay: calc(var(--d) * .05s);
}
.game-tile .logo-art { box-shadow: 0 12px 30px rgba(0,0,0,.4); transition: transform .18s, box-shadow .18s; }
.game-tile:hover .logo-art, .game-tile:focus-visible .logo-art { transform: translateY(-4px) rotate(-1.2deg); box-shadow: 0 0 0 4px var(--cream), 0 18px 36px rgba(0,0,0,.5); }
.game-tile:focus-visible { outline: none; }
.game-tile:active .logo-art { transform: scale(.97); }
.tile-blurb { width: var(--side); font-size: clamp(11px, 1.05vw, 14px); line-height: 1.25; text-align: center; height: calc(var(--cap) - 8px); overflow: hidden; }
.game-tile:disabled { cursor: not-allowed; }
.game-tile:disabled .logo-art { filter: grayscale(.85) brightness(.5); box-shadow: none; transform: none; }
.tile-lock {
  position: absolute; top: calc(var(--side) / 2); left: 50%; transform: translate(-50%, -50%);
  background: rgba(18,17,26,.88); color: var(--cream); font-weight: 700; font-size: 13px; padding: 6px 12px; border-radius: 99px; white-space: nowrap;
}

/* ---------- in-game header + rules card ---------- */
.stage-bar .brand { gap: 12px; }
.bar-logo { --side: 40px; display: inline-flex; }
.bar-logo .logo-art { border-radius: 10px; }
.intro-split { margin: auto; display: flex; align-items: center; gap: clamp(20px, 4vw, 64px); max-width: 1300px; }
.intro-logo { --side: min(50vh, 32vw); }
.intro-logo .logo-art { box-shadow: 0 20px 50px rgba(0,0,0,.45); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.intro-text { display: grid; gap: 14px; }

/* ---------- phone ---------- */
.join-logo { width: min(52vw, 210px); border-radius: 30px; align-self: center; box-shadow: 0 12px 30px rgba(244,60,60,.3); }
.phone-game-logo { width: min(72vw, 300px); border-radius: 32px; animation: pop .5s cubic-bezier(.2,1.4,.4,1); box-shadow: 0 16px 40px rgba(0,0,0,.45); margin-bottom: 8px; }
.phone-room-logo { width: 120px; border-radius: 26px; animation: pop .45s cubic-bezier(.2,1.6,.4,1); }

/* ---------- narrow screens (a phone held upright as host) ---------- */
@media (max-width: 700px) and (orientation: portrait) {
  .stage.lobby2 { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .lobby-players { overflow: visible; }
  .tiles { container-type: inline-size; grid-template-rows: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-tile { --side: calc((100cqw - var(--gap-x)) / 2); }
  .intro-split { flex-direction: column; }
  .intro-logo { --side: min(60vw, 260px); }
}

/* ---------- sideways phone mirrored to a TV ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .stage.lobby2 { grid-template-columns: minmax(250px, 38%) minmax(0, 1fr); }
  .lobby-side { gap: 6px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .lobby-logo { width: 19vh; margin: -6px 0 -10px; }
  .join-card { padding: 6px 10px; border-radius: 14px; }
  .join-pin { font-size: clamp(26px, 10vh, 44px); }
  .join-label { font-size: 11px; }
  .join-note { display: none; }
  .join-qr { width: 22vh; padding: 3px; border-radius: 8px; }
  .lobby-players h2 { font-size: 14px; margin-bottom: 4px; }
  .lobby-players .chip { font-size: 12px; padding: 3px 10px; }
  .lobby-tools .switch { font-size: 11px; }
  .lobby-tools .btn.ghost { min-height: 28px; padding: 0 10px; font-size: 12px; }
  .lobby-games { gap: 6px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .lobby-heading { font-size: 18px; }
  .tiles { --cap: 0px; --gap-y: 8px; --gap-x: 10px; }
  .tile-blurb { display: none; }
  .tile-lock { font-size: 10px; padding: 3px 8px; }
  .bar-logo { --side: 26px; }
  .bar-logo .logo-art { border-radius: 6px; }
  .intro-logo { --side: 58vh; }
}

/* Platform name placeholder: swap for the real logo once it's picked. Flaro red now belongs to the quiz. */
:root { --platform: #2a2342; --platform-2: #3a2f5c; }
.lobby-side { background: linear-gradient(160deg, var(--platform-2), var(--platform)); }
.join-card { box-shadow: 0 14px 34px rgba(0,0,0,.35); }
.platform-mark {
  font-family: var(--display); font-weight: 700; color: var(--cream); line-height: 1; letter-spacing: 0;
  display: inline-flex; align-items: center; gap: .3em;
}
.platform-mark::before { content: ''; width: .5em; height: .5em; border-radius: 50%; background: var(--spark); box-shadow: .62em 0 0 var(--flaro), 1.24em 0 0 #17a898; margin-right: 1.3em; }
.lobby-mark { font-size: clamp(26px, 3vw, 44px); align-self: center; padding: clamp(4px, 1.4vh, 14px) 0; }
.hero-mark { font-size: 22px; flex: none; }
.join-mark { font-size: 40px; align-self: center; }
.hero-card { background: linear-gradient(135deg, rgba(124,100,242,.22), rgba(23,168,152,.14)), var(--surface); }
@media (max-height: 520px) and (orientation: landscape) { .lobby-mark { font-size: 20px; padding: 0; } }
@media (max-width: 640px) { .hero-mark { align-self: flex-start; } }
.join-pin { font-size: clamp(34px, 3.9vw, 84px); }
.join-qr { width: clamp(80px, min(16vh, 9vw), 168px); }
@media (max-height: 520px) and (orientation: landscape) { .join-pin { font-size: clamp(26px, 9vh, 40px); } .join-qr { width: 21vh; } }
.tiles { --cap: 46px; }
.tile-blurb { height: calc(var(--cap) - 8px); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-height: 520px) and (orientation: landscape) { .tiles { --cap: 0px; } }
.join-form label, .join-form input { min-width: 0; width: 100%; }
.hero-card > .hero-mark { flex: none; }

/* =========================================================
   v7 — Mime Time, Blind Spot, Sketchy Telephone
   ========================================================= */

/* Placeholder logo tiles (until real logos arrive) */
.logo-art.lettered { display: grid; place-items: center; text-align: center; }
.logo-art.lettered .lt {
  font-size: calc(var(--side, 120px) * .17); line-height: 1.02; padding: 0 9%;
  text-shadow: 0 3px 0 rgba(0,0,0,.15);
}
.logo-art.lettered.g-charades { background: #e0457b; }
.logo-art.lettered.g-blindspot { background: #18a058; }
.logo-art.lettered.g-telephone { background: #4b5fe8; }
.logo-art.lettered.g-charades .sparks i, .logo-art.lettered.g-telephone .sparks i { background: var(--spark); }

/* Lobby grid: rows follow the number of games */
.tiles { grid-template-rows: repeat(var(--rows, 2), minmax(0, 1fr)); --cap: 40px; }
.game-tile { --side: min(calc((100cqw - 2 * var(--gap-x)) / 3), calc((100cqh - (var(--rows, 2) - 1) * var(--gap-y)) / var(--rows, 2) - var(--cap))); }
@media (max-width: 700px) and (orientation: portrait) { .tiles { grid-template-rows: none; } .game-tile { --side: calc((100cqw - var(--gap-x)) / 2); } }
@media (max-height: 520px) and (orientation: landscape) { .tiles { --cap: 0px; --gap-y: 6px; } }

/* Rules card setup controls (Teams / Solo) */
.mt-setup { display: grid; gap: 12px; margin-top: 10px; }
.seg { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg-btn {
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface);
  font-weight: 700; font-size: 17px; cursor: pointer;
}
.seg-btn.on { background: var(--cream); color: #1d1a24; border-color: var(--cream); }
.seg-btn:disabled { opacity: .4; cursor: not-allowed; }
.mt-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mt-team { border-radius: 16px; padding: 12px 16px; display: grid; gap: 4px; color: #fff; }
.mt-team b { font-family: var(--display); font-size: 20px; }
.mt-team span { font-weight: 600; opacity: .92; }
.t0 { --team: #ff6b57; } .t1 { --team: #17a898; }
.mt-team.t0, .team-score.t0, .team-card.t0 { background: #ff6b57; }
.mt-team.t1, .team-score.t1, .team-card.t1 { background: #17a898; }

/* Spotlight screens: one big message in the middle */
.stage.spotlight { gap: clamp(8px, 2vh, 20px); }
.spot-body { margin: auto; display: grid; justify-items: center; text-align: center; gap: clamp(8px, 1.8vh, 18px); max-width: 1200px; }
.spot-name { font-family: var(--display); font-size: clamp(40px, 6.4vw, 96px); line-height: 1.02; animation: pop .45s cubic-bezier(.2,1.4,.4,1); }
.spot-name.t0 { color: #ff8a7a; } .spot-name.t1 { color: #3fd1bf; }
.spot-sub { font-size: clamp(20px, 2.4vw, 34px); font-weight: 600; }
.spot-category {
  font-family: var(--display); background: var(--surface-2); border-radius: 999px; padding: 6px 22px;
  font-size: clamp(18px, 2vw, 28px); color: var(--spark);
}
.spot-reveal { font-family: var(--display); font-size: clamp(44px, 7vw, 110px); line-height: 1.02; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.spot-reveal.got { color: #5be39b; } .spot-reveal.missed { color: var(--cream); }
.spot-body .timer { margin-top: 6px; }

.team-strip { display: flex; justify-content: center; gap: 14px; }
.team-score {
  display: flex; align-items: center; gap: 14px; color: #fff; border-radius: 16px; padding: 10px 22px;
  opacity: .55; transition: opacity .3s, transform .3s;
}
.team-score.active { opacity: 1; transform: scale(1.06); }
.team-name { font-family: var(--display); font-size: clamp(16px, 1.7vw, 24px); }
.team-pts { font-family: var(--display); font-size: clamp(26px, 3vw, 44px); font-variant-numeric: tabular-nums; }
.team-final { display: flex; justify-content: center; gap: clamp(14px, 3vw, 40px); margin: auto; flex-wrap: wrap; }
.team-card {
  display: grid; justify-items: center; gap: 6px; color: #fff; border-radius: 24px;
  padding: clamp(16px, 3vh, 30px) clamp(24px, 4vw, 56px); min-width: min(320px, 40vw); animation: pop .5s both cubic-bezier(.2,1.4,.4,1);
}
.team-card.win { box-shadow: 0 0 0 5px var(--spark), 0 20px 50px rgba(0,0,0,.4); }
.team-big { font-family: var(--display); font-size: clamp(64px, 9vw, 140px); line-height: 1; }
.team-members { font-weight: 600; opacity: .9; text-align: center; }
.board.small { width: min(100%, 640px); }
.board.small li { padding: 8px 18px; font-size: clamp(16px, 1.8vw, 22px); }

/* Blind Spot */
.bs-clue {
  font-family: var(--display); font-size: clamp(56px, 10vw, 160px); line-height: 1; letter-spacing: 0;
  animation: pop .35s cubic-bezier(.2,1.4,.4,1);
}
.bs-play .stage-bar .btn { min-height: 38px; }
.bs-marks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 1100px; }
.bs-marks li {
  border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: clamp(15px, 1.6vw, 21px);
  animation: slide .4s both; animation-delay: calc(var(--d) * .06s);
}
.bs-marks li.got { background: rgba(47,191,113,.2); color: #6ee7a5; }
.bs-marks li.missed { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }

/* Sketchy Telephone reveal */
.stage.tel-reveal { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; gap: clamp(8px, 1.6vh, 16px); }
.tel-chain {
  --gap: clamp(8px, 1.2vw, 16px); --label: 52px;
  list-style: none; padding: 0; margin: 0; flex: 1; min-height: 0; container-type: size;
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: max-content;
  gap: var(--gap); align-content: center; justify-items: center;
}
.tel-card {
  --side: min(calc((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols)), calc((100cqh - (var(--rows) - 1) * var(--gap)) / var(--rows) - var(--label)));
  width: var(--side); display: flex; flex-direction: column; gap: 6px; position: relative;
  animation: pop .45s both cubic-bezier(.2,1.4,.4,1);
}
.tel-card img, .tel-card .tel-blank {
  width: var(--side); height: var(--side); border-radius: 16px; background: #fff; display: grid; place-items: center;
}
.tel-card .tel-blank { background: var(--surface); color: var(--muted); font-weight: 600; }
.tel-card.prompt, .tel-card.guess {
  height: var(--side); justify-content: center; align-items: center; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
}
.tel-card.prompt { background: linear-gradient(135deg, #4b5fe8, #7c64f2); border: 0; }
.tel-card .tel-text { font-family: var(--display); font-size: calc(var(--side) * .13); line-height: 1.1; overflow-wrap: anywhere; }
.tel-card .tel-label { color: var(--muted); font-size: clamp(12px, 1.1vw, 15px); font-weight: 600; text-align: center; }
.tel-card.prompt .tel-label { color: rgba(255,255,255,.8); }
.tel-card.new img, .tel-card.new.guess, .tel-card.new.prompt { box-shadow: 0 0 0 4px var(--spark), 0 14px 34px rgba(0,0,0,.4); }

/* ---------- phones ---------- */
.btn.wide { width: 100%; margin-top: 18px; }
.team-badge { border-radius: 999px; padding: 6px 16px; font-weight: 700; color: #fff; background: var(--team); }
.act-screen { gap: 14px; }
.act-card {
  display: grid; gap: 8px; justify-items: center; text-align: center; background: var(--surface);
  border: 2px solid var(--line); border-radius: 22px; padding: 26px 18px; margin-top: 6px;
}
.act-category { color: var(--spark); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.act-prompt { font-family: var(--display); font-size: clamp(32px, 10vw, 46px); line-height: 1.05; overflow-wrap: anywhere; }
.got-btn { background: var(--good); color: #fff; border: 0; min-height: 76px; font-size: 24px; margin-top: auto; }
.skip-btn { min-height: 48px; }
.center-fill { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.bs-guesser { gap: 12px; }
.bs-btn {
  flex: 1; border: 0; border-radius: 26px; color: #fff; font-family: var(--display); font-weight: 700;
  font-size: clamp(34px, 11vw, 52px); cursor: pointer; touch-action: manipulation; transition: transform .08s;
}
.bs-btn.got { background: var(--good); }
.bs-btn.pass { background: #5b5670; flex: .7; }
.bs-btn:active { transform: scale(.97); }
.bs-btn.tapped { animation: flash .35s; }
@keyframes flash { 0% { filter: brightness(1.6); } 100% { filter: none; } }
.tel-word { font-family: var(--display); font-size: 28px; }
.tel-nodraw { background: var(--surface); border-radius: 14px; padding: 20px; text-align: center; color: var(--muted); font-weight: 600; }

@media (max-height: 520px) and (orientation: landscape) {
  .spot-name { font-size: clamp(26px, 11vh, 46px); }
  .spot-sub { font-size: 15px; }
  .spot-reveal { font-size: clamp(30px, 13vh, 56px); }
  .spot-category { font-size: 14px; padding: 3px 14px; }
  .spot-body { gap: 4px; }
  .spot-body .timer { width: 56px; }
  .team-score { padding: 4px 12px; gap: 8px; }
  .team-pts { font-size: 22px; }
  .bs-clue { font-size: clamp(36px, 18vh, 80px); }
  .bs-marks li { font-size: 12px; padding: 4px 10px; }
  .board.small li { padding: 3px 12px; font-size: 13px; }
  .tel-chain { --label: 34px; }
  .tel-card .tel-label { font-size: 10px; }
  .tel-card img, .tel-card .tel-blank, .tel-card.prompt, .tel-card.guess { border-radius: 10px; }
  .mt-teams { gap: 6px; } .mt-team { padding: 6px 10px; } .mt-team b { font-size: 14px; } .mt-team span { font-size: 12px; }
  .seg-btn { min-height: 34px; padding: 0 14px; font-size: 14px; }
}
.logo-art.lettered .sparks { top: 13%; right: 11%; width: 13%; height: 13%; }
.phone-screen.play .act-card { flex: 1; align-content: center; }
.act-screen .got-btn { margin-top: 0; }

/* =========================================================
   QUIZ ROUND BREAK — e.g. "Bonus Round" title card
   ========================================================= */
/* editor */
.add-row { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-top: 16px; }
.add-row .add-q { margin-top: 0; }
.add-q.add-break { border-color: rgba(244,60,60,.6); color: var(--cream); }
.add-q.add-break:hover { background: rgba(244,60,60,.14); }
.q-card.break-card {
  background: linear-gradient(135deg, rgba(244,60,60,.22), rgba(249,216,74,.08)), var(--surface);
  border: 1px solid rgba(244,60,60,.55);
}
.break-card .q-num { font-family: var(--display); font-size: 18px; color: var(--cream); }
.break-note { color: var(--muted); font-size: 14px; }
.break-card .q-tools { margin-left: auto; }
.break-fields { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.break-fields label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); }
.break-fields input {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 18px; font-weight: 600; color: var(--text);
}
.break-fields .opt { font-weight: 500; opacity: .75; }
.break-fields input:focus { outline: none; border-color: var(--muted); }
@media (max-width: 640px) { .add-row, .break-fields { grid-template-columns: minmax(0, 1fr); } }

/* TV title card */
.stage.round-break {
  height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; position: relative; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 110%, #ff8a3d 0%, var(--flaro) 38%, #8e1426 72%, #3a0b17 100%);
}
.stage.round-break .stage-bar { position: relative; z-index: 2; }
.stage.round-break .stage-bar .brand { color: var(--cream); }
.stage.round-break .btn.ghost { color: var(--cream); border-color: rgba(253,243,223,.45); }
.stage.round-break .btn.primary { background: var(--cream); color: #2b1416; }
.rb-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: clamp(6px, 1.6vh, 16px); color: var(--cream); position: relative; z-index: 1; padding-bottom: 6vh;
}
.rb-eyebrow {
  font-family: var(--display); font-size: clamp(16px, 2vw, 28px); letter-spacing: .28em; text-transform: uppercase;
  color: var(--spark); animation: slide .6s .1s both cubic-bezier(.2,.8,.2,1);
}
.rb-title {
  font-family: var(--display); font-weight: 700; line-height: .95; letter-spacing: 0; text-transform: uppercase;
  font-size: clamp(64px, 12vw, 200px); max-width: 14ch; overflow-wrap: anywhere;
  text-shadow: 0 6px 0 rgba(58,11,23,.55), 0 0 60px rgba(249,216,74,.45);
  animation: rb-slam .75s .25s both cubic-bezier(.2,1.5,.4,1), rb-glow 2.4s 1.2s ease-in-out infinite;
}
.rb-sub {
  font-family: var(--display); font-size: clamp(26px, 4vw, 64px); line-height: 1.1; max-width: 22ch;
  background: rgba(58,11,23,.38); border-radius: 999px; padding: .15em .8em;
  animation: slide .6s .8s both cubic-bezier(.2,.8,.2,1);
}
.rb-meta { font-weight: 600; font-size: clamp(15px, 1.6vw, 22px); opacity: .85; animation: slide .6s 1s both cubic-bezier(.2,.8,.2,1); }
@keyframes rb-slam { from { transform: scale(2.2) rotate(-4deg); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes rb-glow { 0%, 100% { text-shadow: 0 6px 0 rgba(58,11,23,.55), 0 0 40px rgba(249,216,74,.35); } 50% { text-shadow: 0 6px 0 rgba(58,11,23,.55), 0 0 90px rgba(249,216,74,.7); } }

/* rising flames along the bottom */
.rb-flames { position: absolute; inset: auto 0 -4vh 0; height: 42vh; z-index: -1; pointer-events: none; }
.rb-flames i {
  position: absolute; bottom: 0; width: 26vw; height: 100%; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(60% 70% at 50% 75%, rgba(249,216,74,.85), rgba(255,138,61,.55) 45%, rgba(244,60,60,0) 72%);
  filter: blur(6px); transform-origin: 50% 100%; animation: rb-flicker 1.8s ease-in-out infinite alternate;
}
.rb-flames i:nth-child(1) { left: -6vw; animation-delay: -.3s; height: 80%; }
.rb-flames i:nth-child(2) { left: 16vw; animation-delay: -1.1s; }
.rb-flames i:nth-child(3) { left: 37vw; animation-delay: -.6s; height: 112%; }
.rb-flames i:nth-child(4) { left: 58vw; animation-delay: -1.5s; }
.rb-flames i:nth-child(5) { left: 79vw; animation-delay: -.9s; height: 85%; }
@keyframes rb-flicker { from { transform: scaleY(.86) scaleX(1.05) skewX(-3deg); opacity: .8; } to { transform: scaleY(1.08) scaleX(.95) skewX(3deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rb-title, .rb-flames i { animation: none; } }

@media (max-height: 520px) and (orientation: landscape) {
  .rb-card { padding-bottom: 2vh; gap: 4px; }
  .rb-title { font-size: clamp(40px, 19vh, 96px); }
  .rb-sub { font-size: clamp(18px, 7vh, 32px); }
  .rb-eyebrow { font-size: 13px; }
  .rb-meta { font-size: 13px; }
}

/* phone */
.round-break-phone { background: radial-gradient(110% 70% at 50% 100%, rgba(244,60,60,.55), transparent 70%); }
.round-break-phone h1 { text-transform: uppercase; font-size: 40px; line-height: 1; }
.rb-phone-sub { font-family: var(--display); font-size: 24px; color: var(--spark); }

/* round break pictures */
.break-photo { margin-top: 12px; }
.break-add-photo { width: 100%; min-height: 52px; border-style: dashed; }
.break-photo { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.break-photo:has(.break-add-photo) { grid-template-columns: 1fr; }
.break-thumb { position: relative; width: 180px; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.break-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.break-thumb.as-title { background: repeating-conic-gradient(#3a3550 0 25%, #2c2840 0 50%) 0 0 / 16px 16px; }
.break-thumb.as-title img { object-fit: contain; }
.break-thumb .btn { position: absolute; top: 6px; right: 6px; width: 30px; min-height: 30px; background: rgba(18,17,26,.8); }
.break-photo-opts { display: grid; gap: 8px; }
.break-choice { display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.break-choice:has(input:checked) { border-color: rgba(244,60,60,.8); background: rgba(244,60,60,.12); }
.break-choice input { margin-top: 3px; accent-color: var(--flaro); width: 17px; height: 17px; flex: none; }
@media (max-width: 640px) { .break-photo { grid-template-columns: minmax(0, 1fr); } .break-thumb { width: 100%; } }

.rb-photo {
  display: block; max-width: min(70vw, 900px); max-height: 36vh; object-fit: cover; border-radius: clamp(14px, 1.6vw, 26px);
  box-shadow: 0 0 0 clamp(4px, .45vw, 8px) var(--cream), 0 24px 60px rgba(58,11,23,.6);
  animation: rb-photo-in .7s .1s both cubic-bezier(.2,1.3,.4,1);
}
.rb-title.with-photo { font-size: clamp(48px, 8vw, 130px); }
.has-art .rb-card { padding-bottom: 3vh; }
.rb-title-art { margin: 0; display: grid; place-items: center; animation: rb-slam .75s .25s both cubic-bezier(.2,1.5,.4,1); }
.rb-title-art img {
  display: block; max-width: min(84vw, 1300px); max-height: 52vh; object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(58,11,23,.55)) drop-shadow(0 0 40px rgba(249,216,74,.3));
}
@keyframes rb-photo-in { from { transform: translateY(24px) scale(.9) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rb-photo, .rb-title-art { animation: none; } }
@media (max-height: 520px) and (orientation: landscape) {
  .rb-photo { max-height: 30vh; box-shadow: 0 0 0 3px var(--cream), 0 10px 30px rgba(58,11,23,.6); }
  .rb-title.with-photo { font-size: clamp(30px, 12vh, 60px); }
  .rb-title-art img { max-height: 44vh; }
}
.rb-phone-art { max-width: 100%; max-height: 32vh; border-radius: 16px; object-fit: cover; box-shadow: 0 0 0 3px var(--cream); }
.rb-phone-art.as-title { object-fit: contain; box-shadow: none; max-height: 30vh; }

/* home-screen notices (move browser quizzes, storage warning) */
.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--c2); border-radius: var(--radius); padding: 16px 18px; margin: 20px 0;
}
.notice.warn { border-color: var(--bad); background: rgba(239,83,80,.1); display: block; }
.notice code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.notice-actions { display: flex; gap: 8px; }

/* =========================================================
   GAMES WELCOME — Join a game / Host a game
   ========================================================= */
.welcome {
  min-height: 100vh; min-height: 100dvh; max-width: 920px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(24px, 5vh, 44px);
  padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
}
.welcome-top { display: grid; justify-items: center; gap: 10px; text-align: center; }
.welcome-mark { font-size: clamp(38px, 7vw, 64px); }
.welcome-tag { color: var(--muted); font-size: clamp(16px, 2vw, 20px); max-width: 30ch; }
.welcome-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.welcome-choice {
  display: grid; justify-items: start; gap: 4px; text-align: left; text-decoration: none; color: var(--text);
  padding: clamp(20px, 3vw, 30px); border-radius: 22px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; transition: transform .15s, border-color .15s, background .15s;
}
.welcome-choice:hover, .welcome-choice:focus-visible { transform: translateY(-3px); border-color: var(--muted); }
.welcome-choice:active { transform: scale(.98); }
.join-choice { background: var(--flaro); border-color: var(--flaro); color: var(--cream); }
.join-choice:hover, .join-choice:focus-visible { border-color: var(--cream); }
.wc-icon { font-size: 30px; line-height: 1; margin-bottom: 10px; }
.wc-title { font-family: var(--display); font-size: clamp(24px, 3vw, 32px); line-height: 1.1; }
.wc-sub { font-size: 15px; opacity: .85; }
.welcome-games { display: grid; gap: 12px; }
.welcome-games-label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: center; }
.welcome-logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; }
.welcome-logos li { display: grid; justify-items: center; gap: 6px; animation: slide .5s calc(var(--d) * 50ms) both cubic-bezier(.2,.8,.2,1); }
.welcome-logos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 22%; background: var(--surface-2); }
.welcome-logos span { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.2; }
.welcome-home { align-self: center; color: var(--muted); font-size: 14px; text-decoration: none; }
.welcome-home:hover { color: var(--text); text-decoration: underline; }
.back-link {
  align-self: flex-start; background: none; border: 0; color: var(--muted); font-size: 15px; font-weight: 600;
  padding: 6px 0; cursor: pointer;
}
.back-link:hover { color: var(--text); }
@media (max-width: 700px) {
  .welcome { justify-content: flex-start; padding-top: max(40px, env(safe-area-inset-top)); }
  .welcome-choices { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .welcome-choice { grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
  .wc-icon { grid-row: span 2; margin: 0; font-size: 34px; }
  .welcome-logos { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .welcome-logos li { animation: none; } }
.welcome-logos li { min-width: 0; }
.welcome-logos span { overflow-wrap: anywhere; }

/* =========================================================
   QUIZ ANSWER PROOF — photo and/or note on the reveal screen
   ========================================================= */
.proof-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.proof-label { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.proof-label .opt { font-weight: 500; opacity: .75; }
.proof-add { min-height: 40px; border-style: dashed; }
.proof-thumb { position: relative; display: block; width: 72px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.proof-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.proof-thumb .btn { position: absolute; top: 2px; right: 2px; width: 22px; min-height: 22px; font-size: 11px; background: rgba(18,17,26,.85); }
.proof-row input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--text); min-width: 0; }
.proof-row input:focus { outline: none; border-color: var(--muted); }
@media (max-width: 640px) { .proof-row { grid-template-columns: auto minmax(0, 1fr); } .proof-row input { grid-column: 1 / -1; } }

.reveal-mid { display: flex; align-items: flex-end; justify-content: center; gap: clamp(20px, 4vw, 64px); margin-top: auto; min-height: 0; }
.stage.reveal .reveal-mid .bars { margin-top: 0; }
.stage.reveal.has-proof .reveal-mid { align-items: stretch; }
.stage.reveal.has-proof .bars { height: auto; min-height: clamp(110px, 22vh, 220px); align-self: flex-end; }
.proof {
  margin: 0; display: flex; flex-direction: column; gap: 10px; max-width: min(46vw, 640px); min-height: 0;
  animation: rb-photo-in .6s .1s both cubic-bezier(.2,1.3,.4,1);
}
.proof img {
  display: block; max-width: 100%; max-height: clamp(130px, 28vh, 360px); object-fit: contain; align-self: center;
  border-radius: 16px; box-shadow: 0 0 0 4px var(--text), 0 18px 40px rgba(0,0,0,.45);
}
.proof figcaption { font-size: clamp(16px, 1.5vw, 22px); line-height: 1.3; font-weight: 600; text-align: center; color: var(--text); max-width: 34ch; align-self: center; }
.proof.note-only { justify-content: center; max-width: min(40vw, 560px); }
.proof.note-only figcaption { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; }
.stage.reveal.has-proof .q-text { font-size: clamp(22px, 2.6vw, 38px); }
.stage.reveal.has-proof { gap: clamp(8px, 1.6vh, 18px); }
.stage.reveal.has-proof .answer { min-height: clamp(48px, 7.5vh, 88px); }
@media (max-height: 520px) and (orientation: landscape) {
  .reveal-mid { gap: 14px; }
  .proof { gap: 4px; }
  .proof img { max-height: 30vh; border-radius: 10px; box-shadow: 0 0 0 2px var(--text); }
  .proof figcaption { font-size: 13px; }
  .proof.note-only figcaption { padding: 8px 12px; border-radius: 10px; }
  .stage.reveal.has-proof .bars { min-height: 0; height: clamp(52px, 22vh, 110px); }
}
@media (max-width: 640px) and (orientation: portrait) {
  .reveal-mid { flex-direction: column; align-items: center; }
  .proof { max-width: 100%; }
}
.phone-proof-note { max-width: 32ch; font-size: 16px; line-height: 1.4; background: rgba(0,0,0,.25); border-radius: 14px; padding: 10px 14px; }

/* =========================================================
   QUIZ PREVIEW (editor ▶ Preview)
   ========================================================= */
.previewing .stage .pill { display: none; } /* no players in a preview */
.previewing .stage { padding-bottom: 96px; }
.previewing.with-phone .stage { padding-right: calc(clamp(16px, 3vw, 40px) + min(22vw, 250px) + 24px); }
.preview-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 999px;
  background: rgba(28,26,39,.94); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.5);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); max-width: calc(100vw - 24px);
}
.preview-bar .btn { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 999px; }
.preview-bar .btn.icon { width: 36px; padding: 0; }
.preview-bar .btn.on { background: var(--text); color: var(--bg); }
.pv-tag { font-family: var(--display); font-weight: 700; color: var(--spark); margin-right: 4px; }
.pv-where { font-weight: 600; font-size: 14px; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 32vw; }
.preview-phone {
  position: fixed; right: clamp(12px, 2vw, 28px); top: 50%; transform: translateY(-50%); z-index: 25;
  width: min(22vw, 250px); aspect-ratio: 390 / 800; display: grid; gap: 6px; justify-items: center;
}
.preview-phone iframe {
  width: 390px; height: 800px; border: 0; border-radius: 44px; background: var(--bg);
  position: absolute; top: 0; left: 0; transform-origin: top left;
  box-shadow: 0 0 0 10px #2a2738, 0 24px 60px rgba(0,0,0,.6);
}
.preview-phone { overflow: visible; }
.preview-phone span { position: absolute; bottom: -26px; font-size: 13px; color: var(--muted); font-weight: 600; }
@media (max-width: 900px) {
  .previewing.with-phone .stage { padding-right: clamp(16px, 3vw, 40px); }
  .preview-phone { display: none; }
  .preview-bar [data-act="pv-phone"] { display: none; }
}
/* proof on a sideways phone: photo and note sit side by side; the vote bars step aside to make room */
@media (max-height: 520px) and (orientation: landscape) {
  .stage.reveal.has-proof .bars { display: none; }
  .stage.reveal.has-proof .reveal-mid { flex: 1; min-height: 0; align-items: center; margin-top: 0; }
  .stage.reveal.has-proof .proof { flex-direction: row; align-items: center; gap: 12px; max-width: 92vw; min-height: 0; height: 100%; }
  .stage.reveal.has-proof .proof img { max-height: 100%; height: 100%; max-width: 45vw; }
  .stage.reveal.has-proof .proof figcaption { text-align: left; font-size: 13px; max-width: 40ch; }
  .stage.reveal.has-proof .q-text { -webkit-line-clamp: 1; }
  .previewing .stage { padding-bottom: 58px; }
  .preview-bar { bottom: 8px; padding: 4px 6px 4px 10px; gap: 4px; }
  .preview-bar .btn { min-height: 30px; padding: 0 10px; font-size: 13px; }
  .preview-bar .btn.icon { width: 30px; }
  .pv-where { font-size: 12px; }
}
