/* First Light. Presenter-only: phones and the host sign-in retain their own palette. */
body.presentation-view {
  --paper: #422b38;
  --ink: #fff5e7;
  --muted: #ddbdc9;
  --line: #916575;
  --red: #ffb0a7;
  --blue: #a7d8f3;
  --stage-accent: #f1a6b6;
  --stage-wash: #654252;
  --first-light-panel: #4c303f;
  color: var(--ink);
  background: radial-gradient(ellipse at 85% 22%, #79526455, transparent 58%), #422b38;
  isolation: isolate;
}
body.presentation-view[data-game="connections"] { --stage-accent: #d4b8f4; --stage-wash: #59415f; }
body.presentation-view[data-game="crossword"] { --stage-accent: #a7d8f3; --stage-wash: #3e4858; }
body.presentation-view[data-game="strands"] { --stage-accent: #a2d9d8; --stage-wash: #3c4c51; }
body.presentation-view[data-game="bee"] { --stage-accent: #f5d882; --stage-wash: #594939; }
body.presentation-view::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: url('/first-light-lines.svg') center / cover no-repeat;
}
.presentation-view .masthead { border-bottom: 1px solid #d9aab877; }
.presentation-view .wordmark { font-weight: 500; font-style: italic; letter-spacing: -.055em; }
.presentation-view .brand-spark { color: #f18b9d; }
.presentation-view .stage { padding-top: 24px; }
.presentation-view .stage-heading h1 { font-weight: 500; }
.presentation-view .stage-heading, .presentation-view .welcome-intro { text-shadow: 0 2px 12px #422b38; }
.presentation-view .game-emblem { background: #513443; border-color: #926577; }
.presentation-view :is(.stage-puzzle, .stage-stats, .instruction-card, .instruction-preview, .projected-grid-panel, .projected-clue-panel) {
  background: var(--first-light-panel); border: 1px solid #9c718166;
  border-radius: 18px; box-shadow: 0 12px 34px #24131f20;
}
.presentation-view .projected-clue-panel { padding: 16px 22px; }
.presentation-view .stage-clue { border-color: #9c718166; }
.presentation-view .instruction-preview { background: #563847; }
.presentation-view .instruction-steps li::before { background: #715062; color: #fff5e7; }
.presentation-view .timer-track { stroke: #805c6d; }
.presentation-view .clock.urgent { color: #ffb0a7; }
.presentation-view .wordle-main-clock { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; color: #fff5e7; }
.presentation-view .stage-clock div > .clock { font-size: 3.6rem; color: var(--ink); }
.presentation-view .crossword-stage-clock > .clock { font-size: clamp(3rem, 4.5vw, 4.3rem); color: var(--ink); line-height: 1.05; }
.presentation-view .wordle-live { background: #422b38d9; border-radius: 18px; }
.presentation-view .live-dot { background: #c7dbae; box-shadow: 0 0 0 4px #c7dbae18; }
.presentation-view .live-team-card { background: #4c303f; border-color: #906675; }
.presentation-view .live-team-card.team-complete { background: #424a3e; border-color: #91ac83; }
.presentation-view .progress-team-name > span { color: #c5e0b3; }
.presentation-view .mini-tile { border-color: #b18b9b; }
.presentation-view .mini-group { border-color: #b18b9b; }
.presentation-view .mini-hex::before { background: #4c303f; }
.presentation-view .mini-hex.filled::before { background: #f1d05d; }
/* Teaching examples and playable letter surfaces keep their familiar meanings. */
.presentation-view :is(.example-connections span, .example-strands span, .example-crossword, .strand-theme, .extraction, .strand-found-words) { color: #29232a; }
.presentation-view .example-connections span { background: #f4e9df; }
.presentation-view .example-strands span { background: #f4e9df; }
.presentation-view .example-strands .example-found { background: #317a88; color: white; }
.presentation-view .example-crossword { background: #29232a; border-color: #29232a; }
.presentation-view .example-crossword i { background: #29232a; }
.presentation-view .strand-letter:not(.found-letter):not(.spangram-letter):not(.selected-letter) { color: #fff5e7; }
.presentation-view .strand-letter:not(.found-letter):not(.spangram-letter):not(.selected-letter)::before { background: #725062; }
.presentation-view .pangrams { color: #f5d882; }
.presentation-view .stage-legend span:first-child { color: #c5e0b3; }
.presentation-view .stage-legend span:nth-child(2) { color: #f5d882; }
.presentation-view .stage-legend span:last-child { color: #ddbdc9; }
/* The lobby is one composition: greeting, portrait, QR, then the whole roster. */
.presentation-view .welcome-lobby {
  grid-template-columns: minmax(0, 1fr) minmax(220px, .82fr) 346px;
  grid-template-areas: 'intro portrait qr' 'teams teams teams' 'arrival arrival arrival';
  gap: 18px 32px; padding-top: 4px; align-items: center;
}
.presentation-view .welcome-intro h1 { font-size: clamp(3.5rem, 6.4vw, 6rem); line-height: 1.02; padding: 0; max-width: 320px; }
.presentation-view .welcome-intro h1 em { color: #f18b9d; }
.presentation-view .lobby-party-label { color: #f1a6b6; }
.presentation-view .lobby-portrait { grid-area: portrait; margin: 0 auto; width: 100%; max-width: 278px; padding: 7px 7px 12px; background: #fff5e7; border-radius: 150px 150px 5px 5px; box-shadow: 0 12px 30px #24131f44; }
.presentation-view .lobby-portrait img { display: block; width: 100%; height: 285px; object-fit: cover; object-position: center 35%; border-radius: 145px 145px 0 0; }
.presentation-view .welcome-qr { color: #422b38; background: #fff5e7; border: 0; border-radius: 16px; padding: 14px 18px; margin: 0; transform: none; box-shadow: 0 10px 30px #24131f33; }
.presentation-view .welcome-qr h2 { font-size: 2rem; margin: 0; }
.presentation-view .welcome-qr img { max-width: 300px; margin: 8px auto; background: white; border-radius: 3px; }
.presentation-view .welcome-qr .join-address { color: #694653; border-color: #c7a5af; margin-top: 9px; padding-top: 9px; font-size: .7rem; }
.presentation-view .qr-three-steps { font-size: .62rem; gap: 7px; }
.presentation-view .qr-three-steps b { background: #efd7dd; color: #422b38; }
.presentation-view .qr-corner-star { color: #f18b9d; }
.presentation-view .welcome-roll-call > header { margin-bottom: 9px; }
.presentation-view .welcome-roll-call h2 { font-size: 1.45rem; }
.presentation-view .lobby-live-label { color: #d7e5c3; margin-top: 4px; }
.presentation-view .lobby-team-count { color: #f1a6b6; }
.presentation-view .lobby-team-count strong { font-size: 2.5rem; }
.presentation-view .lobby-team-roster { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.presentation-view .lobby-team-card { background: #4c303f; border-color: #986879; min-height: 48px; padding: 7px 9px; grid-template-columns: 28px minmax(0, 1fr) 10px; gap: 7px; border-radius: 8px; }
.presentation-view .lobby-team-avatar { width: 28px; height: 28px; border-radius: 7px; font-size: .65rem; }
.presentation-view .lobby-team-name { font-size: .75rem; }
.presentation-view .lobby-team-check { color: #c6dfaf; }
.presentation-view .lobby-team-card.recent-arrival { background: #674151; border-color: #f18b9d; }
.presentation-view .lobby-empty-roster { min-height: 65px; padding: 12px 18px; color: #fff5e7; background: #4c303f; border-color: #986879; }
.presentation-view .lobby-arrival { min-height: 57px; padding: 9px 18px; gap: 12px; background: #573747; border-color: #986879; }
.presentation-view .arrival-symbol { font-size: 2rem; color: #f1a6b6; }
.presentation-view .arrival-label { color: #f1a6b6; font-size: .6rem; }
.presentation-view .lobby-arrival-name { font-size: 1.3rem; margin-top: 0; }
.presentation-view .lobby-arrival p { color: #ddbdc9; }
.presentation-view .lobby-arrival.fresh-announcement { background: #674151; border-color: #f18b9d; }
/* Memories accompany the solution, with the answer always given enough space. */
.presentation-view .round-reveal { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .8fr); gap: 36px; align-items: center; margin-top: 22px; }
.presentation-view .reveal-answer { min-width: 0; padding: 22px; background: #4c303f; border: 1px solid #9c718166; border-radius: 18px; }
.presentation-view .reveal-answer :is(.reveal, .crossword-reveal, .strands-reveal, .bee-reveal) { margin: 0; }
.presentation-view .reveal-answer :is(h1, .reveal h1, .crossword-reveal h1, .strands-reveal h1) { font-size: clamp(2.4rem, 4vw, 3.5rem); margin-bottom: 18px; }
.presentation-view .reveal-answer .answer-preview { margin-top: 25px; gap: 8px; }
.presentation-view .reveal-answer .answer-preview span { width: 70px; height: 78px; font-size: 2.8rem; }
.presentation-view .reveal-answer .connection-group { font-size: 1.15rem; padding: 15px 10px; }
.presentation-view .reveal-answer .strands-grid { max-width: 260px; margin-top: 12px; }
.presentation-view .reveal-answer .crossword-grid { max-width: 280px; }
.presentation-view .reveal-answer .bee-reveal .bee-hive { transform: scale(.76); margin-top: -12px; margin-bottom: -18px; }
.presentation-view .reveal-answer .bee-answer-list { font-size: .85rem; }
.presentation-view .reveal-answer .pangrams { font-size: 1.2rem; margin-top: 12px; }
.presentation-view .reveal-answer .lede { font-size: 1rem; margin-top: 10px; }
.presentation-view .reveal-memory { min-width: 0; margin: 0; padding: 9px 9px 15px; background: #fff5e7; color: #422b38; transform: rotate(-2deg); box-shadow: 0 14px 40px #24131f44; }
.presentation-view .reveal-memory img { display: block; width: 100%; height: 310px; object-fit: cover; background: #eadcd0; }
.presentation-view .reveal-memory.cover-memory img { object-fit: contain; }
.presentation-view .reveal-memory.portrait-memory { width: 100%; max-width: 310px; justify-self: center; }
.presentation-view .reveal-memory.portrait-memory img { object-fit: contain; height: 380px; background: #fff5e7; }
.presentation-view .reveal-memory figcaption { font: italic 1.2rem/1.3 Georgia, serif; text-align: center; padding: 12px 9px 0; }
.presentation-view .final-memories { display: flex; justify-content: center; gap: 14px; margin: 14px auto 0; }
.presentation-view .final-memories figure { margin: 0; padding: 4px; background: #fff5e7; transform: rotate(-3deg); }
.presentation-view .final-memories figure:nth-child(even) { transform: rotate(3deg); }
.presentation-view .final-memories img { display: block; border: 4px solid #fff5e7; width: 120px; height: 72px; object-fit: cover; }
/* Answers have their own slide. The host advances each generous photo moment. */
.presentation-view .round-reveal.answer-only { grid-template-columns: minmax(0, 1fr); max-width: 850px; margin: 18px auto 0; }
.presentation-view .answer-only .reveal-answer { text-align: center; }
.presentation-view .answer-only .reveal-answer .answer-preview { justify-content: center; }
.presentation-view .answer-only .reveal-answer .crossword-grid { max-width: 355px; margin: 0 auto; }
.presentation-view .answer-only .reveal-answer .strands-grid { max-width: 325px; }
.presentation-view .answer-only .reveal-answer .connection-group { max-width: 650px; margin-left: auto; margin-right: auto; }
.presentation-view .connection-group.group-with-photo { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 18px; padding: 9px; }
.presentation-view .group-with-photo img { width: 118px; height: 90px; object-fit: contain; background: #fff5e7; border-radius: 3px; }
.presentation-view .chapter-album { max-width: 1100px; margin: 0 auto; }
.presentation-view .chapter-album header { text-align: center; margin-bottom: 18px; }
.presentation-view .chapter-album h1 { font: 500 clamp(2.7rem, 5vw, 4.5rem)/1.1 Georgia, serif; margin: 0; }
.presentation-view .album-caption { font: italic 1.2rem Georgia, serif; color: #e7c4d0; margin: 9px 0 0; }
.presentation-view .album-grid { display: grid; gap: 20px; height: min(52vh, 450px); }
.presentation-view .album-grid[data-photo-count="1"] { max-width: 830px; margin: auto; }
.presentation-view .album-grid[data-photo-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.presentation-view .album-grid[data-photo-count="3"] { grid-template-columns: 1.25fr 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
.presentation-view .album-grid[data-photo-count="3"] figure:first-child { grid-row: 1 / 3; }
.presentation-view .album-grid figure { min-width: 0; min-height: 0; margin: 0; padding: 7px; background: #fff5e7; box-shadow: 0 10px 25px #21121c55; border-radius: 3px; transform: rotate(-1deg); }
.presentation-view .album-grid figure:nth-child(even) { transform: rotate(1deg); }
.presentation-view .album-grid img { display: block; width: 100%; height: 100%; object-fit: contain; background: #eee5dc; }
.presentation-view .album-gift { text-align: center; font: 500 1.45rem Georgia, serif; margin: 18px 0 0; color: #f5d882; }
@media (max-height: 850px) and (min-width: 701px) {
  .presentation-view .chapter-album header { margin-bottom: 14px; }
  .presentation-view .chapter-album h1 { font-size: 3.4rem; }
  .presentation-view .album-grid { height: 385px; max-height: 49vh; }
  .presentation-view .album-caption { margin-top: 7px; }
  .presentation-view .album-gift { margin-top: 14px; }
}
@media (max-width: 700px) {
  .presentation-view .album-grid { height: 360px; gap: 12px; }
  .presentation-view .album-grid[data-photo-count="3"] { grid-template-columns: 1fr 1fr; }
}
/* Opaque bars keep names readable throughout the score animation. */
.presentation-view .score-race td { background: #4c303f; }
.presentation-view .score-bar rect { fill: #684456; }
.presentation-view .winner .score-bar rect { fill: #815367; }
.presentation-view .race-rank { color: #fff5e7; background: #715062; }
.presentation-view .winner .race-rank { background: #edafbe; color: #422b38; }
.presentation-view .team-initial { background: #f1e4d8; color: #422b38; border-color: #f1e4d8; }
.presentation-view :is(.race-gain, .round-gain) { color: #cce4b9; }
.presentation-view .podium-place { background: #4c303f; border-color: #986879; }
.presentation-view .podium-revealed { background: #674151; color: #e6c8d4; }
.presentation-view .podium-slot-0.podium-revealed { background: linear-gradient(135deg, #845469, #674151); color: #f6dc95; border-color: #f1a6b6; box-shadow: 0 0 35px #ea98b71a; }
.presentation-view .podium-slot-2.podium-revealed { background: #634345; border-color: #b38a77; color: #f2c6a9; }
/* Controls and native dialogs are deliberately opaque. */
.presentation-view .presenter-toolbar { background: #38232f; border-color: #916575; backdrop-filter: none; }
.presentation-view .button { background: #edafbe; border-color: #edafbe; color: #422b38; }
.presentation-view .button:hover:not(:disabled) { background: #ffc8d4; border-color: #ffc8d4; }
.presentation-view .button.secondary { color: #fff5e7; background: #4c303f; border-color: #aa7e8f; }
.presentation-view .button.secondary:hover:not(:disabled) { background: #654252; }
.presentation-view :is(.presenter-settings .settings-content, dialog) { background: #4c303f; color: #fff5e7; border-color: #aa7e8f; box-shadow: 0 12px 40px #24131f66; }
.presentation-view input { color: #29232a; border-color: #aa7e8f; }
.presentation-view .transfer-result { background: #654252; }
.presentation-view dialog::backdrop { background: #1f1327b3; }
.presentation-view .notice { background: #4c303f; border-color: #cce4b9; }
.presentation-view .notice.error { background: #623746; border-color: #ffb0a7; }
@media (min-width: 701px) and (max-height: 850px) {
  .presentation-view .stage { padding-top: 18px; }
  .presentation-view .welcome-lobby { grid-template-columns: minmax(0, 1fr) minmax(220px, .82fr) 286px; row-gap: 12px; }
  .presentation-view .lobby-portrait img { height: 254px; }
  .presentation-view .lobby-portrait { max-width: 248px; }
  .presentation-view .welcome-qr img { max-width: 198px; }
  .presentation-view .welcome-intro h1 { font-size: 5.2rem; }
  .presentation-view .stage-clock div > .clock { font-size: 2.8rem; }
  .presentation-view .crossword-stage-clock > .clock { font-size: 3.5rem; }
  .presentation-view .round-reveal { margin-top: 18px; gap: 28px; }
  .presentation-view .reveal-memory img { height: 295px; }
  .presentation-view .reveal-memory.portrait-memory img { height: 340px; }
  .presentation-view .reveal-answer { padding: 18px; }
}
@media (max-width: 1000px) and (min-width: 701px) {
  .presentation-view .welcome-lobby { grid-template-columns: minmax(0, 1fr) 210px 245px; gap: 14px 20px; }
  .presentation-view .welcome-intro h1 { font-size: 4rem; }
  .presentation-view .welcome-qr img { max-width: 185px; }
  .presentation-view .lobby-portrait img { height: 245px; }
  .presentation-view .lobby-team-card { grid-template-columns: minmax(0, 1fr) 10px; }
  .presentation-view .lobby-team-avatar { display: none; }
}
@media (max-width: 700px) {
  .presentation-view .welcome-lobby { grid-template-columns: 1fr; grid-template-areas: 'intro' 'portrait' 'qr' 'teams' 'arrival'; gap: 22px; }
  .presentation-view .welcome-intro h1 { font-size: 4rem; }
  .presentation-view .welcome-qr { width: 100%; max-width: 310px; }
  .presentation-view .lobby-team-roster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .presentation-view .round-reveal { grid-template-columns: 1fr; }
  .presentation-view .reveal-memory { max-width: 400px; margin: 0 auto; }
  .presentation-view .reveal-memory img { height: 260px; }
  .presentation-view .reveal-answer .answer-preview span { width: 45px; height: 55px; font-size: 1.8rem; }
  .presentation-view .final-memories { gap: 8px; }
  .presentation-view .final-memories img { width: 80px; height: 55px; }
}

/* Presentation slides (Keynote deck) woven between the games. */
body.presentation-view.deck-view .masthead { display: none; }
body.presentation-view.deck-view main { padding: 0; }
.presentation-view .deck-stage { height: calc(100vh - 78px); padding: 0; display: grid; }
.presentation-view .deck-slide { min-height: 0; display: grid; place-items: center; text-align: center; }
.presentation-view .deck-image { padding: 10px 14px 0; }
.presentation-view .deck-image img { display: block; max-width: 100%; max-height: calc(100vh - 100px); width: auto; height: auto; object-fit: contain; border-radius: 4px; box-shadow: 0 12px 34px #21121c66; }
.presentation-view .deck-stage .deck-image { grid-template-rows: minmax(0, 1fr); }
.presentation-view .deck-mystery { grid-template-rows: auto minmax(0, 1fr); padding: 36px 40px 10px; gap: 16px; }
.presentation-view .deck-mystery h1, .presentation-view .deck-mystery figure { margin: 0; min-height: 0; height: 100%; display: grid; place-items: center; }
.presentation-view .deck-mystery img { max-height: calc(100vh - 250px); max-width: 100%; width: auto; height: auto; border: 8px solid #fff5e7; border-radius: 3px; box-shadow: 0 12px 34px #21121c88; transform: rotate(-1deg); }

/* Spelling Bee reveal: every cooking word. */
.presentation-view .cooking-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: 1050px; margin: 6px auto 12px; }
.presentation-view .cooking-words .stage-kicker { flex-basis: 100%; text-align: center; }
.presentation-view .cooking-words strong { font: 500 1.15rem Georgia, serif; color: #fff5e7; }
.presentation-view .cooking-words .cooking-pangram { color: #f5d882; }
.presentation-view .bee-reveal h1 { margin-bottom: 4px; }

/* Finale: suspense, then a proper celebration. */
.presentation-view .finale-stage[data-score-beat="suspense"] .podium-place { animation: podium-pulse 1.1s ease-in-out infinite; }
.presentation-view .podium-revealed { animation: podium-pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.presentation-view .podium-slot-0.podium-revealed { scale: 1.1; animation: podium-pop .8s cubic-bezier(.2, 1.6, .4, 1) both, podium-glow 1.6s ease-in-out .8s infinite; }
.presentation-view .finale-stage[data-score-beat="winner"] > .stage-heading h1 { color: #f5d882; animation: podium-pop .8s cubic-bezier(.2, 1.6, .4, 1) both; }
.presentation-view .finale-confetti { inset: 0; position: fixed; z-index: 4; }
.presentation-view .finale-confetti i { top: -30px; opacity: .95; animation: finale-fall 3.4s linear infinite; }
.presentation-view .finale-confetti i:nth-child(4n) { background: #f18b9d; }
.presentation-view .finale-confetti i:nth-child(5n) { background: #a7d8f3; }
@keyframes finale-fall { from { transform: translateY(0) rotate(0); } to { transform: translateY(115vh) rotate(620deg); } }
@keyframes podium-pop { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes podium-pulse { 50% { transform: translateY(-6px); border-color: #f1a6b6; box-shadow: 0 0 24px #f1a6b655; } }
@keyframes podium-glow { 50% { box-shadow: 0 0 60px #f5d882aa; } }
@media (prefers-reduced-motion: reduce) { .presentation-view .podium-revealed, .presentation-view .finale-stage .podium-place, .presentation-view .finale-stage > .stage-heading h1 { animation: none !important; } }
