/* ════════════════════════════════════════════════════════════════════════
   YEA.FUN // CYBER.CSS — 全局设计令牌 + 动效原语 (赛博朋克唯一正源, R1 已拍板)
   暗色 · 高对比 · 冷峻 · 数据张力 · 无表情符号。各页 <link> 引入, 消灭内联色值散落。
   ════════════════════════════════════════════════════════════════════════ */
:root {
  /* 基底 — 近黑分层 */
  --bg-void:  #000000;
  --bg-deep:  #030503;
  --bg-panel: #070707;
  --bg-raise: #0a0a0a;
  /* 信号色 — 冷峻高对比 (收敛到 5 色) */
  --c-matrix: #00FF41;   /* 主色: 在线/确认/数据流 */
  --c-gold:   #FFD700;   /* 权重: 房主/赢家/蓝V/CPT 高亮 */
  --c-cyan:   #00BFFF;   /* 次级: 链路/信息/房间 */
  --c-blood:  #FF003C;   /* 危险: 亏损/争议/斩首/锁定对比 */
  --c-cpt:    #E6FF66;   /* 算力数字专用 */
  /* 文本 / 描边 */
  --t-bright: #ffffff;
  --t-dim:    #8a8a8a;
  --t-ghost:  #066;
  --line:     #1c1c1c;
  --line-hot: #073;
  --font:     'JetBrains Mono','Courier New',monospace;
}

/* ── 动效原语 (仅 transform/opacity, GPU 友好; 克制) ── */
@keyframes cy-pulse   { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes cy-flicker { 0%{opacity:0} 8%{opacity:1} 10%{opacity:.4} 14%{opacity:1} 28%{opacity:.7} 30%{opacity:1} 100%{opacity:1} }
@keyframes cy-sweep   { 0% { background-position: -160% 0; } 100% { background-position: 260% 0; } }
@keyframes cy-blink   { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes cy-scanmove { 0% { transform: translateY(0); } 100% { transform: translateY(4px); } }
@keyframes cy-ringspin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }

/* 扫描线叠层 (覆盖任意容器, 不拦截点击) */
.cy-scan { position: relative; }
.cy-scan::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(0deg, rgba(0,255,65,0.04) 0 1px, transparent 1px 3px);
  animation: cy-scanmove .5s steps(2) infinite;
}

/* 辉光 / 脉冲 / 闪烁 / 打字光标 工具类 */
.cy-glow      { text-shadow: 0 0 10px currentColor; }
.cy-glow-soft { text-shadow: 0 0 6px rgba(0,255,65,.45); }
.cy-pulse     { animation: cy-pulse 1.6s infinite ease-in-out; }
.cy-flicker   { animation: cy-flicker .9s ease-out both; }
.cy-cursor::after { content: '_'; animation: cy-blink 1s steps(1) infinite; color: var(--c-matrix); }

/* 数据流扫描高亮 (用于 TOTAL 等关键数字底) */
.cy-streamtext {
  background: linear-gradient(90deg, transparent 0%, rgba(230,255,102,.28) 50%, transparent 100%);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: cy-sweep 2.2s linear infinite;
}

/* 几何符 (替代表情, 绝对克制): ⟢ ⊙ ▲ ▼ ● ○ ✕ ⚑ — 仅作类名语义提示, 直接用字符即可 */

/* ════════════════════════════════════════════════════════════════════════
   P2 — 大厅全局赛博覆盖 (站点级, 不受内联样式影响的层: 滚动条/选区/字体基线)
   ════════════════════════════════════════════════════════════════════════ */
html { scrollbar-width: thin; scrollbar-color: rgba(0,255,65,.45) #050505; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: #0a3d1a; border: 1px solid var(--c-matrix); box-shadow: inset 0 0 6px rgba(0,255,65,.4); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--c-matrix); }
::selection { background: rgba(0,255,65,.25); color: #fff; }

/* 面板标题 — 令牌化 + 左侧能量轨 (信息层级靠字重 + 字距, 不靠表情/杂色) */
.panel-header {
  font-family: var(--font); letter-spacing: .22em; font-weight: 800; text-transform: uppercase;
  border-left: 2px solid var(--c-matrix); padding-left: 10px; color: var(--t-bright);
}
/* 区段标签 — 鬼绿副标, 大字距 */
.intel-section-label { font-family: var(--font); letter-spacing: .28em; font-weight: 800; color: var(--t-ghost); text-transform: uppercase; }

/* 统一空状态终端面板 (替代各处散落的 dashed 占位) */
.cy-empty { border: 1px dashed var(--line-hot); padding: 16px; color: var(--t-ghost); font-size: 10px; text-align: center; letter-spacing: 2px; text-transform: uppercase; animation: cy-pulse 2.4s infinite; }

/* ════════════════════════════════════════════════════════════════════════
   P3 — DOPAMINE LAYER // 血脉偾张赛博朋克: 矩阵辉光 · 数据冲击 · 动感高亮 · 张力排版
   全局覆盖 index/room/hq/profile (cyber.css + cyber.js)。GPU 友好。让系统躁起来。
   ════════════════════════════════════════════════════════════════════════ */
@keyframes cy-neon    { 0%,100%{ text-shadow:0 0 6px currentColor, 0 0 14px currentColor } 50%{ text-shadow:0 0 11px currentColor, 0 0 28px currentColor } }
@keyframes cy-railrun { 0%,100%{ box-shadow:0 0 8px rgba(0,255,65,.5);  } 50%{ box-shadow:0 0 20px rgba(0,255,65,.9), 0 0 34px rgba(0,255,65,.45) } }
@keyframes cy-glitch  { 0%,90%,100%{ transform:translate(0); text-shadow:0 0 10px currentColor } 91%{ transform:translate(-2px,1px); text-shadow:-3px 0 #FF003C, 3px 0 #00BFFF } 94%{ transform:translate(2px,-1px) } 96%{ transform:translate(-1px,0); text-shadow:3px 0 #FF003C, -3px 0 #00BFFF } 98%{ transform:translate(0) } }
@keyframes cy-pop     { 0%{ transform:scale(1) } 28%{ transform:scale(1.32); filter:brightness(2.4) saturate(1.6) } 100%{ transform:scale(1) } }
@keyframes cy-crt     { 0%,100%{ opacity:.42 } 50%{ opacity:.26 } }
@keyframes cy-shine   { 0%{ transform:translateX(-130%) } 100%{ transform:translateX(130%) } }

/* 全局 CRT 胶片 (cyber.js 注入 #cyFx) — 扫描线 + 边缘暗角 + 微闪烁 */
#cyFx { position:fixed; inset:0; pointer-events:none; z-index:9000;
  background:
    repeating-linear-gradient(0deg, rgba(0,255,65,.035) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.5) 100%);
  animation: cy-crt 3.6s ease-in-out infinite; }

/* 标题 — 静态霓虹 Bloom (PERF: 取代逐帧 text-shadow 重绘, 视觉无损) + 悬停故障 */
.panel-header, .pf-section-label, .topbar-logo, .brand, .pf-topbar .h, .lobby-section-label {
  text-shadow: 0 0 10px currentColor, 0 0 22px currentColor; }
.panel-header { border-left:3px solid var(--c-matrix); padding-left:10px; box-shadow: -1px 0 14px rgba(0,255,65,.45); }
.panel-header:hover, .pf-section-label:hover, .brand:hover { animation: cy-glitch 1.4s steps(2) infinite; cursor: default; }

/* 卡片/格 — 霓虹描边 + 悬停冲击抬升 + 流光扫过 */
.market-card, .player-card, .pf-card, .pf-stat, .mtile, .case, .chal-card, .stat-block, .pc-stat, .freq-tag, .clash-bar {
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease; position: relative; }
.market-card:hover, .player-card:hover, .pf-card:hover, .pf-stat:hover, .mtile:hover, .case:hover, .chal-card:hover, .pc-stat:hover {
  transform: translateY(-3px) scale(1.014);
  box-shadow: 0 0 24px rgba(0,255,65,.4), inset 0 0 16px rgba(0,255,65,.12);
  border-color: var(--c-matrix); z-index: 5; }

/* 按钮 — 高亮冲击 + 掠光 + 按压反馈 */
button, .btn, .pf-btn, .btn-manage-hq, .tbtn, .freq-tag, .stg, .radar-switch button {
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease; }
button:hover, .btn:hover, .pf-btn:hover, .btn-manage-hq:hover, .tbtn:hover, .radar-switch button:hover {
  transform: translateY(-1px) scale(1.035); filter: brightness(1.3) saturate(1.35);
  box-shadow: 0 0 18px rgba(0,255,65,.55); }
button:active, .btn:active, .pf-btn:active, .btn-manage-hq:active, .tbtn:active { transform: scale(.95); }

/* 关键数字 — 静态辉光 (PERF) + 数据冲击 (cy-pop 由 cyber.js 触发, will-change 上 GPU) */
.stat-value, .pf-stat .val, .countdown, .mtile .mv, .pc-stat-val, #internalBalance, #walletBalance, .tv, .total .tv {
  text-shadow: 0 0 9px currentColor, 0 0 18px currentColor; will-change: transform; transform: translateZ(0); display: inline-block; }
.cy-pop { animation: cy-pop .52s ease-out !important; }

/* 徽章/标签/高亮身份 — 流光脉冲 */
.rank-badge, .badge, .reason-tag, .host-id {
  transition: box-shadow .15s ease, transform .1s ease; }
.rank-badge:hover, .badge:hover, .host-id:hover { box-shadow: 0 0 14px currentColor; transform: scale(1.07); }
.host-id { color: var(--c-matrix); text-shadow: 0 0 8px rgba(0,255,65,.6); font-weight: 800; }

/* 滚动 tape 行 — 入场冲击 (cyber.js 给新行加 .cy-tapein) */
.cy-tapein { animation: cy-pop .45s ease-out; }

/* ════════════════════════════════════════════════════════════════════════
   P4 — EXTREME // READY PLAYER ONE: 解除渲染封印 (PC 绝对优先, 零克制)
   加深 CRT · 强化 Bloom 光晕 · 深色面板景深 · 破坏性打击反馈。绝不为省电牺牲张力。
   ════════════════════════════════════════════════════════════════════════ */

/* ── CRT 加深: 更密扫描线 + 更深暗角 + 滚动扫描条 + 边缘 RGB 色散 ── */
@keyframes cy-crt  { 0%,100%{ opacity:.58 } 50%{ opacity:.36 } }
@keyframes cy-roll { 0%{ transform:translateY(-15%) } 100%{ transform:translateY(115%) } }
#cyFx {
  pointer-events: none;                                   /* 彻底剥离对底层 DOM 交互的干扰 */
  background:
    repeating-linear-gradient(0deg, rgba(0,255,65,.06) 0 1px, transparent 1px 2px),
    radial-gradient(ellipse at center, transparent 46%, rgba(0,0,0,.74) 100%);
  animation: cy-crt 3.2s ease-in-out infinite;            /* opacity 动画 — 可合成, 廉价 */
  will-change: opacity; transform: translateZ(0);         /* 提升为独立合成层 */
  contain: strict; }                                      /* 隔离布局/绘制, 不触发底层重排 */
#cyFx::before { content:''; position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(255,0,60,.05), transparent 7%, transparent 93%, rgba(0,191,255,.05)); }
#cyFx::after { content:''; position:absolute; left:0; right:0; height:16%;
  background:linear-gradient(180deg, transparent, rgba(0,255,65,.12), transparent);
  animation: cy-roll 5.5s linear infinite;                /* transform 动画 — 可合成 */
  will-change: transform; transform: translateZ(0); }

/* ── Bloom 增强: 标题/数字三层光晕 (PC GPU 充沛) ── */
@keyframes cy-neon { 0%,100%{ text-shadow:0 0 8px currentColor, 0 0 20px currentColor } 50%{ text-shadow:0 0 16px currentColor, 0 0 40px currentColor, 0 0 66px currentColor } }

/* ── 深色面板景深: 顶部内高光 + 渐变体积 + 外投影 drop (玻璃质感) ── */
.panel, .pf-card, .pf-stat, .mtile, .case, .market-card, .player-card, .stat-block, .chal-card, .pc-stat {
  background-image: linear-gradient(180deg, rgba(255,255,255,.028), rgba(0,0,0,.28));
  box-shadow: 0 6px 24px rgba(0,0,0,.62), inset 0 1px 0 rgba(0,255,65,.09); }

/* ── 破坏性反馈关键帧 ── */
@keyframes cy-impact { 0%{ transform:scale(1) } 16%{ transform:scale(1.6); filter:brightness(3) saturate(2); text-shadow:-4px 0 #FF003C, 4px 0 #00BFFF, 0 0 32px currentColor } 40%{ transform:scale(.9) } 62%{ transform:scale(1.16) } 100%{ transform:scale(1); filter:none } }
@keyframes cy-shake  { 0%,100%{ transform:translate(0) } 10%{ transform:translate(-5px,2px) } 20%{ transform:translate(6px,-3px) } 30%{ transform:translate(-7px,1px) } 40%{ transform:translate(5px,3px) } 50%{ transform:translate(-4px,-2px) } 60%{ transform:translate(6px,1px) } 70%{ transform:translate(-5px,2px) } 80%{ transform:translate(4px,-1px) } 90%{ transform:translate(-3px,1px) } }
@keyframes cy-flashout { 0%{ opacity:.92 } 100%{ opacity:0 } }
@keyframes cy-sparkout { 0%{ transform:translate(-50%,-50%) scale(.2); opacity:.95 } 100%{ transform:translate(-50%,-50%) scale(2.6); opacity:0 } }

/* 数据冲击升级 (cy-pop 更暴力: 残影色散) */
@keyframes cy-pop { 0%{ transform:scale(1) } 24%{ transform:scale(1.42); filter:brightness(2.8) saturate(1.8); text-shadow:-2px 0 #FF003C, 2px 0 #00BFFF, 0 0 24px currentColor } 60%{ transform:scale(.95) } 100%{ transform:scale(1); filter:none } }
.cy-impact { animation: cy-impact .6s cubic-bezier(.2,.85,.2,1) !important; }

/* 全屏冲击层 (#cyImpact, cyber.js) — RGB 径向爆闪 */
#cyImpact { position:fixed; inset:0; pointer-events:none; z-index:9500; opacity:0;
  background:radial-gradient(ellipse at center, rgba(0,255,65,.20), rgba(0,191,255,.07) 40%, transparent 70%); }
#cyImpact.on { animation: cy-flashout .5s ease-out; }
#cyImpact.crit { background:radial-gradient(ellipse at center, rgba(255,0,60,.30), rgba(0,191,255,.12) 45%, transparent 72%); }

/* 震屏 (body.cy-quake) */
.cy-quake { animation: cy-shake .5s cubic-bezier(.36,.07,.19,.97) both; }

/* 点击火花 (.cy-spark, cyber.js 在点击点生成) */
.cy-spark { position:fixed; width:40px; height:40px; pointer-events:none; z-index:9600; border:1px solid var(--c-matrix); border-radius:50%; box-shadow:0 0 20px rgba(0,255,65,.75); animation: cy-sparkout .42s ease-out forwards; }

/* ════════════════════════════════════════════════════════════════════════
   T1 — RITUAL LAYER // 事件仪式引擎 (结算审判 / 铸造 / 开枪) — 由 cyber.js YEA_FX 驱动
   原则: 基线不加噪, 全部为「事件触发 → 有限时长」的爆发动效。仅 transform/opacity/filter。
   ════════════════════════════════════════════════════════════════════════ */
@keyframes cy-rainfall     { 0%{ transform:translateY(-10vh) } 6%{ opacity:1 } 92%{ opacity:.9 } 100%{ transform:translateY(112vh); opacity:0 } }
@keyframes cy-stamp-in     { 0%{ transform:scale(3.2) rotate(-14deg); opacity:0 } 55%{ transform:scale(.9) rotate(-8deg); opacity:1 } 74%{ transform:scale(1.08) rotate(-8deg) } 100%{ transform:scale(1) rotate(-8deg); opacity:1 } }
@keyframes cy-verdict-in   { 0%{ opacity:0 } 100%{ opacity:1 } }
@keyframes cy-crt-collapse { 0%{ transform:scaleY(1); filter:none } 68%{ transform:scaleY(.01); filter:brightness(3.2) } 100%{ transform:scaleY(.002) scaleX(0); filter:brightness(6) } }
@keyframes cy-recoil       { 0%{ transform:translateY(0) } 30%{ transform:translateY(3px) scale(.95) } 62%{ transform:translateY(-2px) scale(1.04) } 100%{ transform:none } }

/* 全屏审判覆盖层 (#cyVerdict, cyber.js YEA_FX.verdict 动态构建) */
#cyVerdict { position:fixed; inset:0; z-index:9800; display:flex; flex-direction:column; align-items:center;
  justify-content:center; text-align:center; cursor:pointer; font-family:var(--font);
  background:rgba(0,0,0,.9); animation:cy-verdict-in .16s ease-out; will-change:transform; }
#cyVerdict.loss { background:radial-gradient(ellipse at center, rgba(255,0,60,.16), rgba(0,0,0,.94) 72%); }
#cyVerdict.closing { animation:cy-crt-collapse .3s ease-in forwards; transform-origin:center; }
#cyVerdict .cv-head  { font-size:12px; letter-spacing:.5em; color:var(--t-dim); text-transform:uppercase; }
#cyVerdict .cv-main  { font-size:clamp(30px, 9vw, 52px); font-weight:900; letter-spacing:.14em; margin:16px 0 8px; text-transform:uppercase; }
#cyVerdict.win  .cv-main { color:var(--c-gold);  text-shadow:0 0 16px currentColor, 0 0 42px currentColor; animation:cy-neon 1.3s ease-in-out infinite; }
#cyVerdict.loss .cv-main { color:var(--c-blood); text-shadow:0 0 14px currentColor, 0 0 34px currentColor;
  border:3px solid var(--c-blood); padding:8px 26px; box-shadow:0 0 30px rgba(255,0,60,.55), inset 0 0 18px rgba(255,0,60,.25);
  animation:cy-stamp-in .5s cubic-bezier(.2,.85,.25,1) both; }
#cyVerdict .cv-amount { font-size:clamp(22px, 6vw, 34px); font-weight:900; color:var(--c-cpt);
  text-shadow:0 0 14px rgba(230,255,102,.7), 0 0 32px rgba(230,255,102,.4); min-height:1.2em; }
#cyVerdict.loss .cv-amount { color:var(--c-blood); text-shadow:0 0 12px rgba(255,0,60,.6); }
#cyVerdict .cv-title { margin-top:12px; font-size:11px; color:var(--t-dim); letter-spacing:.12em; max-width:80vw;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#cyVerdict .cv-hint  { position:absolute; bottom:6vh; font-size:9px; color:#555; letter-spacing:.34em; animation:cy-pulse 1.6s infinite; }

/* 战利品字符雨 (YEA_FX.glyphRain 生成) */
.cy-rain-glyph { position:fixed; top:0; z-index:9790; pointer-events:none; font-family:var(--font); font-weight:900;
  text-shadow:0 0 10px currentColor, 0 0 22px currentColor; animation:cy-rainfall linear forwards; will-change:transform, opacity; }

/* 机械上膛位移 (YEA_FX.recoil) + 数据解码滚动残影 (YEA_FX.slotRoll 期间) */
.cy-recoil { animation:cy-recoil .22s cubic-bezier(.3,.7,.3,1) !important; }
.cy-rolling { filter:brightness(1.7) saturate(1.4); text-shadow:0 0 12px currentColor, 2px 0 #FF003C, -2px 0 #00BFFF; }

/* ════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY VALVE — prefers-reduced-motion (前庭安全阀, 全局唯一开关)
   开启减动效的设备: 所有动画压缩至单帧终态 (视觉信息保留, 运动剥离), CRT 胶片
   与字符雨整层关闭。多巴胺是给要它的人; 不要它的人拿到的是冷静终端。
   ════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  #cyFx, .cy-rain-glyph { display: none !important; }
  body.cy-quake { animation: none !important; }
}
