/* style.css —— 萌将地下城 M1 Demo 界面（动漫卡通风：圆角、粗描边、糖果色） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  background: radial-gradient(120% 120% at 50% 0%, #2b3a67 0%, #1b2340 55%, #12172c 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  user-select: none; touch-action: none; color: #fff;
}
.hidden { display: none !important; }
#wrap { width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; }
#stage-box { position: relative; line-height: 0; }
canvas { display: block; border-radius: 14px; box-shadow: 0 18px 60px rgba(0,0,0,.55); }

/* ---------- HUD ---------- */
#hud { position: absolute; top: 10px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; line-height: 1.3; }
#hp-bar { position: relative; width: 200px; height: 22px; background: rgba(0,0,0,.45); border: 3px solid #33261f; border-radius: 12px; overflow: hidden; }
#hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ff6b6b, #ff9f43); transition: width .15s; }
#hp-text { position: absolute; inset: 0; text-align: center; font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
#buff-tag { margin-top: 6px; display: inline-block; background: #ffb8ce; color: #8b2d4b; border: 2px solid #33261f; border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
#hud-mid { text-align: center; }
#stage-label { font-size: 14px; font-weight: 800; text-shadow: 0 2px 0 #33261f; }
#timer { font-size: 12px; opacity: .85; }
#hud-right { display: flex; align-items: center; gap: 8px; }
#coin-tag { background: rgba(0,0,0,.45); border: 2px solid #33261f; border-radius: 10px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
#bag-tag { background: rgba(0,0,0,.45); border: 2px solid #33261f; border-radius: 10px; padding: 3px 10px; font-size: 13px; font-weight: 700; }
.mini-btn { pointer-events: auto; font-size: 14px; padding: 4px 10px; border-radius: 10px; border: 3px solid #33261f; background: #ffd76a; color: #33261f; font-weight: 800; cursor: pointer; }
.mini-btn:active { transform: scale(.94); }

#boss-bar { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); width: 420px; max-width: 70%; text-align: center; pointer-events: none; }
#boss-name { font-size: 13px; font-weight: 800; text-shadow: 0 2px 0 #33261f; margin-bottom: 3px; }
#boss-track { height: 14px; background: rgba(0,0,0,.5); border: 3px solid #33261f; border-radius: 8px; overflow: hidden; }
#boss-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #b06cff, #ff6b6b); transition: width .12s; }

#toast { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); background: rgba(51,38,31,.92); color: #ffe9a8; font-weight: 800; font-size: 18px; padding: 10px 22px; border-radius: 14px; border: 3px solid #ffd76a; opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; }

/* ---------- 触屏控件 ---------- */
#joy-base { position: fixed; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); border: 3px solid rgba(255,255,255,.35); transform: translate(-50%,-50%); pointer-events: none; z-index: 30; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,215,106,.85); border: 3px solid #33261f; transform: translate(-50%,-50%); }
.touch-btn { position: fixed; z-index: 30; width: 84px; height: 84px; border-radius: 50%; background: rgba(255,159,67,.85); border: 4px solid #33261f; color: #fff; font-size: 18px; font-weight: 900; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.3); }
.touch-btn:active { transform: scale(.92); }
#btn-dodge { right: calc(6vw + 208px); bottom: 7vh; width: 68px; height: 68px; font-size: 16px; }
/* 05 会决议 A1：手动攻击钮（右下主按钮）+ 技能2 + 布局重排 */
#btn-attack { right: 6vw; bottom: 6vh; width: 96px; height: 96px; font-size: 20px; background: rgba(255,107,107,.88); }
#btn-build { right: calc(6vw + 320px); bottom: 8vh; width: 62px; height: 62px; font-size: 12px; background: rgba(169,116,63,.92); }
#btn-build2 { right: calc(6vw + 398px); bottom: 8vh; width: 62px; height: 62px; font-size: 12px; background: rgba(122,138,154,.92); }
#btn-skill2 { right: calc(6vw + 118px); bottom: 6vh; width: 68px; height: 68px; font-size: 26px; background: rgba(108,160,255,.85); }
#btn-skill2.cd { filter: grayscale(.65); opacity: .8; }
/* BOSS 岩甲盾条（05 会 S2） */
#boss-shield-track { height: 8px; margin-top: 3px; background: rgba(0,0,0,.5); border: 2px solid #33261f; border-radius: 6px; overflow: hidden; }
#boss-shield-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #9ad7ff, #6cb8ff); transition: width .12s; }

/* 06 会：药水状态图标行（buff/debuff + 武器徽章） */
#status-hud { position: absolute; top: 96px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 46vw; pointer-events: none; z-index: 6; }
.status-chip { display: flex; align-items: center; gap: 3px; background: rgba(0,0,0,.55); border: 2px solid #33261f; border-radius: 10px; padding: 2px 7px; font-size: 12px; font-weight: 700; color: #fff8e0; line-height: 1.2; }
.status-chip.curse { border-color: #8a4fc0; color: #e3c7ff; }
.status-chip.buff { border-color: #c77a2e; color: #ffd9a8; }
.status-chip.wonder { border-color: #c77dff; color: #f0d9ff; }
.status-chip.weapon { border-color: #ffd76a; color: #ffe9a8; }


/* ---------- 通用屏幕 ---------- */
.screen { position: absolute; inset: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(24,30,54,.88); backdrop-filter: blur(3px); text-align: center; line-height: 1.6; padding: 20px; }
.screen h2 { font-size: 26px; text-shadow: 0 3px 0 #33261f; }
.logo { font-size: 56px; font-weight: 900; letter-spacing: 6px; background: linear-gradient(180deg, #ffe9a8, #ffb830); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #33261f); }
.subtitle { font-size: 15px; color: #ffd76a; font-weight: 700; }
.tips { font-size: 12.5px; color: #aab6d8; }
.big-btn { font-size: 19px; font-weight: 900; color: #33261f; background: linear-gradient(180deg, #ffe9a8, #ffd76a); border: 4px solid #33261f; border-radius: 16px; padding: 12px 34px; cursor: pointer; box-shadow: 0 5px 0 #8a6b1f; transition: transform .06s; }
.big-btn:hover { transform: translateY(-2px); }
.big-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a6b1f; }
.big-btn.ghost { background: #4a5680; color: #fff; box-shadow: 0 5px 0 #2b3252; }
.big-btn.ghost:active { box-shadow: 0 1px 0 #2b3252; }
.big-btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn-row.col { flex-direction: column; }

/* ---------- 选关 ---------- */
#stage-list { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; max-width: 860px; }
.stage-card { width: 150px; background: #fffbe8; color: #33261f; border: 4px solid #33261f; border-radius: 14px; padding: 10px; cursor: pointer; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.35); }
.stage-card:hover { transform: translateY(-2px); }
.stage-card.locked { filter: grayscale(1); opacity: .55; cursor: not-allowed; }
.stage-card .sc-id { font-size: 13px; font-weight: 900; color: #e07b2a; }
.stage-card .sc-name { font-size: 15px; font-weight: 800; margin: 2px 0; }
.stage-card .sc-teach { font-size: 11px; color: #7a6a4f; min-height: 28px; }
.stage-card .sc-stars { font-size: 15px; letter-spacing: 2px; }
.sc-diff { color: #ff9f43; font-size: 11px; letter-spacing: 1px; margin-left: 6px; } /* 09 会 N4：难度档 */

/* ---------- 卡牌 ---------- */
#card-row { display: flex; gap: 18px; }
.gcard { width: 190px; min-height: 230px; background: #fffbe8; color: #33261f; border: 5px solid #3aa6ff; border-radius: 16px; padding: 16px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; box-shadow: 0 6px 0 rgba(0,0,0,.35); transition: transform .08s; }
.gcard:hover { transform: translateY(-6px) scale(1.03); }
.gcard .gc-icon { font-size: 40px; }
.gcard .gc-name { font-size: 19px; font-weight: 900; }
.gcard .gc-tag { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 8px; color: #fff; }
.gcard .gc-desc { font-size: 13px; line-height: 1.5; }
.gcard.r-purple { border-color: #b06cff; }
.gcard.r-gold { border-color: #ffb830; box-shadow: 0 0 22px rgba(255,184,48,.55), 0 6px 0 rgba(0,0,0,.35); }

/* ---------- 结算 ---------- */
#result-stars { font-size: 44px; letter-spacing: 10px; text-shadow: 0 3px 0 #33261f; }
#result-lines { font-size: 14px; color: #d8e0f5; }
#result-tip { font-size: 13px; color: #ffb8ce; font-weight: 700; min-height: 20px; }

/* ---------- 英雄选择（04 会决议 H） ---------- */
#hero-list { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.hero-card { width: 242px; background: #fffbe8; color: #33261f; border: 4px solid #33261f; border-radius: 16px; padding: 12px; cursor: pointer; text-align: center; box-shadow: 0 5px 0 rgba(0,0,0,.35); transition: transform .08s; }
.hero-card:hover { transform: translateY(-4px); }
.hero-card.picked { border-color: #ffb830; box-shadow: 0 0 18px rgba(255,184,48,.6), 0 5px 0 rgba(0,0,0,.35); }
.hero-card .hc-icon { width: 56px; height: 56px; margin: 0 auto 6px; border-radius: 50%; border: 3px solid #33261f; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.hero-card .hc-name { font-size: 16px; font-weight: 900; }
.hero-card .hc-desc { font-size: 12px; color: #7a6a4f; margin: 4px 0; min-height: 36px; }
.hero-card .hc-line { font-size: 11.5px; text-align: left; background: rgba(51,38,31,.07); border-radius: 8px; padding: 4px 8px; margin: 3px 0; }
.hero-card .hc-stats { font-size: 11px; color: #7a6a4f; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin: 6px 0; text-align: left; padding: 0 12px; }
.hero-card .hc-stats b { color: #e07b2a; }
.hero-card .hc-btn { font-weight: 800; background: #ffd76a; border: 3px solid #33261f; border-radius: 10px; padding: 4px 0; }
#hero-tag { font-size: 13px; color: #ffd76a; font-weight: 700; }

/* ---------- 技能 HUD 与触屏技能按钮（04 会决议 H2；05 会：双技能槽） ---------- */
#skill-hud, #skill2-hud { display: flex; align-items: center; gap: 6px; margin-top: 6px; background: rgba(0,0,0,.45); border: 2px solid #33261f; border-radius: 10px; padding: 3px 8px; width: fit-content; }
#skill-icon, #skill2-icon { font-size: 16px; }
#skill-track { width: 90px; height: 10px; background: rgba(255,255,255,.18); border-radius: 6px; overflow: hidden; }
#skill-fill, #skill2-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #ffd76a, #ff9f43); }
#skill-key { font-size: 11px; font-weight: 800; background: #ffd76a; color: #33261f; border-radius: 5px; padding: 0 5px; }
#skill-hud.ready #skill-track, #skill2-hud.ready #skill-track { box-shadow: 0 0 8px rgba(255,215,106,.85); }
#btn-skill { right: calc(6vw + 10px); bottom: calc(6vh + 116px); width: 68px; height: 68px; font-size: 26px; background: rgba(176,108,255,.85); }
#btn-skill.cd { filter: grayscale(.65); opacity: .8; }
