/* TRIVIA OF THE REALM — a warmer, louder page than the maps: color, glow, motion. */

html { height: auto; overflow-y: auto; }
.trivia-body {
  display: flex; flex-direction: column; min-height: 100vh; height: auto; overflow: visible;
  color: #ede4d0;
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(58, 110, 165, 0.18), transparent),
    radial-gradient(900px 420px at 85% 0%, rgba(165, 44, 44, 0.18), transparent),
    radial-gradient(700px 500px at 50% 100%, rgba(201, 161, 90, 0.12), transparent),
    linear-gradient(180deg, #191411, #100d0b);
}
.tv-stage { flex: 1; max-width: 860px; width: 100%; margin: 0 auto; padding: 40px 20px 90px; box-sizing: border-box; }

/* Screens must actually hide — style.css has no generic .hidden rule, only scoped ones. */
.tv-setup.hidden, .tv-gate.hidden, .tv-game.hidden, .tv-result.hidden { display: none; }

/* Screen entrance: fade + rise, retriggered by the engine on every transition. */
.tv-anim-in { animation: tv-screen-in .55s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes tv-screen-in {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- games hub ----------------
   Every card is a link to that game's own page. Games used to unfold inline
   underneath this menu, which made them feel like sections of a page rather
   than places you had gone; that is gone, and .game-embed with it. */
.tv-hub { text-align: center; }
.tv-hub-h1 {
  font-family: var(--serif-display); font-size: 38px; letter-spacing: 3px; margin: 12px 0 12px;
  background: linear-gradient(180deg, #f6e7c5, #c9a15a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tv-games { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 30px; }
.tv-game-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 26px 16px 20px; border-radius: 14px; text-decoration: none; cursor: pointer;
  background: rgba(240, 230, 210, 0.05); border: 2px solid rgba(201, 161, 90, 0.25);
  color: #ede4d0; transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.tv-game-card:hover:not(.tv-game-soon) {
  transform: translateY(-3px); border-color: var(--gold-bright);
  background: rgba(240, 230, 210, 0.085); box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.tv-game-emoji { font-size: 40px; line-height: 1; }
.tv-game-card b { font-family: var(--serif-display); font-size: 15px; letter-spacing: .5px; }
.tv-game-card span { font-size: 12px; opacity: 0.72; line-height: 1.45; }
.tv-game-card i { font-size: 11px; font-style: normal; letter-spacing: 1px; color: var(--gold-bright); margin-top: 2px; }

/* the daily leads the gallery and says so */
.tv-game-daily { border-color: rgba(224, 180, 100, 0.5); background: rgba(201, 161, 90, 0.09); }
.tv-game-flag {
  position: absolute; top: 0; right: 0; padding: 4px 12px 5px; border-radius: 0 12px 0 12px;
  font-family: var(--serif-display); font-size: 9.5px !important; letter-spacing: 2px;
  text-transform: uppercase; color: #241a10; opacity: 1 !important;
  background: linear-gradient(180deg, #e0bd7c, #b98f47);
}
.tv-game-soon { opacity: 0.5; cursor: default; }
.tv-game-soon i { color: var(--gold-dim); }

.tv-hub-foot { margin-top: 30px; font-size: 12px; color: var(--text-muted); }
.tv-backlink { text-align: center; margin-top: 40px; font-size: 12.5px; }
.tv-backlink a { color: var(--text-muted); text-decoration: none; }
.tv-backlink a:hover { color: var(--gold-bright); }

/* ---------------- setup ---------------- */
.tv-setup { text-align: center; }
.tv-kicker { font-family: var(--serif-display); font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); }
.tv-setup h1 {
  font-family: var(--serif-display); font-size: 42px; letter-spacing: 3px; margin: 12px 0 12px;
  background: linear-gradient(180deg, #f6e7c5, #c9a15a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tv-sub { max-width: 520px; margin: 0 auto 34px; opacity: 0.8; line-height: 1.6; }

.tv-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 30px; }
.tv-cat {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 22px 12px 16px; border-radius: 14px;
  background: rgba(240, 230, 210, 0.05);
  border: 2px solid rgba(201, 161, 90, 0.25);
  color: #ede4d0; transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
}
.tv-cat:hover { transform: translateY(-3px); }
.tv-cat img { width: 52px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.tv-cat-emoji { font-size: 44px; line-height: 58px; }
.tv-cat b { font-family: var(--serif-display); font-size: 13.5px; line-height: 1.3; }
.tv-cat i { font-size: 11px; opacity: 0.6; font-style: normal; }
.tv-cat-glow { position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.tv-cat-got .tv-cat-glow { background: radial-gradient(340px 160px at 50% 0%, rgba(90, 140, 200, 0.3), transparent); }
.tv-cat-hotd .tv-cat-glow { background: radial-gradient(340px 160px at 50% 0%, rgba(200, 60, 50, 0.3), transparent); }
.tv-cat-knight .tv-cat-glow { background: radial-gradient(340px 160px at 50% 0%, rgba(220, 160, 60, 0.3), transparent); }
.tv-cat-all .tv-cat-glow { background: radial-gradient(340px 160px at 50% 0%, rgba(150, 90, 200, 0.3), transparent); }
.tv-cat.active .tv-cat-glow, .tv-cat:hover .tv-cat-glow { opacity: 1; }
.tv-cat.active { box-shadow: 0 8px 26px rgba(0,0,0,.45); }
.tv-cat-got.active { border-color: #6fa3d8; }
.tv-cat-hotd.active { border-color: #d85c50; }
.tv-cat-knight.active { border-color: #e0b464; }
.tv-cat-all.active { border-color: #a97fd4; }

.tv-diffs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 34px; }
.tv-diff {
  display: flex; flex-direction: column; gap: 4px; align-items: center;
  padding: 14px 10px; border-radius: 12px;
  background: rgba(240, 230, 210, 0.05); border: 2px solid rgba(201, 161, 90, 0.22);
  color: #ede4d0; transition: border-color .2s ease, background .2s ease;
}
.tv-diff b { font-family: var(--serif-display); font-size: 15px; letter-spacing: 1px; }
.tv-diff span { font-size: 11px; opacity: 0.6; }
.tv-diff-easy.active { border-color: #58b368; background: rgba(88, 179, 104, 0.14); }
.tv-diff-med.active { border-color: #e0a83c; background: rgba(224, 168, 60, 0.14); }
.tv-diff-hard.active { border-color: #d84c4c; background: rgba(216, 76, 76, 0.16); }
.tv-diff-mixed.active { border-color: #a97fd4; background: rgba(169, 127, 212, 0.14); }

.tv-start {
  font-family: var(--serif-display); font-size: 16px; letter-spacing: 2px;
  padding: 16px 44px; border-radius: 12px; border: none; cursor: pointer;
  color: #241c12; background: linear-gradient(180deg, #e8c883, #c9a15a);
  box-shadow: 0 6px 24px rgba(201, 161, 90, 0.35);
  transition: transform .12s ease, box-shadow .2s ease;
}
.tv-start:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(201, 161, 90, 0.5); }

/* ---------------- spoiler shield (gate) ---------------- */
.tv-gate { text-align: center; }
.tv-gate h2 {
  font-family: var(--serif-display); font-size: 32px; letter-spacing: 2px; margin: 10px 0 12px;
  background: linear-gradient(180deg, #f6e7c5, #c9a15a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tv-gate-group { margin: 0 auto 22px; max-width: 640px; text-align: center; }
.tv-gate-label {
  font-family: var(--serif-display); font-size: 13px; letter-spacing: 1.5px;
  color: var(--gold-bright); margin-bottom: 10px;
}
.tv-gate-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tv-gate-opt {
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(240, 230, 210, 0.05); border: 1.5px solid rgba(201, 161, 90, 0.25);
  color: #ede4d0; font-family: var(--serif-body); font-size: 13px;
  transition: border-color .15s ease, background .15s ease;
}
.tv-gate-opt:hover { border-color: var(--gold-bright); }
.tv-gate-opt.active { border-color: var(--gold-bright); background: rgba(201, 161, 90, 0.22); color: #f6e7c5; }
.tv-gate-count { margin: 4px 0 24px; font-size: 13.5px; opacity: 0.75; min-height: 20px; }
.tv-gate-count b { color: var(--gold-bright); }
.tv-gate-count .tv-gate-warn { color: #e0a83c; }
.tv-gate-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; align-items: center; }
.tv-gate-back, .tv-gate-nospoil {
  font-family: var(--serif-display); font-size: 12.5px; letter-spacing: 1px;
  padding: 12px 22px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(201, 161, 90, 0.45); background: transparent; color: var(--gold);
}
.tv-gate-back:hover, .tv-gate-nospoil:hover { background: rgba(201, 161, 90, 0.15); }
.tv-start:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------------- game ---------------- */
.tv-game-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.tv-quit { background: none; border: none; color: var(--gold-dim); font-family: var(--serif-body); font-size: 13px; cursor: pointer; }
.tv-quit:hover { color: var(--gold); }
.tv-dots { display: flex; gap: 7px; flex: 1; justify-content: center; }
.tv-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(240,230,210,0.15); border: 1px solid rgba(201,161,90,0.3); }
.tv-dot.now { background: var(--gold); box-shadow: 0 0 8px rgba(201,161,90,0.8); }
.tv-dot.ok { background: #58b368; border-color: #58b368; }
.tv-dot.bad { background: #d84c4c; border-color: #d84c4c; }
.tv-streak { font-family: var(--serif-display); font-size: 13px; color: #e8a83c; min-width: 64px; text-align: right; }

.tv-card {
  background: linear-gradient(180deg, rgba(240,230,210,0.07), rgba(240,230,210,0.03));
  border: 1px solid rgba(201,161,90,0.35);
  border-radius: 16px; padding: 26px; box-shadow: 0 14px 44px rgba(0,0,0,.45);
}
.tv-qimg { text-align: center; margin-bottom: 18px; }
.tv-qimg img {
  max-width: 190px; max-height: 190px; border-radius: 12px;
  border: 2px solid var(--gold); box-shadow: 0 6px 20px rgba(0,0,0,.5);
  background: #f4ecda; object-fit: cover;
}
.tv-qimg-credit { display: block; font-size: 10px; opacity: 0.5; margin-top: 5px; }
.tv-q { font-family: var(--serif-display); font-size: 21px; line-height: 1.45; text-align: center; margin-bottom: 22px; color: #f4ead2; }
.tv-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tv-a {
  padding: 14px 16px; border-radius: 10px; text-align: left; cursor: pointer;
  background: rgba(240,230,210,0.06); border: 2px solid rgba(201,161,90,0.3);
  color: #ede4d0; font-family: var(--serif-body); font-size: 15px; line-height: 1.4;
  transition: border-color .12s ease, background .12s ease, transform .1s ease;
}
.tv-a:hover:not(:disabled) { border-color: var(--gold-bright); background: rgba(201,161,90,0.14); transform: translateY(-1px); }
.tv-a:disabled { cursor: default; }
.tv-a.right { border-color: #58b368; background: rgba(88,179,104,0.22); animation: tv-pop .3s ease; }
.tv-a.wrong { border-color: #d84c4c; background: rgba(216,76,76,0.22); animation: tv-shake .3s ease; }
.tv-a.dim { opacity: 0.45; }
@keyframes tv-pop { 50% { transform: scale(1.03); } }
@keyframes tv-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.tv-explain {
  margin-top: 16px; padding: 12px 16px; border-radius: 8px; font-size: 13.5px; line-height: 1.6;
  background: rgba(201,161,90,0.1); border-left: 3px solid var(--gold);
}
.tv-next {
  display: block; margin: 18px auto 0; padding: 11px 30px; border-radius: 10px; border: 1px solid var(--gold);
  background: transparent; color: var(--gold); font-family: var(--serif-display); font-size: 13px; letter-spacing: 1.5px; cursor: pointer;
}
.tv-next:hover { background: var(--gold); color: #241c12; }

/* ---------------- results ---------------- */
.tv-result { text-align: center; }
.tv-score-ring {
  width: 170px; height: 170px; margin: 26px auto 18px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 4px solid var(--gold); box-shadow: 0 0 40px rgba(201,161,90,0.35), inset 0 0 30px rgba(201,161,90,0.15);
  animation: tv-ring-in .7s cubic-bezier(.2, .9, .3, 1.25) both;
}
@keyframes tv-ring-in {
  from { opacity: 0; transform: scale(.4); box-shadow: 0 0 0 rgba(201,161,90,0); }
  to   { opacity: 1; transform: scale(1); }
}
.tv-reveal-1 { animation: tv-screen-in .5s ease .45s both; }
.tv-reveal-2 { animation: tv-screen-in .5s ease .7s both; }
.tv-reveal-3 { animation: tv-screen-in .5s ease .95s both; }
.tv-score-ring b { font-family: var(--serif-display); font-size: 46px; color: #f4ead2; }
.tv-score-ring span { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.65; }
.tv-rank { font-family: var(--serif-display); font-size: 26px; color: var(--gold-bright); margin-bottom: 8px; }
.tv-rank-sub { max-width: 460px; margin: 0 auto 28px; opacity: 0.8; line-height: 1.6; }
.tv-result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.tv-result-actions button {
  font-family: var(--serif-display); font-size: 13px; letter-spacing: 1px;
  padding: 12px 26px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--gold); background: transparent; color: var(--gold);
}
.tv-result-actions button:hover { background: var(--gold); color: #241c12; }

@media (max-width: 620px) {
  .tv-answers { grid-template-columns: 1fr; }
  .tv-setup h1 { font-size: 30px; }
}

/* daily-streak badge on the hub */
.tv-streak.hidden { display: none; }
.tv-streak {
  display: inline-block; margin: 2px auto 22px; padding: 8px 18px; border-radius: 999px;
  background: rgba(201, 90, 40, 0.12); border: 1px solid rgba(224, 122, 63, 0.5); color: #f0d9b8;
  font-family: var(--serif-body); font-size: 14px;
}
.tv-streak b { font-family: var(--serif-display); color: #ffb874; letter-spacing: 0.4px; }
.tv-streak-best { margin-left: 8px; padding-left: 10px; border-left: 1px solid rgba(224, 122, 63, 0.4); font-size: 12.5px; opacity: 0.85; }
