/* usagi · css/style.css —— 奶油色软萌 + 移动端自适应 */
:root {
  --cream: #f7ecd9; --paper: #fff8ec; --ink: #4a3b32; --ink2: #7a6658;
  --gold: #d9a54b; --banana: #f2c14e; --leaf: #7d9b6a; --pink: #e8a9c0;
  --purple: #b9a6d6; --shadow: rgba(90, 60, 90, .18);
  --r-lg: 22px; --r-md: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
@supports (height: 100dvh) {
  html, body { height: 100dvh; }
  .title-plate { max-height: calc(100dvh - 24px); }
}
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); background: var(--cream); user-select: none;
}
button { font-family: inherit; cursor: pointer; border: none; }
.is-hidden { display: none !important; }
#app, .screen { height: 100%; width: 100%; }

/* ---------- 屏幕 ---------- */
.screen { position: absolute; inset: 0; display: block; }

/* ---------- 标题 ---------- */
#screen-title { display: flex; align-items: center; justify-content: center; }
.title-bg {
  position: absolute; inset: 0;
  background: center/cover no-repeat url("../assets/art/gen/title-bg.png"), radial-gradient(120% 90% at 50% 20%, #f9e8c8, #e8c9a2 70%);
}
.title-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(70, 40, 30, .45)); }
.title-plate {
  position: relative; max-width: 560px; width: 88%;
  background: linear-gradient(160deg, #fffaf0, #f7e9d2);
  border: 3px solid #e5c890; border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(80, 50, 20, .35);
  padding: 24px 26px 18px; text-align: center;
  max-height: calc(100vh - 24px); overflow-y: auto;
}
.seal-row { display: flex; gap: 10px; justify-content: center; align-items: baseline; }
.seal {
  background: #a53d2c; color: #fff; font-size: 12px; letter-spacing: 4px;
  padding: 4px 10px 2px 14px; border-radius: 4px; writing-mode: vertical-rl; height: 44px;
}
.seal-tag { font-size: 12px; color: var(--ink2); letter-spacing: 2px; }
.title-cn { margin: 10px 0 2px; font-size: clamp(30px, 7vw, 44px); letter-spacing: 6px; font-weight: 800; }
.title-sub { margin: 0 0 16px; color: var(--ink2); font-size: 13px; letter-spacing: 1px; }
.title-btns { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 8px; }
.btn-big {
  background: var(--gold); color: #fff; font-size: 18px; letter-spacing: 8px; font-weight: 700;
  padding: 13px 0; border-radius: 999px; box-shadow: 0 6px 0 #b5812f;
  transition: transform .08s, box-shadow .08s;
}
.btn-big:active { transform: translateY(3px); box-shadow: 0 2px 0 #b5812f; }
.btn-big.btn-ghost { background: #fff4df; color: var(--ink); box-shadow: 0 6px 0 #ddc79b; letter-spacing: 2px; }
.btn-big.btn-ghost:active { box-shadow: 0 2px 0 #ddc79b; }
.title-note { font-size: 11px; color: var(--ink2); opacity: .8; margin: 6px 0 0; }
/* 角色选择 */
.char-label { margin: 7px 0 3px; color: #b5812f; font-size: 11px; letter-spacing: 3px; font-weight: 800; text-align: left; }
.char-label span { color: var(--ink2); font-size: 9.5px; letter-spacing: 1px; font-weight: 500; }
.char-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 4px 0 2px; }
.partner-row { grid-template-columns: repeat(4, 1fr); margin-bottom: 4px; }
.char-card {
  background: #fff6e2; border: 2.5px solid #e8d3a4; border-radius: 16px; padding: 8px 6px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; transition: transform .12s, border-color .12s;
}
.char-card img { width: 62px; height: 62px; object-fit: contain; border-radius: 12px; background: #f6e8cf; }
.char-card b { font-size: 13.5px; letter-spacing: 1px; }
.char-card i { font-style: normal; font-size: 9.5px; color: var(--ink2); line-height: 1.35; min-height: 26px; }
.partner-row .char-card { padding-left: 4px; padding-right: 4px; }
.partner-row .char-card img { width: 54px; height: 54px; }
.partner-row .partner-momonga img { background: #eaf6ff; }
.partner-row .char-card i { font-size: 9px; }
.char-card.sel { border-color: var(--gold); background: #ffedc4; transform: translateY(-3px); box-shadow: 0 8px 18px rgba(200, 150, 60, .25); }
.char-card.sel::after { content: "✓ 已选"; font-size: 9.5px; color: #b5812f; font-weight: 700; }
.char-card.is-self { opacity: .48; cursor: not-allowed; filter: grayscale(.35); transform: none; box-shadow: none; background: #f1eadf; }
.char-card.is-self::after { content: "主角本人"; font-size: 9px; color: #8f7f6e; font-weight: 700; }
.char-card:disabled { cursor: not-allowed; }
@media (max-width: 720px) {
  .char-card img { width: 52px; height: 52px; }
  .partner-row .char-card img { width: 44px; height: 44px; }
  .partner-row .char-card b { font-size: 12px; }
  .partner-row .char-card i { display: none; }
  .char-card i { display: none; }
}

/* ---------- 世界 ---------- */
#screen-world { background: #2a2118; }
#scene-frame { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
#scene-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#scene-fallback { position: absolute; inset: 0; background: radial-gradient(130% 100% at 50% 0%, #f2dfb8, #d8b98a); opacity: .9; }
#scene-fallback::after {
  content: "（美术图加载中，玩法不受影响）"; position: absolute; left: 12px; bottom: 74px;
  font-size: 11px; color: #6a5340;
}
/* 热点 */
.hot {
  position: absolute; transform: translate(-50%, -50%); text-align: center; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.hot-dot {
  width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff;
  background: rgba(255, 244, 214, .55); box-shadow: 0 0 0 4px rgba(255, 209, 108, .35);
  display: grid; place-items: center; font-size: 22px; transition: transform .15s;
}
.hot:hover .hot-dot { transform: scale(1.1); }
.hot-name { font-size: 12px; color: #fff; text-shadow: 0 1px 4px rgba(60, 30, 10, .8); white-space: nowrap; }
.hot-bang {
  position: absolute; top: -30px; font-size: 20px; font-weight: 900; color: #ffd24a;
  text-shadow: 0 2px 6px rgba(0,0,0,.5); animation: bob 1.2s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-5px); } }
.hot-zone { width: 120px; height: 84px; }
.hot-exit .hot-dot { background: rgba(120, 160, 110, .55); }
/* 行走 */
.walk-ring {
  position: absolute; width: 44px; height: 30px; border: 2px solid rgba(255, 220, 130, .9);
  border-radius: 50%; transform: translate(-50%, -50%); animation: ringpulse .9s ease-out infinite;
  pointer-events: none;
}
@keyframes ringpulse { from { opacity: 1; scale: .7; } to { opacity: 0; scale: 1.5; } }
.chibi { position: absolute; width: 104px; height: 118px; transform: translate(-50%, -100%); pointer-events: none; z-index: 5; filter: drop-shadow(0 6px 5px rgba(60, 30, 10, .35)); }
.partner-chibi { width: 84px; height: 96px; z-index: 4; }
body.battle-on #screen-world .chibi { visibility: hidden; }
body.battle-on #hud-top,
body.battle-on #hud-bottom,
body.battle-on #quest-tracker,
body.battle-on #edge-hint { visibility: hidden; }
.chibi svg { width: 100%; height: 100%; }
.chibi img.hero-sprite { width: 100%; height: 100%; object-fit: contain; }.chibi.is-walking img.hero-sprite { animation: walkBob .34s ease-in-out infinite alternate; }
/* 乌萨奇的长耳朵占画框高度，按同一高度缩放时身体会显小；轻微放大以接近吉伊/小八的视觉体量 */
img.hero-sprite.char-usagi { scale: 1.08; transform-origin: bottom center; }
.char-card img.char-usagi { scale: 1.1; transform-origin: bottom center; }
@keyframes walkBob { from { transform: translateY(0); } to { transform: translateY(-4px); } }
/* HUD */
#hud-top {
  position: absolute; top: max(env(safe-area-inset-top), 10px); left: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px; z-index: 8;
}
.hud-banana, .hud-hp {
  background: rgba(255, 248, 236, .92); border: 2px solid #e5c890; border-radius: 999px;
  padding: 7px 14px; display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700;
}
.banana-ico { width: 18px; height: 18px; display: inline-block; border-radius: 50% 50% 50% 4px; background: linear-gradient(135deg, #f6d056, #e0a53c); transform: rotate(-18deg); }
.hp-bar { width: 110px; height: 10px; background: #e9dcc4; border-radius: 99px; overflow: hidden; }
.hp-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #9fc968, #6fa354); transition: width .3s; border-radius: 99px; }
.hud-hp b { font-size: 12px; color: var(--ink2); }
#btn-sound {
  margin-left: auto; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 248, 236, .92); border: 2px solid #e5c890; color: var(--ink); font-size: 17px;
}
/* 讨伐令追踪 */
#quest-tracker {
  position: absolute; right: 12px; top: max(env(safe-area-inset-top), 62px); z-index: 8;
  background: linear-gradient(160deg, #fff6e2, #f6e5c4); border: 2px solid #d9b877; border-radius: var(--r-md);
  padding: 9px 12px; max-width: 220px; box-shadow: 0 8px 20px rgba(80, 50, 20, .25);
}
.qt-title { font-size: 11px; color: #b5812f; letter-spacing: 2px; font-weight: 700; }
#qt-text { font-size: 13px; line-height: 1.45; margin: 4px 0 7px; }
#qt-go {
  width: 100%; background: var(--leaf); color: #fff; border-radius: 999px; padding: 6px 0; font-size: 12px;
}
/* 底栏 */
#hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px max(env(safe-area-inset-bottom), 10px);
  background: linear-gradient(180deg, transparent, rgba(50, 32, 18, .45));
}
#scene-name { color: #fff4d8; font-size: 14px; text-shadow: 0 1px 5px rgba(0,0,0,.6); letter-spacing: 2px; }
.hud-btns { display: flex; gap: 8px; }
.hud-btns button {
  background: rgba(255, 248, 236, .92); border: 2px solid #e5c890; border-radius: 999px;
  padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--ink);
}
#edge-hint {
  position: absolute; z-index: 6; color: #fff; font-size: 13px; text-shadow: 0 1px 4px rgba(0,0,0,.5);
  background: rgba(90, 60, 20, .35); border: 2px solid rgba(255,230,150,.7); border-radius: 999px; padding: 8px 16px;
}

/* ---------- 战斗 ---------- */
#screen-battle { display: flex; flex-direction: column; background: linear-gradient(180deg, #f4e6c8 0%, #e8cfa4 55%, #d9b987 100%); }
#battle-stage { position: relative; flex: 1; overflow: hidden; }
#enemy-side { position: absolute; top: 4%; left: 0; right: 0; text-align: center; }
.enemy-plate { display: inline-flex; gap: 8px; align-items: center; background: rgba(255, 250, 238, .9); border: 2px solid #dfc291; border-radius: 999px; padding: 6px 16px; font-weight: 800; font-size: 15px; }
.ele-tag { font-size: 11px; color: #fff; border-radius: 99px; padding: 2px 9px; }
#enemy-sprite { position: relative; width: min(58vw, 300px); height: min(58vw, 300px); margin: 6px auto 0; }
#enemy-sprite img, #enemy-sprite canvas { width: 100%; height: 100%; object-fit: contain; }
#enemy-sprite .hurtflash { filter: brightness(2.2) saturate(.3); }
#enemy-sprite img { animation: enemyFloat 2.8s ease-in-out infinite; }
@keyframes enemyFloat { 50% { transform: translateY(-5px); } }
.hp-bar.enemy { width: min(60vw, 320px); margin: 4px auto 0; height: 12px; }
.hp-bar.enemy i { background: linear-gradient(90deg, #f08a8a, #d95f5f); }
#enemy-intent { font-size: 13px; color: var(--ink2); margin-top: 6px; }
#party-side { position: absolute; right: 6%; bottom: 4%; width: 130px; height: 150px; }
.chibi-battle { position: absolute; width: 104px; height: 120px; right: 0; bottom: 26px; filter: drop-shadow(0 6px 5px rgba(60, 30, 10, .3)); }
.chibi-battle svg { width: 100%; height: 100%; }
.chibi-battle img.hero-sprite { width: 100%; height: 100%; object-fit: contain; }
img.hero-sprite.is-berserk { animation: berserkShake .16s infinite alternate; filter: drop-shadow(0 0 9px rgba(242, 193, 78, .9)); }
@keyframes berserkShake { from { transform: translateX(-1.5px) rotate(-1deg); } to { transform: translateX(1.5px) rotate(1deg); } }
#usagi-b svg, #usagi-b img.hero-sprite { animation: heroBreath 3.2s ease-in-out infinite; }
@keyframes heroBreath { 50% { transform: translateY(-2px) scale(1.012); } }
#enemy-intent.danger { color: #b33b2e; font-weight: 800; animation: dangerPulse .85s ease-in-out infinite; }
@keyframes dangerPulse { 50% { opacity: .45; } }
#partner-b { width: 72px; height: 84px; right: -58px; bottom: 34px; }
#partner-b img.partner-sprite { object-fit: contain; }
#partner-b.is-hidden { display: none !important; }
#banana-gauge { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 130px; text-align: center; }
#battle-hp {
  position: absolute; left: 5%; bottom: 6%; width: min(38vw, 220px);
  background: rgba(255, 250, 238, .9); border: 2px solid #dfc291; border-radius: 14px;
  padding: 7px 10px 6px; box-shadow: 0 4px 12px rgba(90, 60, 20, .14); z-index: 6;
}
.battle-hp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.battle-hp-head b { letter-spacing: 1px; }
.battle-hp-head span { color: var(--ink2); font-size: 11px; font-variant-numeric: tabular-nums; }
#battle-hp .hp-bar { height: 11px; margin-top: 4px; }
#battle-hp .hp-bar i { background: linear-gradient(90deg, #8fcf98, #67ad78); transition: width .25s; }
#battle-hp.low .hp-bar i { background: linear-gradient(90deg, #f08a8a, #d95f5f); }
#battle-hp.low { border-color: #e19b8f; animation: hpLow .7s ease-in-out infinite alternate; }
@keyframes hpLow { to { box-shadow: 0 0 0 3px rgba(217, 95, 95, .18); } }
#battle-hp-note { font-size: 9px; color: var(--ink2); letter-spacing: 2px; margin-top: 2px; }
.gauge-label { font-size: 10px; color: var(--ink2); letter-spacing: 2px; }
.gauge { width: 100%; height: 14px; background: #efe3c8; border: 2px solid #dfc291; border-radius: 99px; overflow: hidden; }
.gauge i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #f2c14e, #f29e4e); transition: width .25s; }
.gauge b { font-size: 10px; position: relative; top: -1px; }
/* 铃铛波纹与暴走 */
#bell-ripple { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 0 transparent; }
#bell-ripple.on::after {
  content: ""; position: absolute; inset: -20px; border: 3px solid rgba(190, 205, 235, .8);
  border-radius: 26px; animation: bellpulse 1s ease-out infinite;
}
@keyframes bellpulse { from { opacity: .9; scale: .97; } to { opacity: 0; scale: 1.06; } }
#berserk-veil { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 70% at 50% 45%, rgba(255, 230, 140, .55), rgba(255, 150, 60, .25)); mix-blend-mode: screen; }
#phase-banner {
  position: absolute; top: 34%; left: 0; right: 0; margin: 0; text-align: center; font-size: clamp(15px, 4vw, 22px);
  color: #fff; background: rgba(70, 40, 30, .55); padding: 12px 18px; backdrop-filter: blur(2px);
}
#battle-ui {
  height: max(180px, 30%); min-height: 150px; background: rgba(255, 248, 236, .96);
  border-top: 3px solid #e5c890; display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
#cmd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; flex: 1.2; align-content: stretch; }
#cmd-grid button {
  background: #fff3da; border: 2px solid #e2c28a; border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 6px 4px; min-height: 52px; transition: background .12s;
}
#cmd-grid button b { font-size: clamp(15px, 3.6vw, 22px); letter-spacing: 2px; }
#cmd-grid button i { font-size: 10px; color: var(--ink2); font-style: normal; }
#cmd-grid button:disabled { opacity: .38; }
#cmd-grid button:not(:disabled):active { background: #ffdf9e; }
.cmd-berserk { background: linear-gradient(160deg, #ffcf7d, #ff9f68) !important; border-color: #e08a4a !important; }
.cmd-berserk b { color: #8a3d1f; }
#cmd-grid button[data-cmd="berserk"] { grid-column: span 2; }
#battle-log { flex: .8; font-size: 12.5px; line-height: 1.55; overflow-y: auto; color: var(--ink2); background: #fbf3e2; border: 2px solid #f0e0bd; border-radius: var(--r-md); padding: 8px 11px; }
#battle-log p { margin: 0 0 5px; }
#log-toggle { display: none; }
#battle-log p.hl { color: var(--ink); font-weight: 700; }
/* ---------- 战斗演出 ---------- */
#battle-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 7; }
.fx-number {
  position: absolute; transform: translate(-50%, -50%); font-size: 25px; line-height: 1;
  font-weight: 900; color: #7b3e21; text-shadow: 0 2px 0 #fff8e8, 0 0 9px rgba(255,255,255,.9);
  animation: dmgFloat .9s cubic-bezier(.15,.75,.2,1) forwards; white-space: nowrap;
}
.fx-number.crit { color: #c35b1f; font-size: 34px; letter-spacing: 1px; }
.fx-number.hurt { color: #bf3f36; }
.fx-number.heal { color: #358763; }
.fx-number.energy { color: #b5812f; font-size: 17px; }
@keyframes dmgFloat {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.5) rotate(-5deg); }
  18% { opacity: 1; transform: translate(-50%, -68%) scale(1.18) rotate(2deg); }
  55% { opacity: 1; transform: translate(-50%, -105%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(.9) rotate(-3deg); }
}
.fx-ring {
  position: absolute; width: 22px; height: 22px; border: 4px solid #fff3b0; border-radius: 50%;
  transform: translate(-50%, -50%); box-shadow: 0 0 16px rgba(255, 227, 120, .9);
  animation: ringBurst .5s ease-out forwards;
}
@keyframes ringBurst {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.25) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.2) rotate(35deg); }
}
.fx-slash {
  position: absolute; width: 130px; height: 7px; border-radius: 99px; transform: translate(-50%, -50%) rotate(var(--rot, -32deg));
  background: linear-gradient(90deg, transparent 2%, #fff9cf 28%, #ffd36e 52%, #fff 68%, transparent 98%);
  box-shadow: 0 0 14px rgba(255, 213, 95, .95);
  animation: slashSweep .36s ease-out forwards;
}
.fx-slash.gold { background: linear-gradient(90deg, transparent, #ffe084, #fff8d0, #ffb64f, transparent); height: 10px; }
.fx-slash.red { background: linear-gradient(90deg, transparent, #ffd0b5, #e96c53, #ffd7c8, transparent); }
@keyframes slashSweep {
  0% { opacity: 0; clip-path: inset(0 100% 0 0); }
  25% { opacity: 1; clip-path: inset(0 0 0 0); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot, -32deg)) scaleX(1.15); }
}
.fx-shield {
  position: absolute; width: 126px; height: 126px; border: 4px solid rgba(130, 190, 225, .9);
  border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 18px rgba(125, 191, 222, .85), inset 0 0 20px rgba(180, 229, 255, .55);
  animation: shieldPulse .65s ease-out forwards;
}
@keyframes shieldPulse { 0% { opacity: 0; scale: .55; } 35% { opacity: 1; } 100% { opacity: 0; scale: 1.25; } }
.fx-banana {
  position: absolute; font-size: 36px; transform: translate(-50%, -50%) rotate(-30deg);
  filter: drop-shadow(0 3px 3px rgba(80, 40, 10, .35)); animation: bananaToss .55s ease-in forwards;
}
@keyframes bananaToss {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-80deg); }
  22% { opacity: 1; transform: translate(-50%, -130%) scale(1.1) rotate(-20deg); }
  100% { opacity: 0; transform: translate(-50%, -25%) scale(.9) rotate(390deg); }
}
.fx-star {
  position: absolute; font-size: 22px; transform: translate(-50%, -50%); color: #f8cf4f;
  text-shadow: 0 0 8px #fff3a8; animation: starPop .7s ease-out forwards;
}
@keyframes starPop {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.3) rotate(0); }
  30% { opacity: 1; transform: translate(-50%, -100%) scale(1.2) rotate(20deg); }
  100% { opacity: 0; transform: translate(-50%, -200%) scale(.8) rotate(-35deg); }
}
.fx-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, rgba(255, 240, 178, .7), rgba(220, 68, 45, .3)); animation: flashFade .3s ease-out forwards; }
.fx-flash.danger { background: radial-gradient(circle at 55% 65%, rgba(255, 218, 160, .7), rgba(177, 36, 28, .45)); }
@keyframes flashFade { from { opacity: .95; } to { opacity: 0; } }
.fx-bubble { position: absolute; font-size: 30px; animation: starPop .75s ease-out forwards; }
/* 招式选择 */
#skill-menu {
  position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(45, 28, 18, .5); backdrop-filter: blur(2px);
}
#skill-menu.is-hidden { display: none !important; }
.skill-card {
  width: min(520px, 94vw); max-height: 84vh; overflow-y: auto;
  background: var(--paper); border: 3px solid #e5c890; border-radius: var(--r-lg);
  padding: 16px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.skill-head { display: flex; align-items: center; gap: 10px; }
.skill-head b { font-size: 17px; letter-spacing: 3px; }
.skill-head span { margin-left: auto; font-size: 11px; color: var(--ink2); }
.skill-head button {
  width: 32px; height: 32px; border-radius: 50%; background: #f3e3c2;
  color: var(--ink); font-size: 14px;
}
#skill-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.skill-option {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left;
  background: #fffaf0; border: 2px solid #f0e0bd; border-radius: var(--r-md);
  padding: 10px 12px; transition: background .12s, border-color .12s;
}
.skill-option b { font-size: 15px; letter-spacing: 1px; }
.skill-option em { font-style: normal; font-size: 12px; font-weight: 700; color: #b5812f; white-space: nowrap; }
.skill-option small { grid-column: 1 / -1; color: var(--ink2); font-size: 11.5px; line-height: 1.55; }
.skill-option:not(:disabled):active { background: #ffdf9e; border-color: #d9a54b; }
.skill-option:disabled { opacity: .42; }
@media (max-width: 720px) {
  .skill-card { padding: 13px; }
  .skill-head b { font-size: 15px; }
  .skill-option { padding: 9px 10px; }
}

/* ---------- 结局 ---------- */
#screen-ending { display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #3b2c20, #8a6a3c); }
.ending-plate { max-width: 520px; width: 88%; background: var(--paper); border: 3px solid #e5c890; border-radius: var(--r-lg); padding: 26px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.ending-plate h2 { margin: 0 0 12px; letter-spacing: 4px; }
.ending-plate p { color: var(--ink2); font-size: 14px; line-height: 1.8; }
.ending-fact { margin: 14px 0; padding: 10px; background: #fdf1d6; border-radius: var(--r-md); font-size: 13px; }

/* ---------- 覆盖层 ---------- */
.overlay { position: absolute; inset: 0; background: rgba(40, 26, 16, .55); display: grid; place-items: center; z-index: 30; padding: 16px; }
.overlay-card {
  position: relative; width: min(560px, 94vw); max-height: 84vh; overflow-y: auto;
  background: var(--paper); border: 3px solid #e5c890; border-radius: var(--r-lg); padding: 20px 18px 16px;
}
.overlay-x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: #f3e3c2; color: var(--ink); font-size: 15px; }
.ov-title { font-size: 17px; font-weight: 800; letter-spacing: 3px; margin: 0 0 12px; display: flex; gap: 10px; align-items: center; }
.ov-title em { font-style: normal; font-size: 11px; color: #b5812f; letter-spacing: 1px; font-weight: 500; }
.quest-row, .shop-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid #f0e0bd; border-radius: var(--r-md); margin-bottom: 9px; background: #fffaf0; }
.quest-row.done { opacity: .55; }
.quest-info { flex: 1; }
.quest-info b { font-size: 14px; }
.quest-info p { margin: 3px 0 0; font-size: 12px; color: var(--ink2); line-height: 1.5; }
.sel-btn { background: var(--gold); color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.sel-btn:disabled { background: #d8c8a8; color: #fff; }
.sel-btn:active { transform: translateY(1px); }
.price { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #b5812f; font-weight: 700; }
.prog-line { padding: 7px 10px; border-bottom: 1px dashed #e6d4ac; font-size: 13px; line-height: 1.6; }
.prog-line b { color: #b5812f; }

/* ---------- 对话 & 提示 ---------- */
#dialog {
  position: absolute; left: 50%; bottom: max(env(safe-area-inset-bottom), 16px); transform: translateX(-50%);
  width: min(560px, 92vw); z-index: 40; display: flex; align-items: center; gap: 12px;
  background: linear-gradient(160deg, #fffaf0, #f6e9d0); border: 3px solid #e5c890; border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: 0 14px 40px rgba(70, 40, 20, .35);
}
#dialog-face { width: 62px; height: 72px; flex: none; }
#dialog-face svg { width: 100%; height: 100%; }
#dialog-face img { width: 100%; height: 100%; object-fit: contain; }
#dialog-text { flex: 1; font-size: 14.5px; line-height: 1.75; min-height: 60px; }
#dialog-next { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 15px; align-self: flex-end; animation: bob 1.2s ease-in-out infinite; }
#toast {
  position: absolute; top: 20%; left: 50%; transform: translateX(-50%); z-index: 50;
  background: rgba(60, 40, 20, .85); color: #ffe9b8; border-radius: 999px; padding: 9px 20px;
  font-size: 14px; letter-spacing: 1px; animation: toastin .25s ease-out;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- 移动端 ---------- */
@media (max-width: 720px) {
  .chibi { width: 92px; height: 104px; }
  .chibi-battle { width: 96px; height: 110px; }
  #party-side { right: 2%; bottom: 6%; }
  #partner-b { width: 84px; height: 96px; right: 88px; bottom: 24px; }
  .hot-dot { width: 54px; height: 54px; font-size: 25px; }
  .hot-name { font-size: 13px; }
  /* 左右出口在窄屏上分别向内收，避免圆点和文字被屏幕边缘裁掉 */
  .hot.hot-exit-right { transform: translate(-100%, -50%); align-items: flex-end; text-align: right; }
  .hot.hot-exit-left { transform: translate(0, -50%); align-items: flex-start; text-align: left; }
  #cmd-grid { grid-template-columns: repeat(3, 1fr); }
  #battle-ui { height: min(34%, 230px); }
  #battle-log { display: none; }
  #battle-log.compact {
    display: block; position: absolute; top: 86px; right: 8px; width: 160px;
    max-height: 46px; overflow-y: auto; overscroll-behavior: contain;
    font-size: 10px; line-height: 1.4; background: rgba(255, 250, 238, .92);
    border: 2px solid #f0e0bd; border-radius: 12px; padding: 5px 8px;
    z-index: 9; -webkit-overflow-scrolling: touch;
  }
  #battle-log.compact.open { max-height: 38vh; width: 172px; box-shadow: 0 8px 24px rgba(90, 60, 20, .18); }
  #battle-log.compact p { margin: 0 0 3px; }
  #log-toggle {
    display: block; position: absolute; top: 54px; right: 8px; z-index: 12;
    background: rgba(255, 250, 238, .94); border: 2px solid #e5c890; border-radius: 999px;
    padding: 4px 11px; font-size: 10.5px; font-weight: 700; color: var(--ink2);
  }
  #banana-gauge { left: auto; right: 4%; transform: none; }
  #enemy-sprite { width: 66vw; height: 66vw; }
  .quest-row, .shop-row { padding: 9px 10px; }
  .sel-btn { padding: 10px 15px; }
}
@media (max-height: 480px) { /* 横屏手机 */
  #battle-ui { height: 46%; }
  #party-side { width: 110px; height: 130px; }
}
/* 手机浏览器带上地址栏/导航栏后，实际可视高度往往只有 600~700px；
   把标题和战斗区再压紧一点，避免敌人、意图提示和搭档互相叠住 */
@media (max-width: 720px) and (max-height: 700px) {
  .title-plate { padding: 16px 20px 12px; }
  .title-cn { margin: 6px 0 2px; }
  .title-sub { margin-bottom: 10px; }
  .title-btns { gap: 8px; margin: 8px 0 6px; }
  #battle-ui { height: min(33%, 212px); }
  #enemy-sprite { width: 48vw; height: 48vw; }
  .enemy-plate { padding: 5px 14px; font-size: 14px; }
  #enemy-intent { margin-top: 4px; font-size: 12px; }
  #battle-hp { width: 40vw; bottom: 5%; }
  #battle-log.compact { top: 82px; width: 154px; max-height: 42px; }
  #battle-log.compact.open { max-height: 34vh; }
  #party-side { bottom: 2.5%; }
  #partner-b { bottom: 24px; }
}
/* 更矮的小屏（例如 320×568）再收一档，标题不出现滚动条 */
@media (max-width: 720px) and (max-height: 600px) {
  .title-plate { padding: 12px 16px 10px; }
  .title-cn { font-size: clamp(26px, 8vw, 34px); margin: 4px 0 0; }
  .title-sub { margin-bottom: 8px; font-size: 12px; }
  .char-label { margin: 4px 0 1px; }
  .char-card img { width: 46px; height: 46px; }
  .partner-row .char-card img { width: 38px; height: 38px; }
  .title-btns { gap: 6px; margin: 6px 0 4px; }
  .title-note { font-size: 9px; margin-top: 3px; }
  #battle-ui { height: min(32%, 190px); }
  #enemy-sprite { width: 44vw; height: 44vw; }
}
