/* ── NovaFlakes — dark cinematic ice theme ───────────────────────── */

:root {
  --bg: #060a13;
  --bg-raised: #0b1220;
  --bg-card: #0d1526;
  --line: rgba(140, 180, 230, 0.14);
  --text: #e8eef8;
  --text-dim: #9fb0c8;
  --text-faint: #6b7c96;
  --accent: #6fb3ff;
  --accent-deep: #2a6fdb;
  --glow: rgba(111, 179, 255, 0.35);
  --nav-bg: rgba(6, 10, 19, 0.72);
  --hero-grad: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(42, 111, 219, 0.22), transparent 70%);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] {
  --bg: #f3f6fb;
  --bg-raised: #ffffff;
  --bg-card: #ffffff;
  --line: rgba(30, 60, 110, 0.13);
  --text: #131b2a;
  --text-dim: #44546d;
  --text-faint: #7c8aa2;
  --accent: #2a6fdb;
  --accent-deep: #1d4fa8;
  --glow: rgba(42, 111, 219, 0.22);
  --nav-bg: rgba(243, 246, 251, 0.78);
  --hero-grad: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(42, 111, 219, 0.12), transparent 70%);
  --shadow-card: 0 12px 36px rgba(20, 40, 80, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", "Helvetica Neue", Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.35s ease, color 0.35s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Sora", "Helvetica Neue", sans-serif;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--accent); text-decoration: none; }

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

#root { position: relative; z-index: 2; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* ── Nav ──────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.nav-brand img { width: 34px; height: 34px; }
.nav-brand .flakes { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  align-items: center;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 600;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 170px 0 110px;
  text-align: center;
  background: var(--hero-grad);
  overflow: hidden;
}
.hero-logo {
  width: 190px;
  height: 190px;
  margin: 0 auto 26px;
  position: relative;
}
.hero-logo img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 38px var(--glow));
}
.hero h1 {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero h1 .flakes { color: var(--accent); }
.hero .tagline {
  font-size: 21px;
  color: var(--text-dim);
  max-width: 540px;
  margin: 18px auto 38px;
}
.hero-ctas { display: flex; gap: 16px; justify-content: center; }

@media (prefers-reduced-motion: no-preference) {
  .hero-logo img { animation: logo-enter 1.1s cubic-bezier(0.16, 1, 0.3, 1) both, logo-float 7s ease-in-out 1.1s infinite; }
  .hero h1 { animation: rise 0.9s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero .tagline { animation: rise 0.9s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .hero-ctas { animation: rise 0.9s 0.55s cubic-bezier(0.16, 1, 0.3, 1) both; }
}
@keyframes logo-enter {
  from { opacity: 0; transform: scale(0.6) rotate(-18deg); }
  to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 26px;
  border-radius: 12px;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 15.5px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 6px 24px var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 32px var(--glow); }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ── Sections ─────────────────────────────────────────────────────── */
.section { padding: 96px 0; position: relative; }
.section-head { margin-bottom: 46px; }
.section-kicker {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-kicker::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--accent);
  transform: rotate(45deg);
  box-shadow: 0 0 12px var(--glow);
}
.section-head h2 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-top: 12px;
}
.section-head .sub { color: var(--text-dim); margin: 12px 0 0; max-width: 620px; }

/* ── Featured game ────────────────────────────────────────────────── */
.featured {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.featured-media { min-height: 360px; display: grid; }
.featured-media img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}
.featured-body {
  padding: 44px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  align-items: flex-start;
}
.featured-body h3 { font-size: 34px; font-weight: 800; }
.featured-body p { color: var(--text-dim); margin: 0; }
.badge-row { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  font-family: "Sora", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.badge.hot { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px var(--glow) inset; }

/* ── Game grid ────────────────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 28px;
  grid-auto-rows: 1fr;
}
.game-grid > .reveal { display: grid; }
.game-grid .game-card { height: 100%; }
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(111, 179, 255, 0.45);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--glow);
}
html[data-theme="light"] .game-card:hover {
  box-shadow: 0 18px 44px rgba(20, 40, 80, 0.16);
}
.game-card .game-art { width: 100%; height: 170px; object-fit: cover; display: block; }
.game-card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.game-card-body h4 { font-size: 19px; font-weight: 700; }
.game-card-body p { color: var(--text-dim); font-size: 14.5px; margin: 0; flex: 1; }
.game-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.play-link {
  font-family: "Sora", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.play-link::after { content: "→"; transition: transform 0.18s; }
.game-card:hover .play-link::after { transform: translateX(4px); }

/* ── Videos ───────────────────────────────────────────────────────── */
.video-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-cta { display: flex; justify-content: center; margin-top: 30px; }

/* ── About ────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 56px;
  align-items: center;
}
.about-text p { color: var(--text-dim); margin: 0 0 18px; font-size: 17.5px; }
.about-text p strong { color: var(--text); }
.about-mark {
  display: grid;
  place-items: center;
}
.about-mark img {
  width: 250px;
  filter: drop-shadow(0 0 30px var(--glow));
  opacity: 0.92;
}
.stat-row { display: flex; gap: 36px; margin-top: 12px; }
.stat .num {
  font-family: "Sora", sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
}
.stat .lbl { font-size: 13.5px; color: var(--text-faint); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ── Devlog ───────────────────────────────────────────────────────── */
.devlog-list { display: grid; gap: 16px; }
.devlog-item {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  transition: border-color 0.2s, transform 0.2s;
}
.devlog-item:hover { border-color: rgba(111, 179, 255, 0.4); transform: translateX(4px); }
.devlog-date {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.devlog-item h4 { font-size: 18px; font-weight: 700; }
.devlog-item .sum { color: var(--text-dim); font-size: 14.5px; margin: 4px 0 0; }
.devlog-tag {
  font-size: 12px;
  font-weight: 700;
  font-family: "Sora", sans-serif;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ── Newsletter ───────────────────────────────────────────────────── */
.newsletter {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 56px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.newsletter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, var(--glow), transparent 70%);
  opacity: 0.45;
  pointer-events: none;
}
.newsletter h2 { font-size: 32px; font-weight: 800; position: relative; }
.newsletter p { color: var(--text-dim); margin: 12px auto 28px; max-width: 460px; position: relative; }
.newsletter-form {
  display: flex;
  gap: 12px;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.newsletter-form input {
  flex: 1;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-note { font-size: 13px; color: var(--text-faint); margin-top: 14px; position: relative; }
.newsletter-success {
  color: var(--accent);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  position: relative;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 40px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: "Sora", sans-serif; font-weight: 700; }
.footer-brand img { width: 28px; height: 28px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { color: var(--text-dim); font-size: 14.5px; font-weight: 600; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { font-size: 13.5px; color: var(--text-faint); width: 100%; text-align: center; margin-top: 28px; }

/* ── Ice shards (decorative) ──────────────────────────────────────── */
.shard {
  position: absolute;
  background: linear-gradient(160deg, rgba(111, 179, 255, 0.5), rgba(42, 111, 219, 0.1));
  transform: rotate(45deg);
  border-radius: 3px;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .shard { animation: shard-drift 9s ease-in-out infinite; }
}
@keyframes shard-drift {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50%      { transform: rotate(52deg) translateY(-14px); }
}

/* ── Reveal on scroll ─────────────────────────────────────────────── */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .reveal.in { opacity: 1; transform: translateY(0); }
}

/* ── Gamification: HUD, toasts, crystals ─────────────────────────── */
.gx-hud { position: fixed; bottom: 22px; left: 22px; z-index: 80; }
.gx-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.gx-fab:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 30px var(--glow); }
.gx-fab-icon { color: var(--accent); font-size: 16px; }

.gx-panel {
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 18px 18px 16px;
  animation: gx-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes gx-pop { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
.gx-panel-head { display: flex; align-items: center; gap: 10px; }
.gx-panel-title { font-family: "Sora", sans-serif; font-weight: 800; font-size: 16px; }
.gx-pct { margin-left: auto; font-family: "Sora", sans-serif; font-weight: 700; font-size: 13px; color: var(--accent); }
.gx-close {
  background: none; border: none; color: var(--text-faint);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 2px 6px;
}
.gx-close:hover { color: var(--text); }
.gx-bar {
  height: 6px; border-radius: 999px; background: var(--line);
  margin: 12px 0 14px; overflow: hidden;
}
.gx-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  border-radius: 999px;
  box-shadow: 0 0 10px var(--glow);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.gx-list li {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: 10px;
  opacity: 0.55;
}
.gx-list li.done { opacity: 1; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.gx-li-icon { width: 24px; text-align: center; font-size: 15px; flex-shrink: 0; }
.gx-li-text { display: flex; flex-direction: column; min-width: 0; }
.gx-li-text strong { font-family: "Sora", sans-serif; font-size: 13.5px; font-weight: 700; }
.gx-li-text em { font-style: normal; font-size: 12px; color: var(--text-faint); }
.gx-li-check { margin-left: auto; color: var(--accent); font-weight: 800; }
.gx-hint { font-size: 12px; color: var(--text-faint); margin-top: 12px; text-align: center; }
.gx-master-badge {
  margin-top: 12px; text-align: center;
  font-family: "Sora", sans-serif; font-weight: 800; font-size: 13px;
  color: var(--accent);
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 0 18px var(--glow) inset;
}

/* toasts */
.gx-toasts {
  position: fixed; top: 80px; right: 22px; z-index: 90;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.gx-toast {
  display: flex; align-items: center; gap: 13px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 13px 18px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.45), 0 0 18px var(--glow);
  max-width: 340px;
  animation: gx-toast-in 0.45s cubic-bezier(0.16, 1, 0.3, 1), gx-toast-out 0.4s ease 3.7s forwards;
}
html[data-theme="light"] .gx-toast { box-shadow: 0 10px 34px rgba(20,40,80,0.18), 0 0 18px var(--glow); }
.gx-toast.master { border-width: 2px; }
.gx-toast-icon { font-size: 22px; color: var(--accent); flex-shrink: 0; }
.gx-toast strong { display: block; font-family: "Sora", sans-serif; font-size: 13.5px; font-weight: 800; }
.gx-toast em { font-style: normal; font-size: 12.5px; color: var(--text-dim); }
@keyframes gx-toast-in { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: none; } }
@keyframes gx-toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* falling catchable crystals */
.gx-crystals { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.gx-crystal {
  position: absolute;
  top: -40px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  pointer-events: auto;
  animation-name: gx-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
.gx-crystal span {
  display: block;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #cfe6ff, var(--accent) 55%, var(--accent-deep));
  transform: rotate(45deg);
  border-radius: 3px;
  box-shadow: 0 0 14px var(--glow), 0 0 4px rgba(255,255,255,0.6) inset;
  transition: transform 0.2s;
  animation: gx-glint 1.6s ease-in-out infinite;
}
.gx-crystal:hover span { transform: rotate(45deg) scale(1.25); }
.gx-crystal.caught { pointer-events: none; }
.gx-crystal.caught span { animation: gx-shatter 0.45s ease forwards; }
@keyframes gx-fall {
  from { transform: translateY(0); }
  to   { transform: translateY(115vh); }
}
@keyframes gx-glint {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.5); }
}
@keyframes gx-shatter {
  0%   { transform: rotate(45deg) scale(1.3); opacity: 1; }
  100% { transform: rotate(225deg) scale(0); opacity: 0; }
}

/* celebration burst */
.gx-burst {
  position: fixed;
  top: 50%; left: 50%;
  z-index: 95;
  pointer-events: none;
}
.gx-burst span {
  position: absolute;
  top: 0; left: 0;
  background: linear-gradient(135deg, #e6f2ff, var(--accent));
  border-radius: 2px;
  animation: gx-burst-fly ease-out forwards;
  opacity: 0;
}
@keyframes gx-burst-fly {
  0%   { opacity: 1; transform: rotate(var(--ang)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--ang)) translateY(calc(var(--dist) * -1)) scale(0.3); }
}
.gx-burst-label {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: var(--accent);
  text-shadow: 0 0 24px var(--glow);
  white-space: nowrap;
  animation: gx-label 3s ease forwards;
}
@keyframes gx-label {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.6); }
  15%  { opacity: 1; transform: translateX(-50%) scale(1.1); }
  30%  { transform: translateX(-50%) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1); }
}

@media (max-width: 600px) {
  .gx-panel { width: calc(100vw - 44px); }
  .gx-toasts { right: 12px; left: 12px; align-items: flex-end; }
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .hero h1 { font-size: 46px; }
  .featured { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .about-mark { order: -1; }
  .nav-links a:not(.nav-keep) { display: none; }
}
@media (max-width: 600px) {
  .game-grid { grid-template-columns: 1fr; }
  .devlog-item { grid-template-columns: 1fr; gap: 8px; }
  .newsletter-form { flex-direction: column; }
  .hero h1 { font-size: 38px; }
}

/* ── Supernova intro ──────────────────────────────────────────────── */
.nova-intro {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, #0a1428 0%, #04070e 70%);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  transition: opacity 0.55s ease;
}
.nova-intro.leaving { opacity: 0; pointer-events: none; }
.ni-stage { position: relative; display: grid; place-items: center; }

.ni-star {
  width: 200px;
  height: 200px;
  position: relative;
  z-index: 3;
  animation:
    ni-charge 1.45s cubic-bezier(0.5, 0, 0.8, 0.4) both,
    ni-detonate 0.8s cubic-bezier(0.2, 0.9, 0.3, 1) 1.45s both;
}
@keyframes ni-charge {
  0%   { transform: scale(0.1) rotate(-160deg); opacity: 0; filter: brightness(0.6) drop-shadow(0 0 0 rgba(111,179,255,0)); }
  30%  { opacity: 1; }
  78%  { transform: scale(0.92) rotate(8deg); filter: brightness(1.15) drop-shadow(0 0 36px rgba(111,179,255,0.55)); }
  100% { transform: scale(1.04) rotate(0deg); opacity: 1; filter: brightness(2.4) drop-shadow(0 0 90px rgba(160,210,255,0.95)); }
}
@keyframes ni-detonate {
  0%   { transform: scale(1.04); opacity: 1; filter: brightness(2.6) drop-shadow(0 0 100px rgba(180,220,255,1)); }
  35%  { transform: scale(1.7); opacity: 0.9; }
  100% { transform: scale(2.6); opacity: 0; filter: brightness(3) drop-shadow(0 0 140px rgba(180,220,255,0)); }
}

.ni-flash {
  position: absolute;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #bfe0ff 35%, rgba(111,179,255,0) 70%);
  z-index: 2;
  opacity: 0;
  animation: ni-flash 0.9s ease-out 1.45s forwards;
}
@keyframes ni-flash {
  0%   { opacity: 1; transform: scale(0.4); }
  40%  { opacity: 0.95; transform: scale(34); }
  100% { opacity: 0; transform: scale(46); }
}

.ni-ring {
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 3px solid rgba(150, 200, 255, 0.9);
  box-shadow: 0 0 40px rgba(111, 179, 255, 0.7), 0 0 24px rgba(111, 179, 255, 0.6) inset;
  opacity: 0;
  z-index: 1;
}
.ni-ring-1 { animation: ni-ring 1.15s cubic-bezier(0.2, 0.8, 0.3, 1) 1.5s forwards; }
.ni-ring-2 { animation: ni-ring 1.35s cubic-bezier(0.2, 0.8, 0.3, 1) 1.62s forwards; border-width: 1.5px; }
@keyframes ni-ring {
  0%   { opacity: 1; transform: scale(0.3); }
  100% { opacity: 0; transform: scale(11); }
}

.ni-shards { position: absolute; z-index: 2; }
.ni-shards span {
  position: absolute;
  top: 0; left: 0;
  background: linear-gradient(135deg, #eaf4ff, #6fb3ff 60%, #2a6fdb);
  border-radius: 2px;
  opacity: 0;
  animation-name: ni-shard-fly;
  animation-timing-function: cubic-bezier(0.15, 0.85, 0.35, 1);
  animation-fill-mode: forwards;
}
@keyframes ni-shard-fly {
  0%   { opacity: 1; transform: rotate(var(--ang)) translateY(0) scale(1.2); }
  100% { opacity: 0; transform: rotate(var(--ang)) translateY(calc(var(--dist) * -1)) scale(0.2); }
}

.ni-word {
  position: absolute;
  top: calc(50% + 96px);
  font-family: "Sora", sans-serif;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  z-index: 4;
  opacity: 0;
  animation: ni-word 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.85s both;
}
.ni-nova { color: #e8eef8; }
.ni-flakes { color: #6fb3ff; }
@keyframes ni-word {
  0%   { opacity: 0; transform: translateY(26px) scale(0.92); letter-spacing: 0.3em; }
  100% { opacity: 1; transform: translateY(0) scale(1); letter-spacing: -0.02em; }
}

.ni-skip {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Sora", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(159, 176, 200, 0.6);
  animation: ni-skip-in 0.6s ease 1s both;
}
@keyframes ni-skip-in { from { opacity: 0; } to { opacity: 1; } }

/* light theme variant */
html[data-theme="light"] .nova-intro {
  background: radial-gradient(ellipse 80% 80% at 50% 50%, #ffffff 0%, #d8e5f6 70%);
}
html[data-theme="light"] .ni-nova { color: #131b2a; }
html[data-theme="light"] .ni-skip { color: rgba(68, 84, 109, 0.65); }
html[data-theme="light"] .ni-ring {
  border-color: rgba(42, 111, 219, 0.85);
  box-shadow: 0 0 40px rgba(42, 111, 219, 0.5), 0 0 24px rgba(42, 111, 219, 0.4) inset;
}
html[data-theme="light"] .ni-flash {
  background: radial-gradient(circle, #cfe2ff 0%, #5e9bf0 38%, rgba(42, 111, 219, 0) 70%);
}
html[data-theme="light"] .ni-shards span {
  background: linear-gradient(135deg, #8fc0ff, #2a6fdb 60%, #1d4fa8);
}

/* pause hero entrance while the intro plays */
html.intro-playing .hero-logo img,
html.intro-playing .hero h1,
html.intro-playing .hero .tagline,
html.intro-playing .hero-ctas {
  animation-play-state: paused;
}

/* ── Mini supernova on crystal catch ──────────────────────────────── */
.mini-nova { position: fixed; z-index: 75; pointer-events: none; }
.mn-flash {
  position: absolute;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #bfe0ff 35%, rgba(111, 179, 255, 0) 70%);
  animation: mn-flash 0.5s ease-out forwards;
}
@keyframes mn-flash {
  0%   { opacity: 1; transform: scale(0.5); }
  60%  { opacity: 0.9; transform: scale(3.2); }
  100% { opacity: 0; transform: scale(4); }
}
.mn-ring {
  position: absolute;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  border: 2px solid rgba(150, 200, 255, 0.9);
  box-shadow: 0 0 14px var(--glow);
  animation: mn-ring 0.6s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes mn-ring {
  0%   { opacity: 1; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(3.4); }
}
.mini-nova span {
  position: absolute;
  margin: -2px 0 0 -2px;
  background: linear-gradient(135deg, #eaf4ff, var(--accent) 60%, var(--accent-deep));
  border-radius: 2px;
  animation-name: mn-shard;
  animation-timing-function: cubic-bezier(0.15, 0.85, 0.35, 1);
  animation-fill-mode: forwards;
}
@keyframes mn-shard {
  0%   { opacity: 1; transform: rotate(var(--ang)) translateY(0) scale(1.1); }
  100% { opacity: 0; transform: rotate(var(--ang)) translateY(calc(var(--dist) * -1)) scale(0.2); }
}
html[data-theme="light"] .mn-ring { border-color: rgba(42, 111, 219, 0.85); }
html[data-theme="light"] .mn-flash {
  background: radial-gradient(circle, #cfe2ff 0%, #5e9bf0 38%, rgba(42, 111, 219, 0) 70%);
}

/* crystal counter chip on the quests pill */
.gx-fab-crystals {
  color: var(--accent);
  font-size: 12.5px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
