:root {
  --bg-0: #0b1020;
  --bg-1: #131a35;
  --bg-2: #1c2350;
  --fg: #e9ecf8;
  --fg-dim: #a9b1d6;
  --accent: #7aa2ff;
  --accent-2: #c4b5fd;
  --accent-3: #34d399;
  --danger: #f87171;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 60%, var(--bg-2) 100%);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

/* Drifting aurora blobs behind everything */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(closest-side at 18% 22%, rgba(122, 162, 255, 0.45), transparent 65%),
    radial-gradient(closest-side at 82% 18%, rgba(196, 181, 253, 0.40), transparent 60%),
    radial-gradient(closest-side at 30% 85%, rgba(52, 211, 153, 0.22), transparent 60%),
    radial-gradient(closest-side at 88% 78%, rgba(122, 92, 255, 0.30), transparent 65%);
  filter: blur(60px) saturate(120%);
  opacity: 0.85;
  animation: aurora-drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
body::after {
  background:
    radial-gradient(closest-side at 60% 30%, rgba(96, 165, 250, 0.28), transparent 60%),
    radial-gradient(closest-side at 12% 70%, rgba(244, 114, 182, 0.22), transparent 60%);
  filter: blur(80px) saturate(130%);
  opacity: 0.55;
  animation: aurora-drift 40s ease-in-out -10s infinite alternate-reverse;
}

@keyframes aurora-drift {
  0%   { transform: translate3d(-3%, -2%, 0) rotate(0deg)   scale(1.00); }
  25%  { transform: translate3d( 4%, -4%, 0) rotate(8deg)   scale(1.06); }
  50%  { transform: translate3d( 5%,  3%, 0) rotate(-4deg)  scale(1.10); }
  75%  { transform: translate3d(-4%,  5%, 0) rotate(6deg)   scale(1.04); }
  100% { transform: translate3d( 2%, -3%, 0) rotate(-6deg)  scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
  flex: 1;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 3vw, 28px);
}
.brand-left {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 18px);
}
.brand h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #fff 0%, var(--accent-2) 60%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .subtitle { color: var(--fg-dim); font-size: clamp(14px, 1.6vw, 16px); }

.thl-logo {
  display: block;
  width: clamp(56px, 7vw, 92px);
  height: auto;
  filter: drop-shadow(0 4px 14px rgba(122, 162, 255, 0.25));
  animation: thl-throb 3.2s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, filter;
}
.thl-logo--sm { width: clamp(44px, 12vw, 64px); }

.thl-logo--corner {
  position: fixed;
  right: clamp(12px, 2.2vw, 24px);
  bottom: clamp(12px, 2.2vw, 24px);
  width: clamp(44px, 5.5vw, 72px);
  height: auto;
  z-index: 50;
  pointer-events: none;
  opacity: 0.98;
  transform-origin: center;
  will-change: transform, filter;
  animation:
    disco-sway 2.4s ease-in-out infinite,
    disco-hue 4s linear infinite;
}
@keyframes disco-sway {
  0%   { transform: rotate(-7deg) scale(1);    }
  25%  { transform: rotate( 5deg) scale(1.07); }
  50%  { transform: rotate(-4deg) scale(1.02); }
  75%  { transform: rotate( 8deg) scale(1.09); }
  100% { transform: rotate(-7deg) scale(1);    }
}
@keyframes disco-hue {
  0% {
    filter:
      hue-rotate(0deg) saturate(1.6)
      drop-shadow(0 0  6px rgba(255, 80,180, 0.95))
      drop-shadow(0 0 18px rgba(255, 80,180, 0.55));
  }
  20% {
    filter:
      hue-rotate(72deg) saturate(1.8)
      drop-shadow(0 0  6px rgba( 80,220,255, 0.95))
      drop-shadow(0 0 22px rgba( 80,220,255, 0.55));
  }
  40% {
    filter:
      hue-rotate(144deg) saturate(2.0)
      drop-shadow(0 0  6px rgba(140,255,120, 0.95))
      drop-shadow(0 0 22px rgba(140,255,120, 0.55));
  }
  60% {
    filter:
      hue-rotate(216deg) saturate(1.8)
      drop-shadow(0 0  6px rgba(255,210, 60, 0.95))
      drop-shadow(0 0 22px rgba(255,210, 60, 0.55));
  }
  80% {
    filter:
      hue-rotate(288deg) saturate(1.8)
      drop-shadow(0 0  6px rgba(196,181,253, 0.95))
      drop-shadow(0 0 22px rgba(196,181,253, 0.55));
  }
  100% {
    filter:
      hue-rotate(360deg) saturate(1.6)
      drop-shadow(0 0  6px rgba(255, 80,180, 0.95))
      drop-shadow(0 0 18px rgba(255, 80,180, 0.55));
  }
}
/* Safari iOS safe-area */
@supports (padding: env(safe-area-inset-bottom)) {
  .thl-logo--corner {
    right: calc(env(safe-area-inset-right) + clamp(12px, 2.2vw, 24px));
    bottom: calc(env(safe-area-inset-bottom) + clamp(12px, 2.2vw, 24px));
  }
}

@keyframes thl-throb {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 4px 14px rgba(122, 162, 255, 0.22));
  }
  50% {
    transform: scale(1.045);
    filter: drop-shadow(0 6px 22px rgba(196, 181, 253, 0.42));
  }
}

@media (prefers-reduced-motion: reduce) {
  .thl-logo { animation: none; }
  .thl-logo--corner { animation: none; box-shadow: none; filter: none; }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(18px, 2.5vw, 28px);
  position: relative;
  overflow: hidden;
}
.card::after {
  /* slow highlight sheen drifting across cards */
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: card-sheen 9s ease-in-out infinite;
  pointer-events: none;
}
@keyframes card-sheen {
  0%, 60%, 100% { transform: translateX(-110%); }
  80% { transform: translateX(110%); }
}
@media (prefers-reduced-motion: reduce) {
  .card::after { animation: none; display: none; }
}

/* ---------- Presenter ---------- */
.presenter-grid {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: clamp(18px, 2.5vw, 28px);
  align-items: start;
}
@media (max-width: 880px) {
  .presenter-grid { grid-template-columns: 1fr; }
}

.qr-card { text-align: center; }
.qr-card .qr-wrap {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  display: inline-block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(122,162,255,0.0);
  animation: qr-breathe 4.5s ease-in-out infinite;
}
@keyframes qr-breathe {
  0%, 100% { box-shadow: 0 6px 24px rgba(0,0,0,0.30), 0 0 0 0 rgba(122,162,255,0.0); transform: translateY(0); }
  50%      { box-shadow: 0 10px 32px rgba(0,0,0,0.36), 0 0 0 10px rgba(122,162,255,0.10); transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .qr-card .qr-wrap { animation: none; }
}
.qr-card img {
  display: block;
  width: clamp(220px, 30vw, 340px);
  height: auto;
  image-rendering: pixelated;
}
.qr-card .join-url {
  margin-top: 14px;
  font-size: clamp(14px, 1.6vw, 18px);
  color: var(--fg-dim);
  word-break: break-all;
}
.qr-card .join-url strong { color: var(--fg); }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; justify-content: center; }
.stat {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--card-strong);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--fg);
}
.stat b { color: var(--accent-2); margin-right: 6px; font-weight: 700; transition: color 240ms ease; display: inline-block; }
.stat.flash b { animation: count-flash 800ms ease-out; }

.questions { display: grid; gap: clamp(14px, 2vw, 20px); }
.question-card h2 {
  margin: 0 0 12px 0;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
}
.question-card .meta { color: var(--fg-dim); font-size: 13px; margin-bottom: 14px; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 24%) 1fr auto; gap: 12px; align-items: center; }
.bar-row .label { color: var(--fg); font-size: 14px; }
.bar-row .track {
  position: relative;
  height: 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.bar-row .fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 999px;
  overflow: hidden;
  transition: width 600ms cubic-bezier(.22,.9,.3,1);
  box-shadow: 0 0 0 0 rgba(196, 181, 253, 0);
}
.bar-row .fill::after {
  /* travelling highlight on the fill */
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 0;
  width: 40%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.28) 50%, transparent 100%);
  transform: translateX(-120%);
  pointer-events: none;
  animation: fill-shimmer 5s ease-in-out infinite;
}
.bar-row.bumped .fill {
  animation: bar-pop 700ms cubic-bezier(.22,.9,.3,1);
}
@keyframes fill-shimmer {
  0%   { transform: translateX(-120%); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(320%);  opacity: 0; }
}
@keyframes bar-pop {
  0%   { box-shadow: 0 0 0 0 rgba(196, 181, 253, 0.55); filter: brightness(1.0); }
  40%  { box-shadow: 0 0 0 6px rgba(196, 181, 253, 0.18); filter: brightness(1.25); }
  100% { box-shadow: 0 0 0 0 rgba(196, 181, 253, 0);    filter: brightness(1.0); }
}
@media (prefers-reduced-motion: reduce) {
  .bar-row .fill::after { animation: none; }
  .bar-row.bumped .fill { animation: none; }
}

.bar-row .count.flash b { animation: count-flash 700ms ease-out; }
@keyframes count-flash {
  0%   { color: var(--accent-2); text-shadow: 0 0 14px rgba(196,181,253,0.8); transform: scale(1.0); display: inline-block; }
  40%  { color: #fff;            text-shadow: 0 0 18px rgba(196,181,253,1.0); transform: scale(1.18); }
  100% { color: var(--fg);       text-shadow: none; transform: scale(1.0); }
}
.bar-row .count {
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
  font-size: 13px;
  min-width: 70px;
  text-align: right;
}
.bar-row .count b { color: var(--fg); }

.footer-bar {
  margin-top: clamp(20px, 3vw, 32px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--fg-dim);
  font-size: 13px;
}

.conn-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-3); margin-right: 6px; box-shadow: 0 0 8px var(--accent-3); }
.conn-dot.off { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* ---------- Participant ---------- */
.join-shell { width: min(680px, 100%); margin: 0 auto; }
.join-shell .intro {
  color: var(--fg-dim);
  margin: 0 0 18px;
  font-size: 15px;
}

.join-question {
  margin-bottom: clamp(14px, 2vw, 20px);
}
.join-question h2 {
  margin: 0 0 12px 0;
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.3;
}

.choices {
  display: grid;
  gap: 10px;
}
.choice {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  padding: 14px 16px;
  text-align: left;
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: transform 120ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.choice:hover { background: rgba(255,255,255,0.08); }
.choice:active { transform: scale(0.99); }
.choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.choice .chk {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  flex: 0 0 auto;
  position: relative;
}
.choice.selected {
  background: linear-gradient(120deg, rgba(122,162,255,0.22), rgba(196,181,253,0.18));
  border-color: rgba(196,181,253,0.55);
  box-shadow: 0 6px 20px rgba(122,162,255,0.22);
}
.choice.selected .chk { border-color: var(--accent-2); background: var(--accent-2); }
.choice.selected .chk::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #1a1d3a;
}

.saved-pill {
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent-3);
  opacity: 0;
  transition: opacity 240ms ease;
}
.saved-pill.show { opacity: 1; }

.join-footer {
  margin-top: 22px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .bar-row .fill { transition: none; }
  .choice { transition: none; }
}

/* === Luo esitys: magic button + overlay === */
.btn-magic {
  appearance: none;
  border: 1px solid rgba(196,181,253,0.45);
  background: linear-gradient(120deg, rgba(122,162,255,0.18), rgba(196,181,253,0.22));
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(122,162,255,0.18), inset 0 0 0 1px rgba(255,255,255,0.05);
  transition: transform 180ms ease, box-shadow 220ms ease, filter 220ms ease;
}
.btn-magic:hover { transform: translateY(-1px) scale(1.02); filter: brightness(1.12) saturate(1.15); box-shadow: 0 10px 28px rgba(196,181,253,0.35); }
.btn-magic:active { transform: translateY(0) scale(0.98); }
.btn-magic::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: btn-magic-sheen 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-magic-sheen {
  0%   { transform: translateX(-120%); }
  60%  { transform: translateX(220%);  }
  100% { transform: translateX(220%);  }
}

.magic-overlay {
  position: fixed; inset: 0;
  z-index: 999;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(122,162,255,0.35), transparent 60%),
    radial-gradient(circle at 75% 80%, rgba(196,181,253,0.35), transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(255,80,180,0.18), transparent 70%),
    rgba(6, 10, 22, 0.85);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  animation: magic-bg 8s linear infinite;
  overflow: hidden;
}
.magic-overlay[hidden] { display: none; }
@keyframes magic-bg {
  0%   { filter: hue-rotate(0deg)   saturate(1.1); }
  100% { filter: hue-rotate(360deg) saturate(1.1); }
}

.magic-stage {
  position: relative;
  width: min(620px, 92vw);
  padding: clamp(28px, 5vw, 56px);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.04);
  text-align: center;
  overflow: hidden;
  animation: magic-stage-in 600ms cubic-bezier(.22,.9,.3,1.2);
}
@keyframes magic-stage-in {
  0%   { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0);       opacity: 1; }
}

.magic-orb {
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  pointer-events: none;
  top: -80px; left: -80px;
  background: radial-gradient(circle, #7aa2ff, transparent 65%);
  animation: orb-drift-a 9s ease-in-out infinite alternate;
}
.magic-orb--b {
  top: auto; left: auto; right: -100px; bottom: -100px;
  background: radial-gradient(circle, #c4b5fd, transparent 65%);
  animation: orb-drift-b 11s ease-in-out infinite alternate;
}
.magic-orb--c {
  top: 30%; left: 50%; width: 220px; height: 220px;
  background: radial-gradient(circle, #ff66c4, transparent 65%);
  animation: orb-drift-c 7s ease-in-out infinite alternate;
}
@keyframes orb-drift-a { from { transform: translate(0,0)     scale(1);   } to { transform: translate( 60px, 40px) scale(1.2); } }
@keyframes orb-drift-b { from { transform: translate(0,0)     scale(1);   } to { transform: translate(-50px,-30px) scale(1.25); } }
@keyframes orb-drift-c { from { transform: translate(-50%,-50%) scale(1); } to { transform: translate(-30%,-60%)   scale(1.3); } }

.magic-rings { position: absolute; inset: 0; pointer-events: none; }
.magic-rings span {
  position: absolute; top: 50%; left: 50%;
  width: 80px; height: 80px;
  margin: -40px 0 0 -40px;
  border-radius: 50%;
  border: 2px solid rgba(196,181,253,0.6);
  animation: ring-pulse 2.4s ease-out infinite;
  opacity: 0;
}
.magic-rings span:nth-child(2) { animation-delay: 0.8s; border-color: rgba(122,162,255,0.6); }
.magic-rings span:nth-child(3) { animation-delay: 1.6s; border-color: rgba(255,102,196,0.6); }
@keyframes ring-pulse {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { opacity: 0.9; }
  100% { transform: scale(4.5); opacity: 0; }
}

.magic-sparkles { position: absolute; inset: 0; pointer-events: none; }
.magic-sparkles i {
  position: absolute;
  width: 6px; height: 6px;
  background: radial-gradient(circle, #fff, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: sparkle-twinkle 1.8s ease-in-out infinite;
}

@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  50%      { opacity: 1; transform: scale(1.3); }
}

.magic-text { position: relative; z-index: 2; margin-bottom: 22px; }
.magic-title {
  font-size: clamp(22px, 3.4vw, 32px);
  font-weight: 700;
  background: linear-gradient(90deg, #7aa2ff, #c4b5fd, #ff66c4, #7aa2ff);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: title-shimmer 4s linear infinite;
  margin-bottom: 8px;
}
@keyframes title-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.magic-step {
  color: var(--fg-dim);
  font-size: 15px;
  min-height: 1.4em;
  transition: opacity 240ms ease;
}
.magic-step.swap { opacity: 0; }

.magic-progress { position: relative; z-index: 2; }
.magic-progress-track {
  height: 14px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}
.magic-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7aa2ff, #c4b5fd 50%, #ff66c4);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 320ms cubic-bezier(.22,.9,.3,1);
  box-shadow: 0 0 18px rgba(196,181,253,0.7), 0 0 36px rgba(255,102,196,0.35);
  animation: progress-shimmer 2.4s linear infinite;
}
@keyframes progress-shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.magic-progress-num {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  text-shadow: 0 0 12px rgba(196,181,253,0.6);
}

.magic-overlay.done .magic-title { animation: title-pop 600ms cubic-bezier(.22,.9,.3,1.4); }
.magic-overlay.done .magic-progress-fill { box-shadow: 0 0 28px rgba(140,255,120,0.85), 0 0 60px rgba(140,255,120,0.45); background: linear-gradient(90deg, #6ee7b7, #c4b5fd, #ff66c4); }
@keyframes title-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .btn-magic::after, .magic-overlay, .magic-orb, .magic-rings span, .magic-sparkles i, .magic-title, .magic-progress-fill { animation: none !important; }
}

/* === Kaboom: blow up the screen, then fade to black === */
/* Timeline (t = 0 is when body.blowup is added):
   0ms .. 1400ms   magic-overlay scales up + brightens, then blurs & fades
   600ms.. 2800ms  page container + THL logo burst outward
   900ms.. 2100ms  white flash blooms and dies
   2600ms.. 6000ms black curtain slowly fades to full opacity
*/
.kaboom-flash {
  position: fixed; inset: 0;
  z-index: 1000;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  animation: kaboom-flash 1200ms 900ms ease-out forwards;
}
@keyframes kaboom-flash {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}
.kaboom-black {
  position: fixed; inset: 0;
  z-index: 1001;
  background: #000;
  opacity: 0;
  pointer-events: none;
  animation: kaboom-black 3400ms 2600ms cubic-bezier(.5,0,.7,.9) forwards;
}
@keyframes kaboom-black {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}
body.blowup { overflow: hidden; }
body.blowup .container,
body.blowup .thl-logo--corner {
  transform-origin: center;
  animation: kaboom-burst 2200ms 600ms cubic-bezier(.55,-0.1,.2,1) forwards;
}
body.blowup .magic-stage {
  transform-origin: center;
  animation: kaboom-burst 1700ms cubic-bezier(.55,-0.1,.2,1) forwards;
}
body.blowup .magic-overlay {
  animation: kaboom-overlay-fade 1400ms ease-out forwards;
}
@keyframes kaboom-burst {
  0%   { transform: scale(1)    rotate(0deg);  filter: blur(0)    brightness(1);   opacity: 1; }
  15%  { transform: scale(0.94) rotate(-1deg); filter: blur(0)    brightness(1.5); opacity: 1; }
  35%  { transform: scale(1.30) rotate(4deg);  filter: blur(0)    brightness(2.2); opacity: 1; }
  60%  { transform: scale(3.20) rotate(9deg);  filter: blur(8px)  brightness(1.4); opacity: 0.85; }
  100% { transform: scale(9)    rotate(22deg); filter: blur(38px) brightness(0.25); opacity: 0; }
}
@keyframes kaboom-overlay-fade {
  0%   { transform: scale(1);    filter: brightness(1)   blur(0);    opacity: 1; }
  35%  { transform: scale(1.06); filter: brightness(1.9) blur(0);    opacity: 1; }
  70%  { transform: scale(1.35); filter: brightness(1.2) blur(10px); opacity: 0.7; }
  100% { transform: scale(1.85); filter: brightness(0.2) blur(26px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .kaboom-flash, .kaboom-black,
  body.blowup .container,
  body.blowup .magic-stage,
  body.blowup .magic-overlay,
  body.blowup .thl-logo--corner { animation: none !important; }
  .kaboom-black { opacity: 1; }
}
