/* 无名勇士2 · 样式：深色像素 RPG 风，克制配色 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: #0c0e13; color: #e8e8e8; font-family: "PingFang SC", "Microsoft YaHei", sans-serif; overflow: hidden; }
.hidden { display: none !important; }

#stage { position: relative; width: min(100vw, 177.78vh); max-width: 1100px; margin: 0 auto; aspect-ratio: 16 / 9; top: 50%; transform: translateY(-50%); }
#game { width: 100%; height: 100%; display: block; background: #10131a; }

.screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(10, 12, 17, 0.88); z-index: 20; padding: 20px; text-align: center; }
.screen.modal { background: rgba(6, 8, 11, 0.72); }
.screen .card { background: #171a21; border: 2px solid #a62e24; padding: 26px 30px; max-width: 520px; width: 92%; max-height: 92%; overflow-y: auto; text-align: left; }
.screen .card.wide { max-width: 640px; }
.screen .card h2 { text-align: center; margin-bottom: 14px; font-size: 26px; letter-spacing: 4px; }
.screen .card p { margin: 8px 0; font-size: 15px; line-height: 1.7; color: #cfd3da; }
.screen .card p.lvup { color: #ffd54a; font-weight: bold; }

.logo { font-size: clamp(40px, 8vw, 72px); letter-spacing: 8px; color: #f2ecdd; }
.logo span { color: #a62e24; }
.tagline { color: #9aa0ab; font-size: clamp(13px, 2vw, 16px); }
.hint { color: #6d727c; font-size: 12px; line-height: 1.9; }

.menu { display: flex; flex-direction: column; gap: 12px; width: min(300px, 80%); }
.big-btn { background: #a62e24; color: #fff; border: 2px solid #d8cfc0; padding: 13px 22px; font-size: 17px; letter-spacing: 3px; cursor: pointer; }
.big-btn:hover { background: #c03a2d; }
.big-btn.ghost { background: transparent; color: #d8cfc0; }
.big-btn.ghost:hover { background: rgba(255,255,255,0.08); }
.big-btn:disabled { opacity: 0.45; cursor: default; }
.row-btns { display: flex; gap: 12px; margin-top: 18px; justify-content: center; flex-wrap: wrap; }
.row-btns.col { flex-direction: column; align-items: stretch; }
.row-btns .big-btn { flex: 1; min-width: 140px; }

#class-cards { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.class-card { background: #171a21; border: 2px solid #3a3f4a; color: #e8e8e8; padding: 18px 16px; width: 240px; cursor: pointer; text-align: center; }
.class-card:hover { border-color: #a62e24; background: #1e222b; }
.class-card img { width: 96px; height: 96px; object-fit: contain; image-rendering: pixelated; }
.cc-name { font-size: 20px; font-weight: bold; margin: 8px 0 4px; }
.cc-desc { color: #9aa0ab; font-size: 13px; }
.cc-stats { font-size: 13px; line-height: 1.8; margin: 10px 0; color: #cfd3da; }
.cc-skills { font-size: 13px; color: #ffd54a; }

/* HUD */
#hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 10px 12px; z-index: 10; pointer-events: none; }
#hud button { pointer-events: auto; }
.hud-left { width: min(320px, 46%); }
.bar { position: relative; height: 18px; background: rgba(0,0,0,0.6); border: 1px solid #777; margin-bottom: 5px; overflow: hidden; }
.bar > div { height: 100%; width: 100%; transition: width 0.18s; }
.bar span { position: absolute; inset: 0; font-size: 11px; line-height: 18px; text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }
.bar.hp > div { background: #43a047; }
.bar.hp.enemy > div { background: #c62828; }
.bar.mp > div { background: #2f6fd0; }
.bar.exp { height: 6px; border: none; }
.bar.exp > div { background: #c9a227; }
#hud-info { font-size: 12px; color: #d8cfc0; text-shadow: 0 1px 2px #000; }
.hud-right { display: flex; gap: 8px; }
.hud-right button, .p-title-row button { background: rgba(20,22,28,0.85); color: #e8e8e8; border: 1px solid #8a8378; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.hud-right button:hover { border-color: #a62e24; }

/* 战斗条 */
#battle-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; z-index: 10; background: linear-gradient(rgba(0,0,0,0.45), transparent); }
.bb-side { flex: 1; max-width: 380px; }
.bb-side.right { margin-left: auto; }
.bb-side.right .bb-name { text-align: right; }
.bb-name { font-size: 13px; margin-bottom: 4px; text-shadow: 0 1px 2px #000; }
.bb-vs { font-weight: bold; color: #ffd54a; padding-top: 14px; }
#battle-bar .bar { height: 16px; }
#battle-bar .bar.mp { height: 8px; }

/* 技能按钮 */
#skills { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 10px; z-index: 12; }
.skill-btn { position: relative; width: 86px; height: 62px; background: rgba(23,26,33,0.92); border: 2px solid #555c68; color: #e8e8e8; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.skill-btn .sk-key { position: absolute; top: 3px; left: 6px; font-size: 11px; color: #9aa0ab; }
.skill-btn .sk-name { font-size: 15px; font-weight: bold; }
.skill-btn .sk-cd { font-size: 11px; color: #9aa0ab; }
.skill-btn.ready { border-color: #ffd54a; }
.skill-btn:disabled { opacity: 0.5; cursor: default; }

/* 摇杆 */
#joy { position: absolute; left: 18px; bottom: 18px; width: 118px; height: 118px; border-radius: 50%; background: rgba(255,255,255,0.07); border: 2px solid rgba(255,255,255,0.22); z-index: 12; touch-action: none; }
#joy-knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(255,255,255,0.28); border: 2px solid rgba(255,255,255,0.4); pointer-events: none; }

/* 面板 */
.p-title-row { display: flex; justify-content: space-between; align-items: center; }
.p-head { font-size: 18px; font-weight: bold; }
.p-sub { font-size: 13px; color: #9aa0ab; }
.p-stats { border-collapse: collapse; margin: 10px 0; width: 100%; }
.p-stats td { border: 1px solid #333a45; padding: 5px 10px; font-size: 14px; }
.p-stats td:first-child { color: #9aa0ab; width: 90px; }
.p-sec { margin: 16px 0 8px; font-weight: bold; color: #ffd54a; font-size: 15px; }
.p-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #262b34; font-size: 14px; }
.p-row button { background: #232833; color: #e8e8e8; border: 1px solid #555c68; padding: 4px 10px; margin-left: 6px; cursor: pointer; font-size: 13px; }
.p-row button:hover { border-color: #ffd54a; }

#town-info { font-size: 15px; line-height: 1.9; color: #cfd3da; margin-bottom: 8px; }

#toast { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); background: rgba(15,17,22,0.92); border: 1px solid #a62e24; color: #f2ecdd; padding: 10px 18px; font-size: 14px; z-index: 40; opacity: 0; transition: opacity 0.25s; pointer-events: none; max-width: 86%; text-align: center; }
#toast.show { opacity: 1; }

@media (max-width: 640px) {
  .skill-btn { width: 72px; height: 56px; }
  #joy { width: 104px; height: 104px; }
  .screen .card { padding: 18px; }
}
