/* ============ 千里走单骑 · 全局样式 ============ */
:root {
  --ink: #14100c;
  --ink2: #1f1812;
  --paper: #e8dcc0;
  --paper-dim: #c9bb9b;
  --gold: #c9a227;
  --gold-bright: #f0cf6e;
  --cinnabar: #c03028;
  --cinnabar-bright: #e8554a;
  --jade: #4a8f6d;
  --azure: #3e6e9e;
  --shadow: rgba(0,0,0,.55);
  --font-brush: 'Kaiti SC', 'STKaiti', 'KaiTi', 'Noto Serif CJK SC', 'Source Han Serif SC', 'Songti SC', serif;
  --font-title: Georgia, 'Kaiti SC', 'STKaiti', 'Noto Serif CJK SC', 'Source Han Serif SC', 'Songti SC', serif;
  --font-body: 'Songti SC', 'Noto Serif CJK SC', 'Source Han Serif SC', 'Kaiti SC', 'PingFang SC', 'Microsoft YaHei', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; }
/* 关闭微信/iOS WebView 的字号自动放大（否则部分文字会被撑得比按钮还大） */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; overflow: hidden; background: var(--ink); touch-action: manipulation; }
body { font-family: var(--font-body); color: var(--paper); }

#app { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
@supports (height: 100dvh) {
  #app { height: 100dvh; } /* 手机浏览器地址栏伸缩时仍占满可视区 */
}
.hidden { display: none !important; }

/* ============ 背景 ============ */
#bg-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bg-mountains {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(201,162,39,.07), transparent 60%),
    radial-gradient(ellipse 80% 50% at 20% 110%, rgba(62,110,158,.10), transparent 60%),
    radial-gradient(ellipse 80% 50% at 85% 105%, rgba(192,48,40,.08), transparent 60%),
    linear-gradient(180deg, #181310 0%, #14100c 55%, #0d0a07 100%);
}
.bg-mountains::after {
  content: ''; position: absolute; inset: 0; opacity: .05;
  background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(232,220,192,.5) 6px 7px);
  mix-blend-mode: overlay;
}
.bg-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 18vmax rgba(0,0,0,.8); }
#bg-art {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  background-size: cover; background-position: center;
}
#bg-art.on { opacity: 1; }

#fx-canvas { position: absolute; inset: 0; z-index: 50; pointer-events: none; width: 100%; height: 100%; }

/* ============ 通用 ============ */
.screen { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; }

.btn-ink {
  font-family: var(--font-title); color: var(--paper); letter-spacing: .35em; text-indent: .35em;
  background: linear-gradient(165deg, #3a2f23, #241c13);
  border: 1px solid rgba(201,162,39,.55); border-radius: 6px;
  padding: 12px 34px; font-size: 20px; cursor: pointer; position: relative;
  box-shadow: 0 4px 14px var(--shadow), inset 0 1px 0 rgba(240,207,110,.25);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.btn-ink { white-space: nowrap; }
/* 英文模式：取消中文式宽字距，缩小毛笔字号 */
body.en .btn-ink { letter-spacing: .05em; text-indent: 0; font-size: 17px; padding: 11px 26px; }
body.en .btn-ink.big { font-size: 21px; padding: 14px 38px; }
body.en .btn-ink.small { font-size: 12.5px; padding: 6px 12px; letter-spacing: .03em; }
body.en .screen-title, body.en .overlay-panel h2 { font-family: var(--font-title); font-size: 34px; letter-spacing: .04em; }
body.en .act-name { font-family: var(--font-title); font-size: 21px; }
body.en .fighter-name { font-family: var(--font-title); font-size: 15px; letter-spacing: 0; }
body.en .hero-card .hero-name { font-family: var(--font-title); font-size: 21px; }
body.en .end-title { font-family: var(--font-title); font-size: clamp(34px, 7vw, 60px); letter-spacing: .06em; }
body.en .skill-btn { letter-spacing: 0; font-size: 13px; }
body.en .game-subtitle { letter-spacing: .25em; text-indent: .25em; font-size: 15px; }
body.en .title-footer { letter-spacing: .2em; font-size: 11px; }
body.en #turn-banner { font-family: var(--font-title); font-size: 44px; }
body.en .rw-name { font-size: 16.5px; letter-spacing: 0; }
body.en #prompt-text { font-size: 14px; }
.btn-ink:hover { transform: translateY(-2px); border-color: var(--gold-bright); box-shadow: 0 8px 22px var(--shadow), 0 0 14px rgba(201,162,39,.35); }
.btn-ink:active { transform: translateY(0); }
.btn-ink.big { font-size: 26px; padding: 16px 52px; }
.btn-ink.small { font-size: 14px; padding: 7px 16px; letter-spacing: .15em; }
.btn-ink:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-ink.danger { border-color: rgba(192,48,40,.7); }
.btn-ink.danger:hover { border-color: var(--cinnabar-bright); box-shadow: 0 8px 22px var(--shadow), 0 0 14px rgba(192,48,40,.4); }

.screen-title {
  font-family: var(--font-brush); font-size: 56px; color: var(--paper);
  margin-top: 5vh; text-shadow: 0 0 24px rgba(201,162,39,.35);
}
.screen-hint { color: var(--paper-dim); margin-top: 6px; letter-spacing: .2em; }

/* ============ 标题画面 ============ */
#screen-title { justify-content: center; gap: 18px; }
.title-ink {
  position: absolute; width: 64vmin; height: 64vmin; border-radius: 50%;
  background: radial-gradient(circle, rgba(192,48,40,.16) 0%, rgba(192,48,40,.05) 45%, transparent 70%);
  animation: inkPulse 5s ease-in-out infinite;
}
@keyframes inkPulse { 0%,100% { transform: scale(1); opacity:.8 } 50% { transform: scale(1.08); opacity: 1 } }
.game-title { font-family: var(--font-brush); font-size: clamp(64px, 11vw, 130px); font-weight: 400; display: flex; gap: .12em; z-index: 1; }
.game-title span { animation: charDrop .8s cubic-bezier(.2,1.6,.4,1) backwards; text-shadow: 0 6px 30px rgba(0,0,0,.7), 0 0 40px rgba(201,162,39,.25); }
.game-title span:nth-child(1) { animation-delay: .05s }
.game-title span:nth-child(2) { animation-delay: .18s }
.game-title span:nth-child(3) { animation-delay: .31s; color: var(--cinnabar-bright) }
.game-title span:nth-child(4) { animation-delay: .44s }
.game-title span:nth-child(5) { animation-delay: .57s }
@keyframes charDrop { from { opacity: 0; transform: translateY(-60px) scale(1.6); filter: blur(6px) } to { opacity: 1; transform: none; filter: none } }
.game-subtitle { color: var(--gold); letter-spacing: .6em; text-indent: .6em; font-size: 18px; z-index: 1; animation: fadeIn 1.2s .8s backwards; }
.title-buttons { display: flex; gap: 22px; margin-top: 4vh; z-index: 1; animation: fadeIn 1s 1.1s backwards; }
.title-footer { position: absolute; bottom: 4vh; color: rgba(201,187,155,.5); letter-spacing: .5em; font-size: 13px; }
.title-version { position: absolute; bottom: 1.6vh; color: rgba(201,187,155,.4); letter-spacing: .15em; font-size: 11px; }
.settings-version { text-align: center; color: rgba(201,187,155,.5); font-size: 11px; letter-spacing: .12em; margin: 6px 0 2px; }
/* 剧情叙事屏 */
.story-panel { max-width: 680px; }
.story-kicker { color: var(--gold); letter-spacing: .4em; font-size: 13px; margin: 0; opacity: .9; }
.story-text { max-width: 600px; text-align: left; color: #e6dcc4; }
.story-text p { line-height: 2; margin: 0 0 14px; text-indent: 2em; font-size: 15.5px; }
body.en .story-text p { text-indent: 0; line-height: 1.9; }
.intro-story { font-size: 12.5px; line-height: 1.6; color: #cfc4ab; margin: 6px 4px 0; max-width: 220px; text-align: left; opacity: .92; }
.intro-foe.boss .intro-story { max-width: 300px; }

/* 新手教程 */
.overlay-panel.tut-panel { width: min(660px, 94vw); }
.tut-host { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.tut-host-img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 18%;
  border: 2px solid rgba(201,162,39,.6); box-shadow: 0 2px 10px var(--shadow); }
.tut-host-name { font-family: var(--font-brush); font-size: 19px; color: var(--gold-bright); line-height: 1.1; }
.tut-page-no { font-size: 12px; color: #b7a987; letter-spacing: .15em; margin-top: 3px; }
.tut-panel h2 { font-size: 30px !important; margin: 2px 0 8px; }
.tut-line { color: #ece2c8; line-height: 1.85; font-size: 14.5px; max-width: 560px; margin: 0 auto 10px; }
.tut-line b, .tut-note b { color: var(--gold-bright); }
.tut-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px;
  width: 100%; box-sizing: border-box; margin: 4px 0 8px; }
.tut-card { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 6px; border-radius: 10px;
  background: rgba(40,32,22,.55); border: 1px solid rgba(201,162,39,.3); }
.tut-card img { width: 60px; height: 84px; object-fit: cover; border-radius: 6px; box-shadow: 0 2px 8px var(--shadow); }
.tut-fb { width: 60px; height: 84px; display: flex; align-items: center; justify-content: center; font-size: 28px;
  color: var(--gold); background: rgba(20,16,12,.6); border-radius: 6px; }
.tut-cn { font-family: var(--font-brush); font-size: 16px; color: var(--gold-bright); line-height: 1; }
.tut-cd { font-size: 11.5px; line-height: 1.45; color: #cabf9f; text-align: center; }
.tut-note { font-size: 13px; line-height: 1.7; color: #d8cba6; background: rgba(201,162,39,.08);
  border-left: 3px solid rgba(201,162,39,.5); border-radius: 0 8px 8px 0; padding: 8px 12px; max-width: 560px;
  margin: 2px auto 6px; text-align: left; }
.tut-nav { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* 图鉴 / 百科 */
.codex-tabs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.codex-tab.on { background: rgba(201,162,39,.3); border-color: var(--gold); color: var(--gold-bright); }
.codex-search { display: block; width: min(360px, 84%); margin: 0 auto 10px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid rgba(201,162,39,.5); background: rgba(20,16,12,.7); color: #f3ead2; font-size: 14px; }
.overlay-panel.codex-wide { width: min(880px, 94vw); }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; width: 100%;
  box-sizing: border-box; max-height: 48vh; overflow-y: auto; padding: 4px 6px; }
.codex-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  padding: 7px 4px; border-radius: 9px; background: rgba(40,32,22,.5); border: 1px solid rgba(201,162,39,.28); transition: .15s; }
.codex-item:hover { background: rgba(60,48,30,.7); border-color: var(--gold); transform: translateY(-2px); }
.codex-item .cx-round { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold); }
.codex-item .cx-sq { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(201,162,39,.5); }
.codex-item .cx-card { width: 44px; height: 60px; border-radius: 5px; object-fit: cover; border: 1px solid rgba(201,162,39,.5); }
.codex-item .cx-fallback { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: var(--gold); }
.codex-item .cx-name { font-size: 12px; text-align: center; line-height: 1.15; color: #f3ead2; }
.cx-tier { font-size: 10px; padding: 1px 7px; border-radius: 8px; letter-spacing: .06em; border: 1px solid; }
.cx-common { color: #b9b2a4; border-color: #6b6557; background: rgba(120,114,98,.18); }
.cx-rare   { color: #7fb6e8; border-color: #3e6e9e; background: rgba(62,110,158,.2); }
.cx-legend { color: #f0cf6e; border-color: var(--gold); background: rgba(201,162,39,.22); }
.cx-elite  { color: #d8a23f; border-color: #a8771f; background: rgba(168,119,31,.2); }
.cx-boss   { color: #e8554a; border-color: #9e3030; background: rgba(158,48,48,.2); }
.cx-hero   { color: #9fd49a; border-color: #4d7a48; background: rgba(77,122,72,.2); }
.codex-detail { min-height: 40px; margin: 8px auto 2px; max-width: 92%; text-align: center; font-size: 13px;
  line-height: 1.5; color: #e6dcc4; background: rgba(20,16,12,.5); border-radius: 8px; padding: 8px 12px; }
@media (max-width: 700px) {
  .codex-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); max-height: 42vh; }
  .codex-item .cx-round, .codex-item .cx-sq, .codex-item .cx-fallback { width: 44px; height: 44px; }
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

/* ============ 选将 ============ */
.hero-list {
  display: flex; gap: 2vw; margin-top: 4vh; flex-wrap: wrap; justify-content: center;
  max-width: 94vw; overflow-y: auto; padding-bottom: 4vh; scrollbar-width: thin;
}
.hero-card {
  width: clamp(180px, 14.5vw, 250px); border-radius: 12px; overflow: hidden; cursor: pointer; position: relative;
  background: linear-gradient(170deg, #2b2218, #1a140d);
  border: 1px solid rgba(201,162,39,.4);
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform .25s cubic-bezier(.2,1.4,.4,1), box-shadow .25s, border-color .25s;
  animation: cardRise .6s cubic-bezier(.2,1.4,.4,1) backwards;
}
.hero-card:nth-child(2) { animation-delay: .12s } .hero-card:nth-child(3) { animation-delay: .24s }
@keyframes cardRise { from { opacity: 0; transform: translateY(50px) } to { opacity: 1; transform: none } }
.hero-card:hover { transform: translateY(-10px) scale(1.03); border-color: var(--gold-bright); box-shadow: 0 18px 44px var(--shadow), 0 0 26px rgba(201,162,39,.3); }
.hero-card .hero-portrait { width: 100%; aspect-ratio: 3/3.4; position: relative; overflow: hidden; }
.hero-card .hero-portrait img, .hero-card .hero-portrait svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-card .hero-info { padding: 14px 16px 18px; }
.hero-card .hero-name { font-family: var(--font-brush); font-size: 30px; color: var(--gold-bright); }
.hero-card .hero-hp { color: var(--cinnabar-bright); font-size: 14px; margin: 2px 0 8px; letter-spacing: .1em; }
.hero-card .hero-skill { font-size: 13px; color: var(--paper-dim); line-height: 1.6; }
.hero-card .hero-skill b { color: var(--paper); }

/* ============ 地图 ============ */
#screen-map { align-items: stretch; }
.map-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; z-index: 5;
  background: linear-gradient(180deg, rgba(20,16,12,.95), rgba(20,16,12,.7) 80%, transparent);
}
.act-name { font-family: var(--font-brush); font-size: 30px; color: var(--gold-bright); text-shadow: 0 2px 10px var(--shadow); }
.run-stats { display: flex; gap: 22px; font-size: 17px; }
.stat.hp { color: var(--cinnabar-bright); } .stat.coin { color: var(--gold-bright); } .stat.skills { color: var(--paper); }
.map-scroll { flex: 1; position: relative; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
#map-paths { position: absolute; inset: 0; width: 100%; pointer-events: none; }
#map-paths path { stroke: rgba(201,187,155,.28); stroke-width: 2.5; fill: none; stroke-dasharray: 6 8; }
#map-paths path.lit { stroke: var(--gold); stroke-dasharray: none; filter: drop-shadow(0 0 4px rgba(201,162,39,.6)); }
#map-nodes { position: relative; width: 100%; }
.map-node {
  position: absolute; width: 64px; height: 64px; transform: translate(-50%, -50%);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column;
  background: radial-gradient(circle at 35% 30%, #3a2f23, #1c150e);
  border: 2px solid rgba(201,187,155,.35); cursor: default; z-index: 2;
  font-size: 26px; transition: transform .2s, box-shadow .2s, border-color .2s;
  box-shadow: 0 4px 12px var(--shadow);
}
.map-node .node-label { font-size: 10px; color: var(--paper-dim); margin-top: -2px; letter-spacing: .05em; }
.map-node.available { border-color: var(--gold-bright); cursor: pointer; animation: nodeGlow 1.6s ease-in-out infinite; }
@keyframes nodeGlow { 0%,100% { box-shadow: 0 4px 12px var(--shadow), 0 0 8px rgba(240,207,110,.4) } 50% { box-shadow: 0 4px 12px var(--shadow), 0 0 22px rgba(240,207,110,.8) } }
.map-node.available:hover { transform: translate(-50%, -50%) scale(1.18); }
.map-node.cleared { opacity: .45; border-color: var(--jade); }
.map-node.current { border-color: var(--cinnabar-bright); box-shadow: 0 0 18px rgba(232,85,74,.6); }
.map-node.boss { width: 92px; height: 92px; font-size: 42px; border-width: 3px; }

/* ---- 剧情固定地图（手绘地域图 + 地名节点 + 行军路线）---- */
#map-nodes.story-map {
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border-radius: 12px; box-shadow: inset 0 0 60px rgba(10,7,4,.7), 0 6px 22px var(--shadow);
  border: 1px solid rgba(201,162,39,.25);
}
#map-paths path.story-road { stroke: rgba(224,150,40,.8); stroke-width: 4.5; stroke-dasharray: 3 6; stroke-linecap: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.95)); }
#map-paths path.story-road.done { stroke: rgba(120,165,105,.9); }
#map-paths path.story-road.lit { stroke: var(--gold-bright); stroke-width: 5.5; stroke-dasharray: none; filter: drop-shadow(0 0 7px rgba(240,207,110,1)); }
#map-paths path.story-arrow { fill: #fff6e0; stroke: rgba(20,12,4,1); stroke-width: 2.4; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0,0,0,1)); }
#map-paths path.story-arrow.done { fill: #a9e088; stroke: rgba(16,28,10,1); }
#map-paths path.story-arrow.lit { fill: var(--gold-bright); stroke: rgba(30,20,6,1); stroke-width: 2.4; filter: drop-shadow(0 0 9px rgba(240,207,110,1)); }
.map-node.story { width: 54px; height: 54px; font-size: 22px; overflow: visible; }
.map-node.story.boss { width: 78px; height: 78px; font-size: 34px; }
.map-node.story .node-place {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 11.5px; font-weight: 600; letter-spacing: .04em;
  color: #f3e6c4; background: rgba(24,17,10,.82); padding: 1px 7px; border-radius: 5px;
  border: 1px solid rgba(201,162,39,.4); box-shadow: 0 1px 4px var(--shadow); pointer-events: none;
}
.map-node.story.boss .node-place { font-size: 13px; color: var(--gold-bright); }
.map-node.story.cleared .node-place { opacity: .55; }
.map-node.story .node-art { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.map-node.story.boss .node-art { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }

/* 剧情开场插画 + 到达屏 */
.story-art { margin: 4px auto 12px; max-width: 440px; }
.story-art img { width: 100%; border-radius: 10px; border: 1px solid rgba(201,162,39,.45);
  box-shadow: 0 6px 22px var(--shadow); display: block; }
.stop-panel { max-width: 560px; }
.stop-panel .story-text { max-width: 480px; text-align: center; }
.stop-panel .story-text p { text-indent: 0; }

/* 开场：英雄立绘 */
.story-hero { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 2px auto 12px; }
.story-hero-img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; object-position: 50% 18%;
  border: 2px solid rgba(201,162,39,.65); box-shadow: 0 4px 16px var(--shadow); }
.story-hero-tag { font-size: 12px; letter-spacing: .3em; color: #b7a987; }
.story-hero-name { font-family: var(--font-brush); font-size: 22px; color: var(--gold-bright); line-height: 1.1; margin-top: 2px; }

/* Boss 长过场 */
.boss-scene { max-width: 600px; }
.boss-scene .story-text { max-width: 520px; text-align: center; }
.boss-scene .story-text p { text-indent: 0; line-height: 1.9; }
.cut-speaker { display: flex; align-items: center; gap: 14px; margin: 4px auto 10px; justify-content: center; }
.cut-speaker.hero { flex-direction: row-reverse; }
.cut-portrait { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; object-position: 50% 18%;
  border: 2px solid rgba(201,162,39,.6); box-shadow: 0 4px 16px var(--shadow); }
.cut-speaker.foe .cut-portrait { border-color: rgba(192,48,40,.7); }
.cut-name { font-family: var(--font-brush); font-size: 24px; color: var(--gold-bright); }
.cut-speaker.foe .cut-name { color: #e89088; }
.cut-sub { font-size: 12.5px; color: #b7a987; margin-top: 3px; max-width: 200px; }
.cut-line p { font-size: 16px; color: #f0e6cb; font-style: italic; }



/* ============ 战斗 ============ */
#screen-battle { z-index: 10; }
.battle-stage { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }

.fighter-area { display: flex; align-items: center; justify-content: center; gap: 26px; position: relative; }
.fighter-area.enemy { padding-top: 2.2vh; }
.fighter-area.player { position: absolute; left: 3vw; bottom: 19vh; flex-direction: row; align-items: flex-end; gap: 14px; }

.fighter-card {
  width: 158px; border-radius: 10px; padding: 8px 8px 10px; position: relative;
  background: linear-gradient(170deg, #2e2519, #1a140d);
  border: 1px solid rgba(201,162,39,.5); box-shadow: 0 8px 26px var(--shadow);
  transition: transform .1s;
}
.fighter-area.enemy .fighter-card { width: 184px; }
.portrait { width: 100%; aspect-ratio: 1/1.05; border-radius: 6px; overflow: hidden; background: #0e0b08; position: relative; }
.portrait img, .portrait svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.fighter-name { font-family: var(--font-brush); text-align: center; font-size: 22px; color: var(--gold-bright); margin-top: 5px; }
.hp-bar { position: relative; height: 16px; border-radius: 8px; background: #0c0905; border: 1px solid rgba(0,0,0,.6); overflow: hidden; margin-top: 5px; }
.hp-fill { height: 100%; width: 100%; border-radius: 8px; background: linear-gradient(90deg, #7e1f1a, var(--cinnabar-bright)); transition: width .45s cubic-bezier(.3,1,.4,1); box-shadow: 0 0 8px rgba(232,85,74,.5); }
.hp-fill.low { background: linear-gradient(90deg, #5e1410, #a8281f); animation: hpFlash 1s ease-in-out infinite; }
@keyframes hpFlash { 50% { filter: brightness(1.5) } }
.hp-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; letter-spacing: .1em; }
.fighter-skills, .fighter-equips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 0; }
.skill-tag, .equip-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 4px; letter-spacing: .05em; cursor: help;
  background: rgba(62,110,158,.25); border: 1px solid rgba(62,110,158,.6); color: #aecbe8;
}
.equip-tag { background: rgba(201,162,39,.15); border-color: rgba(201,162,39,.55); color: var(--gold-bright); }
.eq-suit { font-weight: 700; margin-right: 1px; }
.eq-suit.red { color: #d8483f; }
.eq-suit.black { color: #e8dcc0; }
.status-row { display: flex; gap: 5px; margin-top: 5px; min-height: 18px; flex-wrap: wrap; }
.relic-row { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.relic-chip {
  width: 26px; height: 26px; border-radius: 50%; cursor: help; overflow: hidden;
  border: 1px solid rgba(201,162,39,.7); background: #241c10;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  box-shadow: 0 2px 6px var(--shadow);
}
.relic-chip img { width: 100%; height: 100%; object-fit: cover; }
.relic-chip.big { width: 44px; height: 44px; font-size: 22px; }
.status-chip { font-size: 11px; padding: 1px 7px; border-radius: 9px; background: rgba(192,48,40,.25); border: 1px solid rgba(192,48,40,.6); color: #f0b0aa; animation: chipPop .3s cubic-bezier(.2,1.6,.4,1); }
.status-chip.buff { background: rgba(74,143,109,.25); border-color: rgba(74,143,109,.7); color: #b2dcc6; }
.status-chip.chain { background: rgba(120,120,140,.3); border-color: rgba(170,180,200,.7); color: #d6dae6; }
@keyframes chipPop { from { transform: scale(0) } to { transform: scale(1) } }
.hand-count { position: absolute; bottom: -9px; right: -9px; background: var(--ink2); border: 1px solid var(--gold); border-radius: 50%; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--gold-bright); box-shadow: 0 3px 8px var(--shadow); z-index: 4; }
.intent { margin-top: 8px; font-size: 13px; color: var(--paper-dim); letter-spacing: .1em; min-height: 18px; }

.fighter-card.hit { animation: hitShake .4s; }
@keyframes hitShake { 0%,100% { transform: translateX(0); filter: none } 20% { transform: translateX(-9px); filter: brightness(2) saturate(0) } 40% { transform: translateX(8px) } 60% { transform: translateX(-5px) } 80% { transform: translateX(3px) } }
.fighter-card.healed { animation: healGlow .7s; }
@keyframes healGlow { 30% { box-shadow: 0 0 34px rgba(74,193,129,.8); filter: brightness(1.3) } }
.fighter-card.acting { transform: translateY(-4px); box-shadow: 0 12px 32px var(--shadow), 0 0 18px rgba(240,207,110,.35); }

/* 中央结算区 */
.resolve-zone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; pointer-events: none; }
#resolve-cards { display: flex; gap: 10px; min-height: 130px; align-items: center; }
#battle-log {
  position: absolute; right: 2vw; top: 0; width: 230px; max-height: 46vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
  font-size: 12.5px; color: var(--paper-dim); line-height: 1.5; text-align: left;
  mask-image: linear-gradient(180deg, transparent, #000 30%);
}
#battle-log .log-line { animation: logIn .3s ease; }
#battle-log .log-line b { color: var(--gold-bright); font-weight: 600; }
#battle-log .log-line em { color: var(--cinnabar-bright); font-style: normal; }
@keyframes logIn { from { opacity: 0; transform: translateX(16px) } to { opacity: 1; transform: none } }

#prompt-bar {
  pointer-events: auto; position: absolute; bottom: 6px; display: flex; align-items: center; gap: 16px;
  background: rgba(20,16,12,.92); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 20px;
  box-shadow: 0 6px 20px var(--shadow), 0 0 16px rgba(201,162,39,.25); z-index: 30;
  animation: chipPop .25s cubic-bezier(.2,1.6,.4,1);
}
#prompt-text { font-size: 16px; color: var(--gold-bright); letter-spacing: .08em; }

/* 手牌 */
#hand-area {
  position: absolute; bottom: env(safe-area-inset-bottom, 0); left: 0; right: 0;
  height: calc(19vh + 60px); min-height: 200px;
  display: flex; align-items: flex-end; justify-content: flex-start; z-index: 20;
  padding: 60px 14px 8px; /* 顶部留出牌上浮的空间 */
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
#hand-area::-webkit-scrollbar { display: none; }
/* 牌少时居中、牌多时可从最左滑到最右 */
#hand-area .game-card:first-child { margin-left: auto; }
#hand-area .game-card:last-child { margin-right: auto; }
.game-card {
  width: 102px; height: 146px; border-radius: 9px; position: relative; flex-shrink: 0;
  background: linear-gradient(168deg, #f3ead2, #d9cba6);
  border: 1px solid #8a7448; color: #2b2114; cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow);
  transition: transform .18s cubic-bezier(.2,1.3,.4,1), box-shadow .18s, margin .18s;
  margin: 0 -14px; transform-origin: bottom center;
  overflow: hidden;
}
.game-card .card-corner { position: absolute; top: 5px; left: 7px; font-size: 13px; line-height: 1.1; font-weight: 600; }
.game-card .card-corner .suit { font-size: 15px; }
.game-card.red .card-corner { color: #b3271f; }
.game-card.black .card-corner { color: #221c12; }
/* 中文：竖排于左上角花色下方（经典三国杀样式） */
.game-card .card-name {
  position: absolute; top: 40px; left: 4px; width: 22px;
  writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 2px;
  font-family: var(--font-brush); font-size: 19px; line-height: 22px; text-align: left;
}
.game-card .card-name.long { font-size: 15px; letter-spacing: 1px; }
/* 英文：横排、避开角标 */
.game-card .card-name.h-en {
  writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: .5px;
  top: 40px; left: 3px; right: auto; width: 17px; text-align: left;
  max-height: calc(100% - 48px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-title); font-size: 12px; line-height: 17px; font-weight: 600;
}
.game-card .card-name.h-en.long { font-size: 10.5px; letter-spacing: .2px; }
.game-card .card-icon { position: absolute; bottom: 30px; left: 0; right: 0; text-align: center; font-size: 30px; opacity: .85; }
.game-card .card-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}
.game-card .card-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10,7,4,.55) 0%, rgba(10,7,4,.25) 26%, transparent 42%),
    linear-gradient(180deg, rgba(10,7,4,.5) 0%, rgba(10,7,4,.12) 24%, transparent 42%);
}
.game-card .card-corner, .game-card .card-name, .game-card .card-icon { z-index: 2; }
.game-card:not(.no-art) .card-name { color: #f3ead2; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 12px rgba(0,0,0,.6); }
.game-card:not(.no-art) .card-type { color: #d8cbab; text-shadow: 0 1px 2px rgba(0,0,0,.9); }
.game-card:not(.no-art) .card-corner { background: rgba(243,234,210,.94); border-radius: 5px; padding: 1px 4px 2px; top: 4px; left: 5px; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.game-card:not(.no-art) .card-icon { display: none; }
.game-card .card-type { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: .25em; color: #7a6a48; }
.game-card.trick { background: linear-gradient(168deg, #e7e3f0, #c5bfd6); border-color: #6c6488; }
.game-card.trick .card-type { color: #5c5478; }
.game-card.equip { background: linear-gradient(168deg, #e2ecdf, #bccdb8); border-color: #5d7a58; }
.game-card.equip .card-type { color: #4d6a48; }

#hand-area .game-card:hover { transform: translateY(-30px) scale(1.08); z-index: 10; box-shadow: 0 16px 32px var(--shadow), 0 0 18px rgba(240,207,110,.45); }
#hand-area .game-card.disabled { filter: grayscale(.75) brightness(.7); cursor: not-allowed; }
#hand-area .game-card.disabled:hover { transform: translateY(-8px); }
#hand-area .game-card.selectable-glow { box-shadow: 0 4px 12px var(--shadow), 0 0 16px rgba(240,207,110,.65); animation: cardPulse 1.2s ease-in-out infinite; }
@keyframes cardPulse { 50% { box-shadow: 0 4px 12px var(--shadow), 0 0 26px rgba(240,207,110,.95) } }
#hand-area .game-card.picked { transform: translateY(-38px) scale(1.08); box-shadow: 0 16px 32px var(--shadow), 0 0 22px rgba(232,85,74,.8); }
.game-card.dealt { animation: dealIn .35s cubic-bezier(.2,1.2,.4,1) backwards; }
@keyframes dealIn { from { opacity: 0; transform: translateY(80px) rotate(8deg) scale(.7) } to { opacity: 1 } }

/* 结算区的牌 */
#resolve-cards .game-card { cursor: default; margin: 0; animation: resolveIn .4s cubic-bezier(.2,1.3,.4,1); }
#resolve-cards .game-card.fading { animation: resolveOut .5s forwards; }
@keyframes resolveIn { from { opacity: 0; transform: translateY(60px) scale(.6) rotate(-6deg) } to { opacity: 1 } }
@keyframes resolveOut { to { opacity: 0; transform: translateY(-30px) scale(.85); filter: blur(3px) } }
#resolve-cards .resolve-tag { position: absolute; top: -24px; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--gold-bright); letter-spacing: .15em; text-shadow: 0 1px 3px #000; }

/* 技能按钮 */
.player-skill-bar { display: flex; flex-direction: column; gap: 7px; margin-bottom: 4px; }
.skill-btn {
  font-family: var(--font-title); font-size: 15px; letter-spacing: .12em; color: #aecbe8;
  background: linear-gradient(165deg, rgba(62,110,158,.35), rgba(62,110,158,.15));
  border: 1px solid rgba(62,110,158,.7); border-radius: 6px; padding: 7px 12px; cursor: help;
  transition: all .15s; position: relative; text-align: left;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.skill-btn.active-skill { cursor: pointer; color: var(--gold-bright); background: linear-gradient(165deg, rgba(201,162,39,.3), rgba(201,162,39,.1)); border-color: var(--gold); }
.skill-btn.active-skill:hover:not(:disabled) { box-shadow: 0 0 14px rgba(201,162,39,.5); transform: translateX(3px); }
.skill-btn:disabled { opacity: .4; cursor: not-allowed; }
.skill-btn .skill-mark {
  font-size: 10px; opacity: .85; margin-left: auto; flex-shrink: 0;
  border: 1px solid currentColor; border-radius: 8px; padding: 1px 6px; line-height: 1.35; letter-spacing: 0;
}

.deck-info { display: flex; gap: 14px; align-items: flex-start; margin-left: 6px; }
.pile-col { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pile-cap { font-size: 10.5px; color: var(--paper-dim); letter-spacing: .06em; white-space: nowrap; }
.pile { width: 46px; height: 64px; border-radius: 6px; position: relative; display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--paper); }
.pile.deck { background: linear-gradient(160deg, #5d2420, #38120f); border: 1px solid #8a4a40; box-shadow: 2px 2px 0 #2a0d0a, 4px 4px 0 #1d0806, 0 6px 14px var(--shadow); }
.pile.discard { background: #181208; border: 1px dashed rgba(201,187,155,.4); color: var(--paper-dim); }
.pile.enemy-pile { background: linear-gradient(160deg, #2a3550, #141a2e); border: 1px solid #4a5a82; box-shadow: 2px 2px 0 #0c1020, 4px 4px 0 #080a16, 0 6px 14px var(--shadow); color: #c8d4ee; }
.pile-col:has(.enemy-pile) .pile-cap { color: #93a6cc; }
.pile::after { content: attr(data-count); }

#btn-endturn { position: absolute; right: 3vw; bottom: 21vh; z-index: 25; letter-spacing: .2em; font-size: 17px; padding: 12px 26px; }
#btn-endturn.urging { animation: nodeGlow 1.4s ease-in-out infinite; border-color: var(--gold-bright); }

/* 回合横幅 */
#turn-banner {
  position: absolute; top: 38%; left: 0; right: 0; text-align: center; z-index: 40; pointer-events: none;
  font-family: var(--font-brush); font-size: 64px; color: var(--paper);
  text-shadow: 0 0 30px rgba(201,162,39,.6), 0 4px 16px #000;
  animation: bannerSweep 1.2s cubic-bezier(.3,.8,.3,1) forwards;
}
#turn-banner.enemy-turn { color: var(--cinnabar-bright); text-shadow: 0 0 30px rgba(192,48,40,.7), 0 4px 16px #000; }
@keyframes bannerSweep {
  0% { opacity: 0; transform: translateX(-120px) scaleX(1.4); filter: blur(8px) }
  18% { opacity: 1; transform: none; filter: none }
  78% { opacity: 1; transform: none }
  100% { opacity: 0; transform: translateX(120px); filter: blur(6px) }
}

/* 刀光特效 */
.slash-fx {
  position: absolute; width: 200px; height: 200px; pointer-events: none; z-index: 45;
  transform: translate(-50%, -50%);
}
.slash-fx::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 38%, rgba(255,255,255,.95) 49%, rgba(240,207,110,.9) 51%, transparent 62%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  animation: slashSweep .32s cubic-bezier(.2,.8,.3,1) forwards;
}
@keyframes slashSweep {
  0% { transform: rotate(-15deg) scale(.3); opacity: 0 }
  25% { opacity: 1 }
  100% { transform: rotate(20deg) scale(1.5); opacity: 0 }
}
.slash-fx.fire::before { background: linear-gradient(135deg, transparent 35%, rgba(255,150,40,.95) 49%, rgba(220,60,20,.9) 53%, transparent 65%); }
.slash-fx.thunder::before { background: linear-gradient(100deg, transparent 42%, rgba(160,200,255,1) 49%, rgba(90,130,255,.95) 52%, transparent 60%); animation-duration: .22s; }

/* 浮动伤害数字 */
.float-num {
  position: absolute; z-index: 48; pointer-events: none; font-family: var(--font-title);
  font-size: 44px; font-weight: 700; color: var(--cinnabar-bright);
  text-shadow: 0 0 12px rgba(192,48,40,.8), 0 3px 6px #000;
  animation: floatUp 1s cubic-bezier(.2,.8,.4,1) forwards;
}
.float-num.heal { color: #6fd29a; text-shadow: 0 0 12px rgba(74,193,129,.8), 0 3px 6px #000; }
.float-num.shield { color: #aecbe8; font-size: 30px; }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.4) }
  15% { opacity: 1; transform: translate(-50%, -16px) scale(1.25) }
  100% { opacity: 0; transform: translate(-50%, -90px) scale(.9) }
}

/* 判定翻牌 */
/* 判定特效：居中翻牌大显示 + 按花色发光，停留后缩入牌堆 */
.judge-layer { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; pointer-events: none; }
.judge-layer::before { content: ''; position: absolute; inset: 0; animation: judgeDim .3s ease forwards;
  background: radial-gradient(circle at center, rgba(8,6,4,.5), rgba(8,6,4,.78)); }
@keyframes judgeDim { from { opacity: 0 } to { opacity: 1 } }
.judge-banner { position: relative; font-size: 21px; letter-spacing: .32em; color: var(--gold-bright);
  text-shadow: 0 2px 10px #000, 0 0 20px rgba(240,207,110,.6); animation: judgeBanner .5s backwards; }
@keyframes judgeBanner { from { opacity: 0; transform: translateY(-14px) } }
.judge-card { position: relative; transform: scale(1.3); animation: judgeReveal .58s cubic-bezier(.2,1.35,.4,1) backwards; }
.judge-card.judge-red  { box-shadow: 0 0 0 2px rgba(216,72,63,.85), 0 0 36px 7px rgba(216,72,63,.55), 0 16px 44px #000; }
.judge-card.judge-black { box-shadow: 0 0 0 2px rgba(120,170,230,.85), 0 0 36px 7px rgba(86,140,212,.5), 0 16px 44px #000; }
@keyframes judgeReveal { 0% { transform: scale(.5) rotateY(90deg); opacity: 0 }
  58% { transform: scale(1.46) rotateY(0deg); opacity: 1 } 100% { transform: scale(1.3) rotateY(0deg); opacity: 1 } }
.judge-layer.judge-out { animation: judgeOut .42s cubic-bezier(.4,0,.7,.4) forwards; }
@keyframes judgeOut { to { opacity: 0; transform: translateY(64px) scale(.42); filter: blur(2px) } }
/* 判定结果：生效 / 失效（翻牌后弹出）*/
.judge-result { position: relative; margin-top: 18px; font-family: var(--font-brush); font-size: 30px;
  letter-spacing: .16em; padding: 4px 22px; border-radius: 10px; opacity: 0;
  animation: judgeResPop .4s cubic-bezier(.2,1.5,.4,1) .5s forwards; text-shadow: 0 2px 10px #000; }
.judge-result.ok { color: #ffe9a8; background: rgba(74,143,109,.32); border: 1.5px solid rgba(120,210,150,.8); box-shadow: 0 0 22px rgba(90,200,130,.5); }
.judge-result.no { color: #e7d8c0; background: rgba(120,120,130,.3); border: 1.5px solid rgba(170,170,180,.65); }
@keyframes judgeResPop { 0% { opacity: 0; transform: scale(.6) translateY(10px) } 100% { opacity: 1; transform: scale(1) translateY(0) } }

/* ============ 浮层（奖励/事件/商店等） ============ */
.screen.overlay { z-index: 60; background: rgba(8,6,4,.78); backdrop-filter: blur(4px); justify-content: center; animation: fadeIn .25s; }
.overlay-panel {
  width: min(880px, 92vw); max-height: min(88vh, 88dvh); overflow-y: auto; scrollbar-width: thin;
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
  background: linear-gradient(172deg, #28201420 , transparent), linear-gradient(172deg, #2b2316, #181208);
  border: 1px solid rgba(201,162,39,.55); border-radius: 14px; padding: 34px 38px;
  box-shadow: 0 24px 70px rgba(0,0,0,.8), inset 0 1px 0 rgba(240,207,110,.2);
  animation: panelIn .35s cubic-bezier(.2,1.2,.4,1);
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
@keyframes panelIn { from { opacity: 0; transform: translateY(36px) scale(.96) } to { opacity: 1 } }
.overlay-panel h2 { font-family: var(--font-brush); font-size: 42px; color: var(--gold-bright); text-shadow: 0 2px 12px var(--shadow); }
.overlay-panel h2.danger { color: var(--cinnabar-bright); }
.overlay-panel .panel-desc { color: var(--paper-dim); line-height: 1.8; text-align: center; max-width: 560px; }
.overlay-panel .panel-row { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
/* 商店货架：内部滚动，保证"离开"按钮始终可见不被挤出底部 */
.overlay-panel .panel-row.shop-goods { width: 100%; max-height: 60vh; overflow-y: auto; align-content: flex-start; padding: 4px; }

.reward-option {
  width: 196px; min-height: 200px; border-radius: 10px; padding: 16px 14px; cursor: pointer; text-align: center;
  background: linear-gradient(170deg, rgba(50,40,24,.46), rgba(29,22,13,.52));
  -webkit-backdrop-filter: blur(7px) saturate(1.1); backdrop-filter: blur(7px) saturate(1.1);
  border: 1px solid rgba(201,187,155,.4);
  box-shadow: inset 0 1px 0 rgba(240,207,110,.14);
  transition: transform .2s cubic-bezier(.2,1.4,.4,1), border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.reward-option:hover { transform: translateY(-7px); border-color: var(--gold-bright); box-shadow: 0 12px 30px var(--shadow), 0 0 18px rgba(201,162,39,.35); }
.reward-option .rw-icon {
  width: 60px; height: 60px; border-radius: 50%; margin: 4px auto 0;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: radial-gradient(circle at 38% 32%, #3d3120, #1c150c 75%);
  border: 1px solid rgba(201,162,39,.55);
  box-shadow: inset 0 1px 6px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
}
.reward-option .rw-img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold); margin-top: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.reward-option .rw-card-thumb { width: 48px; height: 66px; border-radius: 6px; object-fit: cover; border: 1px solid var(--gold); margin-top: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.reward-option .rw-name { font-family: var(--font-title); font-size: 20px; color: var(--gold-bright); letter-spacing: .08em; }
.reward-option .rw-desc { font-size: 12.5px; color: var(--paper-dim); line-height: 1.65; }
.reward-option .rw-tag { font-size: 11px; padding: 1px 9px; border-radius: 8px; border: 1px solid rgba(62,110,158,.6); color: #aecbe8; }
.reward-option .rw-tag.rare { border-color: var(--gold); color: var(--gold-bright); }
.reward-option.sold { filter: grayscale(1) brightness(.55); pointer-events: none; }
.reward-option.event-choice { min-height: 0; width: 250px; padding: 20px 18px; justify-content: center; }
.reward-option .rw-price { color: var(--gold-bright); font-size: 15px; margin-top: auto; }
.reward-option.cant-afford .rw-price { color: var(--cinnabar-bright); }

/* 行囊 / 技能管理 */
.bag-section { width: 100%; }
.bag-section h3 { font-family: var(--font-title); color: var(--gold); letter-spacing: .15em; font-size: 18px; margin-bottom: 10px; border-bottom: 1px solid rgba(201,162,39,.25); padding-bottom: 6px; }
.bag-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.bag-skill { background: rgba(62,110,158,.18); border: 1px solid rgba(62,110,158,.55); border-radius: 8px; padding: 10px 14px; max-width: 240px; }
.bag-skill .bs-name { color: #cfe2f5; font-size: 16px; font-family: var(--font-title); }
.bag-skill .bs-desc { color: var(--paper-dim); font-size: 12px; line-height: 1.55; margin-top: 3px; }
.bag-skill.empty-slot { border-style: dashed; opacity: .5; display: flex; align-items: center; justify-content: center; min-width: 110px; color: var(--paper-dim); }
.bag-skill.replace-target { cursor: pointer; }
.bag-skill.replace-target:hover { border-color: var(--cinnabar-bright); box-shadow: 0 0 14px rgba(192,48,40,.4); }

/* 战利品横幅 */
.loot-banner { font-size: 18px; color: var(--gold-bright); letter-spacing: .1em; }

/* 胜利/失败 */
.end-title { font-family: var(--font-brush); font-size: 84px; }
.end-title.victory { color: var(--gold-bright); text-shadow: 0 0 40px rgba(201,162,39,.7); animation: charDrop .9s cubic-bezier(.2,1.5,.4,1); }
.end-title.defeat { color: var(--cinnabar-bright); text-shadow: 0 0 40px rgba(192,48,40,.6); animation: charDrop .9s cubic-bezier(.2,1.5,.4,1); }

/* 响应式 */
@media (max-width: 900px) {
  .fighter-area.player { left: 2vw; bottom: 22vh; }
  .fighter-card { width: 128px; }
  .fighter-area.enemy .fighter-card { width: 150px; }
  #battle-log { width: 170px; font-size: 11.5px; }
  .game-card { width: 88px; height: 126px; }
}


/* ============ 自定义 Tooltip ============ */
#game-tooltip {
  position: fixed; z-index: 200; max-width: 260px; pointer-events: none;
  background: linear-gradient(172deg, #2e2517, #1a140c);
  border: 1px solid var(--gold); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; line-height: 1.6; color: var(--paper);
  box-shadow: 0 10px 30px rgba(0,0,0,.8), 0 0 14px rgba(201,162,39,.2);
  opacity: 0; transition: opacity .12s; white-space: normal;
}
#game-tooltip.show { opacity: 1; }
#game-tooltip b { color: var(--gold-bright); }

/* ============ 设置 ============ */
.gear-btn {
  position: absolute; top: 14px; right: 20px; z-index: 30;
  width: 42px; height: 42px; border-radius: 50%; font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
  background: rgba(40,32,20,.85); border: 1px solid rgba(201,162,39,.5); color: var(--gold-bright);
  transition: transform .3s, box-shadow .2s;
}
.gear-btn:hover { transform: rotate(60deg); box-shadow: 0 0 14px rgba(201,162,39,.4); }
#screen-map .gear-btn { position: static; width: auto; height: auto; border-radius: 6px; padding: 7px 14px; font-size: 14px; }
.settings-row { display: flex; align-items: center; gap: 16px; width: min(420px, 80vw); }
.settings-row label { width: 110px; color: var(--paper-dim); letter-spacing: .1em; flex-shrink: 0; }
.settings-row input[type=range] { flex: 1; accent-color: var(--gold); height: 6px; cursor: pointer; }
.settings-row .lang-btn { flex: 1; }
.lang-btn.on { border-color: var(--gold-bright); color: var(--gold-bright); box-shadow: 0 0 12px rgba(201,162,39,.35); }

#screen-battle .gear-btn { top: 10px; right: 14px; width: 36px; height: 36px; font-size: 16px; z-index: 35; }

/* ============ 移动端 ============ */
@media (max-width: 700px) {
  .game-title { font-size: clamp(44px, 14vw, 80px); }
  .title-buttons { flex-direction: column; gap: 14px; align-items: center; width: 100%; }
  .title-buttons .btn-ink.big { font-size: 20px; padding: 13px 0; width: min(260px, 70vw); text-align: center; }
  .hero-card { width: clamp(150px, 44vw, 200px); }
  .hero-card .hero-skill { font-size: 11.5px; }
  .fighter-area.enemy .fighter-card { width: 132px; }
  .fighter-area.player { left: 1.5vw; bottom: 24vh; gap: 8px; }
  .fighter-card { width: 108px; }
  .player-skill-bar { position: absolute; left: 116px; bottom: 0; }
  .deck-info { display: flex; flex-direction: column; gap: 7px; position: fixed; right: 3px; top: 34%; margin: 0; z-index: 8; }
  .deck-info .pile { width: 30px; height: 42px; font-size: 12px; }
  .deck-info .pile-cap { font-size: 8px; letter-spacing: 0; }
  .pile-col { gap: 1px; }
  #battle-log { width: 132px; font-size: 10.5px; max-height: 30vh; }
  #hand-area { height: calc(20vh + 56px); min-height: 170px; padding-top: 56px; }
  .game-card { width: 76px; height: 110px; margin: 0 -18px; }
  .game-card .card-name { font-size: 14px; line-height: 16px; top: 38px; left: 4px; width: 18px; }
  .game-card .card-name.long { font-size: 10px; }
  .game-card .card-name.h-en { font-size: 10px; line-height: 13px; width: 13px; top: 32px; left: 2px; max-height: calc(100% - 38px); }
  .game-card .card-name.h-en.long { font-size: 9px; }
  .game-card .card-corner { font-size: 10px; top: 3px; left: 4px; padding: 1px 3px; }
  .game-card .card-corner .suit { font-size: 11px; }
  .hide-m { display: none; }
  #btn-deckview { font-size: 16px; padding: 5px 10px; letter-spacing: 0; text-indent: 0; }
  #btn-endturn { right: 2vw; bottom: 24vh; font-size: 14px; padding: 9px 16px; }
  #turn-banner { font-size: 42px; }
  .overlay-panel { padding: 22px 14px; gap: 12px; }
  .overlay-panel h2 { font-size: 30px; }
  .reward-option { width: 150px; min-height: 170px; }
  .map-header { padding: 10px 12px; }
  .act-name { font-size: 20px; }
  .run-stats { gap: 10px; font-size: 13.5px; }
  .map-node { width: 52px; height: 52px; font-size: 20px; }
  .map-node.boss { width: 74px; height: 74px; font-size: 32px; }
  #prompt-bar { flex-wrap: wrap; max-width: 94vw; padding: 8px 12px; gap: 8px; }
  body.en .btn-ink { font-size: 13px; padding: 8px 14px; }
  body.en .btn-ink.big { font-size: 16px; padding: 11px 22px; }
  body.en .screen-title, body.en .overlay-panel h2 { font-size: 24px; }
  body.en #turn-banner { font-size: 30px; }
  body.en .end-title { font-size: 30px; }
  #prompt-text { font-size: 13.5px; }
}


/* IRON FRONT 拉丁标题 */
.game-title.latin { font-family: Georgia, 'Times New Roman', serif; font-weight: 800; letter-spacing: .12em; gap: .3em; }
.game-title.latin span { animation-delay: .08s; }
.game-title.latin .accent { color: var(--cinnabar-bright); animation-delay: .3s; }
body.en .game-title.latin { font-size: clamp(46px, 9vw, 110px); }
@media (max-width: 700px) { body.en .game-title.latin { font-size: clamp(34px, 11vw, 60px); } }

/* ============ 豪华化 · 鎏金装饰 ============ */
.fighter-card {
  border: 1px solid rgba(201,162,39,.65);
  box-shadow: 0 8px 26px var(--shadow), inset 0 0 0 1px rgba(0,0,0,.6), inset 0 0 0 2px rgba(201,162,39,.28);
}
.fighter-card::before, .fighter-card::after {
  content: '◆'; position: absolute; font-size: 9px; color: var(--gold); z-index: 3;
  text-shadow: 0 0 6px rgba(201,162,39,.8);
}
.fighter-card::before { top: 2px; left: 5px; }
.fighter-card::after { top: 2px; right: 5px; }

.overlay-panel {
  box-shadow: 0 24px 70px rgba(0,0,0,.8), inset 0 1px 0 rgba(240,207,110,.2), inset 0 0 0 1px rgba(0,0,0,.5), inset 0 0 0 2px rgba(201,162,39,.22);
}
.overlay-panel h2 { position: relative; padding-bottom: 14px; }
.overlay-panel h2::after {
  content: ''; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(320px, 60vw); height: 10px;
  background:
    radial-gradient(circle 4px at 50% 50%, var(--gold-bright) 40%, transparent 41%),
    linear-gradient(90deg, transparent, rgba(201,162,39,.75) 18%, rgba(201,162,39,.75) 82%, transparent) 50% 50% / 100% 1px no-repeat;
}

.btn-ink { overflow: hidden; }
.btn-ink::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 36%; left: -45%;
  background: linear-gradient(105deg, transparent, rgba(240,207,110,.28), transparent);
  transform: skewX(-18deg); transition: left .45s ease; pointer-events: none;
}
.btn-ink:hover::after { left: 115%; }

.hp-bar { box-shadow: inset 0 1px 3px rgba(0,0,0,.8), 0 1px 0 rgba(240,207,110,.12); }
.hp-bar .hp-ticks {
  position: absolute; inset: 0; pointer-events: none; border-radius: 8px;
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc(var(--seg) - 1px), rgba(0,0,0,.55) calc(var(--seg) - 1px), rgba(0,0,0,.55) var(--seg));
}

.reward-option { box-shadow: 0 4px 14px var(--shadow), inset 0 0 0 1px rgba(0,0,0,.4); }
.reward-option:hover { box-shadow: 0 12px 30px var(--shadow), 0 0 18px rgba(201,162,39,.35), inset 0 0 0 1px rgba(240,207,110,.35); }

.map-node { box-shadow: 0 4px 12px var(--shadow), 0 0 0 3px rgba(20,16,12,.9), 0 0 0 4px rgba(201,162,39,.25); }
.map-node.boss { box-shadow: 0 4px 16px var(--shadow), 0 0 0 4px rgba(20,16,12,.9), 0 0 0 5px rgba(201,162,39,.45), 0 0 24px rgba(192,48,40,.25); }

.bag-skill.set-done { border-color: var(--gold-bright); box-shadow: 0 0 14px rgba(201,162,39,.35); background: rgba(201,162,39,.10); }

.skill-tag, .equip-tag { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 1px 3px rgba(0,0,0,.4); }

#hand-area::before {
  content: ''; position: absolute; left: 6%; right: 6%; top: 46px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,.28), transparent);
}


/* ============ 勾玉血条 ============ */
.hp-bar.gem-bar { background: transparent; border: none; overflow: visible; height: auto; min-height: 18px; box-shadow: none; }
.hp-gems {
  display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap;
  padding: 2px 0; cursor: help;
}
.gem {
  width: 12px; height: 12px; flex-shrink: 0;
  border-radius: 58% 58% 58% 10%;
  transform: rotate(-45deg);
  box-shadow: inset -1px -1px 2px rgba(0,0,0,.55), 0 0 5px currentColor;
  transition: background .3s;
}
.hp-gems.small .gem { width: 9px; height: 9px; }
.gem.g { background: radial-gradient(circle at 35% 30%, #aef3be, #2ea84f 62%, #155f2a); color: rgba(63,208,107,.7); }
.gem.y { background: radial-gradient(circle at 35% 30%, #ffeaa4, #d8a624 62%, #7a5a10); color: rgba(232,193,74,.7); }
.gem.r { background: radial-gradient(circle at 35% 30%, #ffb3a8, #d04030 62%, #6e150d); color: rgba(255,106,85,.8); animation: hpFlash 1s ease-in-out infinite; }
.gem.empty { background: #161009; box-shadow: inset 0 0 3px #000, 0 0 0 1px rgba(201,187,155,.28); color: transparent; }


/* ============ 地图节点徽章图标 ============ */
.map-node { overflow: visible; }
.map-node .node-art {
  position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px);
  border-radius: 50%; object-fit: cover; z-index: 1;
}
.map-node:has(.node-art) .node-emoji { display: none; }
.map-node .node-label {
  position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  background: rgba(16,12,8,.85); border: 1px solid rgba(201,162,39,.35);
  padding: 1px 8px; border-radius: 8px; white-space: nowrap; z-index: 2;
  margin-top: 0; font-size: 10px;
}
.map-node.cleared .node-art { filter: grayscale(.8) brightness(.6); }


/* ============ 技能/奖励图标 ============ */
.rw-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(201,162,39,.55); box-shadow: 0 3px 10px rgba(0,0,0,.5); margin-top: 4px; }
.skill-icon { border-radius: 6px; object-fit: cover; border: 1px solid rgba(201,162,39,.4); vertical-align: middle; flex-shrink: 0; }
.skill-btn .skill-icon { margin-right: 7px; }
.bag-skill.with-icon { display: flex; gap: 10px; align-items: flex-start; }


/* ============ 一对多战斗 ============ */
.enemy-row { display: flex; gap: 16px; justify-content: center; align-items: flex-start; }
.enemy-row.multi .fighter-card { width: 148px; }
.enemy-row.crowd .fighter-card { width: 124px; }
.fighter-card.dead { filter: grayscale(1) brightness(.45); pointer-events: none; position: relative; }
.fighter-card.dead::after { content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; color: rgba(232,85,74,.85); text-shadow: 0 2px 10px #000; z-index: 5; }
.fighter-card.targetable {
  cursor: pointer; border-color: var(--cinnabar-bright);
  animation: targetGlow 1s ease-in-out infinite;
}
@keyframes targetGlow { 0%,100% { box-shadow: 0 0 10px rgba(232,85,74,.5) } 50% { box-shadow: 0 0 26px rgba(232,85,74,.95) } }
@media (max-width: 700px) {
  .enemy-row { gap: 8px; }
  .enemy-row.multi .fighter-card { width: 112px; }
  .enemy-row.crowd .fighter-card { width: 96px; }
}

/* 标题页退出游戏按钮：主按钮下方独立一行 */
#screen-title .quit-btn { z-index: 1; opacity: .7; animation: fadeIn 1s 1.3s backwards; }
#screen-title .quit-btn:hover { opacity: 1; }

/* 去 emoji：迷你勾玉、铜钱图标、齿轮/行囊图标、事件图标横幅 */
.gem-mini { display: inline-block; width: 13px; height: 13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); vertical-align: -2px; background: radial-gradient(circle at 35% 30%, #7fe0a0, #2e8f57 70%); box-shadow: inset 0 -2px 3px rgba(0,0,0,.35), 0 0 4px rgba(127,224,160,.4); }
.coin-ico { width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; border: 1px solid rgba(201,162,39,.5); }
.gear-img { width: 24px; height: 24px; border-radius: 50%; display: block; }
.bag-ico { width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; border: 1px solid rgba(201,162,39,.4); }
.ev-banner { text-align: center; margin-bottom: 2px; }
.ev-banner .rw-img { width: 72px; height: 72px; }

/* 阵前对阵 */
.intro-row { align-items: stretch; }
.intro-foe { width: 200px; padding: 12px 14px 14px; border: 1px solid rgba(201,162,39,.4); border-radius: 10px; background: linear-gradient(170deg, rgba(58,47,35,.55), rgba(20,16,12,.65)); text-align: center; }
.intro-foe.boss { border-color: rgba(192,48,40,.65); box-shadow: 0 0 18px rgba(192,48,40,.25); }
.intro-portrait { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--gold); box-shadow: 0 4px 14px var(--shadow); margin-bottom: 6px; }
.intro-name { font-family: var(--font-title); font-size: 20px; color: var(--gold-bright); }
.intro-title { font-size: 12.5px; color: var(--paper-dim); margin: 3px 0 6px; line-height: 1.4; }
.intro-skills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-bottom: 6px; }
.intro-skill { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; padding: 2px 7px; border: 1px solid rgba(201,162,39,.35); border-radius: 9px; background: rgba(0,0,0,.25); }
.taunt-bubble { position: relative; margin-top: 4px; padding: 7px 10px; font-size: 13px; line-height: 1.5; color: #e8d9b0; background: rgba(192,48,40,.16); border: 1px solid rgba(192,48,40,.4); border-radius: 10px; font-style: italic; }
.battle-cry { margin: 12px auto 2px; max-width: 560px; font-size: 14.5px; color: var(--gold-bright); text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.act-boss-preview { margin: 10px auto 4px; }
@media (max-width: 700px) {
  .intro-foe { width: 150px; padding: 9px 10px 11px; }
  .intro-portrait { width: 68px; height: 68px; }
  .intro-name { font-size: 16px; }
  .taunt-bubble { font-size: 12px; }
}

/* 模式选择全幅大卡 */
.mode-card {
  position: relative; width: 215px; height: 320px; border-radius: 14px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(201,162,39,.5); background: linear-gradient(170deg, #2b2218, #14100c);
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform .25s cubic-bezier(.2,1.4,.4,1), box-shadow .25s, border-color .25s;
}
.mode-card:hover { transform: translateY(-10px) scale(1.03); border-color: var(--gold-bright); box-shadow: 0 18px 44px var(--shadow), 0 0 26px rgba(201,162,39,.35); }
.mode-card .mode-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mode-card .mode-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, transparent 30%, transparent 46%, rgba(8,5,3,.92) 82%); }
.mode-card .mode-emblem { position: absolute; left: 50%; transform: translateX(-50%); bottom: 108px; width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--gold); box-shadow: 0 2px 10px rgba(0,0,0,.7); }
.mode-card .mode-name { position: absolute; left: 0; right: 0; bottom: 66px; text-align: center; font-family: var(--font-brush); font-size: 27px; color: var(--gold-bright); text-shadow: 0 2px 8px rgba(0,0,0,.9); letter-spacing: .1em; }
.mode-card .mode-desc { position: absolute; left: 14px; right: 14px; bottom: 12px; text-align: center; font-size: 12.5px; line-height: 1.5; color: #d8cbab; text-shadow: 0 1px 4px rgba(0,0,0,.9); }
body.en .mode-card .mode-name { font-family: var(--font-title); font-size: 21px; letter-spacing: .03em; }
@media (max-width: 700px) {
  .mode-row { flex-direction: column; align-items: center; gap: 12px; width: 100%; }
  .mode-card { width: 100%; max-width: 340px; height: 150px; flex: 0 0 auto; }
  .mode-card .mode-art { object-position: center 25%; }
  .mode-card .mode-emblem { left: 18px; transform: none; bottom: auto; top: 14px; width: 38px; height: 38px; }
  .mode-card .mode-name { left: 70px; right: auto; bottom: auto; top: 18px; text-align: left; font-size: 22px; }
  .mode-card .mode-desc { left: 70px; right: 12px; bottom: 14px; text-align: left; }
}

/* 弹窗场景背景 */
.overlay-panel.has-backdrop { background-size: cover; background-position: center; }
.overlay-panel.has-backdrop h2, .overlay-panel.has-backdrop .panel-desc { text-shadow: 0 1px 6px rgba(0,0,0,.85); }

/* 行囊：宝物/珍藏配图 */
.bag-art.round { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--gold); flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.bag-art.card { width: 38px; height: 52px; border-radius: 5px; object-fit: cover; border: 1px solid var(--gold); flex: 0 0 auto; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.set-piece { display: inline-flex; align-items: center; gap: 4px; margin: 2px 6px 2px 0; font-size: 11.5px; opacity: .45; }
.set-piece img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(201,162,39,.4); filter: grayscale(1); }
.set-piece.owned { opacity: 1; color: var(--gold-bright); }
.set-piece.owned img { filter: none; border-color: var(--gold-bright); box-shadow: 0 0 6px rgba(240,207,110,.4); }

/* 主动技不可用态（代替 disabled，保留悬停/点按弹说明） */
.skill-btn.off { opacity: .45; cursor: default; }
.skill-btn.active-skill.off:hover { box-shadow: none; transform: none; }

/* 义军（盟友）卡 */
#ally-row { display: flex; gap: 8px; margin-top: 6px; }
.ally-fighter { width: 118px; border: 1px solid rgba(74,143,109,.65); border-radius: 10px; padding: 7px 7px 9px; background: linear-gradient(170deg, rgba(34,48,40,.6), rgba(16,22,18,.7)); box-shadow: 0 4px 14px var(--shadow); position: relative; }
.ally-fighter .portrait { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; }
.ally-fighter .portrait img, .ally-fighter .portrait svg { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ally-fighter .fighter-name { font-size: 14px; margin-top: 3px; color: #9fd8b8; }
.ally-fighter .skill-tag { font-size: 10px; padding: 1px 5px; }
.ally-fighter .hand-count { position: absolute; top: 5px; right: 6px; font-size: 11px; color: #cfe2d5; background: rgba(0,0,0,.55); border-radius: 8px; padding: 1px 6px; }
.ally-fighter.dead { filter: grayscale(1) brightness(.5); }
.ally-fighter.dead::after { content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 44px; color: rgba(232,85,74,.85); }
.battle-cry.ally-note { color: #9fd8b8; }
@media (max-width: 700px) {
  .ally-fighter { width: 84px; padding: 5px 5px 6px; }
  .ally-fighter .fighter-name { font-size: 11px; }
  .ally-fighter .skill-tag { display: none; }
}

/* 中央牌堆：出过的牌留在桌面，最新一张永远在堆顶 */
#resolve-cards .resolve-played + .resolve-played { margin-left: -76px; }
#resolve-cards .resolve-played.pile-under { filter: brightness(.72) saturate(.85); box-shadow: 0 2px 8px var(--shadow); }
#resolve-cards .resolve-played.pile-under .resolve-tag { opacity: 0; transition: opacity .3s; }
@media (max-width: 700px) {
  #resolve-cards .resolve-played + .resolve-played { margin-left: -56px; }
}

/* 牌堆居中校正：结算区实际延伸到屏幕底，扣除手牌/玩家区高度后再垂直居中，让牌堆落在敌我之间的桌面中央 */
.resolve-zone { padding-bottom: 26vh; }
@media (max-width: 700px) {
  .resolve-zone { padding-bottom: 30vh; }
}
