/* Moss 坦克大战 — tank-only styles（2026-11-13 从 index.html 内联 <style> 迁出，按 DEVS 主题重做；games/shared/ 不动） */
/* ===== DEVS 主题 v1（游戏区统一）— 原样复制自 /workspace/sync/project_notes/游戏区DEVS主题规范.md §9 =====
   只覆盖 shared/css/shell.css 的外观，不改 shared 本身；结构、尺寸逻辑、横竖屏规则沿用 shell.css。
   红色只用于「运行中」与痕迹（细线、选中竖条、击中闪光）；分数、评级、失败一律银白 / 灰。 */
:root {
  --dv-ink: #07080a;            /* 页面底 */
  --dv-ink-2: #0c0e11;          /* 卡片 / 弹层底 */
  --dv-ink-3: #12151a;          /* 悬浮 / 按下 */
  --dv-graphite: #1a1d22;
  --dv-line: rgba(220, 226, 234, .08);
  --dv-line-2: rgba(220, 226, 234, .16);
  --dv-line-3: rgba(220, 226, 234, .30);
  --dv-silver: #d9dee5;
  --dv-silver-hi: #f1f3f6;
  --dv-silver-dim: #8b929c;
  --dv-mute: #5d636c;
  --dv-crimson: #e2273a;        /* 痕迹红：细线、选中竖条、击中闪光 */
  --dv-crimson-line: rgba(255, 70, 86, .55);
  --dv-hair-red: #b0000a;       /* 标题卡血红细线（规范 §4.1） */
  --dv-lamp: #ff2d3f;           /* 运行灯 */
  --dv-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --dv-sans: "Inter", "Helvetica Neue", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --dv-ease-out: cubic-bezier(.16, 1, .3, 1);
  --dv-r-card: 10px; --dv-r-btn: 6px;
  /* shell.css 旧变量改指向新色板（注意：shell 里 --ink 是「文字色」，所以映射到银白，不是底色） */
  --bg: var(--dv-ink); --panel: var(--dv-ink-2); --ink: var(--dv-silver-hi); --dim: var(--dv-silver-dim);
  --red: var(--dv-crimson); --pink: var(--dv-silver); --hair: var(--dv-silver); --line: var(--dv-graphite);
}
html, body { background: var(--dv-ink); color: var(--dv-silver); font-family: var(--dv-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--dv-crimson); color: #fff; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus, a:focus { outline: none; }
button:focus-visible, a:focus-visible { outline: 1px solid var(--dv-line-3); outline-offset: 2px; }

/* HUD：返回 / 标题 / 读数 / 暂停 */
#hud { min-height: 52px; padding: 4px 12px; gap: 10px;
  background: linear-gradient(90deg, var(--dv-crimson) 0 18px, var(--dv-line-2) 18px 100%) 0 100% / 100% 1px no-repeat; }
#hud h1 { font-family: var(--dv-sans); font-weight: 300; font-size: 14px; letter-spacing: .24em; color: var(--dv-silver-hi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#hud h1 .en { display: block; font-family: var(--dv-mono); font-weight: 400; font-size: 9px; letter-spacing: .3em; color: var(--dv-silver-dim); margin-bottom: 2px; }
#hud .back, #hud .ghost, #hud button {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--dv-r-btn);
  background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--dv-line-2);
  font-family: var(--dv-mono); font-size: 11px; letter-spacing: .18em; color: var(--dv-silver-dim);
  text-decoration: none; cursor: pointer; position: relative; white-space: nowrap;
  transition: color .2s ease, box-shadow .2s ease, transform .12s ease; }
#hud .back::after, #hud .ghost::after, #hud button::after { content: ""; position: absolute; inset: -4px 0; } /* 触控区 ≥ 44px */
#hud .back:hover, #hud .ghost:hover, #hud button:hover { color: var(--dv-silver-hi); box-shadow: inset 0 0 0 1px var(--dv-line-3); }
#hud .back:active, #hud .ghost:active, #hud button:active { transform: translateY(1px); }
#hudstats { font-family: var(--dv-mono); font-size: 11px; letter-spacing: .14em; color: var(--dv-silver-dim); }
#hudstats b { color: var(--dv-silver-hi); font-weight: 500; font-variant-numeric: tabular-nums; }

/* 舞台：近黑 + 极淡网格 + 暗角（DEVS .bg） */
#stage { background:
    radial-gradient(120% 90% at 50% 40%, transparent 0 46%, rgba(0,0,0,.66) 100%),
    linear-gradient(var(--dv-line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--dv-line) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--dv-ink); }
#stage canvas { background: var(--dv-ink); box-shadow: 0 0 0 1px var(--dv-line-2), 0 30px 80px -30px rgba(0,0,0,.9); }

/* 虚拟手柄换皮（只改颜色变量与按钮外观，不动尺寸逻辑） */
#pad, .pad { --joy-base: rgba(12,14,17,.78); --joy-ring: rgba(220,226,234,.22); --joy-tick: #8b929c; --joy-tick-on: #f1f3f6;
  --joy-knob: #15181c; --joy-knob-on: #1d2127; --joy-knob-ring: rgba(220,226,234,.55); }
.ab .btn { background: var(--dv-ink-2); border: 1px solid var(--dv-line-2); color: var(--dv-silver);
  font-family: var(--dv-mono); font-weight: 500; font-size: 15px; letter-spacing: .1em; --ab-press: rgba(220,226,234,.10); }
.ab .btn.a { border-color: var(--dv-crimson-line); color: var(--dv-silver-hi); --ab-press: rgba(226,39,58,.16); }
.ab .btn.b { border-color: var(--dv-line-3); color: var(--dv-silver); --ab-press: rgba(220,226,234,.12); }
.ab .btn.on { background: linear-gradient(var(--ab-press), var(--ab-press)), var(--dv-ink-2); }

/* 弹层：遮罩 + 卡片 + 卡头（英文小标签在上、中文标题在下、血红细线） */
#overlay { background: rgba(7,8,10,.66); }
#overlay .card { background: var(--dv-ink-2); border: 0; border-radius: var(--dv-r-card); color: var(--dv-silver);
  box-shadow: inset 0 0 0 1px var(--dv-line-2), 0 30px 80px -30px rgba(0,0,0,.9);
  padding: 18px 16px 16px; }
#overlay.enter .card { animation: devs-pop .32s var(--dv-ease-out) both; }  /* 只在切换界面时播放（JS 给 #overlay 加 .enter 约 1.4s） */
#overlay .card h2 { font-family: var(--dv-sans); font-weight: 300; font-size: 17px; letter-spacing: .2em; color: var(--dv-silver-hi); }
#overlay .card p { color: var(--dv-silver-dim); font-size: 12px; line-height: 1.6; }
#overlay .card .score { color: var(--dv-silver-hi); font-family: var(--dv-mono); font-weight: 300; }
#overlay .card button, #overlay .card .go {
  appearance: none; border: 0; border-radius: var(--dv-r-btn); min-height: 44px; padding: 10px 16px;
  background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--dv-line-2); color: var(--dv-silver);
  font-family: var(--dv-sans); font-size: 13px; letter-spacing: .14em; text-decoration: none; cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease, color .2s ease, transform .12s ease; }
#overlay .card button:hover, #overlay .card .go:hover { background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--dv-line-3); }
#overlay .card button:active, #overlay .card .go:active { transform: translateY(1px); }
#overlay .card button:disabled { opacity: .32; cursor: default; }
@keyframes devs-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes devs-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes devs-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes devs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes devs-breathe { 0%, 100% { opacity: .55; transform: scale(.88); } 50% { opacity: 1; transform: scale(1); } }
.devs-lamp { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--dv-lamp);
  box-shadow: 0 0 0 2px rgba(255,45,63,.14), 0 0 10px rgba(255,45,63,.7); animation: devs-breathe 3.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  #overlay.enter .card, .devs-lamp { animation: none; }
}
/* ===== DEVS 主题 v1 结束 ===== */

/* ===================== Moss 坦克大战 · 本游戏专用（布局 / 尺寸沿用原内联样式，只换外观） ===================== */
#hud h1 { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; font-size: 13px; letter-spacing: .12em; }
#hudstats { margin-left: auto; font-size: 10.5px; letter-spacing: .04em; white-space: nowrap; }
#hudstats b { letter-spacing: 0; }
#hud { gap: 8px; }
#hud .back, #hud #mute { min-width: 44px; min-height: 44px; }
#hud #mute.off { color: var(--dv-mute); text-decoration: line-through; text-decoration-color: var(--dv-crimson); }
#stage canvas { box-shadow: none; }   /* 场地边线 = 画布内 1px 线 */
#stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(7,8,10,.5) 100%); }  /* 只留暗角，去扫描线 */

/* 弹层 */
#overlay .card { max-width: 340px; }
#overlay .card h2 { margin: 0 0 12px; padding-bottom: 10px;
  background: linear-gradient(90deg, var(--dv-crimson) 0 18px, var(--dv-line-2) 18px 100%) 0 100% / 100% 1px no-repeat; }
#overlay .card.over h2 { color: var(--dv-silver); }
#overlay .card .score { font-size: 28px; letter-spacing: .04em; vertical-align: -3px; margin: 0 2px; text-shadow: none; }
#overlay .card .new { font-family: var(--dv-mono); font-size: 9px; letter-spacing: .22em; color: var(--dv-silver-hi); padding: 2px 7px; border-radius: 3px;
  box-shadow: inset 0 0 0 1px var(--dv-line-3); vertical-align: 4px; margin-left: 6px; text-shadow: none; font-weight: 400; }
#overlay .card .menu, #overlay .tcard .menu { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 12px auto 0; width: min(100%, 260px); }
#overlay .card .menu button, #overlay .tcard .menu button { margin-top: 0; min-height: 46px; white-space: nowrap; padding: 8px 18px; }
#overlay .tcard .menu button { appearance: none; border: 0; border-radius: var(--dv-r-btn); cursor: pointer;
  background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--dv-line-2); color: var(--dv-silver);
  font-family: var(--dv-sans); font-size: 14px; letter-spacing: .24em; transition: background-color .2s ease, box-shadow .2s ease, color .2s ease, transform .12s ease; }
#overlay .card .menu button:first-child, #overlay .tcard .menu button:first-child { box-shadow: inset 0 0 0 1px var(--dv-crimson-line); color: var(--dv-silver-hi); }
#overlay .card .menu button.sel, #overlay .tcard .menu button.sel {
  background: rgba(255,255,255,.06); box-shadow: inset 2px 0 0 var(--dv-crimson), inset 0 0 0 1px var(--dv-line-3); color: var(--dv-silver-hi); }
#overlay .tcard .menu button:active { transform: translateY(1px); }
#overlay .card .hint, .tcard .hint { font-family: var(--dv-sans); font-size: 10px; letter-spacing: .12em; margin: 12px 0 0; color: var(--dv-mute); }

/* 标题卡（全屏，game.js 给 overlay 加 .is-title） */
#overlay.is-title { padding: 0; background: var(--dv-ink); }
#overlay .tcard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 26px 0 14px; text-align: center; color: var(--dv-silver); overflow: hidden;
  background: radial-gradient(120% 70% at 50% 40%, transparent 0 46%, rgba(0,0,0,.66) 100%),
    linear-gradient(var(--dv-line) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--dv-line) 1px, transparent 1px) 0 0 / 32px 32px, var(--dv-ink); }
.tcard .t-head { width: 100%; }
.tcard .t-tag { display: block; font-family: var(--dv-mono); font-size: 10px; letter-spacing: .32em; color: var(--dv-silver-dim); }
.tcard h2 { margin: 12px 0 0; font-family: var(--dv-sans); font-weight: 200; font-size: 46px; line-height: .95; letter-spacing: .42em; text-indent: .42em;
  color: #eef1f5; text-shadow: none; white-space: nowrap; }
.tcard h2 span { display: inline-block; }
.tcard .t-cn { margin-top: 10px; font-family: var(--dv-sans); font-weight: 300; font-size: 14px; letter-spacing: .5em; text-indent: .5em; color: var(--dv-silver); }
.tcard .t-line { position: relative; height: 1px; margin: 18px 22px 0; background: linear-gradient(90deg, var(--dv-hair-red) 0 22px, var(--dv-line-2) 22px 100%); transform-origin: left center; }
.tcard .t-line span { position: absolute; right: 0; top: 7px; font-family: var(--dv-mono); font-size: 9px; letter-spacing: .28em; color: var(--dv-mute); white-space: nowrap; }
.tcard .t-hero { image-rendering: pixelated; image-rendering: crisp-edges; display: block; flex: 0 0 auto; }
.tcard .t-low { width: 100%; display: flex; flex-direction: column; align-items: center; }
.tcard .t-legend { list-style: none; margin: 0 0 10px; padding: 0; display: flex; justify-content: center; gap: 10px; }
.tcard .t-legend li { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 6px 4px 8px; border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--dv-line); font-family: var(--dv-mono); font-size: 10px; letter-spacing: .06em; color: var(--dv-silver-dim); }
.tcard .t-legend img { image-rendering: pixelated; image-rendering: crisp-edges; }
.tcard .t-legend b { font-family: var(--dv-sans); font-weight: 400; font-size: 12px; letter-spacing: .14em; margin-top: 2px; }
.tcard .c-n { color: #a9b6c6; } .tcard .c-f { color: #d9c592; } .tcard .c-h { color: #c27a52; }   /* 类型色 = 画布里的敌人色，只作识别 */
.tcard .t-best { margin: 4px 0 0; font-family: var(--dv-mono); font-size: 10px; letter-spacing: .28em; color: var(--dv-silver-dim); }
.tcard .t-best .score { margin-left: 6px; font-family: var(--dv-mono); font-weight: 300; color: var(--dv-silver-hi); font-size: 18px; letter-spacing: .06em; text-shadow: none; }
@media (max-height: 760px) { .tcard h2 { font-size: 36px; } .tcard .t-hero { width: 128px; height: 128px; } }

/* 入场：只在切换界面时（#overlay.enter） */
#overlay.enter .tcard .t-tag { animation: devs-fade .9s .1s ease both; }
#overlay.enter .tcard h2 span { animation: devs-rise .7s var(--dv-ease-out) both; }
#overlay.enter .tcard h2 span:nth-child(2) { animation-delay: .05s; } #overlay.enter .tcard h2 span:nth-child(3) { animation-delay: .10s; } #overlay.enter .tcard h2 span:nth-child(4) { animation-delay: .15s; }
#overlay.enter .tcard .t-cn { animation: devs-fade .9s .3s ease both; }
#overlay.enter .tcard .t-line { animation: devs-draw .8s .3s var(--dv-ease-out) both; }
#overlay.enter .tcard .t-hero, #overlay.enter .tcard .t-low { animation: devs-rise .6s .4s var(--dv-ease-out) both; }
@media (prefers-reduced-motion: reduce) {
  #overlay.enter .tcard .t-tag, #overlay.enter .tcard h2 span, #overlay.enter .tcard .t-cn, #overlay.enter .tcard .t-line,
  #overlay.enter .tcard .t-hero, #overlay.enter .tcard .t-low { animation: none; }
}

/* 新手提示条 */
#tip { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 6; display: none; align-items: center; gap: 10px;
  background: rgba(12,14,17,.94); border: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--dv-line-2), inset 2px 0 0 var(--dv-crimson);
  color: var(--dv-silver); font-family: var(--dv-sans); font-size: 12px; line-height: 1.5; letter-spacing: .04em; padding: 8px 10px 8px 12px; }
#tip.show { display: flex; }
#tip b { color: var(--dv-silver-hi); font-weight: 500; text-shadow: none; }
#tip button { margin-left: auto; flex: 0 0 auto; min-height: 36px; min-width: 52px; border: 0; border-radius: var(--dv-r-btn); background: transparent;
  box-shadow: inset 0 0 0 1px var(--dv-line-2); color: var(--dv-silver-dim); font-family: var(--dv-mono); font-size: 10px; letter-spacing: .2em; }

/* 手柄：沿用模板（A 红细线，B 银细线） */
.ab .btn { box-shadow: none; }
@media (max-width: 400px) {
  #hud .back { padding: 0 8px; letter-spacing: .1em; }
  #hud:has(#hudstats:not(:empty)) h1 { font-size: 0; letter-spacing: 0; }          /* 对局中窄屏：只留英文小标签 TANK，读数不挤 */
  #hud:has(#hudstats:not(:empty)) h1 .en { font-size: 9px; margin: 0; }
}
