* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b0d12; color: #f2f6fb;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; user-select: none; -webkit-user-select: none; }

.hidden { display: none !important; }

#game-root { position: relative; width: 100vw; height: 100vh; }
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #2c4a25; cursor: crosshair; }

/* 顶部 HUD */
#top-hud {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 18px; align-items: center; z-index: 5;
  background: rgba(8,10,16,0.62); padding: 8px 16px; border-radius: 12px;
  border: 2px solid #1d2740; backdrop-filter: blur(4px);
}
#top-hud .team { display: flex; flex-direction: column; gap: 3px; min-width: 160px; }
#top-hud .label { font-size: 12px; opacity: 0.85; font-weight: 700; }
#top-hud .center { text-align: center; min-width: 130px; }
#timer { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
#objective { font-size: 12px; margin-top: 2px; color: #ffd86b; }

.bar { position: relative; width: 100%; height: 14px; background: #11151f;
  border: 1px solid #2c3548; border-radius: 7px; overflow: hidden; }
.bar.small { height: 9px; } .bar.tiny { height: 6px; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transition: width .12s ease; }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 14px; color: #fff; text-shadow: 0 1px 2px #000; }
.blue-fill { background: linear-gradient(90deg,#2a6cff,#6cb3ff); }
.red-fill  { background: linear-gradient(90deg,#ff3838,#ff8a8a); }
.hp-fill   { background: linear-gradient(90deg,#2ecc71,#74e8a4); }
.mp-fill   { background: linear-gradient(90deg,#3498db,#6fc0f5); }
.exp-fill  { background: linear-gradient(90deg,#f1c40f,#fff07a); }
.ult-fill  { background: linear-gradient(90deg,#b15cff,#e58bff); }

/* 击杀公告 */
#killfeed { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; }
#killfeed .kf { background: rgba(8,10,16,0.7); border: 1px solid #2c3548; padding: 3px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 700; animation: kfin .3s ease; }
@keyframes kfin { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* 底部 HUD */
#bottom-hud { position: absolute; bottom: 10px; left: 10px; right: 10px;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; pointer-events: none; z-index: 5; }

#hero-panel { display: flex; gap: 10px; background: rgba(8,10,16,0.62);
  border: 2px solid #1d2740; border-radius: 12px; padding: 10px; pointer-events: auto; align-items: center; }
.portrait { width: 56px; height: 56px; border-radius: 12px; flex: 0 0 auto;
  background: radial-gradient(circle at 32% 28%, #6cb3ff, #1c4ea0);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; border: 2px solid #6cb3ff; }
.bars { width: 200px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.namerow { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
#heroGold { color: #ffd86b; }
.level-row { display: flex; align-items: center; gap: 8px; height: 28px; }
.level-circle {
  --exp: 0%;
  width: 28px; height: 28px; border-radius: 50%;
  background: conic-gradient(#ffd437 var(--exp), #242a36 0);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #f8f2d4; box-shadow: 0 0 0 2px #101010 inset;
  color: #fff; font-size: 12px; font-weight: 900; text-shadow: 0 1px 2px #000;
}
.level-circle span { position: relative; z-index: 1; }
.exp-label { color: #ffd86b; font-size: 11px; font-weight: 700; }
#equip-slots { display: grid; grid-template-columns: repeat(3, 22px); grid-template-rows: repeat(2, 22px); gap: 3px; }
.eslot { width: 22px; height: 22px; border-radius: 5px; background: #11151f; border: 1px solid #2c3548;
  display: flex; align-items: center; justify-content: center; font-size: 13px; }

#skills { display: flex; gap: 8px; background: rgba(8,10,16,0.62); border: 2px solid #1d2740;
  padding: 9px 12px; border-radius: 12px; pointer-events: auto; }
.skill { position: relative; width: 52px; height: 52px; border-radius: 12px;
  background: linear-gradient(180deg,#2b3a5a,#1a233a); border: 2px solid #5a7fc0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.skill.ult { border-color: #c77bff; background: linear-gradient(180deg,#4a2b6a,#26183a); width: 56px; height: 56px; }
.skill.sum { width: 44px; height: 44px; border-color: #6aa84f; background: linear-gradient(180deg,#2b4a2a,#16261a); }
.skill .key { font-size: 16px; font-weight: 800; color: #fff; }
.skill .name { font-size: 10px; color: #cfe1ff; margin-top: 1px; text-align: center; line-height: 1; }
.skill .cd { position: absolute; left: 0; right: 0; bottom: 0; top: 100%; background: rgba(0,0,0,0.72);
  transition: top .1s linear; display: flex; align-items: center; justify-content: center; color: #ffd86b; font-weight: 800; font-size: 14px; }

#right-cluster { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: auto; }
#shopBtn { background: linear-gradient(180deg,#f1b829,#c98a12); border: none; color: #1a1206; font-weight: 800;
  padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; }
#minimap { background: rgba(8,10,16,0.78); border: 2px solid #1d2740; border-radius: 10px; }

/* 商店 */
#shop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 12; }
.shop-panel { background: linear-gradient(180deg,#1a2238,#0e1422); border: 2px solid #3b4a72;
  border-radius: 14px; padding: 22px 26px; width: min(620px, 92vw); max-height: 86vh; overflow: auto; }
.shop-panel h2 { margin-bottom: 14px; color: #ffd86b; display: flex; justify-content: space-between; }
#shop-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 10px; margin-bottom: 16px; }
.shop-item { background: #141b2c; border: 1px solid #2c3548; border-radius: 10px; padding: 10px; cursor: pointer; transition: .12s; }
.shop-item:hover { border-color: #6cb3ff; transform: translateY(-2px); }
.shop-item.disabled { opacity: 0.45; cursor: not-allowed; }
.shop-item .si-name { font-weight: 800; font-size: 14px; }
.shop-item .si-cost { color: #ffd86b; font-size: 13px; float: right; }
.shop-item .si-desc { font-size: 12px; color: #aebcd4; margin-top: 4px; line-height: 1.4; }
#shopClose { background: #2b3a5a; border: 1px solid #5a7fc0; color: #fff; padding: 9px 22px; border-radius: 8px; cursor: pointer; font-weight: 700; }

/* 遮罩 / 开始界面 */
#overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px); z-index: 20; padding: 16px; }
#overlay.show { display: flex; }
#overlay .panel { background: linear-gradient(180deg,#1a2238,#0e1422); border: 2px solid #3b4a72;
  padding: 26px 30px; border-radius: 16px; text-align: center; width: min(720px, 96vw); max-height: 94vh; overflow: auto; }
#overlay h1 { font-size: 34px; margin-bottom: 8px; color: #ffd86b; letter-spacing: 2px; }
#overlay p { color: #c8d3e6; margin-bottom: 14px; line-height: 1.5; }
.hint { font-size: 12px; opacity: 0.8; margin-top: 12px; }
.select-block { text-align: left; margin: 14px 0; }
.select-block h3 { font-size: 14px; margin-bottom: 8px; color: #9fd0ff; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #141b2c; border: 2px solid #2c3548; border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; transition: .12s; }
.chip:hover { border-color: #6cb3ff; }
.chip.active { border-color: #ffd86b; background: #2a2410; color: #ffd86b; }
.chip small { display: block; font-size: 11px; opacity: 0.7; color: #c8d3e6; margin-top: 2px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: 8px; }
.hero-card { background: #141b2c; border: 2px solid #2c3548; border-radius: 10px; padding: 8px; cursor: pointer; transition: .12s; text-align: center; }
.hero-card:hover { border-color: #6cb3ff; transform: translateY(-2px); }
.hero-card.active { border-color: #ffd86b; background: #221c0c; }
.hero-card .hc-icon { width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 4px; display: flex; align-items: center; justify-content: center; font-weight: 800; border: 2px solid #000; }
.hero-card .hc-name { font-size: 13px; font-weight: 700; }
.hero-card .hc-role { font-size: 11px; color: #9fb6d8; }
#startBtn { background: linear-gradient(180deg,#4aa3ff,#1c5fbf); border: none; color: #fff; padding: 12px 34px;
  font-size: 18px; border-radius: 10px; cursor: pointer; font-weight: 800; margin-top: 8px; box-shadow: 0 4px 14px rgba(28,95,191,0.5); }
#startBtn:hover { filter: brightness(1.12); }

@media (max-width: 720px) {
  .bars { width: 130px; }
  #minimap { width: 130px; height: 130px; }
  .skill { width: 44px; height: 44px; } .skill.ult { width: 46px; height: 46px; }
  .skill.sum { display: none; }
}
