/* Daily trivia — the Choose-Era-screen entry + the question modal.
   Palette flows through the styles.css design tokens; all reading text is
   >= 1rem per the CLAUDE.md minimum. See features/dailyTrivia.js. */

/* The slot that hosts the entry. It takes its height from the card inside
   (the card carries its own min-height + bottom margin), so the separation
   between the trivia card and the first era card is exactly the card's
   0.75rem bottom margin — matching the gap between era cards. We do NOT set
   a slot min-height: that double-counted the card's margin and squeezed the
   trivia↔first-era gap (it overlapped). The no-blink behavior is handled in
   features/dailyTrivia.js (cached repaint + guard), not by reserving slot
   height here. */

/* ---- Era-screen entry (mounted in #era-trivia-slot, above #era-list) ----
   Geometry is matched to .era-card in styles.css (padding 0.65rem 0.85rem,
   gap 0.85rem, a 3rem icon slot) so "Daily Trivia" lines up vertically with
   the era names beneath it. Light-purple fill sets the bonus apart. */
.trivia-entry {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--trivia-card-border);
  /* Square corners (was 10px) — the app's card vocabulary is now square. */
  border-radius: 0;
  background: var(--trivia-card-bg);
  text-align: left;
  box-sizing: border-box;
  /* Fixed row floor shared by EVERY state (loading / CTA / answered /
     countdown) so the card's footprint never changes as it transitions
     between states — no feed shift. */
  min-height: 3.1rem;
}
/* Loading placeholder — the shared min-height above already reserves the
   row; this only adds the dashed/dimmed "still loading" treatment. */
.trivia-entry-loading {
  border-style: dashed;
  opacity: 0.5;
}
/* When the trivia slot is interleaved INTO #era-list (between the first era
   card and the rest — see showEraSelection), the list's `gap: 0.75rem`
   already separates it from its neighbors, so drop the card's own bottom
   margin to avoid a doubled gap below it. */
#era-trivia-slot.in-era-list .trivia-entry {
  margin-bottom: 0;
}
/* Tappable CTA variant (a <button>). */
button.trivia-entry-cta {
  cursor: pointer;
  font: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}
button.trivia-entry-cta:hover {
  background: var(--trivia-card-bg-hover);
  border-color: #2a241e;
}
button.trivia-entry-cta:active { transform: scale(0.99); }
.trivia-entry-answered { opacity: 0.72; }

/* Fixed 3rem square — matches .era-card-portrait so the text column starts
   at the same x as the era names. */
.trivia-entry-icon {
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.trivia-entry-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.trivia-entry-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
/* Same display font + size as .era-card-name. */
.trivia-entry-title {
  font-family: var(--font-family-1);
  font-size: 1.15rem;
  color: var(--font-color-1);
}
.trivia-entry-sub {
  font-size: 1rem;
  color: var(--font-color-2);
  /* Italic to match the era cards' year-range subtitle (.era-card-years),
     so the trivia card's sub-line reads as the same kind of secondary
     detail. Applies in both states ("Answer today's question…" CTA and
     the "Next question in…" countdown). */
  font-style: italic;
}
/* Dev-only "Test mode" marker on the entry title. Uppercase chrome caption
   anchored to the title — below 1rem is fine per the CLAUDE.md exception. */
.trivia-test-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--font-color-on-fill);
  background: var(--font-color-danger);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  vertical-align: middle;
}

/* ---- Question modal ---- */
.trivia-modal {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* 30-second countdown bar + numeral. */
.trivia-timer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.trivia-timer-bar {
  flex: 1 1 auto;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--background-color-2);
  overflow: hidden;
}
.trivia-timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: var(--font-color-1);
  /* width is driven inline by JS each second; ease the shrink so it
     reads as a smooth drain rather than a tick. */
  transition: width 1s linear;
}
.trivia-timer-num {
  flex: 0 0 auto;
  min-width: 1.6rem;
  text-align: right;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--font-color-2);
}

.trivia-question {
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--font-color-1);
  margin: 0;
}

.trivia-choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.trivia-choice {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid #c8b890;
  border-radius: 8px;
  background: var(--background-color-3);
  color: var(--font-color-1);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  touch-action: manipulation;
}
/* Hover only on the interactive (question) choices — the results screen
   renders choices as static <div>s and must keep their verdict colors. */
button.trivia-choice:hover:not(:disabled) {
  background: var(--background-color-2);
  border-color: #2a241e;
}
.trivia-choice:disabled { cursor: default; }
/* Read-only choice on the results screen. */
.trivia-choice-static { cursor: default; }
/* Verdict states (results screen). White text so it reads clearly on the
   saturated green / red fills. */
.trivia-choice-correct {
  background: var(--font-color-positive);
  border-color: var(--font-color-positive);
  color: #fff;
  font-weight: 700;
}
.trivia-choice-wrong {
  background: var(--background-color-danger);
  border-color: var(--background-color-danger);
  color: #fff;
  font-weight: 700;
}
/* Two-tap flow: the choice the player has TAPPED but not yet submitted. A clear
   "this is your pick" state (inset ring avoids a 1px reflow vs the base border),
   distinct from hover, before the Submit button confirms. */
.trivia-choice-selected,
button.trivia-choice-selected:hover:not(:disabled) {
  background: var(--background-color-2);
  border-color: #2a241e;
  box-shadow: inset 0 0 0 2px #2a241e;
  font-weight: 700;
}

/* Submit row: confirms the selected choice. Disabled until a choice is tapped. */
.trivia-submit-row {
  margin-top: 0.85rem;
}
.trivia-submit {
  width: 100%;
}
.trivia-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ---- Results sheet (full-screen, slides up) ---- */
/* FILL the full-screen modal body (a flex column) and split into a scrolling
   content area + a pinned Continue footer, so the primary action stays in
   thumb reach while long content scrolls behind it on small screens (mirrors
   MailboxModal's scroll-body + pinned-footer split; the old margin-top:auto
   pin let the whole body scroll the button away once content overflowed).
   Constrained to 32rem, centered horizontally. gap:0 — the content area owns
   its own gap, and the footer's border + padding handle the seam. */
.modal-container.modal-fullscreen .trivia-result-modal {
  max-width: 32rem;
  width: 100%;
  margin: 0 auto;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}
/* Scrollable content (verdict → reward → question → choices → factoid). It
   owns the scroll so the footer below stays put. min-height:0 lets it shrink
   below its content size so overflow-y takes effect. */
.trivia-result-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
/* Pinned footer holding Continue. flex:0 0 auto keeps it out of the scroll;
   the hairline separates it from the content scrolling above (same #c8b890
   seam MailboxModal / DeathModal use). */
.trivia-result-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding-top: 0.85rem;
  border-top: 1px solid #c8b890;
}
.trivia-result-head {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  /* Extra breathing room below the modal title ("Daily Royal Trivia") so
     the verdict ("Correct!" / "Next time!") doesn't crowd it. The title's
     own margin-bottom (1.25rem, shared across modals) stays untouched. */
  margin: 2rem 0 0;
}
.trivia-result-correct { color: var(--font-color-positive); }
.trivia-result-wrong { color: var(--font-color-danger); }

/* "+1 play" reward pill — same visual language as the Choose-Era plays
   chip (icon_Dagger + count in a rounded pill, styled via .plays-chip).
   Centered under the verdict head; only rendered for non-subscribers on a
   correct answer. */
.trivia-reward-pill {
  align-self: center;
}

/* Factoid / explanation — italic, per the restrained-historian voice. */
.trivia-result-explain {
  font-size: 1rem;
  line-height: 1.45;
  font-style: italic;
  color: var(--font-color-1);
  margin: 0;
}
/* Continue — standard alone-button footprint (cf. the Profile "Save
   changes" button): centered (via the footer's justify-content), natural
   width with a 12rem floor, NOT stretched edge-to-edge. Pinning is handled
   by .trivia-result-footer (flex:0 0 auto), not this button. */
.trivia-continue {
  min-width: 12rem;
  margin: 0;
}
