/* Bible Trivia (BBG#163). Base chrome, modal, result and share styles copied from who-was-alive/styles.css;
   the game's own styles (start screen, stone-tablet answers, verse box, join card) are at the end. */
:root {
  --em-deep: #071f14;
  --em-mid: #0e3b26;
  --em-glow: #1d6b45;
  --gold: #f5c451;
  --gold-bright: #ffd76a;
  --gold-deep: #a06b1c;
  --gold-shadow: #7a4c12;
  --cream: #fdf6e3;
  --cream-dim: rgba(253, 246, 227, 0.72);
  --glass: rgba(6, 26, 17, 0.55);
  --glass-line: rgba(245, 196, 81, 0.35);
  --good-glow: #8df0b4;
  --bad-glow: #ff9b9b;
  --brass-face: #d8a64c;
  --brass-mid: #b07c2e;
  --brass-dark: #96692a;
  --brass-edge: #74521a;
  --brass-press: #5d3a0e;
  --brass-ink: #3a2508;
  --font-display: "Lilita One", "Arial Rounded MT Bold", "Outfit", system-ui, sans-serif;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--em-deep);
}

body {
  color: var(--cream);
  background:
    radial-gradient(circle at 12% 16%, rgba(255, 224, 130, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 10%, rgba(255, 224, 130, 0.4) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 24%, rgba(255, 224, 130, 0.45) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 26% 44%, rgba(255, 224, 130, 0.3) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 92% 56%, rgba(255, 224, 130, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 8% 78%, rgba(255, 224, 130, 0.3) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 60% 88%, rgba(255, 224, 130, 0.3) 0 1.5px, transparent 2.5px),
    radial-gradient(ellipse at 50% 16%, var(--em-glow) 0%, var(--em-mid) 52%, var(--em-deep) 100%);
  background-repeat: no-repeat;
  background-size: cover;
}

main {
  width: min(96vw, 920px);
  margin: 1.1rem auto 2rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.35rem, 1rem + 1.2vw, 2rem);
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--cream-dim);
  font-weight: 700;
}

.game-title-styled {
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--gold-bright);
  text-shadow: 0 3px 0 var(--gold-shadow), 0 8px 18px rgba(0, 0, 0, 0.5);
}

.game-brand-logo {
  border-radius: 14px;
  border: 2px solid rgba(231, 180, 90, 0.55);
  box-shadow: 0 0 22px rgba(245, 196, 81, 0.35), 0 8px 16px rgba(0, 0, 0, 0.4);
}

.panel {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* --- Bottom actions --- */

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-top: 1rem;
  padding-bottom: 0.15rem;
}

.actions button {
  white-space: nowrap;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0.62rem 0.8rem;
  min-height: 2.85rem;
  background: var(--glass);
  color: var(--cream);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.actions button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.actions .start-action {
  order: -1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.07em;
  padding: 0.7rem 1.7rem;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  color: #4a2a08;
  border: 2px solid var(--gold-deep);
  box-shadow: 0 5px 0 var(--gold-shadow), 0 0 26px rgba(245, 196, 81, 0.35);
}

.actions .start-action:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--gold-shadow), 0 0 32px rgba(245, 196, 81, 0.5);
}

.actions .start-action:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--gold-shadow), 0 0 18px rgba(245, 196, 81, 0.35);
}

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

/* --- Modals (arcade skin via scoped theme vars) --- */

/* leaderboard.js's gear handler injects inline display:block on this overlay,
   so the layout must center the card without relying on grid/flex */
.settings-modal,
.summary-modal {
  position: fixed;
  inset: 0;
  /* Above the fixed site header (.header-row, z-index 9999 in theme.css), which otherwise
     covers the top of the card: its title and close button. */
  z-index: 10000;
  background: rgba(4, 18, 12, 0.68);
  overflow-y: auto;
  padding: 1rem;
}

.summary-modal {
  z-index: 10001;
}

.settings-card,
.summary-card {
  --text: #fdf6e3;
  --muted: rgba(253, 246, 227, 0.65);
  --accent: #ffd76a;
  --accent-soft: rgba(6, 26, 17, 0.55);
  --line: rgba(245, 196, 81, 0.3);
  --panel: rgba(6, 26, 17, 0.55);
  --bg: rgba(6, 26, 17, 0.45);
  width: min(92vw, 520px);
  max-height: min(86vh, 700px);
  overflow: auto;
  margin: max(7vh, 1rem) auto;
  background: linear-gradient(180deg, #124631 0%, #0a2a1b 100%);
  border: 2px solid rgba(231, 180, 90, 0.55);
  border-radius: 14px;
  padding: 0.85rem;
  color: var(--cream);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.summary-card {
  width: min(92vw, 460px);
  padding: 1rem;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(245, 196, 81, 0.25);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.settings-header h2,
.summary-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  font-size: 1.25rem;
  color: var(--gold-bright);
}

.summary-card h2 {
  margin-bottom: 0.55rem;
}

.popup-close {
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--cream-dim);
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  width: 1.9rem;
  height: 1.9rem;
  cursor: pointer;
}

.popup-close:hover {
  color: var(--cream);
}

.settings-grid {
  margin-top: 0.6rem;
  display: grid;
  gap: 0.6rem;
}

.setting {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  color: var(--cream);
}

.setting input[type="range"],
.setting select {
  width: 100%;
}

.setting input[type="checkbox"],
.setting input[type="range"] {
  accent-color: var(--gold);
}

.setting select {
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  font: inherit;
  background: var(--glass);
  color: var(--cream);
}

.setting-help {
  color: var(--cream-dim);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- Shared helpers --- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.result-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem !important;
  border-radius: 16px !important;
  background: var(--glass) !important;
  border: 1px solid var(--glass-line) !important;
  text-align: center;
}

.result-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  font-size: 1.7rem;
}

.result-copy {
  margin: 0.4rem 0;
  font-weight: 700;
}

.result-learn a {
  color: var(--gold-bright);
  font-weight: 800;
}

.result-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.result-actions button,
.help-modal-play {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  background: var(--glass);
  color: var(--cream);
  border: 1px solid var(--glass-line);
}

.result-actions .start-action,
#help-play-btn {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  color: #4a2a08;
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 0 var(--gold-shadow);
}

/* Next round: the result screen's main action, the same gold as the start screen's Play. */
.next-round-btn {
  display: block;
  width: min(100%, 20rem);
  margin: 1rem auto 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  color: #4a2a08;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  border: 2px solid var(--gold-deep);
  box-shadow: 0 5px 0 var(--gold-shadow), 0 0 24px rgba(245, 196, 81, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.next-round-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--gold-shadow), 0 0 28px rgba(245, 196, 81, 0.45);
}

.next-round-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--gold-shadow);
}

/* The result screen's main share: one tap opens Facebook's share box with the score card attached. */
.share-fb-btn {
  width: min(100%, 20rem);
  box-sizing: border-box;
  margin: 0.8rem auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: #1877f2;
  color: #fff;
  text-decoration: none;
  border: 2px solid #0f5fc9;
  box-shadow: 0 4px 0 #0b4a9e;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.share-fb-btn span {
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: 1.3em;
  line-height: 1;
}

.share-fb-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #0b4a9e;
}

.share-fb-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0b4a9e;
}

.share-status {
  min-height: 1.2em;
  margin: 0.6rem 0 0;
  white-space: pre-line;
  color: var(--cream-dim);
  font-weight: 600;
}

.next-puzzle {
  margin: 0.3rem 0 0;
  color: var(--cream-dim);
  font-weight: 700;
}

.help-list {
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.settings-profile-row,
.theme-switcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.stats-row p {
  margin: 0;
  display: grid;
}

.stats-row strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--gold-bright);
}

.stats-row span {
  font-size: 0.78rem;
  color: var(--cream-dim);
  font-weight: 700;
}

.dist-title {
  margin: 1rem 0 0.4rem;
  font-size: 1rem;
}

.distribution {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.distribution li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dist-label {
  width: 1rem;
  font-weight: 800;
}

.dist-bar {
  display: inline-block;
  text-align: right;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(253, 246, 227, 0.18);
  font-weight: 800;
}

.dist-bar.is-today {
  background: #2f9e5b;
}

.challenge-banner {
  margin: 0.8rem 0 0;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 215, 106, 0.2), rgba(255, 215, 106, 0.08));
  border: 2px solid rgba(255, 215, 106, 0.6);
  color: var(--gold-bright);
  font-weight: 800;
  text-align: center;
}

.help-challenge {
  margin: 0 0 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 106, 0.55);
  color: var(--gold-bright);
  font-weight: 800;
}

.share-card {
  width: min(94vw, 560px);
}

.share-image {
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1;
  margin: 0 auto 0.7rem;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

.share-text {
  margin: 0 0 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: rgba(6, 26, 17, 0.6);
  border: 1px solid var(--glass-line);
  font: 700 0.9rem/1.35 "Outfit", system-ui, sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: all;
  color: var(--cream);
}

.share-native {
  display: block;
  width: 100%;
  margin-bottom: 0.7rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  color: #4a2a08;
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 0 var(--gold-shadow);
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.share-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.8rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: rgba(253, 246, 227, 0.12);
  border: 1px solid rgba(253, 246, 227, 0.3);
}

.share-target[hidden] {
  display: none;
}

.share-target:hover,
.share-target:focus-visible {
  filter: brightness(1.12);
  outline: 2px solid var(--gold-bright);
  outline-offset: 1px;
}

.share-x { background: #000; border-color: #444; }
.share-facebook { background: #1877f2; border-color: #1877f2; }
.share-whatsapp { background: #1fa855; border-color: #1fa855; }
.share-reddit { background: #ff4500; border-color: #ff4500; }

.share-facebook span {
  font-family: Georgia, serif;
  font-weight: 900;
}

@media (max-width: 560px) {
  .stats-row strong {
    font-size: 1.4rem;
  }

  .share-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Bible Trivia --- */

main {
  width: min(94vw, 560px);
}

.start-panel {
  text-align: center;
  margin-top: 0.6rem;
}

.start-logo {
  display: block;
  width: min(48vw, 180px);
  height: auto;
  margin: 0.4rem auto 0.2rem;
  border-radius: 28px;
  box-shadow: 0 0 26px rgba(245, 196, 81, 0.3), 0 10px 22px rgba(0, 0, 0, 0.45);
}

.start-tag {
  margin: 0.5rem 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Today's 10: the daily round, above the practice modes. */
.daily-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0 0 1rem;
  padding: 0.9rem 1rem;
  text-align: left;
  border-radius: 18px;
  border: 2px solid var(--gold-deep);
  background: linear-gradient(135deg, rgba(255, 215, 106, 0.16), rgba(0, 0, 0, 0.2));
  box-shadow: 0 0 22px rgba(245, 196, 81, 0.18);
}

.daily-text {
  flex: 1;
  min-width: 0;
}

.daily-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold-bright);
}

.daily-number {
  font-size: 0.95rem;
  color: var(--cream-dim);
}

.daily-sub {
  margin: 0.15rem 0 0;
  color: var(--cream-dim);
  font-size: 0.9rem;
  font-weight: 700;
}

.daily-btn {
  flex: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  cursor: pointer;
  color: #4a2a08;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 0 var(--gold-shadow);
}

.daily-btn:disabled {
  cursor: default;
  opacity: 1;
  color: var(--cream);
  background: rgba(47, 158, 91, 0.35);
  border-color: #2f9e5b;
  box-shadow: none;
}

/* This week's round (BBG#165): same card, a blue-green accent, and a NEW tag until it's played. */
.weekly-card {
  position: relative;
  border-color: #2fb3a0;
  background: linear-gradient(135deg, rgba(47, 179, 160, 0.2), rgba(0, 0, 0, 0.2));
  box-shadow: 0 0 22px rgba(47, 179, 160, 0.18);
}

.weekly-kicker {
  margin: 0 0 0.1rem;
  color: #7fe0cf;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weekly-card.is-new::after {
  content: "NEW";
  position: absolute;
  top: -0.6rem;
  right: 1rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #e0413a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.weekly-card .daily-btn:disabled {
  background: rgba(47, 179, 160, 0.25);
  border-color: #2fb3a0;
}

/* Friend challenge: the banner's play button, and the head-to-head on the result screen. */
.challenge-btn {
  margin: 0.55rem auto 0;
  display: block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  cursor: pointer;
  color: #4a2a08;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  border: 2px solid var(--gold-deep);
  box-shadow: 0 4px 0 var(--gold-shadow);
}

.versus {
  margin: 0.9rem auto 0;
  max-width: 22rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 2px solid rgba(255, 215, 106, 0.6);
  background: rgba(0, 0, 0, 0.22);
}

.versus-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}

.versus-scores p {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.versus-scores strong {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--gold-bright);
}

.versus-scores span {
  color: var(--cream-dim);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.versus-vs {
  color: var(--cream-dim);
  font-weight: 900;
}

.versus-verdict {
  margin: 0.45rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.versus[data-outcome="win"] .versus-verdict {
  color: #7be39b;
}

.versus-row {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.versus-row span:first-child {
  display: inline-block;
  width: 3.8rem;
  text-align: right;
  color: var(--cream-dim);
  font-size: 0.8rem;
  font-weight: 800;
}

.daily-board {
  margin: 1rem auto 0;
  max-width: 22rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 2px solid var(--gold-deep);
  background: rgba(0, 0, 0, 0.22);
  text-align: left;
}

.daily-board h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-bright);
  text-align: center;
}

.daily-board-status {
  margin: 0 0 0.4rem;
  color: var(--cream-dim);
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
}

.daily-board-list {
  margin: 0;
  padding-left: 1.6rem;
}

.daily-board-list li {
  padding: 0.2rem 0;
  font-weight: 700;
}

.daily-board-list li span {
  display: inline-flex;
}

.daily-board-list .board-name {
  width: calc(100% - 3rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-board-list .board-score {
  width: 3rem;
  justify-content: flex-end;
  color: var(--gold-bright);
}

.daily-board-list li.is-me {
  color: #7be39b;
}

.share-hint {
  margin: 0.4rem 0 0;
  color: var(--cream-dim);
  font-size: 0.85rem;
  font-weight: 700;
}

.practice-head {
  margin: 0 0 0.4rem;
  color: var(--cream-dim);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Career rank: grows with every right answer, across all rounds. */
.career {
  margin: 0.8rem 0 0;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 215, 106, 0.14);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}

.career-line {
  margin: 0;
  color: var(--cream-dim);
  font-weight: 700;
}

.career-line strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--gold-bright);
}

.career-bar {
  height: 8px;
  margin: 0.45rem 0 0.35rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.career-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #2f9e5b, var(--gold-bright));
}

.career-stats {
  margin: 0.1rem 0 0.4rem;
  color: var(--cream-dim);
  font-size: 0.88rem;
  font-weight: 700;
}

.career-next {
  margin: 0;
  color: var(--cream-dim);
  font-size: 0.85rem;
  font-weight: 700;
}

.start-note {
  color: var(--cream-dim);
  font-size: 0.85rem;
  font-weight: 700;
}

.start-note {
  margin: 0.9rem 0 0;
}

/* HUD: one pip per question, then the streak. Points sit in the header. */
.trivia-hud {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.7rem 0 0.8rem;
}

.progress-pips {
  display: flex;
  flex: 1;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pip {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(253, 246, 227, 0.18);
}

.pip.is-right { background: #3fbf7f; }
.pip.is-wrong { background: #e0605a; }
.pip.is-current { background: var(--gold-bright); }

.streak-chip,
.points-chip {
  flex: none;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 106, 0.25);
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.streak-chip.is-hot {
  color: var(--gold-bright);
  border-color: var(--gold);
}

.points-chip {
  color: #3a2408;
  background: var(--gold-bright);
  border: none;
}

/* The question on a parchment card. */
.question-card {
  background: linear-gradient(#fbf1d6, #f1e2b8);
  color: #2b1d0b;
  border-radius: 16px;
  padding: 0.9rem 1rem 1.05rem;
  border: 2px solid #d9b56a;
  box-shadow: 0 5px 0 #8a6326, 0 10px 22px rgba(0, 0, 0, 0.35);
  margin-bottom: 1rem;
}

.question-count {
  margin: 0 0 0.35rem;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a6326;
}

.question-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.65rem);
  line-height: 1.22;
  color: #2b1d0b;
}

/* Answers: stone tablets (arched top) with a gold wax-seal letter. This game's button metaphor. */
.answers {
  display: grid;
  gap: 0.75rem;
}

.tablet {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 3.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: 22px 22px 12px 12px;
  border: 2px solid #8fa39b;
  background: linear-gradient(180deg, #67766f 0%, #4c5954 55%, #434f4b 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 5px 0 #2a3330, 0 8px 16px rgba(0, 0, 0, 0.35);
  color: var(--cream);
  font: inherit;
  font-weight: 800;
  font-size: 1.15rem;
  text-align: left;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, opacity 200ms ease;
}

.tablet:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.tablet:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), 0 2px 0 #2a3330;
}

.tablet:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

.tablet:disabled {
  cursor: default;
  opacity: 1;
}

.seal {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: #3a2408;
  background: radial-gradient(circle at 35% 35%, #ffe9a8, var(--gold) 60%, var(--gold-deep));
  box-shadow: 0 2px 0 var(--gold-shadow), inset 0 -2px 3px rgba(122, 76, 18, 0.45);
}

.tablet.is-right {
  border-color: #7fe0ad;
  background: linear-gradient(180deg, #2aa865 0%, #1b7d48 100%);
  box-shadow: 0 5px 0 #0d4d2b, 0 0 22px rgba(127, 224, 173, 0.35);
}

.tablet.is-wrong {
  border-color: #f2a19b;
  background: linear-gradient(180deg, #cf4136 0%, #a8231b 100%);
  box-shadow: 0 5px 0 #6e1712;
  animation: tablet-shake 320ms ease;
}

.tablet.is-dim {
  opacity: 0.42;
}

.tablet.is-right .tablet-text::after {
  content: " \2713";
}

@keyframes tablet-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.question-panel {
  position: relative;
}

/* Floats up beside the streak chip, clear of the question. */
.points-pop {
  position: absolute;
  right: 6.4rem;
  top: -0.9rem;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: #7fe0ad;
  text-shadow: 0 3px 0 #0d4d2b;
  pointer-events: none;
}

.points-pop.pop {
  animation: points-rise 900ms ease forwards;
}

@keyframes points-rise {
  0% { opacity: 0; transform: translateY(10px) scale(0.8); }
  20% { opacity: 1; transform: translateY(0) scale(1.1); }
  100% { opacity: 0; transform: translateY(-26px) scale(1); }
}

/* After each answer: the verdict and the verse. */
.verse-box {
  margin: 1rem 0 0.9rem;
  padding: 0.7rem 0.9rem;
  border-left: 4px solid var(--gold-bright);
  border-radius: 0 12px 12px 0;
  background: rgba(0, 0, 0, 0.28);
}

.verse-verdict {
  margin: 0 0 0.3rem;
  font-weight: 800;
}

.verse-verdict.is-right { color: var(--good-glow); }
.verse-verdict.is-wrong { color: var(--bad-glow); }

.verse-line {
  margin: 0;
  line-height: 1.45;
}

.verse-line strong {
  color: var(--gold-bright);
  white-space: nowrap;
}

.next-btn {
  display: block;
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  cursor: pointer;
  color: #3a2408;
  background: linear-gradient(180deg, var(--gold-bright) 0%, #efa93d 100%);
  border: 2px solid var(--gold-deep);
  box-shadow: 0 5px 0 var(--gold-shadow);
}

/* After a right answer the game moves on by itself; this bar shows the wait (a tap skips it). */
.next-btn.is-auto {
  position: relative;
  overflow: hidden;
}

.next-btn.is-auto::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: rgba(74, 42, 8, 0.55);
  transform-origin: left;
  animation: auto-advance var(--auto-ms, 2200ms) linear forwards;
}

@keyframes auto-advance {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.next-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--gold-shadow);
}

.next-btn:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 2px;
}

/* Result */
.result-label {
  margin: 0 0 0.2rem;
  color: var(--cream-dim);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.result-career {
  margin: 0.5rem auto 0;
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(47, 158, 91, 0.3);
  border: 1px solid #2f9e5b;
  font-weight: 800;
}

.result-score {
  margin: 0;
  font-family: var(--font-display);
  font-size: 4.4rem;
  line-height: 1.05;
  color: var(--gold-bright);
  text-shadow: 0 5px 0 var(--gold-shadow);
}

.result-rank {
  margin: 0.2rem 0 0;
  font-weight: 800;
  font-size: 1.2rem;
}

.result-points {
  margin: 0.2rem 0 0;
  color: var(--cream-dim);
  font-weight: 700;
}

.missed {
  margin: 0.6rem 0 0.9rem;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 106, 0.14);
  background: rgba(0, 0, 0, 0.2);
  padding: 0.55rem 0.8rem;
}

.missed summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--gold-bright);
}

.missed-list {
  margin: 0.5rem 0 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.5rem;
}

.missed-list li.is-wrong::marker { color: var(--bad-glow); }
.missed-list li.is-right::marker { color: var(--good-glow); }

.missed-q,
.missed-a {
  margin: 0;
  font-size: 0.92rem;
}

.missed-a {
  color: var(--cream-dim);
}

.missed-a strong {
  color: var(--cream);
}

/* The weekly email offer, on parchment like the question card. */
.join-card {
  margin-top: 0.9rem;
  text-align: left;
  background: linear-gradient(#fbf1d6, #f1e2b8);
  color: #2b1d0b;
  border-radius: 16px;
  padding: 0.9rem 1rem;
  border: 2px solid #d9b56a;
}

.join-card h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.35rem;
  color: #0e3b26;
}

.join-card > p {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.join-form {
  display: flex;
  gap: 0.45rem;
}

.join-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #c9b07a;
  background: #fff;
  color: #1d2b24;
}

.join-form button {
  font: inherit;
  font-weight: 800;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: var(--em-mid);
  color: var(--gold-bright);
}

.join-form button:disabled {
  opacity: 0.7;
}

.join-message {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: #6a5a3a;
  font-weight: 600;
}

.join-message.is-error {
  color: #a8231b;
}

.result-more {
  margin: 0.9rem 0 0;
  color: var(--cream-dim);
  font-weight: 700;
}

.result-more a {
  color: var(--gold-bright);
}

/* During a round the header keeps back/pause, the name, the points and settings: the mode is named on the
   question card instead, and the rules and About text wait for the start screen. */
body.game-running #game-bar-mode,
body.game-running #open-help-btn,
body.game-running .game-about {
  display: none !important;
}
