/* Quiz board styles: shared by every quiz page (/quiz-1/, /quiz-2/, ...). Edit here and every board changes.
   Pairs with /assets/board/board.js. Load it after /assets/board-intro.css:
     <link rel="stylesheet" href="/assets/board-intro.css">
     <link rel="stylesheet" href="/assets/board/board.css">
   A quiz with something special adds its own stylesheet after this one (see charades.css). */
/* ============================================================
   Design tokens (from the party invite)
   ============================================================ */
/* Baloo 2 ExtraBold, bundled locally as two subsets (from Google Fonts) */
@font-face {
  font-family: "QuizDisplay";
  src: url("/assets/fonts/display-latin.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "QuizDisplay";
  src: url("/assets/fonts/display-devanagari.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC,
                 U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}

:root {
  --maroon:     #3D0F14;
  --pink:       #ED5C88;
  --pink-dark:  #D6336C;
  --cream:      #FAF0E0;
  --saffron:    #F5A623;
  --saffron-dk: #E08A12;
  --green:      #1B7A52;
  --gold:       #F7C948;

  --ground:     #F8E4C4;   /* cream warmed with saffron, under the sunburst */
  --display: "QuizDisplay", "Baloo 2", "Segoe UI Black", "Arial Rounded MT Bold", "Nirmala UI", sans-serif;
  --sans: -apple-system, "Segoe UI", Roboto, "Nirmala UI", sans-serif;
  --emoji: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;

  --gutter: min(0.9vw, 1.4vh);
  --lift-ms: 400ms;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}
body {
  background: var(--ground);
  color: var(--maroon);
  font-family: var(--sans);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Full-bleed sunburst from top centre, kept faint so it never fights content */
.sunburst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background: repeating-conic-gradient(from 0deg at 50% 0%,
    var(--saffron-dk) 0deg 6deg,
    var(--saffron) 6deg 12deg);
}

/* Cream panel with the invite's double maroon frame */
.frame {
  position: relative;
  background: var(--cream);
  border: 8px solid var(--maroon);
  border-radius: 20px;
}
.frame::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2.5px solid var(--maroon);
  border-radius: 11px;
  pointer-events: none;
  z-index: 6;
}

.display { font-family: var(--display); font-weight: 800; }

/* Cream numerals need an outline to hold contrast on pink */
.outlined {
  color: var(--cream);
  text-shadow:
     0.045em  0.045em 0 var(--maroon),
    -0.045em  0.045em 0 var(--maroon),
     0.045em -0.045em 0 var(--maroon),
    -0.045em -0.045em 0 var(--maroon),
     0       0.1em    0 var(--maroon);
}

/* ============================================================
   Board view
   ============================================================ */
#board-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  padding: 1.4vh 2vw 2vh;
}

/* The page's static <h1> (in the HTML for search engines). board-ui.js replaces #board-view's contents, including this, with the real header and its own <h1>. */
.static-h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.board-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2vw;
}

/* Home link: small house in the top-left corner, same cream-and-maroon pill look as the board tabs */
.board-left { justify-self: start; display: flex; align-items: center; gap: 0.7vw; font-size: max(11px, min(1.65vw, 2.8vh)); }
.home-link {
  position: relative;
  flex: none;
  width: calc(2.95em + 6px); height: calc(2.95em + 6px);   /* the same height as the tabs pill: its 2.95em of content plus two 3px borders */
  background: var(--cream);
  color: var(--maroon);
  border: 3px solid var(--maroon);
  border-radius: 50%;
  transition: background-color .15s;
}
.home-link svg { position: absolute; inset: 24%; width: 52%; height: 52%; }
.home-link:hover { background: rgba(237, 92, 136, .2); }
.home-link:focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; }

/* Board tabs: one segmented control so it's obvious there are three boards,
   with a progress bar per board and a tick when a board is finished. */
.board-switch {
  justify-self: start;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;   /* equal tabs, so the tick on a finished board doesn't shift the others */
  gap: 0.25em;
  padding: 0.25em;
  background: var(--cream);
  border: 3px solid var(--maroon);
  border-radius: 999px;
  font-size: max(11px, min(1.65vw, 2.8vh));
}
.board-tab {
  appearance: none;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--maroon);
  font: inherit;
  line-height: 1;
  white-space: nowrap;
  padding: 0.4em 0.9em 0.45em;
  display: grid;
  justify-items: center;
  gap: 0.3em;
  cursor: pointer;
  transition: background-color .15s;
}
.board-tab:hover { background: rgba(237, 92, 136, .2); }
.board-tab[aria-selected="true"] { background: var(--pink); box-shadow: inset 0 0 0 2px var(--maroon); }
.bt-bar {
  width: 100%;
  min-width: 3em;
  height: 0.3em;
  border-radius: 999px;
  background: rgba(61, 15, 20, .15);
  overflow: hidden;
}
.bt-bar i {
  display: block;
  height: 100%;
  width: calc(var(--p, 0) * 100%);
  background: var(--maroon);
  border-radius: inherit;
  transition: width .5s ease;
}
.bt-label { position: relative; }
/* The tick sits in the tab's right padding, so a finished tab keeps its width */
.board-tab.done .bt-label::after { content: "\2713"; position: absolute; left: 100%; margin-left: 0.2em; }
.board-tab.done .bt-bar i { background: var(--green); }
/* Pulses the next unfinished board once the current one is done */
.board-tab.nudge { animation: tab-nudge 1.4s ease-in-out infinite; }
@keyframes tab-nudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 201, 72, 0); }
  50%      { box-shadow: 0 0 0 0.3em var(--gold); background: rgba(247, 201, 72, .35); }
}
@media (prefers-reduced-motion: reduce) {
  .board-tab.nudge { animation: none; box-shadow: 0 0 0 0.3em var(--gold); }
}

.title-block { text-align: center; line-height: 1; }
.title-block .kicker {
  display: inline-block;
  background: var(--pink);
  color: var(--maroon);
  border: 3px solid var(--maroon);
  border-radius: 999px;
  padding: 0.15em 0.9em;
  font-size: min(1.3vw, 2.2vh);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.5vh;
}
.title-block h1 {
  margin: 0;
  font-size: min(4.2vw, 6.6vh);
  color: var(--maroon);
}

.board-status {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 1vw;
}
.readout {
  background: var(--cream);
  border: 3px solid var(--maroon);
  border-radius: 999px;
  padding: 0.2em 0.8em;
  font-size: max(12px, min(2vw, 3.4vh));
  white-space: nowrap;
}
.key-hint {
  font-size: max(11px, min(1.1vw, 1.9vh));
  opacity: 0.7;
  white-space: nowrap;
}
.key-hint kbd { font-family: var(--sans); font-weight: 700; }

#boards { flex: 1; min-height: 0; }

.board {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 1vh;
  padding: 16px;
}

.col-headers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.col-h {
  margin: 0 calc(var(--gutter) / 2);
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--green);
  color: var(--cream);
  border: 3px solid var(--maroon);
  border-radius: 10px;
  padding: 0.2em 0.5em;
  font-size: min(1.5vw, 2.7vh);
  line-height: 1.1;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* The grid sits on the hidden photo. The photo is fixed to the grid area. */
.grid-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  container-type: size;
}
.hidden-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.grid-wrap.photo-missing {
  background: repeating-linear-gradient(45deg, #4a1a20 0 24px, var(--maroon) 24px 48px);
}
.grid-wrap.photo-missing .hidden-photo { display: none; }
.grid-wrap.photo-missing::before {
  content: "Hidden photo missing: " attr(data-src);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--cream);
  font-size: 4cqh;
  font-weight: 700;
}

.tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
}

/* A cell is a cream backing (covers the gutters) holding a pink tile.
   Lifting fades the WHOLE cell to opacity 0, so the hole is a clean,
   fully transparent rectangle that joins its lifted neighbours. */
.cell {
  position: relative;
  padding: calc(var(--gutter) / 2);
  background: var(--cream);
  cursor: pointer;
  opacity: 1;
  transition: opacity var(--lift-ms) ease var(--delay, 0ms);
}
.tile {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pink);
  border: 3px solid var(--maroon);
  border-radius: 12px;
  transition:
    transform var(--lift-ms) cubic-bezier(.2, .7, .3, 1) var(--delay, 0ms),
    background-color 120ms ease;
}
.tile .num {
  font-size: min(13cqh, 8.5cqw);
  line-height: 1;
}
.cell:hover .tile { background: var(--pink-dark); }

.cell.is-cursor { z-index: 2; }
.cell.is-cursor .tile {
  background: var(--pink-dark);
  box-shadow: 0 0 0 4px var(--gold), 0 0 28px 10px rgba(247, 201, 72, 0.85);
  transform: scale(1.03);
}

.cell.lifted { opacity: 0; }
.cell.lifted .tile { transform: scale(1.12); }

/* Cursor over an already-lifted hole: outline only, never a fill */
.cursor-ring {
  z-index: 3;
  margin: calc(var(--gutter) / 2);
  border: 5px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--maroon), inset 0 0 0 2px var(--maroon);
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.cursor-ring.show { opacity: 1; }

/* ============================================================
   Question / answer view
   ============================================================ */
#question-view {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  padding: 2.4vh 2.4vw;
  background: var(--ground);
  --fit: 1;
}
#question-view > .sunburst { z-index: 0; }

.q-frame {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2vh;
  padding: 3vh 3.4vw;
}

.q-head {
  display: flex;
  align-items: center;
  gap: 1.2vw;
}
.q-cat {
  background: var(--green);
  color: var(--cream);
  border: 3px solid var(--maroon);
  border-radius: 12px;
  padding: 0.2em 0.8em;
  font-size: min(2.4vw, 4.2vh);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.15;
}
.q-pts {
  background: var(--pink);
  border: 3px solid var(--maroon);
  border-radius: 12px;
  padding: 0.05em 0.5em;
  font-size: min(3vw, 5.2vh);
  line-height: 1.15;
}
.q-progress {
  margin-left: auto;
  display: flex;
  gap: 0.6vw;
  align-items: center;
}
.q-progress i {
  width: min(1.6vw, 2.6vh);
  height: min(1.6vw, 2.6vh);
  border-radius: 50%;
  border: 3px solid var(--maroon);
  background: transparent;
}
.q-progress i.on { background: var(--pink); }
.q-close {
  margin-left: auto;
  width: min(3.2vw, 5.4vh);
  height: min(3.2vw, 5.4vh);
  border-radius: 50%;
  border: 3px solid var(--maroon);
  display: grid;
  place-items: center;
  font-size: min(1.8vw, 3vh);
  font-weight: 700;
  cursor: pointer;
  opacity: 0.45;
  flex: none;
}
.q-progress + .q-close { margin-left: 1vw; }
.q-close:hover { opacity: 1; }

.q-instruction {
  font-size: min(2.3vw, 3.9vh);
  font-weight: 600;
  line-height: 1.25;
}

.q-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
}

/* text */
.q-text {
  text-align: center;
  text-wrap: balance;
  line-height: 1.15;
  font-size: calc(var(--fit) * min(7vw, 12vh));
}
.q-text.prose {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.3;
  max-width: 28ch;
  font-size: calc(var(--fit) * min(4.4vw, 7.6vh));
}

/* emoji */
.q-emoji {
  font-family: var(--emoji);
  font-size: calc(var(--fit) * min(10vw, 18vh));
  letter-spacing: 0.2em;
  margin-right: -0.2em;
  white-space: nowrap;
  line-height: 1.2;
}

/* longText: capped line length, tall rather than wide */
.q-long {
  max-width: var(--measure, 60ch);
  text-align: left;
  font-size: max(var(--floor, 28px), calc(var(--fit) * min(3.2vw, 5.4vh)));
  line-height: 1.5;
  font-weight: 500;
  text-wrap: pretty;
}

/* list */
.q-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--fit) * 2.4vh);
  min-width: min(56vw, 100%);
}
.q-list li {
  text-align: center;
  background: #FFF8EC;
  border: 4px solid var(--maroon);
  border-radius: 18px;
  box-shadow: 0 0.08em 0 var(--maroon);
  padding: 0.15em 1em;
  line-height: 1.2;
  font-size: calc(var(--fit) * min(5vw, 8.6vh));
}

/* clueChain: accumulate, anchored at top so earlier clues never jump */
.q-body.type-clueChain { justify-content: flex-start; }
.q-clues {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: var(--measure, 60ch);
  display: flex;
  flex-direction: column;
  gap: calc(var(--fit) * 2.6vh);
  font-size: max(var(--floor, 28px), calc(var(--fit) * min(2.9vw, 4.9vh)));
}
.q-clues li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8em;
  align-items: start;
  line-height: 1.45;
  font-weight: 500;
}
.q-clues .n {
  min-width: 1.7em;
  text-align: center;
  background: var(--pink);
  border: 3px solid var(--maroon);
  border-radius: 0.35em;
  line-height: 1.35;
}
.q-clues li.latest { animation: rise 380ms ease both; }

/* audio */
.audio-ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--fit) * 3.4vh);
}
.play-btn {
  width: calc(var(--fit) * min(24vh, 15vw));
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--maroon);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1vh var(--pink), 0 0 0 1.6vh var(--maroon);
  cursor: pointer;
}
.play-btn svg { width: 42%; margin-left: 9%; fill: var(--cream); }
.eq {
  display: flex;
  align-items: flex-end;
  gap: calc(var(--fit) * 1.1vh);
  height: calc(var(--fit) * 11vh);
}
.eq i {
  width: 2.4vh;
  height: 18%;
  background: var(--pink);
  border: 3px solid var(--maroon);
  border-radius: 1.2vh;
}
.audio-state {
  font-size: calc(var(--fit) * min(2.8vw, 4.6vh));
  text-align: center;
}
.audio-state .playing-label { display: none; }
.audio-hint {
  font-size: max(14px, calc(var(--fit) * min(1.7vw, 2.9vh)));
  font-weight: 600;
  opacity: 0.75;
}
.audio-playing .eq i { animation: eq 0.46s ease-in-out infinite alternate; }
.audio-playing .eq i:nth-child(2n) { animation-duration: 0.37s; }
.audio-playing .eq i:nth-child(3n) { animation-duration: 0.55s; }
.audio-playing .play-btn { animation: pulse 0.9s ease-in-out infinite; }
.audio-playing .audio-state .playing-label { display: inline; }
.audio-playing .audio-state .idle-label { display: none; }
.audio-error .eq { display: none; }
.audio-missing {
  font-family: var(--sans);
  font-size: calc(var(--fit) * min(2.2vw, 3.6vh));
  padding: 1.6vh 2vw;
}

/* answer block */
.q-answer {
  display: none;
  background: var(--maroon);
  color: var(--cream);
  border-radius: 16px;
  padding: 1.8vh 2.6vw 2.2vh;
  box-shadow: inset 0 0 0 3px var(--gold);
}
.show-answer .q-answer {
  display: block;
  animation: rise 300ms ease both;
}
.q-answer-label {
  color: var(--gold);
  font-size: min(1.5vw, 2.6vh);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.q-answer-text {
  font-size: min(4.6vw, 7.8vh);
  line-height: 1.12;
  text-wrap: balance;
}
.q-answer-text.long { font-size: min(3.2vw, 5.4vh); }
.q-answer-note {
  margin-top: 0.5em;
  font-size: min(2.1vw, 3.6vh);
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
}

/* image: full-bleed on a dark ground, nothing else */
#question-view.image-mode { background: #1F080B; }
#question-view.image-mode > .sunburst { display: none; }
.q-image {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2.4vh;
  position: relative;
}
.q-img-wrap {
  flex: 1 1 0;
  min-height: 0;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2vw;
}
.q-img-wrap img,
.q-img-wrap .missing {
  flex: 1 1 0;
  min-width: 0;
}
.q-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* Optional answerImage: appears beside the question image on reveal */
.q-img-wrap .q-answer-img { display: none; }
.show-answer .q-img-wrap .q-answer-img { display: block; animation: rise 300ms ease both; }
.q-image .q-answer { align-self: center; max-width: 90%; text-align: center; }

/* The only mouse control that moves a question forward */
.q-actions {
  flex: none;
  display: flex;
  justify-content: flex-end;
}
.q-image .q-actions { justify-content: center; }
.q-action {
  font-size: min(2.1vw, 3.6vh);
  line-height: 1.2;
  background: var(--pink);
  border: 3px solid var(--maroon);
  border-radius: 14px;
  padding: 0.3em 1.1em;
  box-shadow: 0 0.12em 0 var(--maroon);
  cursor: pointer;
  transition: background-color 120ms ease;
}
.q-action:hover { background: var(--pink-dark); }
.q-action:active { transform: translateY(0.08em); box-shadow: 0 0.04em 0 var(--maroon); }
.image-mode .q-action { border-color: var(--cream); box-shadow: 0 0.12em 0 var(--cream); }
.q-image .q-close {
  position: absolute;
  top: 0;
  right: 0;
  border-color: var(--cream);
  color: var(--cream);
  opacity: 0.25;
  z-index: 2;
}

.missing {
  border: 4px dashed currentColor;
  border-radius: 16px;
  padding: 4vh 3vw;
  text-align: center;
  font-size: min(2.4vw, 4vh);
  font-weight: 700;
  line-height: 1.4;
}
.missing code { font-size: 0.8em; font-weight: 500; }
.image-mode .missing { color: var(--cream); }

/* ============================================================
   Help overlay
   ============================================================ */
#help {
  /* One size unit for the whole help card, so its text, spacing and width scale together on every screen
     (laptop, 1080p TV, phone) and the card keeps its proportions. Never smaller than about 11px of text. */
  --hu: max(8.2px, min(1vw, 1.7vh));
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(31, 8, 11, 0.72);
}
#help-content { display: contents; }   /* filled by board-ui.js; adds no box of its own */
.help-card {
  width: min(94vw, calc(var(--hu) * 100));
  max-height: 94vh;
  overflow: auto;
  padding: calc(var(--hu) * 1.5) calc(var(--hu) * 2.4);
}
.help-card h2 {
  margin: 0 0 calc(var(--hu) * 0.9);
  font-size: calc(var(--hu) * 2.3);
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--hu) * 2);
}
.help-grid h3 {
  margin: 0 0 calc(var(--hu) * 0.6);
  background: var(--green);
  color: var(--cream);
  border-radius: 8px;
  padding: 0.2em 0.6em;
  font-size: calc(var(--hu) * 1.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.help-grid dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--hu) * 0.4) calc(var(--hu) * 0.8);
  font-size: calc(var(--hu) * 1.25);
  line-height: 1.25;
}
.help-grid dt { white-space: nowrap; }
.help-grid dd { margin: 0; }
kbd {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85em;
  background: #FFF8EC;
  border: 2px solid var(--maroon);
  border-bottom-width: 4px;
  border-radius: 6px;
  padding: 0 0.4em;
}
.help-foot { margin-top: calc(var(--hu) * 1); font-size: calc(var(--hu) * 1.1); opacity: 0.75; }
.help-legal { margin-top: calc(var(--hu) * 0.3); font-size: calc(var(--hu) * 1); }   /* the copyright lines at the foot of the card */
#help-content + .help-legal, .help-more + .help-legal { margin-top: calc(var(--hu) * 1); }

/* The other-quizzes links: kept in the page for search engines, but folded away so the help screen stays uncluttered */
.help-more { margin-top: calc(var(--hu) * 1); font-size: calc(var(--hu) * 1.1); }
.help-more summary { cursor: pointer; font-weight: 700; }
.help-more summary:focus-visible { outline: 3px solid var(--maroon); outline-offset: 3px; border-radius: 6px; }
.help-more ul { display: flex; flex-wrap: wrap; gap: 0.4em 1.3em; margin: 0.7em 0 0; padding: 0; list-style: none; }
.help-more a { color: inherit; font-weight: 700; }
.help-more a[aria-current="page"] { text-decoration: none; opacity: 0.6; }
#help-content + .help-legal { margin-top: 1.8vh; }

/* Small line under the board once every board is finished. Not a pop-up. */
.end-tip { margin: 0; text-align: center; font-size: min(1.5vw, 2.5vh); font-weight: 600; color: var(--maroon); }
.end-tip a { color: var(--pink-dark); text-underline-offset: 0.2em; }

/* ============================================================
   Session: confirm dialog + toast
   ============================================================ */
#confirm {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(31, 8, 11, 0.72);
}
.confirm-card {
  width: min(760px, 88vw);
  padding: 4vh 3.4vw;
  text-align: center;
}
.confirm-card h2 { margin: 0 0 1.4vh; font-size: min(3.4vw, 5.6vh); }
.confirm-card p {
  margin: 0 0 3vh;
  font-size: min(1.9vw, 3.2vh);
  font-weight: 600;
  line-height: 1.35;
}
.confirm-keys { font-size: min(1.8vw, 3vh); font-weight: 700; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 3.5vh;
  z-index: 70;
  transform: translate(-50%, 20px);
  max-width: 90vw;
  background: var(--maroon);
  color: var(--cream);
  box-shadow: inset 0 0 0 3px var(--gold);
  border-radius: 999px;
  padding: 0.6em 1.4em;
  font-size: min(1.7vw, 2.9vh);
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast kbd { color: var(--maroon); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes eq {
  from { height: 14%; }
  to   { height: 100%; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.answers-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; margin-right: .75rem; }

/* Phones: the TV sizes above shrink to 4-6px on a phone, so the header gets real pixel sizes and stacks.
   Row 1: home, title, score. Row 2: the three board tabs. Row 3: Categories and Title list. */
@media (max-width: 700px) {
  .board-header { grid-template-columns: auto 1fr auto; row-gap: 8px; column-gap: 10px; }
  .board-left, .board-status { display: contents; }
  .home-link { grid-row: 1; grid-column: 1; width: 44px; height: 44px; }
  .title-block { grid-row: 1; grid-column: 2; }
  .title-block .kicker { font-size: 10px; border-width: 2px; }
  .title-block h1 { font-size: 24px; line-height: 1.05; }
  .readout { grid-row: 1; grid-column: 3; font-size: 15px; border-width: 2px; }
  .board-switch { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; grid-template-columns: repeat(3, 1fr); font-size: 15px; border-width: 2px; }
  .board-status > span.key-hint { display: none; }   /* the keyboard hint means nothing on a phone */
  .board-status > .key-hint { font-size: 15px; opacity: 1; margin: 0; padding: 6px 4px; }
  .cats-link { grid-row: 3; grid-column: 1 / 3; justify-self: start; }
  .answers-link { grid-row: 3; grid-column: 2 / 4; justify-self: end; }
}

/* Tip pop-up: built by tip-popup.js and framed with the category pop-up styles in board-intro.css */
.bq-tip__pop { width: min(94vw, calc(var(--u) * 52)); outline: none; }
.bq-tip__card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: calc(var(--u) * 2); text-align: center; }
.bq-tip__main { min-width: 0; }
/* The QR for people watching on a TV. White tile with a quiet zone of about four modules, which scanners need. */
.bq-tip__qr { margin: 0; padding-left: calc(var(--u) * 2); border-left: 2px dashed rgba(61, 15, 20, .25); text-align: center; }
.bq-tip__qrbox { display: inline-block; padding: calc(var(--u) * 1.5); background: #fff; border: 3px solid var(--maroon, #3D0F14); border-radius: calc(var(--u) * 1); color: var(--maroon, #3D0F14); line-height: 0; }
.bq-tip__qrcode { display: block; width: calc(var(--u) * 11); height: calc(var(--u) * 11); }
.bq-tip__qr figcaption { margin-top: calc(var(--u) * .7); font-weight: 800; font-size: calc(var(--u) * 1.1); line-height: 1.3; color: var(--maroon, #3D0F14); }
.bq-tip__qr small { display: block; font-weight: 600; font-size: .85em; opacity: .75; }
.bq-tip__pop--no-qr { width: min(94vw, calc(var(--u) * 38)); }
.bq-tip__card--no-qr { display: block; }
@media (max-width: 700px) {      /* phones: the button does the job, and you can't scan the screen you're holding */
  .bq-tip__pop { width: min(94vw, calc(var(--u) * 38)); }
  .bq-tip__card { display: block; }
  .bq-tip__qr { display: none; }
}
.bq-tip .bq-intro__sub { margin: calc(var(--u) * .9) 0 0; font-size: calc(var(--u) * 1.3); line-height: 1.45; color: var(--maroon, #3D0F14); }
.bq-tip .bq-intro__act { justify-content: center; margin-top: calc(var(--u) * 1.5); }
.bq-tip__go { display: inline-block; text-decoration: none; }
.bq-tip__later {
  appearance: none; background: none; border: 0; padding: calc(var(--u) * .4) calc(var(--u) * .6); cursor: pointer;
  font: 600 calc(var(--u) * 1.1) var(--sans, system-ui, sans-serif); color: var(--maroon, #3D0F14);
  text-decoration: underline; text-underline-offset: 3px;
}
.bq-tip__later:focus-visible { outline: 3px solid var(--maroon, #3D0F14); outline-offset: 3px; border-radius: 6px; }
