* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #1a1a2e; color: #eee; font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; overflow: hidden; }
#app { position: relative; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; }
#game { background: linear-gradient(#3a2c5a, #1a1a2e); display: block; image-rendering: auto; box-shadow: 0 0 40px rgba(0,0,0,.6); width: min(96vw, 1280px); height: auto; aspect-ratio: 16 / 9; }

/* 覆盖层通用 */
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(120,80,200,.35), rgba(10,10,25,.95)); z-index: 10; text-align: center; padding: 20px; }
.hidden { display: none !important; }
h1.title { font-size: 64px; letter-spacing: 4px; color: #ffd54f;
  text-shadow: 0 0 18px #ff7043, 4px 4px 0 #b71c1c; margin-bottom: 6px; }
.subtitle { color: #ce93d8; margin-bottom: 28px; font-size: 16px; }
.btn { background: linear-gradient(#ff7043, #e53935); color: #fff; border: none; padding: 14px 30px; margin: 8px;
  font-size: 20px; border-radius: 12px; cursor: pointer; box-shadow: 0 4px 0 #b71c1c; transition: transform .08s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #b71c1c; }
.btn.alt { background: linear-gradient(#5c6bc0, #3949ab); box-shadow: 0 4px 0 #283593; }
.btn.sm { font-size: 15px; padding: 9px 18px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; max-width: 1000px; }
.modes { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hint { color: #90a4ae; font-size: 13px; margin-top: 18px; max-width: 640px; line-height: 1.6; }
.back { position: absolute; top: 16px; left: 16px; }

/* 角色选择网格 */
.pick-wrap { width: 100%; max-width: 1000px; }
.pick-title { font-size: 22px; margin-bottom: 12px; color: #ffd54f; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.card { background: #2a2a40; border: 2px solid #444; border-radius: 10px; padding: 8px 6px; cursor: pointer; position: relative; }
.card:hover { border-color: #ffd54f; }
.card.sel { border-color: #69f0ae; box-shadow: 0 0 12px #69f0ae; }
.card.sel2 { border-color: #64b5f6; box-shadow: 0 0 12px #64b5f6; }
.card.locked { opacity: .35; cursor: not-allowed; }
.card .nm { font-size: 14px; margin-top: 4px; }
.card .em { font-size: 22px; }
.card .lk { position: absolute; top: 4px; right: 6px; font-size: 16px; }
.energybar { width: 100%; height: 8px; background: #333; border-radius: 4px; margin-top: 4px; overflow: hidden; }
.energybar > i { display: block; height: 100%; background: linear-gradient(90deg,#ffd54f,#ff7043); width: 0%; }

/* 角色详情 */
.detail { position: absolute; right: 20px; top: 20px; width: 260px; background: rgba(20,20,40,.92);
  border: 1px solid #555; border-radius: 12px; padding: 14px; font-size: 13px; text-align: left; }
.detail h3 { color: #ffd54f; margin-bottom: 8px; }
.detail .line { margin: 3px 0; color: #cfd8dc; }
.detail .lockmsg { color: #ef5350; }

/* 顶部玩家标签 */
.topbar-game { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 10px 16px; z-index: 5; pointer-events: none; }
.pstats { width: 40%; }
.pstats.right { text-align: right; }
.pname { font-size: 16px; font-weight: bold; }
.hpbar { height: 14px; background: #222; border: 1px solid #555; border-radius: 8px; overflow: hidden; margin-top: 4px; }
.hpbar > i { display: block; height: 100%; transition: width .1s; }
.hp-l > i { background: linear-gradient(90deg,#69f0ae,#00c853); }
.hp-r > i { background: linear-gradient(90deg,#ff5252,#d50000); float: right; }
.ename { height: 6px; background: #333; border-radius: 4px; margin-top: 3px; overflow: hidden; }
.ename > i { display: block; height: 100%; background: linear-gradient(90deg,#ffd54f,#ff7043); width: 0%; }

/* 结算 */
.result { font-size: 52px; font-weight: bold; margin-bottom: 16px; }
.result.win { color: #69f0ae; }
.result.lose { color: #ff5252; }

.toast { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.8);
  padding: 10px 20px; border-radius: 20px; font-size: 15px; z-index: 20; }
