:root {
  --gold: #c8aa6e; --gold2: #f0e6d2; --gold-dark: #785a28;
  --navy: #010a13; --navy2: #0a1428; --blue: #3a9cff; --red: #ff4a5a; --green: #6dff7a;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--navy); color: var(--gold2); font-family: var(--font); user-select: none; }
#app canvas { display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
.fade-out { animation: fadeout .6s forwards; }
@keyframes fadeout { to { opacity: 0; } }
@keyframes fadein { from { opacity: 0; } }

/* ---------- logo / boot ---------- */
.logo { font-size: 72px; font-weight: 900; letter-spacing: 10px; text-align: center; color: transparent;
  background: linear-gradient(180deg, #fff6dc 0%, #e8c87a 45%, #8a6428 100%); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.8)) drop-shadow(0 0 30px rgba(200,170,110,.35)); }
.logo span { display: block; font-size: 26px; letter-spacing: 18px; margin-top: 6px; }
#boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; z-index: 50;
  background: radial-gradient(ellipse at center, #13233f 0%, #050a14 70%); }
#boot .bar { width: 360px; height: 4px; background: #1e2328; border: 1px solid var(--gold-dark); }
#boot .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); transition: width .3s; }
#boot .bar.done { opacity: 0; transition: opacity .5s; }
#boot .credits { position: absolute; bottom: 20px; font-size: 12px; color: #7a7a8a; }
.start, .lock-btn, .rbtns button { padding: 14px 54px; font-size: 20px; font-weight: 700; letter-spacing: 4px; color: var(--gold2);
  background: linear-gradient(180deg, #1e3a5a, #0a1a2e); border: 2px solid var(--gold); box-shadow: 0 0 20px rgba(200,170,110,.3), inset 0 0 12px rgba(80,160,255,.25);
  transition: all .2s; }
.start:hover, .lock-btn:hover, .rbtns button:hover { background: linear-gradient(180deg, #2a5080, #10284a); box-shadow: 0 0 34px rgba(200,170,110,.6), inset 0 0 18px rgba(80,160,255,.45); transform: translateY(-1px); }
.start { animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 40px rgba(200,170,110,.7), inset 0 0 18px rgba(80,160,255,.4); } }

/* ---------- intro ---------- */
#intro-ui { position: fixed; inset: 0; z-index: 20; pointer-events: auto; }
.letterbox { position: absolute; left: 0; right: 0; height: 11vh; background: #000; }
.letterbox.top { top: 0; } .letterbox.bottom { bottom: 0; }
.caption { position: absolute; bottom: 14vh; width: 100%; text-align: center; font-size: 30px; letter-spacing: 8px; opacity: 0; text-shadow: 0 2px 10px #000; }
.caption.show { animation: cap 3s forwards; }
@keyframes cap { 0% { opacity: 0; transform: translateY(10px); letter-spacing: 2px; } 15%, 80% { opacity: 1; transform: none; letter-spacing: 8px; } 100% { opacity: 0; } }
.hero-name { position: absolute; left: 8vw; top: 30vh; font-size: 56px; font-weight: 900; color: var(--c); opacity: 0; text-shadow: 0 0 20px rgba(0,0,0,.9), 0 0 40px var(--c); }
.hero-name small { display: block; font-size: 20px; color: var(--gold2); letter-spacing: 6px; }
.hero-name.show { animation: hn 1.05s forwards; }
@keyframes hn { 0% { opacity: 0; transform: translateX(-40px); } 20%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateX(20px); } }
.skip { position: absolute; right: 24px; bottom: calc(11vh + 16px); background: rgba(0,0,0,.4); color: var(--gold2); border: 1px solid var(--gold-dark); padding: 8px 18px; z-index: 2; }
.title-card { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 50px; animation: tc 1.4s; cursor: pointer; }
.title-card .logo { font-size: 96px; }
@keyframes tc { from { opacity: 0; transform: scale(1.3); filter: blur(10px); } }
.press { font-size: 18px; letter-spacing: 6px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }

/* ---------- select ---------- */
#select-ui { position: fixed; inset: 0; z-index: 20; animation: fadein .5s; }
.sel-header { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, rgba(1,10,19,.95), transparent); }
.sel-step { font-size: 18px; letter-spacing: 2px; color: #8a8a9a; }
.sel-step b { color: var(--gold2); background: var(--gold-dark); padding: 2px 9px; border-radius: 50%; margin-right: 4px; }
.sel-step span { padding: 2px 8px; border: 1px solid #555; border-radius: 50%; margin-right: 4px; }
.sel-step i { margin: 0 14px; font-style: normal; color: var(--gold); }
.sel-timer { position: absolute; right: 30px; font-size: 32px; font-weight: 700; color: var(--gold); }
.hero-grid { position: absolute; left: 24px; top: 90px; display: grid; grid-template-columns: repeat(2, 120px); gap: 12px; }
.hero-card { position: relative; width: 120px; height: 120px; padding: 0; border: 2px solid #3c3c41; background: #000; overflow: hidden; transition: all .15s; }
.hero-card img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; filter: saturate(.8) brightness(.85); transition: all .2s; }
.hero-card span { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,.9)); color: #fff; font-size: 14px; padding: 14px 0 4px; }
.hero-card:hover { border-color: var(--gold); } .hero-card:hover img { filter: none; transform: scale(1.08); }
.hero-card.on { border-color: var(--c); box-shadow: 0 0 18px var(--c); } .hero-card.on img { filter: none; }
.hero-info, .class-info { position: absolute; right: 40px; top: 100px; width: 360px; padding: 24px; background: linear-gradient(180deg, rgba(10,20,40,.85), rgba(1,10,19,.85)); border: 1px solid var(--gold-dark); }
.hi-title { color: var(--gold); letter-spacing: 6px; font-size: 14px; }
.hi-name { font-size: 40px; font-weight: 900; margin: 4px 0 12px; }
.hi-lore { color: #a09b8c; line-height: 1.7; }
.hi-passive { margin-top: 16px; padding: 12px; border-left: 3px solid var(--gold); background: rgba(200,170,110,.08); }
.hi-passive b { display: block; color: var(--gold); margin-bottom: 4px; }
.hi-suggest { margin-top: 14px; color: #cdbe91; }
.hi-source { position: absolute; right: 40px; top: 460px; width: 120px; text-align: center; font-size: 12px; color: #888; }
.hi-source img { width: 120px; height: 120px; object-fit: cover; border: 1px solid #3c3c41; opacity: .85; }
.lock-btn { position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); }
.lock-btn:hover { transform: translateX(-50%) translateY(-1px); }
.back-btn { position: absolute; bottom: 48px; left: 40px; background: none; color: var(--gold); border: 1px solid var(--gold-dark); padding: 10px 20px; font-size: 16px; }
.class-grid { position: absolute; left: 24px; top: 90px; display: grid; grid-template-columns: repeat(2, 170px); gap: 12px; }
.class-card { position: relative; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--gold2);
  background: linear-gradient(180deg, #1a2436, #0a121e); border: 2px solid #3c3c41; transition: all .15s; }
.class-card .ci { font-size: 34px; } .class-card b { font-size: 20px; } .class-card small { color: #8a8a9a; font-size: 12px; }
.class-card em { position: absolute; top: 6px; right: 6px; font-size: 11px; font-style: normal; background: var(--gold-dark); padding: 1px 6px; }
.class-card:hover { border-color: var(--gold); } .class-card.on { border-color: var(--gold); box-shadow: 0 0 18px rgba(200,170,110,.6); background: linear-gradient(180deg, #2a3a56, #121e30); }
.statbars { display: grid; grid-template-columns: 50px 1fr; gap: 8px 10px; align-items: center; margin-bottom: 18px; }
.statbars label { color: #a09b8c; font-size: 14px; }
.statbars div { height: 8px; background: #1e2328; } .statbars i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dark), var(--gold)); }
.skill-list div { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; padding: 6px 0; border-top: 1px solid rgba(200,170,110,.15); }
.skill-list .ico { grid-row: span 2; font-size: 26px; } .skill-list small { color: #8a8a9a; }
.mode-pick { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); color: #a09b8c; }
.mode-pick button { margin-left: 8px; padding: 6px 16px; background: #0a1428; color: var(--gold2); border: 1px solid #3c3c41; }
.mode-pick button.on { border-color: var(--gold); background: #1e3a5a; }

/* ---------- loading ---------- */
#loading { position: fixed; inset: 0; z-index: 30; background: radial-gradient(ellipse, #0f1c33, #01050c); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.lrow { display: flex; gap: 14px; }
.lcard { width: 150px; height: 250px; position: relative; border: 2px solid #3c3c41; overflow: hidden; background: #000; animation: fadein .6s; }
.lcard.me { border-color: var(--gold); box-shadow: 0 0 22px rgba(200,170,110,.6); }
.lcard img { width: 100%; height: 100%; object-fit: cover; }
.lcard b { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; font-size: 18px; text-shadow: 0 2px 6px #000; }
.lcard small { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; color: var(--gold); }
.lcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,.9)); }
.lcard b, .lcard small { z-index: 1; }
.vs { font-size: 40px; font-weight: 900; color: var(--gold); letter-spacing: 6px; }
.ltip { color: #8a8a9a; margin-top: 10px; }
.lbar { width: 400px; height: 3px; background: #1e2328; } .lbar i { display: block; height: 100%; width: 0; background: var(--gold); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: none; }
.hud-top { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; gap: 22px; align-items: center; padding: 6px 26px; background: rgba(1,10,19,.85); border: 1px solid var(--gold-dark); border-top: none; font-size: 20px; font-weight: 700; }
.blue-score { color: var(--blue); } .red-score { color: var(--red); } .clock { color: var(--gold2); font-size: 16px; font-weight: 400; }
.bars-layer { position: absolute; inset: 0; overflow: hidden; }
.ub { position: absolute; left: 0; top: 0; will-change: transform; }
.ub .hpb { position: relative; height: 6px; background: #111; border: 1px solid #000; }
.ub .hpb i { position: absolute; left: 0; top: 0; bottom: 0; }
.ub.minion .hpb { width: 36px; height: 4px; } .ub.minion.blue .hp { background: #4a90ff; } .ub.minion.red .hp { background: #ff4a5a; }
.ub.hero .hpb { width: 92px; height: 9px; }
.ub.hero .sh { background: #ddd; } .ub.hero .hp { background: linear-gradient(#5fd85f, #2f9a2f); } .ub.hero.red .hp { background: linear-gradient(#ff6060, #b02a2a); } .ub.hero.blue:not(.me) .hp { background: linear-gradient(#60b0ff, #2a70c0); }
.ub .mpb { width: 92px; height: 3px; background: #111; } .ub .mpb i { display: block; height: 100%; background: #3a8cff; }
.ub .nm { font-size: 12px; text-shadow: 0 1px 2px #000, 0 0 3px #000; white-space: nowrap; margin-bottom: 1px; }
.ub .nm b { display: inline-block; background: #111; border: 1px solid var(--gold-dark); padding: 0 3px; margin-right: 3px; font-size: 10px; }
.ub.tower .hpb, .ub.nexus .hpb { width: 120px; height: 8px; } .ub.tower.blue .hp, .ub.nexus.blue .hp { background: #4a90ff; } .ub.tower.red .hp, .ub.nexus.red .hp { background: #ff4a5a; }
.ub.inv .hpb { outline: 1px solid #aaa; opacity: .55; }
.ftext { position: absolute; left: 0; top: 0; font-weight: 900; font-size: 18px; text-shadow: 0 2px 3px #000, 0 0 2px #000; white-space: nowrap; }
.ftext.phys { color: #fff; } .ftext.magic { color: #b48cff; } .ftext.hurt { color: #ff5050; } .ftext.heal { color: #6dff7a; }
.ftext.crit { font-size: 26px; color: #ffb030; } .ftext.gold { color: #ffd84a; font-size: 16px; } .ftext.cc { color: #ffe080; font-size: 15px; }
.ftext.level { color: #ffe070; font-size: 22px; } .ftext.immune { color: #aaa; font-size: 14px; }
.killfeed { position: absolute; right: 200px; top: 50px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.killfeed div { background: rgba(1,10,19,.8); border: 1px solid var(--gold-dark); padding: 3px 10px; font-size: 14px; display: flex; align-items: center; gap: 6px; animation: fadein .3s; }
.killfeed img { width: 22px; height: 22px; object-fit: cover; vertical-align: middle; margin-right: 3px; border-radius: 3px; }
.killfeed .b { color: var(--blue); } .killfeed .r { color: var(--red); }
.announce { position: absolute; top: 18%; width: 100%; text-align: center; font-size: 34px; font-weight: 900; letter-spacing: 4px; opacity: 0; text-shadow: 0 0 14px #000, 0 2px 4px #000; }
.announce.show { animation: ann 2.4s forwards; } .announce.big { font-size: 52px; color: #ff5040; } .announce.good { color: #7ac8ff; } .announce.bad { color: #ff6a6a; }
@keyframes ann { 0% { opacity: 0; transform: scale(1.4); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.minimap { position: absolute; right: 10px; bottom: 10px; border: 2px solid var(--gold-dark); background: #000; }
.hud-bottom { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px; background: linear-gradient(180deg, rgba(10,20,40,.92), rgba(1,10,19,.96)); border: 1px solid var(--gold-dark); border-bottom: none; pointer-events: auto !important; }
.portrait { position: relative; width: 84px; height: 84px; border: 2px solid var(--gold); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait .lvl { position: absolute; bottom: -6px; right: -6px; background: #0a1428; border: 1px solid var(--gold); padding: 0 6px; font-weight: 700; }
.xpbar { position: absolute; left: -8px; top: 0; bottom: 0; width: 4px; background: #1e2328; display: flex; align-items: flex-end; }
.xpbar i { display: block; width: 100%; background: #b070ff; }
.center { display: flex; flex-direction: column; gap: 4px; }
.buffs { height: 18px; display: flex; gap: 4px; font-size: 12px; } .buffs span { background: #1e2328; padding: 0 4px; border: 1px solid var(--gold-dark); }
.skills { display: flex; gap: 6px; }
.skill { position: relative; width: 56px; height: 56px; border: 2px solid #3c3c41; background: #0a1428; display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: auto; }
.skill.ready { border-color: var(--gold); }
.skill .ico { font-size: 28px; }
.skill .key { position: absolute; left: 2px; top: 0; font-size: 11px; font-weight: 700; color: var(--gold2); text-shadow: 0 0 2px #000; }
.skill .mpc { position: absolute; right: 2px; bottom: 0; font-size: 10px; color: #7ab4ff; }
.skill .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.72); display: flex; align-items: flex-start; justify-content: center; font-size: 18px; font-weight: 700; color: #fff; height: 0; }
.skill.nomana { filter: hue-rotate(180deg) saturate(.4); } .skill.locked { filter: grayscale(1) brightness(.4); }
.bar { position: relative; width: 248px; height: 16px; background: #111; border: 1px solid #000; }
.bar i { display: block; height: 100%; transition: width .1s; } .bar.hp i { background: linear-gradient(#5fd85f, #2a8a2a); } .bar.mp i { background: linear-gradient(#5aa0ff, #2a5ac0); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 11px; line-height: 16px; text-shadow: 0 1px 2px #000; }
.side { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 170px; }
.items { display: grid; grid-template-columns: repeat(6, 26px); gap: 3px; } .items span { width: 26px; height: 26px; border: 1px solid #3c3c41; background: #0a1428; text-align: center; line-height: 24px; font-size: 16px; }
.gold { color: #ffd84a; font-weight: 700; } .kda { color: #a09b8c; }
.death-overlay { position: absolute; top: 34%; width: 100%; text-align: center; font-size: 40px; font-weight: 900; color: #ff6060; opacity: 0; transition: opacity .5s; text-shadow: 0 0 10px #000; }
.death-overlay.show { opacity: 1; } .death-overlay .respawn { font-size: 22px; color: var(--gold2); }
.recall-bar { position: absolute; bottom: 160px; left: 50%; transform: translateX(-50%); width: 240px; text-align: center; opacity: 0; }
.recall-bar.show { opacity: 1; } .recall-bar i { display: block; height: 6px; background: #7ab4ff; margin-top: 4px; width: 0; }
.shop { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%); width: 560px; padding: 18px; background: rgba(1,10,19,.95); border: 2px solid var(--gold); pointer-events: auto !important; }
.shop h3 { margin: 0 0 12px; color: var(--gold); } .shop h3 small { color: #888; font-weight: 400; font-size: 12px; }
.shop-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shop-item { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto auto; text-align: left; padding: 8px; background: #0a1428; color: var(--gold2); border: 1px solid #3c3c41; }
.shop-item .ico { grid-row: span 3; font-size: 26px; } .shop-item small { color: #8a8a9a; font-size: 11px; } .shop-item .cost { color: #ffd84a; }
.shop-item:hover:not(:disabled) { border-color: var(--gold); } .shop-item:disabled { opacity: .45; cursor: default; }
.scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -55%); background: rgba(1,10,19,.94); border: 1px solid var(--gold); padding: 12px 18px; }
.scoreboard table, .rtable { border-collapse: collapse; } .scoreboard td, .rtable td, .rtable th { padding: 4px 12px; }
.scoreboard img, .rtable img { width: 32px; height: 32px; object-fit: cover; vertical-align: middle; }
.scoreboard small, .rtable small { display: block; color: #8a8a9a; font-size: 11px; }
.scoreboard tr.me, .rtable tr.me { background: rgba(200,170,110,.18); }
.scoreboard .bt { color: var(--blue); text-align: left; } .scoreboard .rt { color: var(--red); text-align: left; }
.help { position: absolute; left: 10px; top: 10px; font-size: 12px; color: rgba(240,230,210,.6); max-width: 360px; line-height: 1.6; }
.tooltip { position: absolute; transform: translateY(-100%); width: 280px; padding: 10px; background: rgba(1,10,19,.96); border: 1px solid var(--gold); font-size: 13px; line-height: 1.6; z-index: 5; }
.tooltip small { color: #8a8a9a; }

/* ---------- result ---------- */
#result { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(1,5,12,.82); animation: fadein .8s; }
.rtitle { font-size: 110px; font-weight: 900; letter-spacing: 20px; animation: tc 1s; }
.rtitle.win { color: transparent; background: linear-gradient(180deg, #fff6dc, #e8c87a 50%, #8a6428); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 30px rgba(200,170,110,.6)); }
.rtitle.lose { color: #a03a3a; text-shadow: 0 0 30px rgba(255,0,0,.4); }
.rsub { color: #a09b8c; }
.rtable { background: rgba(10,20,40,.7); border: 1px solid var(--gold-dark); }
.rtable th { color: var(--gold); font-weight: 400; text-align: left; border-bottom: 1px solid var(--gold-dark); }
.rtable tr.blue td:first-child { border-left: 3px solid var(--blue); } .rtable tr.red td:first-child { border-left: 3px solid var(--red); }
.rbtns { display: flex; gap: 20px; margin-top: 10px; }

@media (max-width: 900px) {
  .logo { font-size: 44px; } .title-card .logo { font-size: 54px; }
  .hero-info, .class-info { width: 260px; right: 10px; padding: 14px; } .hi-name { font-size: 28px; }
  .hero-grid { grid-template-columns: repeat(2, 80px); } .hero-card { width: 80px; height: 80px; }
  .class-grid { grid-template-columns: repeat(2, 120px); } .hi-source { display: none; }
}
.skill.spell { width: 44px; height: 44px; align-self: flex-end; }
.skill.spell .ico { font-size: 22px; }
.skill.spell:nth-child(5) { margin-left: 10px; }
.skill-list.kit { margin-top: 12px; }
.hi-source { top: auto; bottom: 120px; }
.ub.monster .hpb { width: 80px; height: 7px; } .ub.monster .hp { background: linear-gradient(#e0c050, #a07a20); }
.ub.monster .nm { color: #f0d890; text-align: center; }
