/* Hindsight ("which came first?"), on top of style.css. Same layout and fonts as GeoClue,
   with its own Museum plum colors. Layout: progress bar, two stacked event cards, then the reveal. */
:root.hindsight {
  --bg: #efeaf3; --card: #faf8fc; --ink: #241a33; --muted: #6b5f7a; --line: #d8cfe2;
  --accent: #6a3d9a; --on-accent: #ffffff; --win: #2e8a57; --hot: #d1462f; --fire: #e8731c; --fire2: #f4b63a;
}
@media (prefers-color-scheme: dark) {
  :root.hindsight:not([data-theme="light"]) {
    --bg: #17111f; --card: #211a2c; --ink: #ece6f3; --muted: #a497b4; --line: #3a2e4a;
    --accent: #b48be0; --on-accent: #17111f; --win: #4fbf7f; --hot: #f0634a; --fire: #ff8a3d; --fire2: #ffc95c; color-scheme: dark;
  }
}
:root.hindsight[data-theme="dark"] {
  --bg: #17111f; --card: #211a2c; --ink: #ece6f3; --muted: #a497b4; --line: #3a2e4a;
  --accent: #b48be0; --on-accent: #17111f; --win: #4fbf7f; --hot: #f0634a; --fire: #ff8a3d; --fire2: #ffc95c; color-scheme: dark;
}
.hindsight .wrap { position: relative; } /* keeps the page above the streak glow */
.hindsight dialog::backdrop { background: rgba(23, 17, 31, .55); }

.hs-progress { display: flex; gap: 6px; }
.hs-progress i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); transition: background .3s; }
.hs-progress i.now { background: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.hs-progress i.ok { background: var(--win); }
.hs-progress i.no { background: var(--hot); }

.hs-round { display: grid; gap: 10px; }
.hs-q { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.hs-q h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; }
.hs-q span { font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }

.pick {
  --c: var(--line);
  width: 100%; text-align: left; font: inherit; font-weight: 400; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1.5px solid var(--c); border-radius: 10px; padding: 14px 16px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  transition: border-color .2s, transform .1s;
}
.pick:hover:not(:disabled) { border-color: var(--accent); }
.pick:active:not(:disabled) { transform: scale(.985); }
.pick:disabled { cursor: default; opacity: 1; }
.pick .ev { font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.pick .where { grid-column: 1; font-size: .85rem; color: var(--muted); }
.pick .yr { grid-row: 1 / span 2; grid-column: 2; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 1rem; text-align: right; white-space: nowrap; }
.pick .tag { grid-column: 1; font-size: .78rem; font-weight: 600; }
.pick.first { --c: var(--win); background: color-mix(in srgb, var(--win) 9%, var(--card)); }
.pick.first .yr, .pick.first .tag { color: var(--win); }
.pick.wrong { --c: var(--hot); }
.pick.wrong .tag { color: var(--hot); }
.pick.shown .yr { animation: hs-fade .35s ease both; }
.hs-or { justify-self: center; font-family: var(--mono); font-size: .75rem; color: var(--muted); letter-spacing: .1em; }

.hs-reveal { display: grid; gap: 12px; animation: hs-up .35s cubic-bezier(.2, .8, .2, 1) both; }
.hs-verdict { margin: 0; font-family: var(--display); font-weight: 600; font-size: 1.15rem; }
.hs-verdict.ok { color: var(--win); }
.hs-verdict.no { color: var(--hot); }
.hs-fact { margin: 0; }
.hs-fact a { font-size: .8rem; color: var(--muted); margin-left: 4px; }
.hs-tl { position: relative; height: 54px; margin: 0 6px; }
.hs-tl .axis { position: absolute; left: 0; right: 0; top: 20px; height: 2px; background: var(--line); }
.hs-tl .span { position: absolute; left: 12%; width: 76%; top: 20px; height: 2px; background: var(--accent); }
.hs-tl .dot { position: absolute; top: 14px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--card); }
.hs-tl .dot.a { left: 12%; background: var(--win); }
.hs-tl .dot.b { left: 88%; background: var(--muted); }
.hs-tl .lab, .hs-tl .gap { position: absolute; font-family: var(--mono); font-size: .72rem; transform: translateX(-50%); white-space: nowrap; }
.hs-tl .lab { top: 34px; color: var(--muted); }
.hs-tl .lab.a { left: 12%; } .hs-tl .lab.b { left: 88%; }
.hs-tl .gap { top: 0; left: 50%; color: var(--ink); }
.hs-facts { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.hs-facts h3 { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.hs-facts p { margin: 0; display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 0 8px; font-size: .92rem; }
.hs-facts b { font-family: var(--mono); font-weight: 500; font-size: .8rem; color: var(--muted); padding-top: .15em; }
.hs-facts a { grid-column: 2; font-size: .78rem; color: var(--muted); justify-self: start; }
.hs-progress i.fire { background: linear-gradient(90deg, var(--fire), var(--fire2)); box-shadow: 0 0 10px color-mix(in srgb, var(--fire) 60%, transparent); }

/* Streak: "Heating up!" badge, a warm glow at the top of the screen and floating embers */
.hs-heat { margin: 0; justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; color: #fff; background: linear-gradient(90deg, var(--fire), var(--fire2), var(--fire)); background-size: 200% 100%;
  box-shadow: 0 4px 18px color-mix(in srgb, var(--fire) 45%, transparent); animation: hs-heat-in .55s cubic-bezier(.3, 1.6, .5, 1) both, hs-shimmer 2.4s linear infinite; }
.hs-heat .flame { display: inline-block; transform-origin: 50% 90%; animation: hs-flicker .9s ease-in-out infinite alternate; }
.hs-glow { position: fixed; inset: 0 0 auto 0; height: 140px; pointer-events: none; opacity: 0; transition: opacity .8s;
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--fire) 38%, transparent), transparent 70%); }
body.hot .hs-glow { opacity: 1; animation: hs-breathe 2.6s ease-in-out infinite; }
body.hot .pick:not(:disabled) { border-color: color-mix(in srgb, var(--fire) 55%, var(--line)); }
.hs-embers { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.hs-embers i { position: absolute; bottom: -10px; width: 6px; height: 6px; border-radius: 50%; background: var(--fire2); box-shadow: 0 0 8px var(--fire); animation: hs-ember 1.6s ease-out forwards; }

/* Right: a soft green wash sweeps across the screen. Wrong: the card shakes and the edges pulse red. */
.hs-flash { position: fixed; inset: 0; pointer-events: none; z-index: 31; opacity: 0; }
.hs-flash.ok { background: linear-gradient(100deg, transparent 0%, color-mix(in srgb, var(--win) 34%, transparent) 45%, color-mix(in srgb, var(--win) 34%, transparent) 55%, transparent 100%);
  background-size: 250% 100%; animation: hs-sweep .8s ease-out; }
.hs-flash.no { box-shadow: inset 0 0 0 6px color-mix(in srgb, var(--hot) 60%, transparent), inset 0 0 70px color-mix(in srgb, var(--hot) 35%, transparent); animation: hs-edge .6s ease-out; }
.pick.pop { animation: hs-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.pick.shake { animation: hs-shake .5s cubic-bezier(.36, .07, .19, .97); }
.hs-verdict { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hs-plus { font-family: var(--mono); font-size: .85rem; padding: 2px 8px; border-radius: 999px; color: #fff; background: var(--win); animation: hs-float .7s ease-out both; }
.hs-plus.x2 { background: linear-gradient(90deg, var(--fire), var(--fire2)); }
.hs-tl .span { transform-origin: left; animation: hs-grow .6s .1s ease-out both; }
.hs-recap .pct { display: block; color: var(--muted); font-size: .8rem; }
#field .everyone-big b { margin-right: 6px; }
.hs-reveal .btns { justify-content: flex-start; }

/* Results */
.hs-score { font-family: var(--mono); color: var(--accent); }
.hs-recap { list-style: none; margin: 0; padding: 0; width: 100%; text-align: left; display: grid; gap: 8px; font-size: .88rem; border-top: 1px solid var(--line); padding-top: 12px; }
.hs-recap li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: 6px; }
.hs-recap .line { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); gap: 6px; }
.hs-recap small { padding-top: .1em; color: var(--muted); font-family: var(--mono); }
.hs-recap .pct { display: block; color: var(--muted); font-size: .8rem; }

@keyframes hs-fade { from { opacity: 0; } }
@keyframes hs-heat-in { from { opacity: 0; transform: scale(.6) rotate(-4deg); } }
@keyframes hs-shimmer { to { background-position: -200% 0; } }
@keyframes hs-flicker { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.18) rotate(6deg); } }
@keyframes hs-breathe { 50% { opacity: .65; } }
@keyframes hs-ember { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), -70vh) scale(.3); opacity: 0; } }
@keyframes hs-pop { 40% { transform: scale(1.035); } }
@keyframes hs-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(5px); } 30%, 50%, 70% { transform: translateX(-9px); } 40%, 60% { transform: translateX(9px); } }
@keyframes hs-sweep { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 0; background-position: -60% 0; } }
@keyframes hs-edge { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hs-float { from { opacity: 0; transform: translateY(8px) scale(.8); } }
@keyframes hs-grow { from { transform: scaleX(0); } }
@keyframes hs-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .pick.shown .yr, .hs-reveal, .hs-heat, .hs-heat .flame, body.hot .hs-glow, .pick.pop, .pick.shake, .hs-plus, .hs-tl .span { animation: none; }
  .hs-progress i, .pick { transition: none; }
  .hs-flash, .hs-embers { display: none; }
}
