/* REDEEM-PIXEL-001 · GPT WORLD 入境处 · 像素篮球风样式（无外部字体/资源） */
:root {
  --ink: #140f24; --ink2: #1e1636; --ink3: #2b2150; --line: #0a0712; --paper: #f7f1e3; --paper2: #e6dcc4;
  --yellow: #ffd23f; --orange: #f28c28; --orange2: #c65f12; --cyan: #39e6ff; --purple: #9b5cff; --pink: #ff5d8f;
  --green: #3ddc84; --red: #ff4d4d; --amber: #ffb23f; --muted: #b8afd6; --text: #f4efff;
  --px: 4px;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Courier New", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; color: var(--text); background: var(--ink); font: 15px/1.6 var(--sans); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
canvas.sprite { image-rendering: auto; display: block; }
.sprite-md { width: 128px; height: 128px; }
.sprite-lg { width: 192px; height: 192px; }
.sprite-xl { width: 256px; height: 256px; }

/* ── 天空、城市、球场 ── */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, #0d0a1c 0%, #1b1240 45%, #3a1f5c 72%, #5a2a5e 100%); }
.stars { position: absolute; inset: 0; width: 2px; height: 2px; background: transparent; }
.stars.s1 { box-shadow: 40px 60px #fff, 120px 140px #cfc6ff, 260px 40px #fff, 340px 180px #fff9c4, 480px 90px #fff, 600px 30px #cfc6ff, 720px 160px #fff, 860px 70px #fff, 980px 130px #fff9c4, 1100px 40px #fff, 1220px 180px #cfc6ff, 1340px 100px #fff, 1460px 60px #fff, 1580px 150px #fff, 200px 260px #fff, 520px 240px #cfc6ff, 900px 280px #fff, 1280px 250px #fff9c4, 70px 330px #fff, 1500px 320px #fff; animation: twinkle 2.4s steps(2) infinite; }
.stars.s2 { width: 4px; height: 4px; box-shadow: 180px 90px #fff, 640px 120px #39e6ff, 1040px 200px #fff, 1400px 50px #ffd23f, 420px 300px #fff; animation: twinkle 3.1s steps(2) infinite reverse; }
@keyframes twinkle { 50% { opacity: .45; } }
.city { position: absolute; left: 0; right: 0; bottom: 120px; height: 160px; opacity: .55;
  background:
    linear-gradient(#24164a, #24164a) 4% 100%/7% 60% no-repeat, linear-gradient(#2d1b5a, #2d1b5a) 12% 100%/5% 90% no-repeat,
    linear-gradient(#24164a, #24164a) 19% 100%/8% 45% no-repeat, linear-gradient(#321f66, #321f66) 30% 100%/4% 100% no-repeat,
    linear-gradient(#24164a, #24164a) 36% 100%/9% 55% no-repeat, linear-gradient(#2d1b5a, #2d1b5a) 48% 100%/6% 80% no-repeat,
    linear-gradient(#24164a, #24164a) 57% 100%/10% 50% no-repeat, linear-gradient(#321f66, #321f66) 69% 100%/5% 95% no-repeat,
    linear-gradient(#24164a, #24164a) 76% 100%/8% 62% no-repeat, linear-gradient(#2d1b5a, #2d1b5a) 87% 100%/6% 85% no-repeat,
    linear-gradient(#24164a, #24164a) 95% 100%/7% 40% no-repeat; }
.city::after { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0; background-image: radial-gradient(#ffd23f 1px, transparent 1.5px); background-size: 26px 22px; opacity: .25; mask: linear-gradient(transparent 20%, #000 60%); }
.court { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: repeating-linear-gradient(90deg, #8a4b22 0 48px, #7b411c 48px 96px); box-shadow: inset 0 6px 0 #f2b05a, inset 0 10px 0 #5c2f12; }
.court::before { content: ""; position: absolute; left: 50%; top: 22px; width: 220px; height: 80px; transform: translateX(-50%); border: 4px solid rgba(255,255,255,.35); border-bottom: 0; border-radius: 110px 110px 0 0; }

/* ── HUD ── */
.hud { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px clamp(12px, 3vw, 28px); background: rgba(13, 9, 28, .82); border-bottom: 4px solid var(--line); box-shadow: 0 4px 0 #2b2150; backdrop-filter: blur(4px); }
.hud-logo { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.logo-ball { width: 28px; height: 28px; background: var(--orange); box-shadow: inset -4px -4px 0 var(--orange2), 0 0 0 3px var(--line); border-radius: 50%; position: relative; }
.logo-ball::before, .logo-ball::after { content: ""; position: absolute; background: var(--line); }
.logo-ball::before { left: 12px; top: 0; width: 3px; height: 28px; } .logo-ball::after { top: 12px; left: 0; height: 3px; width: 28px; }
.logo-text b { display: block; font: 900 16px/1 var(--mono); letter-spacing: .12em; color: var(--yellow); text-shadow: 2px 2px 0 var(--orange2); }
.logo-text small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.hud-status { margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; font: 700 12px/1 var(--mono); padding: 6px 10px; background: #0b0816; border: 3px solid var(--line); box-shadow: inset 0 0 0 2px #2b2150; }
.hud-status i { width: 10px; height: 10px; background: var(--amber); box-shadow: 0 0 0 2px var(--line); animation: blink 1s steps(2) infinite; }
.hud-status[data-state="available"] i { background: var(--green); animation: none; }
.hud-status[data-state="paused"] i { background: var(--amber); animation: none; }
.hud-status[data-state="error"] i { background: var(--red); }
.hud-nav { display: flex; gap: 6px; }
.hud-nav button { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--ink3); border: 3px solid var(--line); box-shadow: inset 0 -3px 0 #1a1238; cursor: pointer; font-weight: 700; font-size: 13px; }
.hud-nav button:hover, .hud-nav button:focus-visible { background: #3a2c6b; }
.hud-ico { font-size: 14px; }
@keyframes blink { 50% { opacity: .3; } }

/* ── 世界舞台 ── */
.world { position: relative; z-index: 1; min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 24px clamp(12px, 3vw, 28px) 140px; }
.scene { width: 100%; max-width: 980px; display: grid; justify-items: center; }
.pop-in { animation: popIn .32s steps(6) both; }
@keyframes popIn { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
.pixel-title { margin: 0; text-align: center; font: 900 clamp(26px, 5vw, 46px)/1.1 var(--mono); letter-spacing: .06em; color: var(--yellow); text-shadow: 3px 3px 0 var(--orange2), 6px 6px 0 var(--line); outline: none; }
.pixel-title small { display: block; margin-top: 10px; font: 700 clamp(13px, 2vw, 16px)/1.4 var(--sans); letter-spacing: .1em; color: var(--cyan); text-shadow: 2px 2px 0 var(--line); }
.blink { font: 700 14px var(--mono); color: var(--muted); animation: blink 1s steps(2) infinite; }
.boot-box { display: grid; justify-items: center; gap: 18px; padding: 30px; }

/* ── 窗口 ── */
.win { width: 100%; max-width: 860px; background: var(--paper); color: #241a12; border: 4px solid var(--line); box-shadow: inset 0 0 0 4px #fffaf0, inset 0 -8px 0 4px var(--paper2), 8px 8px 0 rgba(0,0,0,.45); position: relative; }
.win-head { padding: 18px 22px 10px; border-bottom: 4px dashed #d8cbb0; }
.win-head h2 { margin: 6px 0 0; font: 900 clamp(20px, 3.4vw, 26px)/1.25 var(--sans); outline: none; }
.win-sub { margin: 6px 0 0; color: #6b5a44; font-size: 14px; }
.win-badge { display: inline-block; padding: 3px 8px; font: 800 11px/1.4 var(--mono); letter-spacing: .12em; background: #241a12; color: var(--yellow); }
.win-body { padding: 18px 22px; }
.win-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 14px 22px 20px; border-top: 4px dashed #d8cbb0; }
.win-foot > :only-child { margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; background: #fff; color: #241a12; border: 4px solid var(--line); box-shadow: inset 0 -4px 0 #d8cbb0, 0 4px 0 var(--line); font-weight: 800; cursor: pointer; transform: translateY(0); transition: transform .05s steps(1); }
.btn:hover { background: #fffbe8; }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 -2px 0 #d8cbb0, 0 0 0 var(--line); }
.btn:focus-visible, .role-card:focus-visible, .link:focus-visible, .hud-nav button:focus-visible, .hud-logo:focus-visible, input:focus-visible, textarea:focus-visible { outline: 4px solid var(--cyan); outline-offset: 2px; }
.btn.primary { background: var(--yellow); box-shadow: inset 0 -4px 0 #d9a514, 0 4px 0 var(--line); }
.btn.ghost { background: transparent; box-shadow: none; border-style: dashed; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 13px; }
.btn:disabled { cursor: not-allowed; filter: grayscale(.8); opacity: .7; }
.btn.launch-btn { background: var(--orange); color: #fff; text-shadow: 2px 2px 0 var(--orange2); box-shadow: inset 0 -4px 0 var(--orange2), 0 4px 0 var(--line); font-size: 16px; padding: 10px 20px; animation: pulse 1.2s steps(2) infinite; }
.btn.launch-btn:disabled { animation: none; }
@keyframes pulse { 50% { box-shadow: inset 0 -4px 0 var(--orange2), 0 4px 0 var(--line), 0 0 0 4px rgba(255, 210, 63, .7); } }
.link { background: none; border: 0; padding: 2px 0; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 700; }

/* ── 选择角色 ── */
.select-head { display: grid; gap: 12px; justify-items: center; margin-bottom: 22px; }
.select-hint { margin: 0; max-width: 640px; text-align: center; color: var(--muted); font-size: 14px; }
.role-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; width: 100%; }
.role-card { position: relative; display: grid; justify-items: center; gap: 8px; padding: 18px 16px 20px; color: var(--text); background: var(--ink2); border: 4px solid var(--line); box-shadow: inset 0 0 0 4px #3a2c6b, 8px 8px 0 rgba(0,0,0,.45); cursor: pointer; transition: transform .1s steps(2); text-align: center; }
.role-card:hover, .role-card:focus-visible { transform: translateY(-6px); }
.role-rookie:hover, .role-rookie:focus-visible { box-shadow: inset 0 0 0 4px var(--green), 8px 14px 0 rgba(0,0,0,.45); }
.role-pro:hover, .role-pro:focus-visible { box-shadow: inset 0 0 0 4px var(--orange), 8px 14px 0 rgba(0,0,0,.45); }
.role-tag { justify-self: start; font: 800 11px var(--mono); letter-spacing: .14em; padding: 2px 6px; background: var(--line); color: var(--cyan); }
.role-pro .role-tag { color: var(--orange); }
.role-name { font: 900 clamp(22px, 3vw, 30px)/1.2 var(--sans); color: var(--yellow); text-shadow: 3px 3px 0 var(--line); }
.role-desc { color: var(--muted); font-size: 14px; max-width: 30em; }
.select-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 22px 0 0; color: var(--cyan); }
.service-banner { margin: 16px 0 0; padding: 8px 14px; border: 3px solid var(--line); background: #241a44; color: var(--text); font-size: 14px; text-align: center; }
.service-banner[data-state="paused"] { background: #4a3a10; }
.service-banner[data-state="error"] { background: #4a1420; }

/* ── NPC 对话 ── */
.npc { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bubble { position: relative; margin: 0; padding: 10px 14px; background: #fff; border: 4px solid var(--line); box-shadow: 4px 4px 0 rgba(0,0,0,.2); }
.bubble::before { content: ""; position: absolute; left: -14px; top: 50%; width: 10px; height: 10px; background: #fff; border-left: 4px solid var(--line); border-bottom: 4px solid var(--line); transform: translateY(-50%) rotate(45deg); }

/* ── 公告 ── */
.notice-lead { font-weight: 700; margin: 0 0 12px; }
.policy-scroll { max-height: 34vh; overflow: auto; padding: 12px 14px; background: #fffaf0; border: 4px solid var(--line); box-shadow: inset 0 0 0 2px #e6dcc4; }
.policy-scroll h3 { margin: 0 0 8px; font-size: 15px; }
.policy-text { white-space: pre-line; font-size: 14px; color: #3e3022; }
.notice-foot { color: #6b5a44; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 800; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--orange); }

/* ── 四步 ── */
.stepper { display: flex; gap: 6px; padding: 0; margin: 12px 0 0; list-style: none; counter-reset: s; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 6px; padding: 6px 8px; font-size: 13px; font-weight: 800; background: #e6dcc4; border: 3px solid var(--line); color: #6b5a44; }
.stepper li b { display: grid; place-items: center; width: 22px; height: 22px; background: #fff; border: 2px solid var(--line); font-family: var(--mono); }
.stepper li[data-state="done"] { background: #c8f2d6; color: #1d5a33; }
.stepper li[data-state="done"] b::after { content: "✓"; position: absolute; }
.stepper li[data-state="done"] b { color: transparent; position: relative; }
.stepper li[data-state="done"] b::after { color: #1d5a33; }
.stepper li[data-state="now"] { background: var(--yellow); color: #241a12; }
.step-intro { margin: 0 0 12px; color: #6b5a44; font-size: 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 900; }
.field label small { font: 700 11px var(--mono); color: #8a7658; margin-left: 6px; letter-spacing: .08em; }
.label-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.field input, .field textarea { width: 100%; padding: 10px 12px; background: #fff; color: #241a12; border: 4px solid var(--line); box-shadow: inset 4px 4px 0 #ece3cf; font-size: 16px; border-radius: 0; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:disabled, .field textarea:disabled { background: #e8e1d2; color: #8a7d6a; }
.field [aria-invalid="true"] { border-color: #c62828; box-shadow: inset 4px 4px 0 #ffd6d6; }
.field-error { margin: 0; min-height: 0; color: #c62828; font-weight: 800; font-size: 13px; }
.field-error:empty { display: none; }
.field-hint { margin: 0; color: #6b5a44; font-size: 13px; }
.form-message { margin: 6px 0 0; font-weight: 800; font-size: 14px; }
.form-message:empty { display: none; }
.form-message[data-result] { padding: 8px 12px; border: 3px solid var(--line); background: #fff3c4; }
.form-message[data-result="blocked"] { background: #e6e0f5; }
.form-message[data-result="unknown"] { background: #ffe1b8; border-style: dashed; }
.form-message[data-result="invalid"], .form-message[data-result="rejected"] { background: #ffd9d9; }
.launch { display: flex; align-items: center; gap: 12px; }
.launch .shout, .launch-side .shout { margin: 0; font: 900 clamp(18px, 3vw, 24px)/1.3 var(--sans); color: var(--orange2); text-shadow: 2px 2px 0 #ffe7a8; }
.launch .sub { margin: 4px 0 0; color: #6b5a44; }
.review { display: grid; gap: 8px; margin: 12px 0 0; }
.review > div { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: start; padding: 8px 10px; background: #fff; border: 3px solid var(--line); }
.review dt { font-weight: 900; } .review dd { margin: 0; word-break: break-all; }

/* ── 工作台 ── */
.workbench-body { display: grid; grid-template-columns: 1fr 230px; gap: 18px; align-items: start; }
.launch-side { flex-direction: column; text-align: center; padding: 12px; background: #fff7dd; border: 4px solid var(--line); }
.workbench-body .form-message { grid-column: 1 / -1; }

/* ── 结果 ── */
.result-top { display: flex; align-items: center; gap: 18px; padding: 18px 22px; }
.result-top h2 { margin: 8px 0 4px; font: 900 clamp(20px, 3.4vw, 28px)/1.25 var(--sans); outline: none; }
.result-text { margin: 0; color: #4a3a28; }
.result-win[data-result="accepted"] .win-badge { background: #1d5a33; color: #c8f2d6; }
.result-win[data-result="unknown"] .win-badge { background: #7a4a00; color: #ffe1b8; }
.result-win[data-result="invalid"] .win-badge, .result-win[data-result="rejected"] .win-badge, .result-win[data-result="rate-limited"] .win-badge { background: #7a1c1c; color: #ffd9d9; }
.receipt-box { margin: 0 22px 16px; padding: 14px; background: #fffaf0; border: 4px solid var(--line); box-shadow: inset 0 0 0 3px var(--yellow); }
.receipt-label { font: 800 12px var(--mono); letter-spacing: .1em; color: #6b5a44; }
.receipt-value { display: block; margin: 6px 0; font: 900 clamp(16px, 3vw, 22px)/1.3 var(--mono); word-break: break-all; color: #241a12; }
.receipt-note { margin: 0 0 10px; font-size: 13px; color: #6b5a44; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-tip { margin: 8px 0 0; font-size: 13px; font-weight: 800; color: #1d5a33; }
.copy-tip:empty { display: none; }

/* ── 查询 ── */
.lookup-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.lookup-form .field { margin: 0; }
.lookup-result { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px; background: #fff; border: 4px solid var(--line); }
.lookup-result strong { font-size: 20px; }
.lookup-result[data-result="completed"] { box-shadow: inset 0 0 0 4px var(--green); }
.lookup-result[data-result="processing"] { box-shadow: inset 0 0 0 4px var(--cyan); }
.lookup-result[data-result="needs-support"], .lookup-result[data-result="unavailable"] { box-shadow: inset 0 0 0 4px var(--amber); }
.lookup-result[data-result="not-found"], .lookup-result[data-result="error"], .lookup-result[data-result="rate-limited"] { box-shadow: inset 0 0 0 4px var(--red); }
.status-result { margin: 4px 0 0; }
.privacy-note { margin: 14px 0 0; font-size: 13px; color: #6b5a44; }

/* ── 弹层 ── */
dialog.pop { padding: 0; border: 0; background: transparent; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: visible; }
dialog.pop::backdrop { background: rgba(8, 5, 18, .72); }
dialog.pop[open] { animation: popIn .28s steps(6) both; }
dialog.pop .win-body { max-height: 60vh; overflow: auto; }
.support-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin: 10px 0 0; } .support-line strong { font: 900 20px var(--mono); }
.muted { color: #6b5a44; font-size: 13px; }

/* ── 演出层 ── */
.stage { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(9, 6, 20, .95); padding: 16px; }
body.staging { overflow: hidden; }
.stage-title { margin: 0 0 10px; text-align: center; font: 900 clamp(18px, 3vw, 24px)/1.3 var(--sans); color: var(--yellow); text-shadow: 3px 3px 0 var(--line); }
.stage-pct { margin: 10px 0 0; text-align: center; font: 700 13px var(--mono); color: var(--muted); }
.stage-pct b { color: var(--cyan); font-size: 16px; }
.stage-net { margin: 6px 0 0; text-align: center; font-weight: 800; color: var(--text); }
.stage-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; min-height: 34px; }
.stage .btn.ghost { color: var(--text); border-color: #6d5fa8; }
.run-box { width: min(860px, 100%); }
.dunk-court { position: relative; height: 380px; margin-bottom: 12px; overflow: hidden; background: linear-gradient(180deg, #1c1438 0%, #2a1c4e 70%, #3a2458 100%); border: 4px solid var(--line); box-shadow: inset 0 0 0 3px #3a2c6b; }
.dunk-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 7%; background: repeating-linear-gradient(90deg, #8a4b22 0 48px, #7b411c 48px 96px); box-shadow: inset 0 4px 0 #f2b05a; }
.dunk-court .hoop { position: absolute; right: 0; bottom: 7%; width: 200px; height: 350px; }
.dunk-court .hoop-back { z-index: 1; } .dunk-court .dunk-ball { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; } .dunk-court .hoop-front { z-index: 3; pointer-events: none; } .dunk-court .runner { z-index: 4; }
.runner { position: absolute; left: 0; top: 0; width: 192px; height: 192px; will-change: transform; }
.runner .sprite { width: 100%; height: 100%; }
.bar { position: relative; height: 28px; background: #0b0816; border: 4px solid var(--line); box-shadow: inset 0 0 0 3px #2b2150; overflow: hidden; }
.bar .fill { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--orange) 0 12px, var(--yellow) 12px 24px); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.bar .tick { position: absolute; top: 0; bottom: 0; width: 4px; background: rgba(255,255,255,.25); }
.bar .t1 { left: 25%; } .bar .t2 { left: 50%; } .bar .t3 { left: 75%; }
.stage.shake .run-box { animation: shake .3s steps(3) 1; }
@keyframes shake { 33% { transform: translate(-4px, 2px); } 66% { transform: translate(4px, -2px); } }
.stage-portal .portal-box { position: relative; width: min(560px, 100%); display: grid; justify-items: center; }
.portal { position: relative; width: min(320px, 70vw); aspect-ratio: 1; margin-bottom: -120px; }
.portal .ring { position: absolute; inset: 0; border-radius: 50%; border: 8px dashed var(--cyan); animation: spin 2.4s steps(12) infinite; opacity: .2; transform: scale(.2); transition: opacity .4s steps(3), transform .6s steps(6); }
.portal .r2 { inset: 12%; border-color: var(--purple); animation-direction: reverse; animation-duration: 1.8s; }
.portal .r3 { inset: 26%; border-color: var(--pink); border-style: dotted; animation-duration: 1.2s; }
.portal .core { position: absolute; inset: 34%; border-radius: 50%; background: radial-gradient(circle, #fff 0 18%, var(--cyan) 30%, var(--purple) 60%, transparent 70%); opacity: 0; transform: scale(.2); transition: opacity .4s steps(3), transform .6s steps(6); }
.portal .warp { position: absolute; inset: -20%; background: repeating-conic-gradient(from 0deg, rgba(57,230,255,.35) 0 4deg, transparent 4deg 18deg); border-radius: 50%; opacity: 0; animation: spin 1.6s linear infinite; mask: radial-gradient(circle, transparent 30%, #000 70%, transparent 72%); }
.stage-portal[data-phase="1"] .ring, .stage-portal[data-phase="2"] .ring, .stage-portal[data-phase="hold"] .ring, .stage-portal[data-phase="enter"] .ring, .stage-portal[data-phase="glitch"] .ring, .stage-portal[data-phase="eject"] .ring { opacity: 1; transform: scale(1); }
.stage-portal[data-phase="1"] .core, .stage-portal[data-phase="2"] .core, .stage-portal[data-phase="hold"] .core, .stage-portal[data-phase="enter"] .core, .stage-portal[data-phase="glitch"] .core, .stage-portal[data-phase="eject"] .core { opacity: 1; transform: scale(1); }
.stage-portal[data-phase="2"] .warp, .stage-portal[data-phase="hold"] .warp, .stage-portal[data-phase="enter"] .warp { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { position: relative; z-index: 2; transition: transform .8s steps(8); }
.hero.lift { transform: translateY(-70px) scale(.9); }
.hero.enter canvas { animation: enter 1.4s steps(14) both; }
@keyframes enter { 0% { transform: translateY(-70px) rotate(0) scale(.9); } 100% { transform: translateY(-150px) rotate(720deg) scale(0); opacity: 0; } }
.hero.eject canvas { animation: eject 1.2s steps(10) both; }
@keyframes eject { 0% { transform: translateY(-80px) scale(.6); } 40% { transform: translateY(-140px) scale(.7) rotate(-20deg); } 70% { transform: translateY(20px) rotate(10deg); } 85% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
.hero.glitch canvas { animation: glitch .5s steps(2) infinite; }
@keyframes glitch { 0% { transform: translate(-3px, -60px); filter: hue-rotate(0); } 50% { transform: translate(3px, -64px); filter: hue-rotate(180deg) saturate(2); } 100% { transform: translate(-1px, -60px); } }
.stage-portal[data-phase="glitch"] .portal { animation: glitchPortal .3s steps(2) infinite; }
@keyframes glitchPortal { 50% { transform: translateX(6px); filter: grayscale(1); } }
.stage-portal .bar { position: relative; width: 100%; margin-top: 8px; }
.flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.stage-portal[data-phase="enter"] .flash { animation: flash 1.5s steps(6) both; }
@keyframes flash { 0%, 55% { opacity: 0; } 75% { opacity: .95; } 100% { opacity: 0; } }

.demo-tag { position: fixed; left: 8px; bottom: 8px; z-index: 60; margin: 0; padding: 4px 8px; font: 700 11px var(--mono); background: #2b2450; color: #e9e4ff; border: 2px solid var(--line); }
.foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; padding: 10px 16px 18px; font-size: 12px; color: #d9cfff; text-shadow: 1px 1px 0 var(--line); margin-top: -120px; }

/* ── 手机 ── */
@media (max-width: 720px) {
  .hud { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .hud-status { order: 2; margin-left: auto; }
  .hud-nav { order: 3; width: 100%; justify-content: space-between; }
  .hud-nav button { flex: 1; justify-content: center; padding: 6px 4px; font-size: 12px; }
  .world { padding: 16px 12px 150px; place-items: start center; }
  .role-grid { grid-template-columns: 1fr; gap: 16px; }
  .role-card { grid-template-columns: 112px 1fr; justify-items: start; text-align: left; align-items: center; column-gap: 12px; padding: 12px; }
  .role-card .sprite-xl { width: 112px; height: 112px; grid-row: 1 / span 4; }
  .role-tag { justify-self: start; }
  .sprite-lg { width: 128px; height: 128px; }
  .sprite-md { width: 96px; height: 96px; }
  .win-head, .win-body, .win-foot { padding-left: 14px; padding-right: 14px; }
  .stepper li span { display: none; }
  .stepper li { justify-content: center; }
  .workbench-body { grid-template-columns: 1fr; }
  .launch-side { flex-direction: row; text-align: left; }
  .review > div { grid-template-columns: 1fr auto; } .review dt { grid-column: 1 / -1; }
  .lookup-form { grid-template-columns: 1fr; }
  .result-top { flex-direction: column; text-align: center; }
  .dunk-court { height: 250px; }
  .runner { width: 120px; height: 120px; }
  .dunk-court .hoop { width: 120px; height: 210px; }
  .win-foot .btn { flex: 1; }
  .foot { margin-top: -140px; }
}
/* ── REDEEM-PIXEL-002 · 动效开关 ── */
.hud-nav .motion-toggle[aria-pressed="false"] { background: #24402f; }
.motion-toast { position: fixed; z-index: 40; left: 50%; top: 74px; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; max-width: calc(100vw - 24px); padding: 8px 12px; background: #1e1636; color: var(--text); border: 3px solid var(--line); box-shadow: inset 0 0 0 2px #3ddc84, 6px 6px 0 rgba(0,0,0,.45); font-size: 14px; font-weight: 700; }
.motion-toast .link { color: var(--muted); }
.role-route { font: 700 12px var(--mono); color: var(--cyan); letter-spacing: .04em; }

/* ── 大厅背景球场世界（图层在卡片后方，不拦截操作） ── */
.lobby-world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: none; image-rendering: pixelated; image-rendering: crisp-edges; }
body[data-scene="select"] .lobby-world { display: block; }
body[data-scene="select"] .sky .city, body[data-scene="select"] .sky .court { display: none; }
.scene-select .select-links { padding: 6px 14px; background: rgba(13, 9, 28, .82); border: 3px solid var(--line); }
.scene-select .select-hint { padding: 2px 10px; background: rgba(13, 9, 28, .55); }
.world-toggle { color: var(--muted); font-size: 13px; }
body[data-scene="select"] .foot span { padding: 0 6px; background: rgba(13, 9, 28, .72); }

/* ── 四档球员 ── */
.tier-head { display: grid; gap: 10px; justify-items: center; margin-bottom: 20px; }
.tier-sub { margin: 0; color: var(--muted); text-align: center; }
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; width: 100%; }
.tier-card { --acc: #ff9a1f; position: relative; display: grid; justify-items: center; gap: 4px; padding: 14px 10px 14px; color: var(--text); background: var(--ink2); border: 4px solid var(--line); box-shadow: inset 0 0 0 3px #3a2c6b, 6px 6px 0 rgba(0,0,0,.45); cursor: pointer; text-align: center; transition: transform .1s steps(2); }
.tier-pro5x { --acc: #4aa3ff; } .tier-pro10x { --acc: #ff4d4d; } .tier-pro25x { --acc: #ffc93c; background: linear-gradient(180deg, #2a1748, #1e1636 60%); }
.tier-card:hover, .tier-card:focus-visible { transform: translateY(-6px); box-shadow: inset 0 0 0 3px var(--acc), 6px 12px 0 rgba(0,0,0,.45); }
.tier-card:focus-visible { outline: 4px solid var(--cyan); outline-offset: 2px; }
.tier-card.selected { transform: translateY(-8px); background: #2b2150; box-shadow: inset 0 0 0 4px var(--acc), 0 0 0 4px var(--acc), 6px 14px 0 rgba(0,0,0,.45); }
.tier-pro25x.selected { animation: legend 1.6s steps(4) infinite; }
@keyframes legend { 50% { box-shadow: inset 0 0 0 4px var(--acc), 0 0 0 4px #b07cff, 0 0 24px 6px rgba(255,201,60,.5); } }
.tier-rank { justify-self: start; font: 800 11px var(--mono); padding: 2px 6px; background: var(--line); color: var(--acc); letter-spacing: .12em; }
.tier-check { position: absolute; top: 10px; right: 10px; font: 800 11px var(--mono); padding: 2px 6px; background: var(--acc); color: #1a1020; opacity: 0; }
.tier-card.selected .tier-check { opacity: 1; }
.tier-card .sprite-lg { width: 176px; height: 176px; }
.tier-name { font: 900 26px/1.1 var(--mono); color: var(--acc); text-shadow: 3px 3px 0 var(--line); letter-spacing: .04em; }
.tier-title { font-weight: 800; font-size: 14px; }
.power { display: block; width: 100%; max-width: 180px; height: 10px; background: #0b0816; border: 2px solid var(--line); box-shadow: inset 0 0 0 1px #2b2150; }
.power i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--acc, #ff9a1f) 0 8px, #fff6 8px 10px); }
.power-num { font: 900 15px var(--mono); color: var(--yellow); }
.tier-skill { font-size: 12px; color: var(--muted); }
.tier-message { text-align: center; margin-top: 12px; }
.tier-foot { display: flex; justify-content: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.tier-foot .btn.ghost { color: var(--text); border-color: #6d5fa8; }
.tier-go { min-width: 220px; font-size: 16px; }

/* ── 填写页：左表单 + 右球员 ── */
.win-wide { max-width: 1000px; }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.form-main { min-width: 0; }
.bubble-plain { margin: 0 0 12px; }
.bubble-plain::before { display: none; }
.tier-panel { --acc: #ff9a1f; position: sticky; top: 84px; display: grid; justify-items: center; gap: 4px; padding: 12px; background: #fff7dd; border: 4px solid var(--line); box-shadow: inset 0 0 0 3px var(--acc); text-align: center; }
.tier-panel[data-tier="pro5x"] { --acc: #4aa3ff; background: #e8f2ff; } .tier-panel[data-tier="pro10x"] { --acc: #ff4d4d; background: #fff0ee; } .tier-panel[data-tier="pro25x"] { --acc: #b07cff; background: linear-gradient(180deg, #fff6d6, #f1e6ff); }
.tier-panel-tag { justify-self: start; font: 800 11px var(--mono); padding: 2px 6px; background: #241a12; color: var(--yellow); letter-spacing: .12em; }
.tier-panel .sprite-lg { width: 192px; height: 192px; }
.tier-panel-name { margin: 0; display: grid; } .tier-panel-name b { font: 900 24px var(--mono); color: #241a12; } .tier-panel-name small { font-weight: 800; color: #6b5a44; }
.tier-panel .power { --acc: inherit; } .tier-panel .power i { background: repeating-linear-gradient(90deg, var(--acc) 0 8px, #fff8 8px 10px); }
.tier-panel-power { margin: 0; font: 800 12px var(--mono); color: #4a3a28; }
.tier-panel .shout { margin: 4px 0 0; font: 900 16px/1.3 var(--sans); color: var(--orange2); }
.workbench-body { grid-template-columns: minmax(0, 1fr) 260px; }

/* ── 过场微调 ── */
.run-box { overflow: visible; }
.runner { will-change: transform; }

@media (max-width: 960px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .form-layout, .workbench-body { grid-template-columns: 1fr; }
  .tier-panel { position: static; grid-template-columns: 112px 1fr; justify-items: start; text-align: left; column-gap: 12px; order: -1; }
  .tier-panel .sprite-lg { width: 112px; height: 112px; grid-row: 1 / span 6; }
  .tier-panel .shout { display: none; }
  .tier-grid { gap: 10px; }
  .tier-card { padding: 10px 6px; } .tier-card .sprite-lg { width: 112px; height: 112px; } .tier-name { font-size: 20px; }
  .motion-toast { top: 112px; font-size: 13px; }
}
/* 简洁动效（系统减少动画或用户选择）：保留原地小动作，去掉大幅移动 */
html[data-motion="lite"] .stars, html[data-motion="lite"] .btn.launch-btn, html[data-motion="lite"] .blink, html[data-motion="lite"] .hud-status i, html[data-motion="lite"] .portal .ring, html[data-motion="lite"] .portal .warp, html[data-motion="lite"] .tier-pro25x.selected { animation: none !important; }
html[data-motion="lite"] .pop-in, html[data-motion="lite"] dialog.pop[open] { animation-duration: .01s; }
html[data-motion="lite"] .stage.shake .run-box { animation: none; }
html[data-motion="lite"] .stage-portal[data-phase="enter"] .flash { animation: none; }
html[data-motion="lite"] .hero, html[data-motion="lite"] .role-card, html[data-motion="lite"] .tier-card { transition: none; }

/* Fixed levels use stylesheet rules compatible with the production CSP. */
.power-lvl-1{width:25%}.power-lvl-2{width:50%}.power-lvl-3{width:75%}.power-lvl-4{width:100%}

/* Codex mobile background clearance: keep foreground unchanged and reveal actors below the footer. */
@media(max-width:600px){body[data-scene="select"] .foot{margin-bottom:128px}}
