:root {
  --bg: #07070c;
  --fg: #f3f3f7;
  --muted: #8a8aa0;
  --line: rgba(255, 255, 255, 0.12);
  --lime: #d4ff3a;
  --violet: #8b5cff;
  --pink: #ff3d8b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-snap-type: y proximity; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--lime); color: var(--bg); }

/* ---------- 背景层 ---------- */
#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scanlines {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- 经验条 ---------- */
.xp { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: rgba(255,255,255,0.05); }
.xp-fill {
  height: 100%; width: 100%; transform-origin: left; transform: scaleX(0);
  background: linear-gradient(90deg, var(--violet), var(--lime));
  box-shadow: 0 0 12px var(--lime);
}

/* ---------- 右侧关卡指示 ---------- */
.stage-nav {
  position: fixed; right: 28px; top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 18px;
}
.stage-nav a { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.stage-nav a span { opacity: 0; transform: translateX(6px); transition: .25s; white-space: nowrap; }
.stage-nav a i {
  order: 2; width: 10px; height: 10px; border: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: .25s;
}
.stage-nav a:hover span, .stage-nav a.active span { opacity: 1; transform: none; }
.stage-nav a.active { color: var(--lime); }
.stage-nav a.active i { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 10px var(--lime); }

/* ---------- 通用关卡 ---------- */
main { position: relative; z-index: 1; }
.stage {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 96px 0;
  scroll-snap-align: start;
  overflow: hidden;
}
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 72px 0 32px; position: relative; }
.stage-label { font-family: var(--mono); font-size: 13px; letter-spacing: .15em; color: var(--lime); }
.stage-title { margin-top: 12px; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.1; }
.bg-num {
  position: absolute; right: -2vw; bottom: -6vw; z-index: -1;
  font-family: var(--mono); font-weight: 800; font-size: clamp(14rem, 34vw, 30rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.07);
  user-select: none;
}

/* 进场动画 */
[data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- START ---------- */
.stage-hero { justify-content: center; text-align: center; }
.stage-hero::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 80vmax; height: 80vmax; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(139,92,255,0.22), transparent 55%);
  z-index: -1;
}
.hud { position: absolute; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.hud b { color: var(--lime); font-weight: 400; }
.hud-tl { top: 28px; left: 32px; color: var(--fg); }
.hud-tr { top: 28px; right: 32px; }
.hud-bl { bottom: 28px; left: 32px; }
.hud-br { bottom: 28px; right: 32px; }
.hud-bl em { font-style: normal; color: var(--lime); }

.hero-inner { padding: 0 56px; }
.hero-kicker { font-size: 15px; letter-spacing: .4em; color: var(--muted); }
.glitch {
  position: relative; display: inline-block; margin-top: 20px;
  font-size: clamp(3rem, 11vw, 9rem); font-weight: 900; line-height: 1; letter-spacing: .02em;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--pink); mix-blend-mode: screen; animation: glitch-a 3.2s infinite steps(1); }
.glitch::after { color: var(--lime); mix-blend-mode: screen; animation: glitch-b 3.2s infinite steps(1); }
@keyframes glitch-a {
  0%, 88%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  89% { transform: translate(-6px, 2px); clip-path: inset(10% 0 60% 0); }
  92% { transform: translate(5px, -2px); clip-path: inset(55% 0 20% 0); }
  95% { transform: translate(-3px, 0); clip-path: inset(30% 0 45% 0); }
}
@keyframes glitch-b {
  0%, 88%, 100% { transform: none; clip-path: inset(0 0 100% 0); }
  90% { transform: translate(6px, -1px); clip-path: inset(70% 0 5% 0); }
  93% { transform: translate(-5px, 2px); clip-path: inset(20% 0 65% 0); }
  96% { transform: translate(3px, 0); clip-path: inset(45% 0 35% 0); }
}
.hero-en { margin-top: 24px; font-family: var(--mono); font-size: clamp(12px, 2vw, 16px); letter-spacing: .6em; color: var(--muted); }
.press-start {
  display: inline-block; margin-top: 64px; padding: 14px 28px;
  font-family: var(--mono); font-size: 15px; letter-spacing: .2em; color: var(--lime);
  border: 1.5px solid var(--lime);
  box-shadow: 4px 4px 0 var(--lime);
  transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.press-start:hover { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--lime); background: var(--lime); color: var(--bg); }
.blink { animation: blink 1.1s steps(1) infinite; }
.press-start:hover .blink { animation: none; }
@keyframes blink { 50% { opacity: 0; } }
.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); width: 1px; height: 48px; background: var(--line); overflow: hidden; }
.scroll-hint span { position: absolute; left: 0; top: -50%; width: 1px; height: 50%; background: var(--lime); animation: drop 1.8s ease-in-out infinite; }
@keyframes drop { to { top: 100%; } }

/* ---------- 01 简介 ---------- */
.statement { margin-top: 24px; font-size: clamp(2.6rem, 8vw, 6.5rem); line-height: 1.12; font-weight: 900; }
.statement span { display: block; }
.statement em { font-style: normal; color: var(--lime); }
.about-row { margin-top: 40px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: end; }
.about-text { color: var(--muted); font-size: 17px; max-width: 520px; }
.stats { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stats li { padding: 18px 0 0; }
.stats b { display: block; font-size: 28px; }
.stats span { font-family: var(--mono); font-size: 11px; letter-spacing: .15em; color: var(--muted); }

/* ---------- 02 关卡地图 ---------- */
.map { position: relative; margin-top: 72px; --node: 28px; }
.track { position: absolute; left: 0; right: 0; top: calc(var(--node) / 2 - 2px); height: 4px; background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 18px); }
.track-fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--violet), var(--lime));
  box-shadow: 0 0 14px rgba(212,255,58,.6);
  transition: width 1.6s cubic-bezier(.2,.7,.2,1), height 1.6s cubic-bezier(.2,.7,.2,1);
}
.player {
  position: absolute; left: 0; top: calc(var(--node) / 2); z-index: 2;
  width: 0; height: 0;
  transition: left 1.6s cubic-bezier(.2,.7,.2,1), top 1.6s cubic-bezier(.2,.7,.2,1);
}
.player::before {
  content: ""; position: absolute; left: -9px; top: -9px; width: 18px; height: 18px;
  background: var(--lime); box-shadow: 0 0 0 6px rgba(212,255,58,.2), 0 0 24px var(--lime);
  animation: bob 1s ease-in-out infinite alternate;
}
.player span {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 11px; letter-spacing: .15em; color: var(--bg);
  background: var(--lime); padding: 2px 6px; white-space: nowrap;
}
.player span::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--lime); }
@keyframes bob { to { transform: translateY(-4px); } }

.checkpoints { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative; }
.cp-loading { grid-column: 1 / -1; padding-top: 48px; color: var(--muted); font-family: var(--mono); }
.cp { text-align: center; }
.cp-node {
  width: var(--node); height: var(--node); margin: 0 auto; position: relative; z-index: 1;
  background: var(--bg); border: 2px solid var(--muted); transform: rotate(45deg) scale(.8);
}
.cp-body { margin-top: 32px; padding: 24px 20px; border: 1px solid var(--line); background: rgba(7,7,12,.9); backdrop-filter: blur(4px); }
.cp-date { font-family: var(--mono); font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: .02em; }
.cp-title { margin-top: 6px; font-size: 18px; }
.cp-desc { margin-top: 10px; font-size: 14px; color: var(--muted); }
.cp-badge { display: inline-block; margin-top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: .15em; padding: 3px 10px; border: 1px solid currentColor; color: var(--muted); }

.cp.is-done .cp-node { background: var(--violet); border-color: var(--violet); }
.cp.is-done .cp-body { opacity: .55; }
.cp.is-done .cp-date { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--violet); }
.cp.is-done .cp-badge { color: var(--violet); }
.cp.is-next .cp-node, .cp.is-live .cp-node { border-color: var(--lime); animation: pulse 1.6s ease-out infinite; }
.cp.is-next .cp-body, .cp.is-live .cp-body { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime), 0 0 40px rgba(212,255,58,.12); }
.cp.is-next .cp-date, .cp.is-live .cp-date { color: var(--lime); }
.cp.is-next .cp-badge, .cp.is-live .cp-badge { color: var(--lime); }
.cp.is-live .cp-node { background: var(--lime); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212,255,58,.6); } 100% { box-shadow: 0 0 0 16px rgba(212,255,58,0); } }

/* ---------- 03 任务 ---------- */
.quests { list-style: none; margin-top: 56px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.quests li { padding: 28px 24px 8px 0; position: relative; }
.quests li + li { padding-left: 24px; border-left: 1px solid var(--line); }
.q-id { font-family: var(--mono); font-size: 12px; letter-spacing: .15em; color: var(--lime); }
.quests h3 { margin-top: 18px; font-size: clamp(1.4rem, 2.6vw, 2rem); }
.quests p { margin-top: 10px; color: var(--muted); font-size: 15px; }
.quests li::before {
  content: ""; position: absolute; top: -5px; width: 9px; height: 9px; background: var(--lime);
  left: 0; transform: rotate(45deg);
}
.quests li + li::before { left: -5px; }

/* ---------- FINAL ---------- */
.stage-final { flex-direction: column; justify-content: center; text-align: center; }
.stage-final::before {
  content: ""; position: absolute; left: 50%; bottom: -30vmax; width: 90vmax; height: 60vmax; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(255,61,139,.18), transparent 60%);
  z-index: -1;
}
.final-inner { padding: 0 32px; }
.boss-date {
  margin-top: 20px; font-family: var(--mono); font-weight: 800; line-height: .9;
  font-size: clamp(6rem, 24vw, 20rem); letter-spacing: -.04em;
  background: linear-gradient(180deg, var(--fg) 30%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.final-label { margin-top: 28px; color: var(--muted); }
.countdown { margin-top: 16px; display: flex; justify-content: center; gap: clamp(12px, 4vw, 48px); }
.countdown div { min-width: 64px; }
.countdown b { display: block; font-family: var(--mono); font-size: clamp(2rem, 6vw, 4rem); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown span { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.final-note { margin-top: 48px; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.final-note::before { content: "// "; color: var(--lime); }
.footer { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 账号 ---------- */
.account { position: fixed; top: 20px; right: 28px; z-index: 45; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; }
.account-btn, .account-out {
  font: inherit; letter-spacing: inherit; cursor: pointer; background: rgba(7,7,12,.9); color: var(--lime);
  border: 1px solid var(--lime); padding: 6px 12px; transition: background .15s, color .15s;
}
.account-btn:hover, .account-out:hover { background: var(--lime); color: var(--bg); }
.account-user { display: flex; align-items: center; gap: 10px; background: rgba(7,7,12,.9); padding-left: 10px; }
.account-user[hidden] { display: none; }
.account-sid { color: var(--muted); }
.account-sid b { color: var(--fg); font-weight: 400; }
.account-out { color: var(--muted); border-color: var(--line); }

/* ---------- 像素按钮 ---------- */
.btn-pixel {
  display: inline-block; padding: 14px 28px; cursor: pointer;
  font-family: var(--sans); font-size: 16px; font-weight: 700; letter-spacing: .15em;
  color: var(--bg); background: var(--lime); border: 0;
  box-shadow: 4px 4px 0 var(--violet);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.btn-pixel:hover:not(:disabled) { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--violet); }
.btn-pixel:disabled { cursor: not-allowed; opacity: .55; }
.btn-pixel.is-joined { background: transparent; color: var(--lime); box-shadow: inset 0 0 0 1.5px var(--lime); }
.btn-block { display: block; width: 100%; }

/* ---------- 大众评审 ---------- */
.jury {
  margin-top: 48px; padding: 28px 32px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px 48px; align-items: center;
  border: 1px solid var(--line); background: linear-gradient(120deg, rgba(139,92,255,.14), rgba(7,7,12,.4) 60%);
  position: relative;
}
.jury::before { content: ""; position: absolute; left: -1px; top: -1px; width: 18px; height: 18px; border-left: 2px solid var(--lime); border-top: 2px solid var(--lime); }
.jury-kicker { font-family: var(--mono); font-size: 12px; letter-spacing: .2em; color: var(--pink); }
.jury h3 { margin-top: 6px; font-size: 26px; }
.jury-desc { margin-top: 6px; color: var(--muted); font-size: 15px; }
.jury-action { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; align-items: end; }
.jury-slots { display: flex; align-items: baseline; gap: 10px; }
.jury-count { font-family: var(--mono); font-size: 28px; color: var(--muted); font-variant-numeric: tabular-nums; }
.jury-count b { color: var(--lime); font-weight: 700; }
.jury-slots-label { font-size: 13px; color: var(--muted); }
.jury-bar { grid-column: 1; grid-row: 2; height: 6px; background: rgba(255,255,255,.08); }
.jury-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--lime)); transition: width .6s cubic-bezier(.2,.7,.2,1); }
.jury.is-full .jury-bar-fill { background: var(--pink); }
#jury-btn { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
.jury-msg { grid-column: 1 / -1; min-height: 1.4em; font-size: 13px; color: var(--muted); }
.jury-msg.ok { color: var(--lime); }
.jury-msg.err { color: var(--pink); }

/* ---------- 登录框 ---------- */
.modal { margin: auto; padding: 0; border: 0; background: transparent; color: var(--fg); max-width: calc(100vw - 32px); }
.modal::backdrop { background: rgba(4,4,8,.78); backdrop-filter: blur(4px); }
.modal[open] .modal-box { animation: pop .22s cubic-bezier(.2,.7,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-box {
  position: relative; width: 400px; max-width: 100%; padding: 36px 32px 28px;
  background: #0d0d16; border: 1.5px solid var(--lime); box-shadow: 6px 6px 0 var(--violet);
}
.modal-box h3 { margin: 8px 0 24px; font-size: 22px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; cursor: pointer; background: none; border: 0; color: var(--muted); font-size: 16px; }
.modal-close:hover { color: var(--fg); }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input {
  width: 100%; padding: 12px 14px; font: 16px var(--mono); color: var(--fg);
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 0; outline: none;
}
.field input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(212,255,58,.15); }
.modal-err { min-height: 1.4em; margin-bottom: 10px; font-size: 13px; color: var(--pink); }
.modal-note { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .about-row { grid-template-columns: 1fr; gap: 32px; }
  .jury { grid-template-columns: 1fr; }
  .quests { grid-template-columns: repeat(2, 1fr); }
  .quests li:nth-child(3) { padding-left: 0; border-left: 0; }
  .quests li:nth-child(3)::before { left: 0; }
}

@media (max-width: 720px) {
  html { scroll-snap-type: none; }
  .stage { padding: 80px 0; }
  .wrap { padding: 0 36px 0 20px; }
  .stage-nav { right: 10px; gap: 14px; }
  .stage-nav a span { display: none; }
  .stage-nav a i { width: 8px; height: 8px; }
  .hud-tl, .hud-bl { left: 20px; }
  .hud-tr, .hud-br { right: 20px; }
  .hud-bl { right: 20px; bottom: 84px; text-align: center; }
  .hud-br { display: none; }
  .hero-inner { padding: 0 28px; }
  .hero-kicker { letter-spacing: .2em; font-size: 13px; }
  .hero-en { letter-spacing: .35em; }
  .press-start { margin-top: 48px; }

  /* 地图改为竖向 */
  .map { margin-top: 48px; padding-left: 0; }
  .track { left: calc(var(--node) / 2 - 2px); right: auto; top: 0; bottom: 0; width: 4px; height: auto; background: repeating-linear-gradient(180deg, var(--line) 0 10px, transparent 10px 18px); }
  .track-fill { width: 100% !important; height: 0; background: linear-gradient(180deg, var(--violet), var(--lime)); }
  .player { left: calc(var(--node) / 2); }
  .player span { display: none; }
  .checkpoints { grid-template-columns: 1fr; gap: 28px; }
  .cp { display: grid; grid-template-columns: var(--node) 1fr; gap: 20px; text-align: left; align-items: start; }
  .cp-node { margin: 22px 0 0; }
  .cp-body { margin-top: 0; padding: 18px; }

  .quests { grid-template-columns: 1fr; }
  .quests li, .quests li + li { padding: 22px 0 22px 24px; border-left: 1px solid var(--line); }
  .quests li::before, .quests li + li::before { left: -5px; top: 30px; }
  .quests { border-top: 0; }
  .quests h3 { margin-top: 8px; }
  .footer { padding: 0 20px; }

  .account { top: 14px; right: 14px; }
  .hud-tl { top: 20px; }
  .jury { margin-top: 36px; padding: 22px 20px; }
  .jury-action { grid-template-columns: 1fr; }
  .jury-bar { grid-row: auto; }
  #jury-btn { grid-column: 1; grid-row: auto; width: 100%; margin-top: 6px; }
  .modal-box { padding: 32px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
