/* =========================================================
   孤独的公路 · Lonely Highway — 像素风样式表 v3
   设计 token 统一在这里；字体：Fusion Pixel Font (OFL-1.1)
   ========================================================= */

@font-face {
  font-family: "Fusion Pixel";
  src: url("../assets/fonts/fusion-pixel-12px-proportional-zh_hans-subset.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 底色与面板 */
  --bg: #0a0b11;
  --bg-deep: #06070c;
  --panel: #14121f;
  --panel-2: #1b1830;
  --panel-3: #221e3c;
  --line: #3b3757;
  --line-soft: #2a2740;
  /* 文本 */
  --text: #e9e7f2;
  --muted: #8d89a8;
  --faint: #5d5978;
  /* 语义色 */
  --gold: #ffc857;
  --gold-deep: #b8860b;
  --cyan: #7ce6c3;
  --sky: #7ce0ff;
  --rose: #ff5a5f;
  --danger: #ff6b6e;
  /* 像素硬阴影 */
  --sh-1: 2px 2px 0 rgba(0, 0, 0, 0.5);
  --sh-2: 3px 3px 0 rgba(0, 0, 0, 0.55);
  --sh-3: 6px 6px 0 rgba(0, 0, 0, 0.5);
  --font-pixel: "Fusion Pixel", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性优先级最高（否则会被 display:flex 之类的规则盖掉） */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 5px 5px;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: none;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: #22180a; }

/* =============== 统一图标 =============== */
.i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.i svg {
  width: 1em;
  height: 1em;
  display: block;
  shape-rendering: crispEdges;
}

/* =============== 页面骨架 =============== */
.page {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  min-height: 100dvh;
  padding: 8px 12px 0;
  gap: 8px;
}

/* =============== 顶栏 =============== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 2px 2px;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand-ic { font-size: 24px; color: var(--gold); filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.6)); }

.brand-title {
  font-size: 24px;
  font-weight: normal;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.7);
}

.brand-en {
  font-size: 12px;
  letter-spacing: 4px;
  color: var(--faint);
  margin-top: 3px;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: #cfcbe4;
  border: 2px solid var(--line);
  box-shadow: var(--sh-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}
.icon-btn svg { shape-rendering: crispEdges; }
.icon-btn:hover { background: #262247; color: #fff; border-color: #4a4570; }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.icon-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.icon-btn.muted { color: var(--faint); }
.icon-btn.muted #sound-off-marks { opacity: 1; }
#sound-off-marks { opacity: 0; }

.icon-btn-sm { width: 26px; height: 26px; box-shadow: var(--sh-1); }
.icon-btn-sm:active { transform: translate(2px, 2px); }

.lang-btn {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
  font-size: 12px;
  letter-spacing: 1px;
}

/* =============== 广告位 =============== */
.ad-slot { position: relative; min-height: 64px; }

.ad-ph {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 2px dashed var(--line-soft);
  background: rgba(20, 18, 31, 0.45);
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 3px;
}

.ad-ph::before {
  content: "";
  width: 14px;
  height: 14px;
  background:
    linear-gradient(45deg, transparent 46%, var(--faint) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--faint) 46% 54%, transparent 54%);
  opacity: 0.7;
}

.ad-slot-inline .ad-ph { min-height: 90px; }

/* ---- 左右对联广告位（桌面宽屏显示，参考稿分布） ---- */
.ad-side {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  min-height: 600px;
  display: none;              /* 空槽 / 窄屏时隐藏 */
  z-index: 5;
}
.ad-side-left { left: 16px; }
.ad-side-right { right: 16px; }
.ad-side .ad-ph { min-height: 600px; }

@media (min-width: 1220px) {
  .ad-side.has-ad { display: block; }
}

/* ---- 底部悬浮锚定广告条（可收起） ---- */
.anchor-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  background: rgba(10, 9, 17, 0.92);
  border-top: 2px solid var(--line-soft);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55);
  z-index: 98;
  padding: 6px 44px 6px 10px;
}
.anchor-bar[hidden] { display: none; }
.anchor-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 970px;
  margin: 0 auto;
  min-height: 60px;
}
.anchor-slot .ad-ph { width: 100%; min-height: 60px; }
.anchor-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: #cfcbe4;
  border: 2px solid var(--line);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.anchor-close:hover { color: #fff; background: #262247; }
/* 锚定条显示时给页面底部留出空间 */
body.anchor-on { padding-bottom: 84px; }
/* 锚定条显示时同意条上移，避免重叠 */
body.anchor-on .consent-bar { bottom: 96px; }

/* =============== 舞台 =============== */
.stage {
  position: relative;
  flex: 1;
  min-height: 420px;
  max-height: 900px;
  background: var(--bg-deep);
  border: 3px solid var(--line-soft);
  box-shadow:
    0 0 0 3px #0e0c18,
    0 22px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

#game {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

/* CRT 扫描线 */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.3;
}

/* =============== 浮动飘字 =============== */
.float-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }

.float-item {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: var(--gold);
  text-shadow: 2px 2px 0 #000;
  white-space: nowrap;
  animation: float-up 0.9s steps(9) forwards;
}
.float-item.bad { color: #ff8b8e; }
.float-item.shield { color: var(--cyan); }

@keyframes float-up {
  0%   { opacity: 1; margin-top: 0; }
  100% { opacity: 0; margin-top: -40px; }
}

/* =============== 头顶标签（车牌 / 气泡） =============== */
.label-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }

.car-label {
  position: absolute;
  left: 0; top: 0;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  will-change: transform;
}

.plate-chip {
  font-size: 12px;
  line-height: 1.3;
  color: #cfcbe4;
  background: rgba(10, 10, 18, 0.72);
  border: 1px solid var(--line);
  padding: 1px 6px;
  white-space: nowrap;
}
.plate-chip.mine { border-color: var(--gold-deep); color: var(--gold); }

.bubble {
  font-size: 12px;
  line-height: 1.3;
  color: #1b1305;
  background: var(--gold);
  border: 2px solid #6d4f00;
  padding: 2px 8px;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--sh-1);
}

/* =============== 提示条 =============== */
.toast-layer {
  position: absolute;
  top: 54px;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  z-index: 9;
}

.toast {
  font-size: 12px;
  color: var(--text);
  background: rgba(20, 18, 31, 0.94);
  border: 2px solid var(--line);
  border-left-width: 4px;
  padding: 4px 12px 4px 10px;
  box-shadow: var(--sh-2);
  animation: toast-in 0.18s steps(3) both, toast-out 0.3s steps(3) 2.6s both;
}
.toast.bad { border-color: #8a3742; color: #ffb3b6; }
.toast.shield { border-color: #1d6b7a; color: #aeeaff; }

@keyframes toast-in { from { opacity: 0; margin-top: -10px; } to { opacity: 1; margin-top: 0; } }
@keyframes toast-out { to { opacity: 0; } }

/* =============== HUD =============== */
.hud {
  position: absolute;
  inset: 10px 12px auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 7;
}
.stage[data-state="playing"] .hud { opacity: 1; }

.hud-left { display: flex; flex-direction: column; gap: 3px; }

.score-line {
  font-size: 24px;
  line-height: 1.1;
  color: #fff;
  text-shadow: 2px 2px 0 #000;
}
.score-line em { font-style: normal; font-size: 12px; color: #cfcbe4; margin-left: 3px; }

.speed-line { display: flex; align-items: center; gap: 7px; }
.speed-line > span:first-child {
  font-size: 12px;
  color: #a8a4c0;
  text-shadow: 1px 1px 0 #000;
  min-width: 62px;
}
.speed-bar {
  width: 64px;
  height: 6px;
  border: 1px solid rgba(233, 231, 242, 0.35);
  background: rgba(10, 10, 18, 0.6);
  padding: 1px;
}
.speed-bar b {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
}
.speed-bar b.max { background: var(--rose); }

.hp-row { display: flex; gap: 4px; margin-top: 3px; align-items: center; font-size: 12px; }
.hp-row .hp svg { width: 1em; height: 1em; display: block; shape-rendering: crispEdges; }
.hp-row .hp { color: var(--rose); transition: color 0.2s; }
.hp-row .hp.off { color: #38344c; }
.hp-row .hp.shield { color: #64e7ff; margin-left: 4px; animation: pulse-soft 1.2s steps(2) infinite; }
.hp-row.hurt { animation: hurt-shake 0.4s steps(4); }

@keyframes hurt-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
@keyframes pulse-soft { 50% { opacity: 0.55; } }

.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hud-best { font-size: 12px; color: #cfcbe4; text-shadow: 1px 1px 0 #000; }
.hud-net {
  font-size: 12px;
  color: #aeeaff;
  background: rgba(10, 10, 18, 0.6);
  border: 1px solid #1d6b7a;
  padding: 1px 7px;
}
.hud-pause { pointer-events: auto; }

/* =============== 道具栏（固定四格） =============== */
.hud-items {
  position: absolute;
  left: 12px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 7;
  opacity: 0;
  transition: opacity 0.25s;
}
.stage[data-state="playing"] .hud-items { opacity: 1; }

.slot {
  width: 34px;
  height: 34px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #4a4666;
  background: rgba(20, 18, 31, 0.72);
  border: 2px solid var(--line-soft);
  box-shadow: var(--sh-1);
  transition: color 0.15s, border-color 0.15s;
}
.slot b {
  position: absolute;
  right: -4px;
  bottom: -6px;
  font-size: 12px;
  font-weight: normal;
  color: #22180a;
  background: var(--gold);
  border: 1px solid #6d4f00;
  padding: 0 3px;
  line-height: 1.4;
}
.slot.on { color: var(--gold); border-color: var(--gold-deep); }
.slot.on-nitro { color: var(--sky); border-color: #2a6a8a; }
.slot.on-shield { color: #64e7ff; border-color: #1d6b7a; }
.slot.on-rev { color: var(--gold); border-color: var(--gold); animation: pulse-soft 1s steps(2) infinite; }

.slot .tag {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #aeeaff;
  background: rgba(10, 10, 18, 0.8);
  border: 1px solid #1d6b7a;
  padding: 1px 5px;
  white-space: nowrap;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot .tag:empty { display: none; }

/* =============== 战斗按钮 =============== */
.combat-btns {
  position: absolute;
  right: 12px;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 8;
}

.combat-btn {
  width: 50px;
  height: 50px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(20, 18, 31, 0.72);
  border: 2px solid rgba(233, 231, 242, 0.3);
  box-shadow: var(--sh-2);
  color: #e9e7f2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding: 0;
}
.combat-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.combat-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.combat-chat { display: flex; }
.stage[data-state="playing"] .combat-fire { display: flex; color: var(--gold); border-color: rgba(255, 200, 87, 0.5); }
.stage[data-state="playing"] .combat-fire.dim { opacity: 0.4; }
.stage[data-state="playing"] .combat-revenge { display: flex; color: #7ce6ff; border-color: rgba(90, 200, 235, 0.6); animation: pulse-soft 1.2s steps(2) infinite; }

/* =============== 聊天面板 =============== */
.chat-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 8px;
  z-index: 11;
  background: rgba(10, 10, 18, 0.94);
  border: 2px solid var(--line);
  padding: 8px;
  box-shadow: var(--sh-3);
}
.chat-panel[hidden] { display: none; }

#chat-input {
  flex: 1;
  min-width: 0;
  background: #0d0c16;
  border: 2px solid var(--line-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
}
#chat-input:focus { border-color: var(--gold); }

/* =============== 触屏控制 =============== */
.touch-controls {
  position: absolute;
  inset: auto 12px 16px;
  display: none;
  justify-content: space-between;
  pointer-events: none;
  z-index: 8;
}
body.touch .stage[data-state="playing"] .touch-controls { display: flex; }

.touch-btn {
  pointer-events: auto;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 18, 31, 0.6);
  border: 2px solid rgba(233, 231, 242, 0.28);
  box-shadow: var(--sh-2);
  color: #e9e7f2;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.touch-btn svg { shape-rendering: crispEdges; }
.touch-btn:active { transform: translate(2px, 2px); box-shadow: none; background: rgba(233, 231, 242, 0.22); }

/* =============== 弹层 =============== */
.overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  background: rgba(8, 8, 15, 0.62);
  z-index: 10;
  overflow-y: auto;
}
.overlay.active { display: flex; animation: overlay-in 0.18s steps(3); }

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.panel {
  width: min(330px, 94%);
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: var(--sh-3);
  padding: 18px 20px;
  margin: auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title {
  font-size: 24px;
  font-weight: normal;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-title .i { font-size: 24px; color: var(--gold); }

.panel-x {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel-2);
  border: 2px solid var(--line);
  cursor: pointer;
  font-family: inherit;
}
.panel-x:hover { color: #fff; border-color: #4a4570; }
.panel-x:active { transform: translate(2px, 2px); }

.panel-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.panel-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.panel-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.panel-note { font-size: 12px; color: var(--faint); margin-top: 10px; }

/* =============== 主菜单 =============== */
.overlay-menu { padding-bottom: 120px; }

.menu-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.menu-kicker { font-size: 12px; letter-spacing: 4px; color: var(--faint); }

.game-title {
  font-size: 48px;
  font-weight: normal;
  letter-spacing: 8px;
  text-indent: 8px;
  color: var(--gold);
  text-shadow:
    -2px 0 0 #000, 2px 0 0 #000, 0 -2px 0 #000, 0 2px 0 #000,
    4px 4px 0 rgba(0, 0, 0, 0.8);
}

.game-sub { font-size: 12px; color: #a8a4c0; max-width: 300px; }

/* 数据卡：最佳 / 星光 / 联机状态 */
.menu-stats {
  display: flex;
  align-items: stretch;
  background: rgba(27, 24, 48, 0.88);
  border: 2px solid var(--line);
  box-shadow: var(--sh-1);
}
.ms-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  color: #cfcbe4;
  border-left: 1px solid var(--line-soft);
}
.ms-item:first-child { border-left: none; }
.ms-item .i { font-size: 12px; color: var(--muted); }
.ms-item .i.star { color: var(--gold); }
.ms-item b { color: var(--gold); font-weight: normal; }
.ms-item em { font-style: normal; color: var(--muted); }
.ms-net { color: #aeeaff; max-width: 200px; }
.ms-net.solo { color: var(--muted); }
.ms-net span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-plate { font-size: 12px; color: var(--muted); }
.menu-plate::before { content: "车号 "; color: var(--faint); }
html[lang="en"] .menu-plate::before { content: "Plate "; }

.menu-name { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.menu-name input {
  width: 132px;
  background: #0d0c16;
  border: 2px solid var(--line-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
}
.menu-name input:focus { border-color: var(--gold); }

.menu-btns { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 2px; }

.btn-garage .i { color: var(--gold); }
.mini-star {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 12px;
  font-weight: normal;
  color: var(--gold);
  background: rgba(255, 200, 87, 0.12);
  border: 1px solid var(--gold-deep);
}
.mini-star .i { font-size: 12px; }

.hint { font-size: 12px; color: var(--faint); max-width: 330px; }

/* 今日路王 */
.menu-top {
  font-size: 12px;
  color: #cfcbe4;
  background: rgba(20, 18, 31, 0.85);
  border: 2px solid var(--line);
  box-shadow: var(--sh-1);
  padding: 8px 14px;
  min-width: 236px;
}
.menu-top-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  letter-spacing: 3px;
}
.menu-top-title .i { font-size: 12px; color: var(--gold); }
.menu-top ol { list-style: none; margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.menu-top li { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.menu-top li b { color: var(--gold); font-weight: normal; }
.menu-top li span::before { color: var(--faint); margin-right: 6px; }
.menu-top li:nth-child(1) span::before { content: "1st"; color: var(--gold); }
.menu-top li:nth-child(2) span::before { content: "2nd"; color: #c9c6d8; }
.menu-top li:nth-child(3) span::before { content: "3rd"; color: #cd9a6a; }
.menu-top li:nth-child(n+4) span::before { content: "—"; }
.menu-top li.you span { color: var(--gold); }

/* =============== 车库 =============== */
.panel-shop { width: min(380px, 96%); }

.shop-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
}
.shop-stars { display: inline-flex; align-items: center; gap: 5px; color: #cfcbe4; }
.shop-stars .i { font-size: 12px; color: var(--gold); }
.shop-stars b { color: var(--gold); font-weight: normal; font-size: 12px; }
.shop-stars b.bump { animation: star-bump 0.4s steps(4); }
.shop-plate { color: var(--muted); }

@keyframes star-bump {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); color: #fff; }
  100% { transform: scale(1); }
}

.shop-list { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }

.shop-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line-soft);
  background: rgba(13, 12, 22, 0.6);
  padding: 8px 10px;
  text-align: left;
  transition: border-color 0.15s;
}
.shop-row:hover { border-color: var(--line); }
.shop-row.flash { animation: row-flash 0.5s steps(3); }

@keyframes row-flash {
  0% { background: rgba(255, 200, 87, 0.22); }
  100% { background: rgba(13, 12, 22, 0.6); }
}

.shop-ic {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--gold);
  background: rgba(255, 200, 87, 0.08);
  border: 2px solid var(--line-soft);
  flex-shrink: 0;
}

.shop-info { flex: 1; min-width: 0; }
.shop-name { font-size: 12px; color: #fff; display: flex; align-items: baseline; gap: 6px; }
.shop-name .lv { color: var(--muted); }
.shop-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }

.pips { display: flex; gap: 2px; margin-top: 5px; }
.pip { width: 10px; height: 6px; background: #2a2740; border: 1px solid var(--line); }
.pip.on { background: var(--gold); border-color: var(--gold-deep); }

.shop-buy { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
.shop-buy svg { width: 11px; height: 11px; shape-rendering: crispEdges; }
.shop-buy.dim { opacity: 0.45; }

/* =============== 结算 =============== */
.over-label { font-size: 12px; letter-spacing: 4px; color: var(--muted); }

.over-score { margin: 8px 0 2px; }
.over-score b {
  font-size: 48px;
  font-weight: normal;
  color: #fff;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.7);
}
.over-score em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 4px; }

.over-sub { font-size: 12px; color: var(--muted); }
.over-record { font-size: 12px; color: var(--gold); margin-top: 8px; }

.blink { animation: blink-anim 1s steps(1) infinite; }
@keyframes blink-anim { 50% { opacity: 0; } }

/* =============== 按钮 =============== */
.btn {
  font-family: inherit;
  font-size: 12px;
  padding: 10px 18px;
  border: 2px solid #000;
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--sh-2);
  cursor: pointer;
  letter-spacing: 1px;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  transition: filter 0.1s, background 0.1s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn:disabled:hover { filter: none; }

.btn-primary { background: var(--gold); color: #22180a; border-color: #6d4f00; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }

.btn-ad { background: var(--cyan); color: #05221a; border-color: #0c6b4f; }

.btn-ghost { background: rgba(27, 24, 48, 0.9); color: #cfcbe4; }

.btn-lg { font-size: 24px; padding: 12px 34px; }
.btn-sm { font-size: 12px; padding: 7px 14px; }

/* =============== 页脚 =============== */
.site-footer {
  text-align: center;
  padding: 2px 0 14px;
  color: var(--faint);
  font-size: 12px;
}
.foot-note { color: #45415e; font-size: 12px; margin-top: 2px; }

.foot-links { margin-top: 3px; }
.foot-links a {
  color: var(--faint);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.foot-links a:hover { color: var(--gold); }

/* =============== Cookie 同意条 =============== */
.consent-bar {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: min(520px, 92vw);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: var(--sh-3);
  padding: 10px 14px;
  font-size: 12px;
  color: #cfcbe4;
  z-index: 99;
}
.consent-bar p { flex: 1; text-align: left; }

/* 英文模式下顶栏不再重复显示英文副标题 */
html[lang="en"] .brand-en { display: none; }

/* =============== 小屏适配 =============== */
@media (max-width: 430px) {
  .brand-title { font-size: 24px; letter-spacing: 2px; }
  .brand-en { display: none; }
  .game-title { font-size: 36px; letter-spacing: 6px; text-indent: 6px; }
  .btn-lg { font-size: 24px; padding: 11px 26px; }
  .stage { min-height: 380px; }
  .over-score b { font-size: 36px; }
  .overlay-menu { padding-bottom: 150px; }
  .combat-btn { width: 46px; height: 46px; font-size: 24px; }
  .combat-btns { bottom: 96px; }
  .hud-items { bottom: 96px; }
  .menu-top { min-width: 200px; }
  .slot { width: 32px; height: 32px; }
  .slot .tag { max-width: 64px; }
}

@media (max-height: 720px) {
  .stage { min-height: 340px; }
}

/* 桌面端：舞台更大更高 */
@media (min-width: 900px) {
  .stage { min-height: 560px; }
}
