:root {
  --bg: #08101f;
  --panel: rgba(22, 36, 68, 0.78);
  --line: rgba(140, 190, 255, 0.22);
  --txt: #f7faff;
  --muted: #9aabcb;
  --cyan: #3cefff;
  --gold: #ffe08a;
  --orange: #ff9a3c;
  --ok: #4dffb0;
  --grad-cta: linear-gradient(135deg, #ffb347 0%, #ff7a2f 50%, #ff4f7b 100%);
  --grad-blue: linear-gradient(135deg, #3cefff, #5eb0ff 50%, #8b7cff);
  --font-display: "Outfit", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  --font-head: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  position: relative;
  font-family: var(--font-body);
  color: var(--txt);
  background:
    radial-gradient(70% 50% at 10% 0%, rgba(77, 163, 255, 0.35), transparent 55%),
    radial-gradient(60% 45% at 90% 15%, rgba(255, 138, 31, 0.22), transparent 50%),
    radial-gradient(50% 40% at 70% 100%, rgba(53, 224, 255, 0.12), transparent 45%),
    linear-gradient(165deg, #0a1030 0%, #050814 55%, #0a1628 100%);
  display: flex; align-items: center; justify-content: center;
}
body::before {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(60, 239, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 239, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 40%, #000 10%, transparent 72%);
  animation: gridDrift 28s linear infinite;
}
.aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.aurora span {
  position: absolute; width: 42vw; height: 42vw; border-radius: 50%; filter: blur(40px); opacity: 0.45;
  animation: floaty 16s ease-in-out infinite;
}
.aurora span:nth-child(1) { left: -8vw; top: -10vh; background: rgba(60, 239, 255, 0.28); }
.aurora span:nth-child(2) { right: -10vw; top: 8vh; background: rgba(255, 122, 47, 0.22); animation-delay: -6s; }
.aurora span:nth-child(3) { left: 30vw; bottom: -18vh; background: rgba(139, 124, 255, 0.22); animation-delay: -11s; }
button { font-family: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
[hidden] { display: none !important; }

.stage { position: relative; z-index: 1; display: flex; align-items: center; gap: 52px; padding: 20px; max-height: 100dvh; }
body[data-mode="web"] { align-items: stretch; justify-content: stretch; }
body[data-mode="web"] .stage {
  width: 100vw; height: 100dvh; max-height: none;
  align-items: stretch; gap: 28px;
  padding: 16px 20px 16px 24px;
}
.brief { width: min(340px, 30vw); max-height: calc(100dvh - 40px); overflow: auto; flex-shrink: 0; }
body[data-mode="web"] .brief { width: 300px; align-self: center; }
.brief-kicker { font-size: 11px; letter-spacing: 0.2em; color: var(--gold); margin-bottom: 10px; }
.brief h1 {
  font-family: var(--font-display);
  font-size: 62px; line-height: 0.9; letter-spacing: 0.02em;
  background: linear-gradient(120deg, #3cefff, #8b7cff, #ffe08a, #3cefff);
  background-size: 220% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
  animation: hue 9s ease-in-out infinite;
}
.brief-desc { color: var(--muted); font-size: 14px; line-height: 1.65; margin-bottom: 16px; }
.brief-list { list-style: none; display: grid; gap: 8px; }
.brief-list li {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
}
.brief-list b { color: var(--txt); }
.corner-switch {
  position: fixed; top: 18px; right: 18px; z-index: 40;
  display: flex; padding: 4px; gap: 4px; border-radius: 999px;
  background: rgba(8, 14, 28, 0.88); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.corner-switch button {
  border: 0; background: transparent; color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 13px;
}
.corner-switch button { transition: background .2s ease, color .2s ease, transform .2s ease; }
.corner-switch button.on { background: #f7faff; color: #14203a; }

.phone {
  position: relative;
  width: 390px; height: min(844px, calc(100dvh - 28px));
  border-radius: 42px; padding: 10px;
  background: linear-gradient(160deg, #2a3f6e, #0c1224 60%, #151028);
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.35), 0 0 40px rgba(53, 224, 255, 0.12), 0 28px 80px rgba(0,0,0,0.55);
  animation: glow 4.8s ease-in-out infinite;
}
.screen {
  position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(77,163,255,0.28), transparent 50%),
    linear-gradient(180deg, #101a36 0%, var(--bg) 40%, #060914 100%);
  display: flex; flex-direction: column;
}
.statusbar {
  display: flex; justify-content: space-between; padding: 10px 18px 0;
  font-size: 12px; color: var(--muted); font-family: var(--font-display); flex-shrink: 0;
}
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px 4px; gap: 8px; flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.b-title { font-size: 16px; font-weight: 800; }
.b-badge { font-size: 10px; color: #1a1200; background: var(--grad-cta); padding: 3px 7px; border-radius: 6px; font-weight: 800; }
.pts-pill {
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.pts-pill b { color: var(--gold); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.content { flex: 1; min-height: 0; overflow: auto; padding: 6px 12px 96px; }
.content::-webkit-scrollbar { width: 0; }

.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(12px); }
.lobby-card { position: relative; overflow: hidden; padding: 16px; margin-bottom: 12px; }
.lobby-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 80% at 100% 0%, rgba(255,138,31,0.18), transparent 50%),
    radial-gradient(70% 70% at 0% 100%, rgba(53,224,255,0.12), transparent 45%);
}
.lobby-badges, .lobby-card h2, .lobby-card .desc { position: relative; }
.lobby-badges { display: flex; gap: 6px; margin-bottom: 8px; }
.pill { font-size: 10px; letter-spacing: 0.08em; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; letter-spacing: 0.08em; color: #ff8a9a;
  background: rgba(255,70,90,0.15); border: 1px solid rgba(255,90,110,0.35);
  padding: 3px 8px; border-radius: 6px;
}
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff4d67; box-shadow: 0 0 8px #ff4d67; animation: pulse 1.4s ease-in-out infinite; }
.lobby-card h2 { font-size: 20px; font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.lobby-card .desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 2px 10px; }
.sec-head h3 { font-size: 15px; font-weight: 800; }
.schedule-list { display: grid; gap: 8px; }
.game-row {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center;
  padding: 12px; text-align: center; width: 100%; color: inherit;
}
.game-row .team { font-size: 15px; font-weight: 800; white-space: nowrap; }
.game-row .meta { font-size: 10px; color: var(--muted); margin-top: 2px; }
.game-row .score { font-family: var(--font-display); font-size: 20px; color: var(--gold); letter-spacing: 0.04em; }
.game-row .when { font-size: 10px; color: var(--cyan); margin-top: 2px; }
.game-row .flag { margin-top: 4px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: #041018; background: var(--cyan); border-radius: 999px; display: inline-block; padding: 1px 6px; }
.game-row { transition: transform .18s ease, border-color .18s ease; }
.game-row:hover { transform: translateY(-2px); border-color: rgba(60, 239, 255, 0.45); }
.chips { display: flex; gap: 7px; overflow: auto; padding-bottom: 2px; align-items: center; }
.clear-picks {
  margin-left: auto; flex: 0 0 auto;
  border: 1px solid rgba(255, 138, 154, 0.45); background: rgba(255, 80, 100, 0.08);
  color: #ffb4c0; border-radius: 999px; padding: 7px 12px; font-size: 12px; font-weight: 700;
}
.clear-picks:disabled { opacity: 0.35; cursor: default; }
.clear-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.clear-row .clear-picks { margin-left: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: rgba(77,163,255,0.08);
  color: var(--txt); border-radius: 999px; padding: 7px 12px; font-size: 12px;
}
.chip.on { border-color: var(--cyan); color: var(--cyan); }

.back {
  border: 0; background: transparent; color: var(--cyan); font-size: 13px; padding: 2px 0 10px;
}
.mode-grid { display: grid; gap: 8px; }
.mode-card {
  text-align: left; width: 100%; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; background: rgba(255,255,255,0.03); color: inherit;
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
}
.mode-card .tag { font-size: 10px; letter-spacing: 0.12em; color: var(--cyan); }
.mode-card h3 { font-size: 16px; margin: 2px 0 4px; line-height: 1.35; }
.mode-card p { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mode-card .enter {
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  color: #1a0c00; background: var(--grad-cta); padding: 8px 10px; border-radius: 10px; white-space: nowrap;
}
.mode-card { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.mode-card:hover { transform: translateY(-2px); }
.mode-card.is-picked { border-color: rgba(60, 239, 255, 0.5); background: rgba(60, 239, 255, 0.07); }
.mode-card.hit { border-color: rgba(255, 224, 138, 0.55); background: rgba(255, 224, 138, 0.08); }
.mode-card.miss { border-color: rgba(255, 138, 154, 0.4); }
.mode-card.is-picked .enter { background: transparent; color: var(--cyan); box-shadow: inset 0 0 0 1px rgba(60, 239, 255, 0.55); }
.mode-card.hit .enter { color: #1a1200; background: var(--gold); box-shadow: none; }
.mode-card.miss .enter { color: #ffb4c0; background: transparent; box-shadow: inset 0 0 0 1px rgba(255, 138, 154, 0.55); }
.quiz-q { font-size: 18px; font-weight: 700; line-height: 1.4; margin: 8px 0 14px; }
.opt {
  position: relative;
  display: block; width: 100%; text-align: left; margin-bottom: 8px; padding: 14px 12px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); font-size: 15px; font-weight: 700;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.opt small { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.opt:active { transform: scale(0.985); }
.opt.on {
  border-color: rgba(60, 239, 255, 0.9);
  background: linear-gradient(180deg, rgba(60, 239, 255, 0.2), rgba(60, 239, 255, 0.05));
  box-shadow: 0 0 0 1px rgba(60, 239, 255, 0.28), 0 10px 24px rgba(60, 239, 255, 0.12);
}
.opt.on.hit {
  border-color: rgba(255, 224, 138, 0.95);
  background: linear-gradient(180deg, rgba(255, 224, 138, 0.24), rgba(255, 224, 138, 0.05));
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.28), 0 10px 24px rgba(255, 196, 80, 0.12);
}
.opt.on.miss {
  border-color: rgba(255, 138, 154, 0.75);
  background: linear-gradient(180deg, rgba(255, 80, 100, 0.16), rgba(255, 80, 100, 0.04));
}
.conf { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 6px 0 12px; }
.conf button {
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  min-height: 52px; font-size: 13px; font-weight: 700;
}
.conf button small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.conf button.on { border-color: var(--cyan); }
.cta {
  width: 100%; height: 44px; border: 0; border-radius: 12px;
  background: var(--grad-cta); color: #1a0c00; font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 24px rgba(255, 90, 31, 0.28);
}
.cta:disabled { opacity: 0.4; box-shadow: none; }
.quiz-tip { font-size: 12px; color: var(--muted); margin: 10px 0; line-height: 1.5; }
.fan-hero {
  border-radius: 18px; padding: 16px; margin-bottom: 12px;
  background: radial-gradient(80% 120% at 100% 0%, rgba(255,210,77,0.28), transparent 50%), linear-gradient(145deg, #1a2748, #10182e);
  border: 1px solid var(--line);
}
.fan-hero .who { font-size: 12px; letter-spacing: 0.08em; color: var(--gold); margin-bottom: 6px; }
.fan-hero .tier {
  font-size: 40px; font-weight: 700; line-height: 1;
  background: var(--grad-cta); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-family: var(--font-display); font-variant-numeric: tabular-nums;
}
.fan-hero .pts { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.mine {
  position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 72px 12px 14px; margin-bottom: 8px;
}
.mine b { display: block; margin-bottom: 4px; }
.mine span { color: var(--muted); font-size: 12px; }
.mine em {
  position: absolute; top: 12px; right: 12px; font-style: normal;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  border-radius: 999px; padding: 3px 7px; color: #041018; background: var(--cyan);
}
.mine.hit em { background: var(--gold); }
.mine.miss em { color: #ffb4c0; background: rgba(255, 80, 100, 0.16); }
.empty { text-align: center; padding: 28px 8px; color: var(--muted); font-size: 13px; }
.rank-entry {
  display: block; width: 100%; text-align: left; margin-bottom: 12px; padding: 12px 14px;
  border-radius: 16px; border: 1px solid rgba(60, 239, 255, 0.4);
  background: linear-gradient(90deg, rgba(60, 239, 255, 0.14), rgba(255, 224, 138, 0.06));
}
.rank-entry b { display: block; font-size: 16px; margin-bottom: 2px; }
.rank-entry span { color: var(--muted); font-size: 12px; }
.rank-jump {
  display: block; border: 0; background: transparent; color: var(--cyan);
  font-size: 12px; font-weight: 700; padding: 0 0 8px; text-align: left;
}
.rank-hero { padding: 16px; margin-bottom: 12px; }
.rank-hero .tag { font-size: 11px; letter-spacing: 0.12em; color: var(--cyan); margin-bottom: 8px; }
.rank-hero h2 { font-size: 22px; line-height: 1.35; font-weight: 800; }
.rank-hero p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.rank-row {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 10px 12px; margin-bottom: 6px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
}
.rank-row .no { font-family: var(--font-display); font-size: 16px; color: var(--muted); }
.rank-row.top .no { color: var(--gold); }
.rank-row strong { display: block; font-size: 14px; }
.rank-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.rank-row em { font-style: normal; text-align: right; font-family: var(--font-display); font-size: 18px; color: var(--gold); }
.rank-row em small { font-family: var(--font-body); font-size: 10px; font-weight: 500; }
.rank-row.me {
  border-color: rgba(60, 239, 255, 0.75);
  background: linear-gradient(90deg, rgba(60, 239, 255, 0.18), rgba(60, 239, 255, 0.04));
  box-shadow: 0 0 0 1px rgba(60, 239, 255, 0.22), 0 8px 24px rgba(60, 239, 255, 0.08);
}
.rank-gap { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 0 10px; }
.rank-col-head { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 2px 10px; }
.rank-col-head h3 { font-size: 16px; }
.rank-col-head span { color: var(--cyan); font-size: 12px; font-weight: 700; }
.rank-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.web-sub.rank-link { border: 0; background: transparent; padding: 0; color: var(--cyan); font-weight: 700; text-align: left; }
.tabbar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; height: 62px;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  background: rgba(8, 12, 28, 0.88); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 20px; z-index: 5;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.tab {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tab span { font-size: 16px; line-height: 1; }
.tab.on { color: var(--cyan); text-shadow: 0 0 12px rgba(53,224,255,0.45); }
.toast {
  position: fixed; z-index: 30; left: 50%; top: 24px; transform: translateX(-50%);
  background: #f7faff; color: #14203a; border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700;
  animation: toastIn .35s ease;
}
body[data-mode="web"] .phone { display: none; }
.web { display: none; }
body[data-mode="web"] .web {
  position: relative;
  display: flex; flex: 1; min-width: 640px; height: auto; align-self: stretch;
  border-radius: 28px; overflow: hidden; flex-direction: column;
  background:
    radial-gradient(90% 40% at 0% 0%, rgba(77,163,255,0.22), transparent 50%),
    linear-gradient(180deg, #121c38, #08101f 30%, #070b16);
  box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.35), 0 28px 80px rgba(0,0,0,0.45);
}
.web-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 210px 8px 20px; flex-shrink: 0;
}
.web-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
.web-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 18px 22px; }
.web-game { margin-bottom: 16px; }
.web-match {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 4px 2px 10px;
}
.web-match h3 { font-size: 18px; }
.web-match span { color: var(--muted); font-size: 12px; }
.web-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
}
.qcard .tag { font-size: 10px; letter-spacing: 0.12em; color: var(--cyan); }
.qcard h4 { font-size: 15px; line-height: 1.5; margin: 6px 0 10px; font-weight: 700; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pair button {
  position: relative;
  text-align: left; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); padding: 10px 12px; font-weight: 700; font-size: 14px;
  line-height: 1.35; white-space: normal;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.pair button small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; font-size: 11px; }
.pair button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(60, 239, 255, 0.5); }
.pair button:active:not(:disabled) { transform: scale(0.98); }
.pair button.on, .opt.on { padding-right: 58px; }
.pair button.on {
  border-color: rgba(60, 239, 255, 0.9);
  background: linear-gradient(180deg, rgba(60, 239, 255, 0.22), rgba(60, 239, 255, 0.05));
  box-shadow: 0 0 0 1px rgba(60, 239, 255, 0.28), 0 10px 22px rgba(60, 239, 255, 0.12);
}
.pair button.on.hit {
  border-color: rgba(255, 224, 138, 0.95);
  background: linear-gradient(180deg, rgba(255, 224, 138, 0.26), rgba(255, 224, 138, 0.06));
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.3), 0 10px 22px rgba(255, 196, 80, 0.14);
}
.pair button.on.miss {
  border-color: rgba(255, 138, 154, 0.75);
  background: linear-gradient(180deg, rgba(255, 80, 100, 0.18), rgba(255, 80, 100, 0.04));
  box-shadow: none;
}
.pair button.just { animation: pop .42s ease; }
.pair button:disabled { opacity: 0.45; cursor: default; }
.pair button.on:disabled { opacity: 1; }
.mark {
  position: absolute; top: 7px; right: 7px; font-style: normal;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  color: #041018; background: var(--cyan); border-radius: 999px; padding: 2px 6px;
}
.pair button.on.hit .mark, .opt.on.hit .mark { background: var(--gold); }
.pair button.on.miss .mark, .opt.on.miss .mark { color: #ffb4c0; background: rgba(255, 80, 100, 0.18); }
.qcard { transition: transform .18s ease, border-color .18s ease; }
.qcard:hover { transform: translateY(-2px); }
.qcard.held { box-shadow: inset 3px 0 0 var(--cyan); }
.qcard.held.hit { box-shadow: inset 3px 0 0 var(--gold); }
.qcard.held.miss { box-shadow: inset 3px 0 0 #ff8a9a; }
canvas.spark { display: block; width: 100%; height: 42px; margin-top: 10px; }
canvas.spark-head { width: min(280px, 46vw); height: 36px; }

body.enter .qcard,
body.enter .game-row,
body.enter .mode-card,
body.enter .opt,
body.enter .mine,
body.enter .lobby-card,
body.enter .brief-list li,
body.enter .rank-row,
body.enter .rank-hero { animation: rise .52s ease backwards; }
body.enter .web::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 90px; z-index: 4; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(60, 239, 255, 0.16), transparent);
  animation: scan 1.15s ease-out;
}
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
.fx .spark {
  position: absolute; width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 50%;
  background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
  animation: spark .68s ease-out forwards;
}
.fx .spark.gold { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scan { from { top: -90px; } to { top: 110%; } }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(0.15); opacity: 0; } }
@keyframes pop {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.045); }
  100% { transform: scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.65); opacity: 0.45; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(77, 163, 255, 0.35), 0 0 32px rgba(53, 224, 255, 0.12), 0 28px 80px rgba(0,0,0,0.55); }
  50% { box-shadow: 0 0 0 1px rgba(60, 239, 255, 0.72), 0 0 58px rgba(53, 224, 255, 0.3), 0 28px 80px rgba(0,0,0,0.55); }
}
@keyframes hue {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes gridDrift { to { background-position: 0 56px, 56px 0; } }
@keyframes floaty {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3vw, 2vh, 0) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 1100px) {
  body[data-mode="web"] .brief { display: none; }
  body[data-mode="web"] .web { min-width: 0; }
  .web-grid, .rank-split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .brief { display: none; }
  .stage { padding: 0; }
  .phone { width: 100vw; height: 100dvh; border-radius: 0; padding: 0; box-shadow: none; }
  .screen { border-radius: 0; }
  body[data-mode="web"] .stage { padding: 12px; }
}
