/* =========================================================
   VENOMVERSE MOBILE — 移动优先单页游戏样式
   设计调性：Cyberpunk Neon（与电脑版 colors_and_type.css 同族）
   60% 深紫墨底 / 30% 霓虹面板 / 10% 紫主 + 青 info + 粉 destructive
   零 CDN / 零外部字体 / 全部触控目标 >= 44px
   ========================================================= */

:root {
  /* 语义令牌 —— 对齐电脑版 --venom-* */
  --ink:        #070512;   /* background */
  --ink-2:      #0d0a1c;   /* 次级底 */
  --panel:      #120d26;   /* card */
  --panel-2:    #1a1333;   /* popover */
  --panel-3:    #2d1f52;   /* accent */
  --line:       rgba(167, 139, 250, .18);
  --line-soft:  rgba(167, 139, 250, .10);
  --venom:      #a78bfa;   /* primary 紫 */
  --venom-dark: #7c3aed;   /* primary-600 */
  --cyan:       #22d3ee;   /* info */
  --magenta:    #ec4899;   /* destructive 粉 */
  --gold:       #f59e0b;   /* warning */
  --violet:     #c4b5fd;   /* primary-300 浅紫文字 */
  --text:       #e8e4f5;   /* foreground */
  --muted:      #8b85a8;   /* muted-foreground */
  --dim:        #5b5278;   /* 派生深紫灰 */
  --danger:     #ec4899;   /* 与 destructive 统一 */

  /* 稀有度色 —— 与 state 色同源，家族一致 */
  --r-common:    #9aa3bd;
  --r-uncommon:  #10b981;
  --r-rare:      #22d3ee;
  --r-epic:      #a78bfa;
  --r-legendary: #f59e0b;
  --r-mythic:    #ec4899;

  /* 发光 & 渐变 token —— 对齐 colors_and_type.css */
  --glow-primary: 0 0 20px rgba(167, 139, 250, .35);
  --glow-cyan:    0 0 20px rgba(34, 211, 238, .30);
  --glow-pink:    0 0 20px rgba(236, 72, 153, .30);
  --glow-green:   0 0 20px rgba(16, 185, 129, .30);
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --grad-cyan:    linear-gradient(135deg, #22d3ee 0%, #8b5cf6 100%);
  --grad-radial:  radial-gradient(ellipse at top, #1a0f3d 0%, #070512 60%);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --topbar-h: 96px;
  --tabbar-h: 60px;

  /* 字体：零 CDN 模拟 Orbitron / JetBrains Mono 气质 */
  --display: 'Orbitron','Bahnschrift','DIN Alternate','Arial Narrow',Impact,'PingFang SC',sans-serif;
  --body: 'Inter','Noto Sans SC','PingFang SC','Microsoft YaHei',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --mono: 'JetBrains Mono','SFMono-Regular',Consolas,'Roboto Mono',ui-monospace,'Courier New',monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(120% 55% at 50% -10%, rgba(139, 92, 246, .16), transparent 62%),
    radial-gradient(90% 40% at 100% 100%, rgba(236, 72, 153, .08), transparent 65%),
    var(--ink);
}

/* 噪点质感：内联 SVG，零外部请求，消除塑料感 */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button, input, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }

::-webkit-scrollbar { width: 0; height: 0; }
html { scrollbar-width: none; }

/* ---------- 应用外壳 ---------- */
#app {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  isolation: isolate;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0, 0, 0, .7);
}

#app::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, .030) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, .030) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 70%);
}

/* CRT 扫描线：极细水平线 + 缓慢呼吸位移 */
#app::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  opacity: .35;
  animation: scanDrift 8s linear infinite;
}
@keyframes scanDrift { from { background-position-y: 0 } to { background-position-y: 24px } }

/* ---------- 顶栏 ---------- */
#topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
  padding: calc(var(--safe-t) + 8px) calc(12px + var(--safe-r)) 8px calc(12px + var(--safe-l));
  background: linear-gradient(180deg, rgba(7, 10, 11, .98), rgba(7, 10, 11, .88));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.top-row { display: flex; align-items: center; gap: 10px; min-height: 36px; }

.brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }

.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 30px;
  font-family: var(--display); font-size: 21px; line-height: 1;
  color: var(--ink);
  background: var(--venom);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  box-shadow: 0 0 18px rgba(167, 139, 250, .45);
}

.brand-name {
  font-family: var(--display);
  font-size: 18px;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-name span { color: var(--venom); }

.top-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  font-size: 16px;
  color: var(--text);
}
.icon-btn:active { background: rgba(167, 139, 250, .14); transform: scale(.94); }
.icon-btn[hidden] { display: none; }

.resources {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.res {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
}
.res i { font-style: normal; font-size: 12px; }
.res b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.res[data-k="paxi"] { border-color: rgba(255, 193, 77, .28); color: var(--gold); }
.res[data-k="fang"] { border-color: rgba(34, 211, 238, .28); color: var(--cyan); }
.res[data-k="neon"] { border-color: rgba(168, 139, 255, .28); color: var(--violet); }
.res[data-k="void"] { border-color: rgba(236, 72, 153, .28); color: var(--magenta); }

/* ---------- 主视图 ---------- */
#view {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  padding: 14px 12px calc(var(--tabbar-h) + var(--safe-b) + 26px);
  animation: viewIn .26s ease both;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- 底部导航 ---------- */
#tabbar {
  position: fixed;
  z-index: 45;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding: 0 max(4px, var(--safe-l)) var(--safe-b) max(4px, var(--safe-r));
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: linear-gradient(180deg, rgba(11, 17, 19, .96), rgba(7, 10, 11, .99));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}

.tab {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 2px;
  min-height: var(--tabbar-h);
  color: var(--dim);
  transition: color .18s;
}
.tab .ti { font-size: 19px; line-height: 1; filter: grayscale(1); opacity: .7; transition: .18s; }
.tab .tl { font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.tab.active { color: var(--venom); }
.tab.active .ti { filter: none; opacity: 1; transform: translateY(-2px); }
.tab.active::before {
  content: '';
  position: absolute; top: 0; left: 24%; right: 24%; height: 2px;
  background: var(--venom);
  box-shadow: 0 0 12px var(--venom);
}
.tab:active { background: rgba(167, 139, 250, .06); }

/* ---------- 通用区块 ---------- */
.section { margin-bottom: 20px; }
.sec-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.sec-head::before {
  content: ''; width: 3px; height: 16px; flex: 0 0 3px;
  background: var(--venom); box-shadow: 0 0 10px rgba(167, 139, 250, .6);
}
.sec-title {
  font-family: var(--display);
  font-size: 17px; letter-spacing: .08em;
  flex: 1;
}
.sec-more {
  font-size: 11px; color: var(--muted);
  padding: 6px 2px;
}
.sec-more:active { color: var(--venom); }

.panel {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(23, 36, 38, .92), rgba(11, 17, 19, .95));
  overflow: hidden;
}
.panel-pad { padding: 14px; }

.hairline { height: 1px; background: var(--line-soft); margin: 12px 0; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.venom { color: var(--venom); }
.cyan { color: var(--cyan); }
.gold { color: var(--gold); }
.magenta { color: var(--magenta); }
.small { font-size: 11px; }
.tiny { font-size: 10px; }
.bold { font-weight: 800; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .03em;
  border: 1px solid transparent;
  transition: transform .12s, filter .12s, background .12s;
}
.btn:active { transform: scale(.97); filter: brightness(1.12); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-primary {
  background: var(--grad-primary); color: #fff;
  box-shadow: 0 6px 22px rgba(139, 92, 246, .32);
}
.btn-cyan { background: rgba(34, 211, 238, .16); color: var(--cyan); border-color: rgba(34, 211, 238, .4); }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--text); border-color: var(--line); }
.btn-danger { background: rgba(236, 72, 153, .13); color: #f9a8d4; border-color: rgba(236, 72, 153, .38); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 11px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }

/* ---------- Hero（难忘元素：毒液脉冲 + 巨型 V 水印） ---------- */
.hero {
  position: relative;
  min-height: 226px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, .22);
  background:
    radial-gradient(85% 70% at 78% 22%, rgba(34, 211, 238, .20), transparent 62%),
    radial-gradient(70% 80% at 15% 95%, rgba(167, 139, 250, .14), transparent 60%),
    linear-gradient(135deg, #0d1818, #070b0d 72%);
  margin-bottom: 18px;
}
.hero::before {
  content: 'V';
  position: absolute; right: -6px; top: -54px;
  font-family: var(--display);
  font-size: 250px; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(167, 139, 250, .22);
  transform: rotate(-8deg);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 4px);
  opacity: .5; pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; padding: 18px 16px 16px; height: 100%; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 20px;
  border: 1px solid rgba(167, 139, 250, .35);
  background: rgba(167, 139, 250, .08);
  color: var(--venom); font-size: 10px; font-weight: 800; letter-spacing: .1em;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 10vw, 50px);
  line-height: .98;
  letter-spacing: .02em;
  margin-top: 12px;
  text-transform: uppercase;
  text-shadow: 0 0 26px rgba(167, 139, 250, .25);
}
.hero h1 em {
  font-style: normal;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(167, 139, 250, .45));
}
.hero p { margin-top: 8px; font-size: 11px; color: #b9cbc4; max-width: 230px; }
.hero-cta { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.hero-snake {
  position: absolute; z-index: 1;
  right: -18px; bottom: -14px;
  width: 170px; height: 170px;
  object-fit: cover;
  border-radius: 50%;
  opacity: .82;
  mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 74%);
  animation: float 5s ease-in-out infinite;
}
.hero-ring {
  position: absolute; z-index: 1;
  right: 12px; bottom: 34px;
  width: 128px; height: 128px;
  border: 1px solid rgba(167, 139, 250, .35);
  border-radius: 50%;
  animation: pulseRing 3.2s ease-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes pulseRing {
  0%   { transform: scale(.72); opacity: .8; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* ---------- 快捷入口 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 76px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
  font-size: 11px; font-weight: 700;
}
.quick .qi {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-size: 17px;
  background: rgba(167, 139, 250, .08);
}
.quick:active { background: rgba(167, 139, 250, .12); transform: scale(.96); }

/* ---------- 数据条 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  padding: 10px 8px; border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .02);
  text-align: center;
}
.stat b { display: block; font-family: var(--display); font-size: 22px; letter-spacing: .04em; color: var(--text); }
.stat span { font-size: 10px; color: var(--muted); }

/* ---------- 分段筛选 ---------- */
.segment {
  display: flex; gap: 6px;
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .025);
  margin-bottom: 12px;
  overflow-x: auto;
}
.seg {
  flex: 1 0 auto;
  min-width: 52px; min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.seg.active { background: var(--venom); color: #0b1005; }

/* ---------- 横向选择区 ---------- */
.hscroll {
  display: flex; gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.hcard { flex: 0 0 146px; scroll-snap-align: start; }
.hcard .snake-card { height: 100%; }
.arena-pick {
  flex: 0 0 122px; scroll-snap-align: start;
  border-radius: 11px; overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--panel); text-align: left;
}
.arena-pick img { width: 100%; height: 66px; object-fit: cover; opacity: .75; }
.arena-pick span { display: block; padding: 7px 8px; font-size: 11px; font-weight: 700; }
.arena-pick.active { border-color: var(--venom); box-shadow: 0 0 0 1px var(--venom) inset; }
.arena-pick.active span { color: var(--venom); }
.fighter-pick {
  flex: 0 0 88px; scroll-snap-align: start;
  border-radius: 11px; overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--panel); text-align: center; padding-bottom: 6px;
}
.fighter-pick img { width: 100%; height: 76px; object-fit: cover; }
.fighter-pick span, .fighter-pick small { display: block; font-size: 10px; font-weight: 800; margin-top: 3px; }
.fighter-pick small { color: var(--muted); font-family: var(--mono); font-weight: 400; margin-top: 0; }
.fighter-pick.active { border-color: var(--venom); box-shadow: 0 0 0 1px var(--venom) inset; }

/* 高稀有度霓虹光环（epic+ 常驻，与电脑版一致） */
.snake-card.tier-high {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--r) 55%, transparent),
              0 0 18px color-mix(in srgb, var(--r) 28%, transparent);
}

/* ---------- 蛇卡片（2 列） ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.snake-card {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--r) 45%, transparent);
  background: var(--panel);
  text-align: left;
  width: 100%;
}
.snake-card:active { transform: scale(.97); }
.snake-card .thumb {
  position: relative;
  width: 100%; aspect-ratio: 1 / .86;
  background: #0b1212;
  overflow: hidden;
}
.snake-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.snake-card .thumb::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7, 10, 11, .92), transparent 55%);
}
.rar-tag {
  position: absolute; z-index: 2; top: 7px; left: 7px;
  padding: 3px 7px; border-radius: 5px;
  background: color-mix(in srgb, var(--r) 22%, #070512);
  border: 1px solid color-mix(in srgb, var(--r) 60%, transparent);
  color: var(--r); font-size: 9px; font-weight: 800; letter-spacing: .06em;
}
.id-tag {
  position: absolute; z-index: 2; top: 7px; right: 7px;
  font-family: var(--mono); font-size: 9px; color: #c8d8d2;
  background: rgba(0, 0, 0, .55); padding: 3px 5px; border-radius: 5px;
}
.snake-card .meta { position: relative; padding: 8px 9px 10px; }
.snake-card .nm { font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snake-card .sub { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--muted); }
.lv-badge { color: var(--venom); font-family: var(--mono); font-weight: 700; }
.card-grid .empty { grid-column: 1 / -1; }

/* ---------- 蛋卡 ---------- */
.egg-card {
  border-radius: 13px; padding: 12px 8px;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--r) 40%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--r) 10%, #10191b), #0b1113);
}
.egg-card img { width: 74px; height: 74px; object-fit: contain; margin: 0 auto 8px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--r) 30%, transparent)); }
.egg-card .en { font-size: 12px; font-weight: 800; }
.egg-card .ec { margin: 4px 0 8px; font-size: 10px; color: var(--muted); min-height: 28px; }
.egg-card .own { font-size: 10px; color: var(--r); font-family: var(--mono); }

/* ---------- 战斗 ---------- */
.arena-banner {
  position: relative; height: 130px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.arena-banner img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.arena-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, #070512, transparent 70%);
}
.arena-banner .ab-txt { position: absolute; z-index: 2; left: 14px; bottom: 10px; }
.arena-banner .ab-txt b { display: block; font-family: var(--display); font-size: 21px; letter-spacing: .06em; }
.arena-banner .ab-txt span { font-size: 10px; color: var(--cyan); }

.fighters { display: grid; grid-template-columns: 1fr 28px 1fr; gap: 4px; align-items: center; margin-bottom: 12px; }
.fighter {
  border: 1px solid color-mix(in srgb, var(--r) 45%, transparent);
  border-radius: 13px; overflow: hidden; background: var(--panel);
}
.fighter .fpic { height: 92px; position: relative; overflow: hidden; }
.fighter .fpic img { width: 100%; height: 100%; object-fit: cover; }
.fighter .fpic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,10,11,.9), transparent 60%); }
.fighter .fname { position: absolute; z-index: 2; bottom: 5px; left: 7px; font-size: 10px; font-weight: 800; }
.fighter .finfo { padding: 7px 8px 9px; }
.hpbar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 5px 0; }
.hpbar i { display: block; height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--venom-dark), var(--venom)); transition: width .38s ease; }
.hpbar.low i { background: linear-gradient(90deg, #b52020, var(--danger)); }
.hpnum { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9px; color: var(--muted); }
.vs-mark { text-align: center; font-family: var(--display); font-size: 17px; color: var(--magenta); text-shadow: 0 0 12px rgba(236,72,153,.7); }

.battle-log {
  height: 132px; overflow-y: auto;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, .4);
  font-family: var(--mono); font-size: 10px; line-height: 1.7;
}
.battle-log div { color: var(--muted); }
.battle-log b { color: var(--venom); }
.battle-log .enemy b { color: var(--magenta); }
.battle-log .sys { color: var(--cyan); }

.skill-bar {
  display: flex; gap: 6px;
  overflow-x: auto; padding: 2px 0 6px;
  scroll-snap-type: x proximity;
}
.skill {
  flex: 0 0 62px;
  min-height: 62px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 9px; text-align: center; color: var(--muted);
  scroll-snap-align: start;
}
.skill i { font-style: normal; font-size: 19px; }
.skill-ico { font-style: normal; width: 26px; height: 26px; display: block; border-radius: 7px; overflow: hidden; border: 1px solid var(--line); }
.skill-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.skill.active { border-color: var(--venom); color: var(--venom); background: rgba(167, 139, 250, .09); }
.skill:disabled { opacity: .4; }

/* ---------- 商店条目 ---------- */
.shop-item {
  display: flex; gap: 10px; align-items: center;
  padding: 10px; border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .025);
  margin-bottom: 8px;
}
.shop-item img, .shop-item .emoji {
  width: 52px; height: 52px; flex: 0 0 52px;
  border-radius: 10px; object-fit: cover;
  display: grid; place-items: center; font-size: 26px;
  background: rgba(167, 139, 250, .06);
}
.shop-item .sname { font-size: 12px; font-weight: 800; }
.shop-item .sdesc { font-size: 10px; color: var(--muted); margin: 2px 0 6px; }
.price { font-family: var(--mono); font-size: 11px; font-weight: 800; color: var(--gold); }

/* ---------- 底部抽屉 ---------- */
#sheet-root:empty { display: none; }
.sheet-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
  animation: fadeIn .2s ease both;
}
.sheet {
  position: fixed; z-index: 81;
  left: 50%; bottom: 0; transform: translateX(-50%);
  width: 100%; max-width: 560px;
  max-height: 88dvh;
  display: flex; flex-direction: column;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: linear-gradient(180deg, #142021, #080d0e);
  box-shadow: 0 -16px 50px rgba(0, 0, 0, .6);
  animation: sheetUp .28s cubic-bezier(.22, 1, .36, 1) both;
  padding-bottom: var(--safe-b);
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes sheetUp { from { transform: translate(-50%, 100%) } to { transform: translate(-50%, 0) } }
.sheet-bar { width: 38px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.2); margin: 9px auto 4px; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 16px 10px; border-bottom: 1px solid var(--line-soft); flex: 0 0 auto; }
.sheet-head h3 { font-family: var(--display); font-size: 18px; letter-spacing: .06em; flex: 1; }
.sheet-body { overflow-y: auto; padding: 14px 16px 22px; -webkit-overflow-scrolling: touch; }
.sheet-close { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.05); color: var(--muted); }

/* 详情属性条 */
.attr-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; font-size: 11px; }
.attr-row span { width: 30px; color: var(--muted); font-family: var(--mono); }
.attr-row .track { flex: 1; height: 6px; border-radius: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.attr-row .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--venom)); }
.attr-row b { width: 34px; text-align: right; font-family: var(--mono); }

.gene-chip {
  display: inline-block; padding: 5px 8px; margin: 0 5px 6px 0;
  border-radius: 7px; border: 1px solid var(--line-soft);
  background: rgba(255,255,255,.03); font-size: 10px; color: #bcd0c8;
}

/* ---------- Toast ---------- */
#toast-root {
  position: fixed; z-index: 100;
  top: calc(var(--safe-t) + 104px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 86vw;
  pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: 10px;
  background: rgba(12, 22, 22, .96);
  border: 1px solid var(--venom);
  color: var(--venom);
  font-size: 12px; font-weight: 700; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: toastIn .25s ease both;
}
.toast.err { border-color: var(--danger); color: #ff9a9a; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) } to { opacity: 1; transform: none } }

/* ---------- 开箱动画 ---------- */
.reveal-stage { min-height: 260px; display: grid; place-items: center; position: relative; overflow: hidden; }
.reveal-stage img {
  width: 190px; height: 190px; object-fit: cover; border-radius: 18px;
  border: 2px solid var(--r, var(--venom));
  box-shadow: 0 0 40px color-mix(in srgb, var(--r) 45%, transparent);
  animation: revealPop .55s cubic-bezier(.2,1.5,.4,1) both;
}
.reveal-stage::before {
  content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--r) 32%, transparent), transparent 68%);
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes revealPop { from { opacity: 0; transform: scale(.3) rotate(-15deg) } to { opacity: 1; transform: none } }

/* ---------- 列表行 ---------- */
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 10px;
  border-bottom: 1px solid var(--line-soft);
  min-height: 52px;
}
.list-row:last-child { border-bottom: 0; }
.list-row .lr-ico { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: rgba(167,139,250,.07); display: grid; place-items: center; font-size: 17px; }
.list-row .lr-title { font-size: 12px; font-weight: 700; }
.list-row .lr-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }
.list-row .lr-val { font-family: var(--mono); font-size: 11px; color: var(--venom); }
.list-row.done .lr-val { color: var(--muted); }

/* ---------- 桌面预览：手机框 ---------- */
@media (min-width: 700px) {
  body {
    background:
      radial-gradient(60% 60% at 50% 0%, rgba(167,139,250,.10), transparent 70%),
      repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 12px),
      #050708;
  }
  #app { margin: 18px auto; min-height: calc(100dvh - 36px); border: 1px solid var(--line); border-radius: 24px; }
  #tabbar { bottom: 18px; border-radius: 0 0 24px 24px; }
  .sheet { bottom: 18px; border-radius: 20px 20px 18px 18px; }
}

@media (max-width: 350px) {
  .brand-name { font-size: 15px; }
  .res { font-size: 10px; gap: 2px; }
  .quick { min-height: 68px; font-size: 10px; }
  .tab .tl { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== M5：顶栏钱包按钮（三国风格：连接/短地址） ===== */
.icon-btn.wallet-btn {
  width: auto;
  min-width: 36px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  color: var(--ink);
}
.icon-btn.wallet-btn[aria-label^='钱包'] { color: var(--cyan); border-color: rgba(34, 211, 238, .4); }

/* ===== M5：钱包页 ===== */
.wallet-hero { border: 1px solid rgba(167, 139, 250, .25); }
.wallet-hero .mono { font-family: ui-monospace, monospace; }
#w-addr-full { font-size: 9px; word-break: break-all; opacity: .75; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
