/* 星火：霓虹赛道 — 反重力竞速 / 手机横屏 HUD */
.neon-shell {
  position: absolute !important; inset: 0; width: 100%; height: 100%; overflow: hidden; background: #030711;
}
#gWrap:has(.neon-live) .neon-shell { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.neon-shell:fullscreen, .neon-shell:-webkit-full-screen { width: 100vw; height: 100vh; }
.neon-live {
  position: absolute; inset: 0; overflow: hidden; background: #030711; color: #effdff;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --neon-cyan: #25e6ff; --neon-pink: #ff4fd8; --neon-gold: #ffd166; --neon-ink: #04101a;
  user-select: none; touch-action: none;
}
#gWrap:has(.neon-live) .g-stage,
body.landscape-mode:has(.neon-live) .g-stage {
  height: 100%; min-height: 0; padding: 0; border: 0; background: transparent;
}
body.landscape-mode:has(.neon-live) .neon-live,
#gWrap:has(.neon-live) .neon-live {
  position: absolute !important; inset: 0; width: 100%; height: 100% !important;
  min-height: 0; max-width: none; border-radius: 0; box-shadow: none;
}
.g-wrap.g-live:has(.neon-live) .g-victory,
.g-wrap.g-live:has(.neon-live) .g-champ-overlay,
.g-wrap.g-live:has(.neon-live) .g-final { display: none !important; }
.g-wrap.g-live-done:has(.neon-live) .g-stage {
  position: fixed; inset: 0; z-index: 260; width: 100vw; height: 100vh; min-height: 0; padding: 0; margin: 0;
  border: 0; border-radius: 0; background: #030711;
}
.g-wrap:has(.neon-result.on) .g-stage {
  position: fixed !important; inset: 0 !important; z-index: 260 !important; width: 100vw !important; height: 100vh !important;
  min-height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important;
}
body.landscape-mode:has(.neon-result.on) .topbar,
body.landscape-mode:has(.neon-result.on) #dock { display: none !important; }
.g-wrap.g-live-done:has(.neon-live) .neon-live { position: absolute !important; inset: 0; height: 100vh !important; }
.neon-live:fullscreen, .neon-live:-webkit-full-screen { width: 100vw; height: 100vh; }

.neon-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.neon-vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 44%, transparent 30%, rgba(0,0,0,.44) 100%),
    linear-gradient(180deg, rgba(0,0,0,.74) 0%, transparent 16%, transparent 76%, rgba(0,0,0,.76) 100%);
  box-shadow: inset 0 0 140px rgba(0,0,0,.55);
}
.neon-scan { position: absolute; inset: 0; pointer-events: none; opacity: .12; mix-blend-mode: screen;
  background: repeating-linear-gradient(0deg, rgba(160,250,255,.2) 0 1px, transparent 1px 4px);
}
.neon-grain { position: absolute; inset: 0; pointer-events: none; opacity: .04; mix-blend-mode: overlay;
  background-image: radial-gradient(rgba(255,255,255,.9) .5px, transparent .6px); background-size: 3px 3px;
}

/* 顶部：右侧给通用退出键留 64px */
.neon-top {
  position: absolute; z-index: 6; left: 0; right: 0; top: 0;
  display: grid; grid-template-columns: minmax(120px, 1fr) minmax(112px, 22vw) minmax(120px, 1fr);
  align-items: start; gap: 7px;
  padding: max(8px, env(safe-area-inset-top)) max(64px, calc(env(safe-area-inset-right) + 52px)) 8px max(12px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(2,7,15,.97), rgba(2,7,15,.68) 60%, transparent);
  pointer-events: none;
}
.g-wrap:has(.neon-live) .g-live-exit { top: max(8px, env(safe-area-inset-top)); right: 10px; }
.g-wrap:has(.neon-live) #gLiveHelp,
.g-wrap:has(.neon-live) .g-live-help,
.g-wrap:has(.neon-live) #gHelp,
.g-wrap:has(.neon-live) .g-help { display: none !important; }
.g-wrap:has(.neon-result.on) .g-live-exit { display: none !important; }
.g-wrap:has(.neon-codex.on) .g-live-exit { display: none !important; }

.neon-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.neon-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: none; color: var(--neon-cyan);
  border: 1px solid rgba(37,230,255,.32); background: linear-gradient(135deg, rgba(37,230,255,.12), rgba(0,0,0,.58));
  font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 10px; font-weight: 900;
  letter-spacing: .08em; text-shadow: 0 0 14px var(--neon-cyan); transform: skewX(-9deg);
}
.neon-brand-copy { min-width: 0; }
.neon-brand-copy small { display: block; font-size: 7px; letter-spacing: .18em; color: rgba(198,240,247,.48); font-weight: 800; white-space: nowrap; }
.neon-brand-copy b { display: block; margin-top: 1px; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: clamp(18px, 2.8vw, 30px); letter-spacing: .04em; color: #f6ffff; text-shadow: 0 0 20px rgba(37,230,255,.26); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neon-track-sub { display: block; margin-top: 1px; color: rgba(194,236,244,.52); font-size: 7px; letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.neon-top-center { text-align: center; min-width: 0; padding-top: 1px; }
.neon-lap-tag { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 2px; border: 1px solid rgba(37,230,255,.23); color: rgba(208,249,255,.8); font-size: 7px; letter-spacing: .12em; font-weight: 900; background: rgba(37,230,255,.06); }
.neon-lap-tag b { color: #fff4c4; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 11px; }
.neon-clock { display: block; margin-top: 2px; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: clamp(20px, 3vw, 33px); letter-spacing: .06em; line-height: 1; color: #fff6d8; text-shadow: 0 0 18px rgba(255,209,102,.22); }
.neon-clock.low { color: #ff8c5c; animation: neonPulse 1s infinite; }
.neon-track-name { display: block; margin-top: 3px; color: rgba(205,239,247,.5); font-size: 7px; letter-spacing: .12em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.neon-pos { text-align: right; min-width: 0; padding-top: 2px; }
.neon-pos small { display: block; color: rgba(178,228,238,.46); font-size: 7px; letter-spacing: .16em; font-weight: 800; }
.neon-pos b { display: block; margin-top: 1px; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: clamp(22px, 4vw, 42px); line-height: .9; color: #eaffff; text-shadow: 0 0 22px rgba(37,230,255,.38); }
.neon-pos b i { font-style: normal; font-size: 9px; color: rgba(206,245,250,.45); letter-spacing: .08em; margin-left: 2px; }
.neon-pos em { display: block; margin-top: 3px; color: rgba(255,209,102,.72); font-size: 7px; font-style: normal; letter-spacing: .08em; }

/* 排名条 */
.neon-standings { position: absolute; z-index: 6; left: max(12px, env(safe-area-inset-left)); top: 76px; width: min(146px, 20vw); display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.neon-stand-title { color: rgba(190,238,246,.44); font-size: 6px; letter-spacing: .16em; font-weight: 900; margin-bottom: 1px; }
.neon-stand-row { display: flex; align-items: center; gap: 4px; min-width: 0; padding: 2px 4px; border-left: 2px solid var(--sc); background: linear-gradient(90deg, rgba(4,15,24,.66), rgba(4,15,24,.12)); color: rgba(214,249,255,.62); font-size: 6.5px; white-space: nowrap; overflow: hidden; }
.neon-stand-row.my { background: linear-gradient(90deg, rgba(37,230,255,.15), rgba(4,15,24,.12)); color: #f2ffff; }
.neon-stand-row i { font-style: normal; color: var(--sc); font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-weight: 900; min-width: 9px; }
.neon-stand-row b { overflow: hidden; text-overflow: ellipsis; font-weight: 700; flex: 1; }
.neon-stand-row em { font-style: normal; color: rgba(255,209,102,.62); font-size: 6px; }

/* 雷达 / 赛道小地图 */
.neon-minimap { position: absolute; z-index: 6; right: max(12px, calc(env(safe-area-inset-right) + 62px)); top: 78px; width: 112px; height: 68px;
  border: 1px solid rgba(37,230,255,.18); background: rgba(2,9,18,.42); box-shadow: 0 0 24px rgba(0,0,0,.24); pointer-events: none; backdrop-filter: blur(6px); }
.neon-minimap canvas { width: 100%; height: 100%; display: block; }
.neon-minimap small { position: absolute; left: 4px; bottom: 2px; font-size: 5px; letter-spacing: .14em; color: rgba(143,232,250,.42); font-weight: 800; }

/* 左下：车辆 / 速度 */
.neon-hero { position: absolute; z-index: 6; left: max(104px, calc(env(safe-area-inset-left) + 104px)); bottom: max(12px, env(safe-area-inset-bottom));
  width: min(224px, 29vw); padding: 7px 9px 7px; border-left: 2px solid var(--nc);
  background: linear-gradient(90deg, rgba(5,17,26,.92), rgba(3,9,16,.5)); box-shadow: 0 10px 26px rgba(0,0,0,.34); pointer-events: none; backdrop-filter: blur(7px);
}
.neon-hero-head { display: flex; align-items: center; gap: 6px; }
.neon-car-icon { width: 22px; height: 22px; display: grid; place-items: center; flex: none; font-size: 13px; color: var(--nc);
  border: 1px solid color-mix(in srgb, var(--nc) 40%, transparent); background: color-mix(in srgb, var(--nc) 10%, rgba(0,0,0,.3)); }
.neon-hero-copy { flex: 1; min-width: 0; }
.neon-hero-copy small { display: block; font-size: 6.5px; letter-spacing: .1em; color: rgba(188,232,242,.48); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neon-hero-copy b { display: block; font-size: 10px; letter-spacing: .04em; color: #f0fdff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.neon-hero-class { font-size: 7px; font-weight: 900; letter-spacing: .08em; color: var(--nc); padding: 2px 5px; border: 1px solid color-mix(in srgb, var(--nc) 26%, transparent); }
.neon-speedline { display: flex; align-items: flex-end; gap: 4px; margin-top: 3px; }
.neon-speed { font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 22px; line-height: .8; letter-spacing: -.03em; color: #fff7df; text-shadow: 0 0 16px rgba(255,209,102,.19); }
.neon-speed-unit { font-size: 6px; letter-spacing: .12em; color: rgba(199,239,246,.46); margin-bottom: 1px; }
.neon-speedline em { margin-left: auto; color: rgba(255,209,102,.65); font-size: 6px; font-style: normal; letter-spacing: .06em; }
.neon-boost-line { margin-top: 4px; }
.neon-boost-copy { display: flex; justify-content: space-between; color: rgba(193,236,245,.48); font-size: 6px; letter-spacing: .1em; }
.neon-boost-copy b { color: #fff4c8; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 8px; }
.neon-boost-bar { height: 4px; margin-top: 2px; background: rgba(210,246,255,.13); overflow: hidden; transform: skewX(-18deg); }
.neon-boost-bar u { display: block; height: 100%; width: 60%; background: linear-gradient(90deg, #ff7a35, #ffd166); box-shadow: 0 0 10px rgba(255,160,60,.5); transition: width .12s linear; }
.neon-hero-stats { display: flex; gap: 7px; margin-top: 4px; font-size: 6.5px; letter-spacing: .03em; color: rgba(187,231,240,.5); }
.neon-hero-stats b { color: #fff1c2; font-size: 8px; margin-left: 2px; font-family: "DIN Alternate", "Bahnschrift", sans-serif; }
.neon-hero-flag { margin-top: 4px; display: flex; align-items: center; gap: 4px; font-size: 6px; letter-spacing: .09em; color: rgba(126,240,168,.66); }
.neon-hero-flag i { width: 4px; height: 4px; border-radius: 50%; background: #7ef0a8; box-shadow: 0 0 8px #7ef0a8; animation: neonPulse 1.4s infinite; }

/* 摇杆 */
.neon-joy { position: absolute; z-index: 8; left: max(13px, env(safe-area-inset-left)); bottom: max(13px, env(safe-area-inset-bottom));
  width: 82px; height: 82px; border-radius: 50%; border: 1px solid rgba(144,239,255,.25);
  background: radial-gradient(circle at 50% 50%, rgba(10,43,52,.55), rgba(4,13,18,.7) 64%, rgba(2,8,12,.82));
  box-shadow: inset 0 0 22px rgba(49,213,244,.12), 0 6px 18px rgba(0,0,0,.28); touch-action: none;
}
.neon-joy::before { content: ""; position: absolute; inset: 15px; border-radius: 50%; border: 1px dashed rgba(151,239,255,.14); }
.neon-joy-knob { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #c7fbff, #28c8f0 42%, #0a6b91 100%);
  box-shadow: 0 0 20px rgba(45,231,255,.55), inset 0 -4px 8px rgba(0,28,50,.5); pointer-events: none;
}
.neon-joy-label { position: absolute; left: 0; right: 0; bottom: -13px; text-align: center; font-size: 6px; letter-spacing: .16em; color: rgba(172,234,245,.5); font-weight: 800; }

/* 四键 */
.neon-actions { position: absolute; z-index: 8; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom));
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: min(156px, 20vw); }
.neon-btn { appearance: none; border: 1px solid rgba(127,231,250,.2); background: linear-gradient(180deg, rgba(8,27,38,.9), rgba(4,12,19,.8));
  color: #dffbff; min-height: 40px; padding: 4px 6px; font-family: inherit; cursor: pointer; touch-action: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); transition: border-color .12s, background .12s, transform .12s; }
.neon-btn b { display: block; font-size: 9px; letter-spacing: .08em; }
.neon-btn small { display: block; margin-top: 2px; font-size: 6px; letter-spacing: .08em; color: rgba(181,229,239,.5); }
.neon-btn.on { border-color: rgba(255,209,102,.7); background: linear-gradient(180deg, rgba(84,50,10,.9), rgba(20,12,5,.85)); box-shadow: 0 0 18px rgba(255,180,60,.2); transform: translateY(1px); }
.neon-btn.cool { opacity: .45; }
.neon-btn.boost { border-color: rgba(255,150,60,.3); }
.neon-btn.boost b { color: #ffd166; }
.neon-btn.pulse b { color: #ff9de8; }
.neon-btn.brake b { color: #b8e6ff; }

/* 发车倒计时 */
.neon-countdown { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle at 50% 46%, transparent 20%, rgba(0,0,0,.34) 100%); }
.neon-countdown.off { display: none; }
.neon-countdown b { font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: clamp(46px, 12vw, 94px); color: #fff6d5;
  text-shadow: 0 0 32px rgba(255,209,102,.5), 2px 2px 0 rgba(0,0,0,.4); letter-spacing: .04em; }
.neon-countdown small { position: absolute; bottom: 25%; font-size: 8px; letter-spacing: .2em; color: rgba(204,246,255,.62); }

/* 提示 */
.neon-toast { position: absolute; z-index: 9; left: 50%; bottom: 23%; transform: translate(-50%, 10px); padding: 4px 9px; border: 1px solid rgba(255,209,102,.3);
  background: rgba(6,17,25,.82); color: #fff0bd; font-size: 7px; letter-spacing: .08em; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.neon-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 结算 */
.neon-result { position: absolute; inset: 0; z-index: 14; display: none; align-items: center; justify-content: center; padding: 14px;
  background: radial-gradient(circle at 50% 42%, rgba(8,28,40,.38), rgba(0,4,9,.82) 76%); backdrop-filter: blur(3px); }
.neon-result.on { display: flex; }
.neon-result-box { width: min(760px, 92vw); max-height: 96%; overflow: auto; scrollbar-width: none; padding: 16px 20px; border: 1px solid rgba(37,230,255,.25);
  background: linear-gradient(160deg, rgba(5,20,29,.97), rgba(3,10,16,.96)); box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 24px 60px rgba(0,0,0,.5); }
.neon-result-box::-webkit-scrollbar { width: 0; height: 0; }
.neon-result-kicker { color: rgba(143,232,250,.52); font-size: 7px; letter-spacing: .2em; font-weight: 800; text-align: center; }
.neon-result-title { margin: 4px 0 2px; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: clamp(26px, 5vw, 38px); letter-spacing: .08em; color: #f4ffff; text-align: center; text-shadow: 0 0 22px rgba(37,230,255,.28); }
.neon-result-sub { color: rgba(195,238,246,.55); font-size: 8px; letter-spacing: .08em; text-align: center; }
.neon-podium { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 10px; }
.neon-podium-row { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-left: 3px solid var(--pc); background: linear-gradient(90deg, rgba(255,255,255,.04), transparent); font-size: 8px; }
.neon-podium-row.my { background: linear-gradient(90deg, rgba(37,230,255,.12), transparent); }
.neon-podium-row .pnum { width: 28px; color: var(--pc); font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-weight: 900; font-size: 14px; }
.neon-podium-row .pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.neon-podium-row .pclass { color: rgba(191,235,243,.46); font-size: 7px; }
.neon-podium-row .ptime { color: #fff0bd; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 8px; }
.neon-result-stats { display: flex; justify-content: center; gap: 18px; padding: 7px 0 2px; border-top: 1px solid rgba(255,255,255,.08); color: rgba(195,238,246,.5); font-size: 7px; text-align: center; }
.neon-result-stats b { display: block; margin-top: 2px; color: #fff2c7; font-family: "DIN Alternate", "Bahnschrift", sans-serif; font-size: 13px; }
.neon-result-actions { display: flex; justify-content: center; gap: 8px; margin-top: 11px; }
.neon-result-actions button { appearance: none; border: 1px solid rgba(37,230,255,.4); background: rgba(37,230,255,.1); color: #eaffff; padding: 8px 16px; font-family: inherit; font-size: 9px; letter-spacing: .1em; cursor: pointer; }
.neon-result-actions button.primary { background: #25cfe8; color: #031319; border-color: #9df7ff; font-weight: 900; }
.neon-result-actions button.ghost { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04); color: rgba(220,250,255,.72); }

/* 手册 */
.neon-help { position: absolute; z-index: 7; right: max(14px, calc(env(safe-area-inset-right) + 14px)); top: auto; bottom: 112px; width: 24px; height: 24px;
  border: 1px solid rgba(147,239,255,.3); background: rgba(6,20,28,.75); color: #d6fbff; font-size: 12px; cursor: pointer; }
.neon-codex { position: absolute; inset: 0; z-index: 38; display: none; align-items: center; justify-content: center; padding: 14px; background: rgba(1,5,10,.84); backdrop-filter: blur(5px); }
.neon-codex.on { display: flex; }
.neon-codex-box { width: min(880px, 96vw); max-height: 92%; overflow: auto; border: 1px solid rgba(37,230,255,.25); background: linear-gradient(150deg, rgba(5,20,30,.98), rgba(3,9,16,.98)); padding: 16px 20px; }
.neon-codex-head { display: flex; align-items: flex-start; gap: 10px; }
.neon-codex-title { flex: 1; }
.neon-codex-title small { color: rgba(143,232,250,.52); font-size: 7px; letter-spacing: .18em; font-weight: 800; }
.neon-codex-title h2 { margin: 3px 0 0; font-size: clamp(22px, 4vw, 30px); letter-spacing: .04em; color: #f1feff; }
.neon-codex-title p { margin: 4px 0 0; color: rgba(195,238,246,.58); font-size: 8px; line-height: 1.5; }
.neon-codex-close { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.04); color: #e9ffff; font-size: 14px; cursor: pointer; }
.neon-codex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 13px; }
.neon-codex-item { border-left: 2px solid rgba(37,230,255,.35); background: rgba(255,255,255,.035); padding: 6px 8px; }
.neon-codex-item b { display: block; color: #dffbff; font-size: 9px; letter-spacing: .05em; }
.neon-codex-item p { margin: 3px 0 0; color: rgba(188,235,243,.5); font-size: 7px; line-height: 1.45; }
.neon-codex-classes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 8px; }
.neon-codex-class { border: 1px solid color-mix(in srgb, var(--cc) 25%, transparent); padding: 6px 7px; background: color-mix(in srgb, var(--cc) 7%, transparent); }
.neon-codex-class b { display: block; color: var(--cc); font-size: 9px; }
.neon-codex-class small { display: block; margin-top: 2px; color: rgba(188,235,243,.5); font-size: 7px; line-height: 1.4; }

@keyframes neonPulse { 0%,100% { opacity: 1; } 50% { opacity: .42; } }

@media (max-width: 760px) {
  .neon-hero { width: 210px; left: 100px; }
  .neon-standings { top: 70px; width: 124px; }
  .neon-actions { width: 142px; }
  .neon-minimap { width: 96px; height: 60px; top: 69px; }
}
@media (max-width: 560px) {
  .neon-brand-copy b { font-size: 17px; }
  .neon-hero { width: 188px; padding: 6px 7px; }
  .neon-standings { width: 106px; }
  .neon-stand-row { font-size: 6px; }
  .neon-actions { width: 126px; gap: 4px; }
  .neon-btn { min-height: 36px; }
  .neon-btn b { font-size: 8px; }
  .neon-minimap { width: 84px; height: 54px; right: 56px; }
  .neon-codex-grid { grid-template-columns: 1fr; }
  .neon-codex-classes { grid-template-columns: 1fr 1fr; }
}
