@font-face { font-family: 'Marcellus'; src: url('assets/Marcellus-Regular.ttf') format('truetype'); font-display: block; }
@font-face { font-family: 'Barlow'; src: url('assets/Barlow-Medium.ttf') format('truetype'); font-display: block; }

:root {
  --gold1: #f0e6d2; --gold2: #c8aa6e; --gold3: #c89b3c; --gold4: #785a28; --gold5: #463714;
  --blue1: #cdfafa; --blue2: #0ac8b9; --blue3: #0397ab; --blue5: #005a82; --blue6: #0a323c; --blue7: #091428;
  --dark: #010a13; --grey1: #a09b8c; --grey2: #5b5a56; --grey3: #3c3c41; --grey4: #1e2328;
  --hp: #2fb34a; --mp: #2a6ad8;
  --ui: 1;
  --cur: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M2 2 L22 10 L13 13 L10 22 Z' fill='%23c8aa6e' stroke='%23463714' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M4 4 L18 10 L12 12 Z' fill='%23f0e6d2' opacity='.6'/%3E%3C/svg%3E") 2 2, default;
  --cur-atk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M3 3 L8 3 L24 19 L19 24 L3 8 Z' fill='%23e84a3a' stroke='%23400' stroke-width='1.5'/%3E%3Cpath d='M18 25 L25 18 L27 20 L20 27 Z' fill='%23c8aa6e' stroke='%23400'/%3E%3C/svg%3E") 3 3, crosshair;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #010a13; color: var(--gold1); font-family: 'Barlow', system-ui, sans-serif; user-select: none; cursor: var(--cur); }
body.attack-cursor, body.attack-cursor canvas { cursor: var(--cur-atk); }
canvas#world { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
button { font-family: inherit; cursor: var(--cur); }

@media (max-height: 820px) { :root { --ui: 0.82; } }
@media (max-height: 680px) { :root { --ui: 0.68; } }
@media (max-width: 1250px) { :root { --ui: 0.72; } }
@media (max-width: 950px) { :root { --ui: 0.55; } }
@media (max-width: 700px) { :root { --ui: 0.42; } #minimap { bottom: calc(150px * var(--ui) + 4px); } }

/* ───── shared frame: dark hextech panel with gold edge ───── */
.frame {
  background: linear-gradient(180deg, rgba(16,24,34,0.96), rgba(4,10,18,0.96));
  border: 1px solid var(--gold4);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(200,170,110,0.08), 0 6px 24px rgba(0,0,0,0.6);
}

/* ───── HUD ───── */
#hud { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .5s; }
#hud.show { opacity: 1; }
#hud .frame, #hud .ab, #hud .slot, #minimap canvas { pointer-events: auto; }

#score { position: absolute; top: 0; right: 0; display: flex; gap: 18px; padding: 6px 16px; border-top: 0; border-right: 0; font-size: 15px; align-items: center; }
#score .sc { display: flex; align-items: center; gap: 6px; color: var(--gold1); }
#score .ico { font-style: normal; opacity: .85; }
#score .ico.sword::before { content: '⚔'; color: var(--gold2); }
#score .ico.minion::before { content: '◆'; color: #8fb4ff; font-size: 12px; }
#score .time b { font-variant-numeric: tabular-nums; letter-spacing: .5px; }

#objective { position: absolute; top: 10px; left: 50%; transform: translate(-50%, -6px); display: flex; gap: 10px; align-items: center; padding: 5px 14px 5px 6px; opacity: 0; transition: .3s; border-radius: 2px; }
#objective.show { opacity: 1; transform: translate(-50%, 0); }
#objective .on { font-family: 'Marcellus', serif; letter-spacing: 1px; color: var(--gold1); font-size: 14px; }
#objective .ot { font-variant-numeric: tabular-nums; color: var(--gold2); font-size: 15px; }
#objective.soon .ot { color: #ff8a5a; animation: pulse 1s infinite; }
#swarm { position: absolute; top: 60px; left: 50%; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 8px; width: 220px; text-shadow: 0 1px 3px #000; pointer-events: none; }
#swarm .sn { font-family: 'Marcellus', serif; letter-spacing: 1px; font-size: 12px; color: var(--gold2); text-transform: uppercase; }
#swarm .st { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--gold1); }
#swarm .sb { flex-basis: 100%; height: 3px; background: #0008; display: none; }
#swarm .sb i { display: block; height: 100%; background: linear-gradient(90deg, #ff5a3a, #ffb04a); }
#swarm.soon .st { color: #ff8a5a; animation: pulse 1s infinite; }
#swarm.on .sn { color: #ff6a4a; font-size: 15px; animation: pulse .8s infinite; }
#swarm.on .sb { display: block; }
.oi { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold3); background: radial-gradient(circle at 35% 30%, #fff8, transparent 40%), var(--c, #444); }
.oi.blue { --c: radial-gradient(#5ab0ff, #123a7a); } .oi.red { --c: radial-gradient(#ff8a5a, #6a1a08); }
.oi.herald { --c: radial-gradient(#9a7aff, #24104a); } .oi.drake { --c: radial-gradient(#ffb04a, #6a2408); } .oi.baron { --c: radial-gradient(#c88aff, #2a0a4a); }

#bossbar { position: absolute; top: 14px; left: 50%; width: min(560px, 60vw); transform: translate(-50%, -10px); opacity: 0; transition: .35s; text-align: center; }
#bossbar.show { opacity: 1; transform: translate(-50%, 0); }
#bossbar .bn { font-family: 'Marcellus', serif; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold1); text-shadow: 0 2px 6px #000; margin-bottom: 4px; }
#bossbar .bt { position: relative; height: 16px; border: 1px solid var(--gold3); background: #0a0608; box-shadow: 0 0 0 1px #000, 0 4px 16px rgba(0,0,0,.6); }
#bossbar .bf { position: absolute; inset: 1px auto 1px 1px; background: linear-gradient(#ff7a5a, #a82a1a); transition: width .15s; }
#bossbar.baron .bf { background: linear-gradient(#c88aff, #5a1aa8); }
#bossbar.drake .bf { background: linear-gradient(#ffb04a, #b8461a); }
#bossbar .bv { position: absolute; inset: 0; font-size: 11px; line-height: 15px; color: #fff; text-shadow: 0 1px 2px #000; }

#announce { position: absolute; top: 19%; left: 0; right: 0; text-align: center; opacity: 0; pointer-events: none; }
#announce.show { animation: announce 3.2s ease forwards; }
#announce .a-title { display: inline-block; font-family: 'Marcellus', serif; font-size: 30px; letter-spacing: 3px; text-transform: uppercase; color: var(--ac); text-shadow: 0 0 18px color-mix(in srgb, var(--ac) 60%, transparent), 0 2px 4px #000; padding: 6px 60px;
  background: linear-gradient(90deg, transparent, rgba(1,10,19,.85) 20%, rgba(1,10,19,.85) 80%, transparent); border-top: 1px solid; border-bottom: 1px solid; border-image: linear-gradient(90deg, transparent, var(--gold3), transparent) 1; }
#announce .a-title.big { font-size: 42px; }
#announce .a-sub { margin-top: 8px; color: var(--grey1); font-size: 16px; letter-spacing: 1px; text-shadow: 0 2px 4px #000; }
@keyframes announce { 0% { opacity: 0; transform: scale(1.25); } 8% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }

#msg { position: absolute; bottom: calc(190px * var(--ui)); left: 50%; transform: translateX(-50%); color: #ff6a5a; font-size: 16px; text-shadow: 0 2px 4px #000; opacity: 0; transition: opacity .2s; }
#msg.show { opacity: 1; }

/* bottom cluster */
#bottom { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%) scale(var(--ui)); transform-origin: 50% 100%; display: flex; align-items: flex-end; }
#stats { display: grid; grid-template-columns: repeat(2, 64px); gap: 3px 6px; padding: 8px 10px; margin-right: -1px; border-bottom: 0; height: 128px; align-content: center; }
#stats > div { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--gold1); }
#stats b { font-weight: 500; font-variant-numeric: tabular-nums; }
.st { font-style: normal; width: 14px; text-align: center; font-size: 12px; }
.st.ad::before { content: '⚔'; color: #ff9a3c; } .st.ap::before { content: '✦'; color: #b48cff; }
.st.ar::before { content: '⛨'; color: #e8c86a; } .st.mr::before { content: '◈'; color: #7ac8ff; }
.st.as::before { content: '➶'; color: #f2d27a; } .st.cdr::before { content: '◷'; color: #d0d8e0; }
.st.crit::before { content: '✸'; color: #ff6a4a; } .st.ms::before { content: '➤'; color: #e8e0d0; }

#core { position: relative; display: flex; align-items: flex-end; padding: 0 14px 10px 0; border-bottom: 0; height: 150px;
  background: linear-gradient(180deg, rgba(12,20,30,0.97), rgba(2,8,14,0.98)); }
#core::before { content: ''; position: absolute; left: 50%; top: -6px; width: 60%; height: 2px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, var(--gold3), transparent); }
#portrait { position: relative; width: 120px; height: 120px; margin: 0 6px -2px 10px; flex: none; align-self: center; }
#portrait canvas { position: absolute; inset: 12px; width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--gold4); }
#xpring { position: absolute; inset: 0; transform: rotate(90deg); }
#xpring circle { fill: none; stroke-width: 6; }
#xpring .t { stroke: #0b1520; }
#xpring .v { stroke: url(#none); stroke: #9a6af0; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; transition: stroke-dashoffset .3s; filter: drop-shadow(0 0 3px #9a6af0); }
#lvl { position: absolute; bottom: 2px; right: 6px; width: 30px; height: 30px; border-radius: 50%; background: #0a1018; border: 2px solid var(--gold3); display: grid; place-items: center; font-size: 15px; color: var(--gold1); box-shadow: 0 0 8px #000; }

#mid { display: flex; flex-direction: column; gap: 6px; }
#buffs { display: flex; gap: 6px; height: 28px; align-items: flex-end; }
.buff { position: relative; width: 26px; height: 26px; border: 1px solid var(--gold3); border-radius: 3px; box-shadow: 0 0 6px #000; }
.buff.blue { background: radial-gradient(circle at 35% 30%, #cfefff, #2a7ae0 50%, #0a1a40); }
.buff.red { background: radial-gradient(circle at 35% 30%, #ffd0a0, #e0502a 50%, #3a0a04); }
.buff.soul { background: radial-gradient(circle at 35% 30%, #fff0a0, #ff7a1a 50%, #4a1004); }
.buff span { position: absolute; bottom: -2px; right: 1px; font-size: 10px; text-shadow: 0 0 3px #000, 0 0 3px #000; }

#abilities { display: flex; gap: 6px; align-items: flex-end; }
.ab { position: relative; width: 58px; height: 58px; border: 2px solid var(--gold4); background: #000; box-shadow: 0 0 0 1px #000, 0 2px 8px rgba(0,0,0,.7); transition: border-color .15s, transform .08s; }
.ab img { width: 100%; height: 100%; display: block; }
.ab.passive { width: 38px; height: 38px; border-radius: 3px; margin-right: 2px; }
.ab.sum { width: 44px; height: 44px; }
.ab .key { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); font-size: 11px; background: #0a1018; border: 1px solid var(--gold4); color: var(--gold1); padding: 0 5px; line-height: 14px; }
.ab.sum .key { bottom: -9px; }
.ab .cost { position: absolute; right: 2px; top: 1px; font-size: 10px; color: #8fb4ff; text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ab .pips { position: absolute; left: 0; right: 0; top: -9px; display: flex; justify-content: center; gap: 3px; }
.ab .pips i { width: 7px; height: 5px; background: #1b2530; border: 1px solid #000; }
.ab .pips i.on { background: linear-gradient(#ffe7a0, #c89b3c); box-shadow: 0 0 4px #c89b3c; }
.ab .cd { position: absolute; inset: 0; background: conic-gradient(transparent calc(var(--p, 1) * 360deg), rgba(0,0,0,.72) 0); opacity: 0; }
.ab.cooling .cd { opacity: 1; }
.ab .cdt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: #fff; text-shadow: 0 0 4px #000, 0 0 2px #000; }
.ab.sum .cdt { font-size: 15px; }
.ab.locked img { filter: grayscale(1) brightness(.35); }
.ab.nomana img { filter: saturate(.4) brightness(.6) sepia(.3) hue-rotate(180deg); }
.ab.aim { border-color: var(--blue1); transform: translateY(-2px); box-shadow: 0 0 12px var(--blue2); }
.ab.active { border-color: var(--gold2); box-shadow: 0 0 14px var(--gold3); }
.ab.ready { animation: ready .45s ease-out; }
@keyframes ready { 0% { box-shadow: 0 0 0 0 rgba(240,230,210,.9); border-color: #fff; } 100% { box-shadow: 0 0 0 14px rgba(240,230,210,0); } }
.sep { width: 8px; }

#res { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.bar { position: relative; height: 18px; background: #050a10; border: 1px solid #000; outline: 1px solid var(--gold5); overflow: hidden; }
.bar .fill { position: absolute; inset: 0 auto 0 0; transition: width .12s; }
.bar.hp .fill { background: linear-gradient(#5ce06e, #2fb34a 50%, #1a7a30); }
.bar.hp .shield { position: absolute; top: 0; bottom: 0; background: linear-gradient(#ffffff, #c6ccd4); }
.bar.mp { height: 14px; }
.bar.mp .fill { background: linear-gradient(#5aa0ff, #2a6ad8 50%, #1a3a8a); }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 17px; color: #fff; text-shadow: 0 1px 2px #000; }
.bar.mp span { font-size: 11px; line-height: 13px; }
.bar em { position: absolute; right: 6px; top: 0; font-style: normal; font-size: 11px; line-height: 17px; color: #b8f0c0; text-shadow: 0 1px 2px #000; }

#inv { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 10px 12px; margin-left: -1px; border-bottom: 0; height: 128px; }
#items { display: grid; grid-template-columns: repeat(4, 40px); grid-template-rows: repeat(2, 40px); gap: 4px; }
.slot { position: relative; border: 1px solid var(--gold5); background: #050a10; }
.slot img { width: 100%; height: 100%; display: block; }
.slot.empty { background: linear-gradient(135deg, #0a1018, #050a10); box-shadow: inset 0 0 8px #000; }
.slot.trinket { grid-column: 4; grid-row: 1 / span 2; border-radius: 50%; width: 40px; height: 40px; align-self: center; border-color: var(--gold3); }
.slot.trinket .ward { position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff3a0, #c89b3c 50%, #463714); }
.ilv { position: absolute; right: 1px; bottom: 0; font-size: 11px; color: var(--gold1); text-shadow: 0 0 2px #000, 0 0 2px #000; }
.ilv.max { color: #ffd76a; font-size: 9px; }
#gold { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; color: #ffd76a; background: #050a10; border: 1px solid var(--gold5); padding: 2px 0; }
.coin { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c0, #e8b84a 50%, #8a5a10); }

#minimap { position: absolute; right: 0; bottom: 0; padding: 6px; border-right: 0; border-bottom: 0; transform: scale(var(--ui)); transform-origin: 100% 100%; }
#minimap canvas { display: block; width: 230px; height: 230px; border: 1px solid var(--gold4); }

#tip { position: fixed; z-index: 50; max-width: 340px; padding: 10px 12px; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: linear-gradient(180deg, #0a1520, #010a13); border: 1px solid var(--gold4); box-shadow: 0 0 0 1px #000, 0 8px 30px rgba(0,0,0,.7); font-size: 13px; line-height: 1.45; color: var(--grey1); }
#tip.show { opacity: 1; }
#tip h4 { margin: 0 0 2px; font-family: 'Marcellus', serif; font-weight: 400; font-size: 15px; color: var(--gold1); display: flex; justify-content: space-between; gap: 16px; }
#tip .rk { color: var(--gold2); font-family: 'Barlow'; font-size: 12px; }
#tip .sub { font-size: 12px; color: #8fb4ff; margin-bottom: 6px; }
#tip p { margin: 0; }
.sc-ad { color: #ff9a3c; } .sc-ap { color: #b48cff; } .sc-true { color: #fff; } .kw { color: var(--gold1); }

/* ───── champion select ───── */
#menu { position: fixed; inset: 0; z-index: 20; display: block; background:
  radial-gradient(ellipse at 50% 0%, rgba(10,50,60,.55), transparent 60%),
  radial-gradient(ellipse at 50% 100%, rgba(70,55,20,.35), transparent 60%),
  linear-gradient(180deg, rgba(1,10,19,.78), rgba(1,10,19,.94)); transition: opacity .6s, visibility .6s; overflow: auto; }
#menu.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.menu-inner { width: min(1180px, 94vw); padding: 20px 0 28px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.brand { text-align: center; margin-bottom: 14px; }
.logo { font-family: 'Marcellus', serif; font-size: clamp(38px, 6vw, 68px); letter-spacing: 8px; background: linear-gradient(180deg, #f0e6d2 20%, #c8aa6e 60%, #785a28); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 12px rgba(0,0,0,.8)); }
.logo span { letter-spacing: 6px; }
.tag { color: var(--grey1); letter-spacing: 2px; font-size: 15px; margin-top: 2px; }
.pick-label { font-family: 'Marcellus', serif; color: var(--gold2); letter-spacing: 4px; text-transform: uppercase; margin: 18px 0 14px; display: flex; align-items: center; gap: 14px; }
.pick-label::before, .pick-label::after { content: ''; width: 120px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold4)); }
.pick-label::after { transform: scaleX(-1); }
#champs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; width: 100%; }
.champ { position: relative; border: 1px solid var(--gold5); background: linear-gradient(180deg, #0a1520, #010a13); transition: transform .2s, border-color .2s, box-shadow .2s; overflow: hidden; }
.champ:hover { transform: translateY(-4px); border-color: var(--gold4); }
.champ.sel { border-color: var(--gold2); box-shadow: 0 0 0 1px var(--gold3), 0 0 30px rgba(200,155,60,.35); }
.champ.sel::after { content: ''; position: absolute; inset: 0; border: 2px solid var(--gold2); pointer-events: none; }
.splash { height: 180px; overflow: hidden; position: relative; }
.splash canvas { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform .4s; }
.champ:hover .splash canvas { transform: scale(1.07); }
.splash::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, #010a13); }
.info { padding: 0 18px 18px; margin-top: -30px; position: relative; }
.cname { font-family: 'Marcellus', serif; font-size: 30px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold1); }
.ctitle { color: var(--gold2); font-size: 14px; letter-spacing: 1px; margin-top: -2px; }
.meta { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 8px; font-size: 13px; color: var(--grey1); }
.role { border: 1px solid var(--gold5); padding: 1px 8px; color: var(--gold2); letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
.diff { display: flex; gap: 3px; } .diff i { width: 18px; height: 5px; background: #1e2328; } .diff i.on { background: var(--blue2); box-shadow: 0 0 6px var(--blue3); }
.info p { font-size: 13px; color: var(--grey1); line-height: 1.5; margin: 0 0 12px; min-height: 58px; }
.kit { display: flex; gap: 6px; } .kit img { width: 38px; height: 38px; border: 1px solid var(--gold4); }
.kit img:first-child { border-radius: 50%; }

.hex-btn { margin-top: 24px; min-width: 240px; padding: 12px 28px; font-size: 18px; letter-spacing: 3px; text-transform: uppercase; font-family: 'Marcellus', serif; color: var(--blue1);
  background: linear-gradient(180deg, #1e2328, #0a1018); border: 2px solid; border-image: linear-gradient(180deg, var(--blue2), var(--blue5)) 1;
  box-shadow: 0 0 20px rgba(10,200,185,.25), inset 0 0 12px rgba(10,200,185,.18); transition: .2s; }
.hex-btn:hover { color: #fff; box-shadow: 0 0 30px rgba(10,200,185,.5), inset 0 0 20px rgba(10,200,185,.35); background: linear-gradient(180deg, #0a323c, #091428); }
.hex-btn.ghost { color: var(--gold1); border-image: linear-gradient(180deg, var(--gold2), var(--gold4)) 1; box-shadow: none; }
.hex-btn.ghost:hover { box-shadow: 0 0 20px rgba(200,155,60,.35); background: linear-gradient(180deg, #2a2418, #0a1018); }
.controls { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: var(--grey1); font-size: 13px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; margin-right: 3px; border: 1px solid var(--gold4); background: #0a1018; color: var(--gold1); font-family: 'Barlow'; font-size: 12px; text-align: center; }

/* ───── level up ───── */
#levelup { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  background: radial-gradient(ellipse at center, rgba(1,10,19,.55), rgba(1,10,19,.85)); opacity: 0; visibility: hidden; transition: .2s; }
#levelup.show { opacity: 1; visibility: visible; }
.lu-head { text-align: center; }
.lu-title { font-family: 'Marcellus', serif; font-size: 44px; letter-spacing: 6px; text-transform: uppercase; background: linear-gradient(180deg, #f0e6d2, #c8aa6e); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(200,155,60,.5)); }
.lu-sub { color: var(--grey1); letter-spacing: 3px; text-transform: uppercase; font-size: 13px; }
#cards { display: flex; gap: min(22px, 2vw); max-width: 96vw; }
.card { position: relative; width: min(250px, 31vw); padding: 22px min(18px, 1.6vw) 18px; text-align: center; cursor: var(--cur); background: linear-gradient(180deg, #0f1c28, #030c16); border: 1px solid var(--gold4);
  box-shadow: 0 0 0 1px #000, 0 12px 40px rgba(0,0,0,.6); transition: transform .15s, border-color .15s, box-shadow .15s; animation: cardin .35s backwards cubic-bezier(.2,1.4,.4,1); }
.card::before { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(200,170,110,.15); pointer-events: none; }
.card:hover { transform: translateY(-8px); border-color: var(--gold2); box-shadow: 0 0 0 1px var(--gold3), 0 0 36px rgba(200,155,60,.35); }
.card.ability:hover { border-color: var(--blue2); box-shadow: 0 0 0 1px var(--blue3), 0 0 36px rgba(10,200,185,.3); }
@keyframes cardin { from { opacity: 0; transform: translateY(30px) scale(.9); } }
.cimg { position: relative; width: 84px; height: 84px; margin: 0 auto 12px; border: 2px solid var(--gold3); box-shadow: 0 0 20px rgba(0,0,0,.8); }
.card.ability .cimg { border-color: var(--blue2); }
.cimg img { width: 100%; height: 100%; display: block; }
.badge { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); background: #0a1018; border: 1px solid var(--gold3); padding: 0 8px; font-size: 12px; color: var(--gold1); }
.csub { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue2); margin-top: 8px; }
.card.item .csub { color: var(--gold2); }
.ctit { font-family: 'Marcellus', serif; font-size: 21px; color: var(--gold1); margin: 4px 0 8px; }
.card p { font-size: 13px; line-height: 1.5; color: var(--grey1); margin: 0; min-height: 60px; }
.hk { position: absolute; top: 8px; right: 10px; font-size: 12px; color: var(--grey2); }

/* ───── overlays ───── */
.overlay { position: fixed; inset: 0; z-index: 16; display: grid; place-items: center; background: rgba(1,10,19,.7); opacity: 0; visibility: hidden; transition: .3s; }
.overlay.show { opacity: 1; visibility: visible; }
.panel { display: flex; flex-direction: column; align-items: center; padding: 30px 50px; background: linear-gradient(180deg, #0a1520, #010a13); border: 1px solid var(--gold4); }
.panel .hex-btn { margin-top: 14px; }
.ov-title { font-family: 'Marcellus', serif; font-size: 34px; letter-spacing: 6px; text-transform: uppercase; color: var(--gold1); }
.end-inner { text-align: center; }
#end-title { font-family: 'Marcellus', serif; font-size: clamp(60px, 10vw, 120px); letter-spacing: 14px; background: linear-gradient(180deg, #d8e0f0, #6a7a90); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 30px rgba(0,0,0,.9)); }
#end.victory #end-title { background-image: linear-gradient(180deg, #fff6d8, #f0c862 50%, #a8701c); filter: drop-shadow(0 0 40px rgba(240,200,98,.45)); }
#end.show #end-title { animation: endin 1.2s cubic-bezier(.2,1,.3,1); }
@keyframes endin { from { opacity: 0; transform: scale(1.4); letter-spacing: 40px; } }
#end-sub { color: var(--grey1); letter-spacing: 2px; margin-top: -6px; }
#end-stats { display: grid; grid-template-columns: repeat(3, 170px); gap: 10px; margin: 28px auto 6px; justify-content: center; }
#end-stats div { background: rgba(10,20,30,.85); border: 1px solid var(--gold5); padding: 10px; }
#end-stats span { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--grey1); }
#end-stats b { font-family: 'Marcellus', serif; font-weight: 400; font-size: 24px; color: var(--gold1); }
.end-btns { display: flex; gap: 16px; justify-content: center; }

#loading { position: fixed; inset: 0; z-index: 40; display: grid; place-content: center; justify-items: center; gap: 16px; background: #010a13; color: var(--gold2); letter-spacing: 2px; transition: opacity .5s, visibility .5s; }
#loading.gone { opacity: 0; visibility: hidden; }
.spinner { width: 46px; height: 46px; border: 3px solid var(--gold5); border-top-color: var(--gold2); border-radius: 50%; animation: spin 1s linear infinite; }
.err { color: #ff6a5a; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .5; } }

/* ───── 3D layers ───── */
canvas#world.dead { filter: saturate(0.15) brightness(0.8); transition: filter 1s; }
#overlay { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
#grade { position: fixed; inset: 0; pointer-events: none; mix-blend-mode: soft-light;
  background: linear-gradient(180deg, rgba(60,90,180,0.28), rgba(128,128,128,0) 55%, rgba(255,170,90,0.22)); }
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 55%, rgba(2,6,14,0.62) 100%); }
#flash { position: fixed; inset: 0; pointer-events: none; mix-blend-mode: screen; }
#loading .lp { font-size: 13px; color: var(--grey1); letter-spacing: 1px; min-height: 1em; }

/* ───── menus: tabs, modes, co-op lobby, modifiers ───── */
.hidden { display: none !important; }
#tabs { display: flex; gap: 2px; align-items: center; margin: 4px 0 10px; border-bottom: 1px solid var(--gold5); width: 100%; justify-content: center; position: relative; }
#tabs button { background: none; border: 0; padding: 10px 26px; font-family: 'Marcellus', serif; letter-spacing: 3px; text-transform: uppercase; font-size: 15px; color: var(--grey1); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .2s; }
#tabs button:hover { color: var(--gold1); }
#tabs button.on { color: var(--gold1); border-bottom-color: var(--gold2); }
#be { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 6px; color: #9ae4ff; font-size: 17px; }
.be-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; background: radial-gradient(circle at 35% 30%, #e8fbff, #3ac8ff 45%, #0a3a6a); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); filter: drop-shadow(0 0 4px #3ac8ff); }
.tab { display: none; width: 100%; flex-direction: column; align-items: center; }
.tab.on { display: flex; animation: tabin .3s ease; }
@keyframes tabin { from { opacity: 0; transform: translateY(8px); } }
.tab-head { color: var(--grey1); letter-spacing: 1px; margin: 8px 0 18px; text-align: center; }
.mode-row { display: flex; gap: 10px; margin-top: 4px; }
.mode { padding: 8px 26px; background: linear-gradient(180deg, #1e2328, #0a1018); border: 1px solid var(--gold5); color: var(--grey1); font-family: 'Marcellus', serif; letter-spacing: 2px; text-transform: uppercase; font-size: 14px; transition: .2s; }
.mode:hover { color: var(--gold1); border-color: var(--gold4); }
.mode.on { color: var(--blue1); border-color: var(--blue2); box-shadow: 0 0 14px rgba(10,200,185,.3), inset 0 0 10px rgba(10,200,185,.15); }
#coop { margin-top: 14px; width: min(760px, 100%); }
.coop-form { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.coop-form input { background: #0a1018; border: 1px solid var(--gold4); color: var(--gold1); padding: 8px 10px; font-family: 'Barlow'; font-size: 15px; outline: none; user-select: text; }
.coop-form input:focus { border-color: var(--gold2); }
#pname { width: 180px; } #code { width: 90px; text-transform: uppercase; letter-spacing: 4px; text-align: center; }
.coop-form .or { color: var(--grey2); font-size: 13px; }
.small-btn { padding: 8px 16px; background: linear-gradient(180deg, #1e2328, #0a1018); border: 1px solid var(--blue3); color: var(--blue1); font-family: 'Marcellus', serif; letter-spacing: 1.5px; text-transform: uppercase; font-size: 13px; transition: .2s; }
.small-btn:hover:not(:disabled) { box-shadow: 0 0 14px rgba(10,200,185,.4); color: #fff; }
.small-btn:disabled { opacity: .35; border-color: var(--grey3); }
.small-btn.on { border-color: #ff7a6a; color: #ffb0a0; box-shadow: 0 0 14px rgba(255,90,70,.4); }
#room { border: 1px solid var(--gold5); background: rgba(4,10,18,.85); padding: 12px 16px; }
.room-code { display: flex; align-items: baseline; gap: 10px; color: var(--grey1); letter-spacing: 1px; margin-bottom: 8px; }
.room-code b { font-family: 'Marcellus', serif; font-size: 28px; letter-spacing: 8px; color: var(--blue1); text-shadow: 0 0 12px rgba(10,200,185,.5); user-select: text; }
.room-code span { font-size: 12px; color: var(--grey2); }
#roster { display: flex; flex-direction: column; gap: 4px; }
.rp { display: grid; grid-template-columns: 1fr 120px 90px; padding: 6px 10px; background: #0a1018; border-left: 3px solid var(--grey3); }
.rp.me { background: #0c1a24; }
.rp.ready { border-left-color: var(--blue2); }
.rp .rn em { font-style: normal; font-size: 11px; color: var(--gold2); border: 1px solid var(--gold5); padding: 0 4px; margin-left: 6px; }
.rp .rc { color: var(--gold2); } .rp .rr { color: var(--grey1); text-align: right; font-size: 13px; }
.rp.ready .rr { color: var(--blue2); }
.champ .taken { position: absolute; top: 10px; left: 10px; background: rgba(4,10,18,.9); border: 1px solid #3a8ae8; color: #9ac8ff; font-size: 12px; padding: 2px 8px; }
.pick-label.small { font-size: 13px; margin: 14px 0 8px; }
.pick-label.small span { color: #9ae4ff; letter-spacing: 1px; font-family: 'Barlow'; text-transform: none; }
#mods { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 960px; }
.mod { display: flex; flex-direction: column; align-items: center; min-width: 120px; padding: 6px 12px; background: #0a1018; border: 1px solid var(--gold5); color: var(--grey1); font-family: 'Barlow'; transition: .2s; }
.mod b { font-weight: normal; color: var(--gold1); font-size: 14px; }
.mod span { font-size: 11px; color: #6ab8d8; }
.mod:hover:not(:disabled) { border-color: var(--gold3); }
.mod.on { border-color: #ff7a4a; background: linear-gradient(180deg, #2a140a, #0a1018); box-shadow: 0 0 12px rgba(255,120,60,.35); }
.mod.on b { color: #ffc8a0; }
.mod.locked { opacity: .35; }
.mod:disabled:not(.locked) { cursor: default; }

/* upgrades shop */
#upgrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; width: 100%; }
.upg { display: flex; gap: 12px; align-items: center; padding: 10px; background: linear-gradient(180deg, #0f1c28, #030c16); border: 1px solid var(--gold5); }
.upg img { width: 54px; height: 54px; border: 1px solid var(--gold3); }
.upg .ut { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.upg .ut b { font-family: 'Marcellus', serif; font-weight: normal; font-size: 17px; color: var(--gold1); }
.upg .ut span { font-size: 13px; color: var(--grey1); }
.upg .pips { display: flex; gap: 3px; margin-top: 4px; } .upg .pips i { width: 16px; height: 5px; background: #1e2328; } .upg .pips i.on { background: #3ac8ff; box-shadow: 0 0 6px #3ac8ff; }
.upg .buy { min-width: 82px; padding: 8px 10px; background: linear-gradient(180deg, #0a2a3a, #071420); border: 1px solid #3ac8ff; color: #cdf3ff; font-family: 'Barlow'; font-size: 15px; }
.upg .buy:hover:not(:disabled) { box-shadow: 0 0 14px rgba(58,200,255,.5); }
.upg .buy:disabled { opacity: .4; border-color: var(--grey3); }
.upg.maxed { border-color: var(--gold4); } .upg.maxed .buy { color: var(--gold2); border-color: var(--gold4); opacity: 1; background: none; }
.upg.locked { opacity: .5; } .upg.locked img { filter: grayscale(1); }

/* achievements + collection */
#achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; width: 100%; }
.ach { display: flex; gap: 12px; padding: 10px 12px; background: #0a1018; border: 1px solid var(--grey3); opacity: .65; }
.ach .ai { width: 38px; height: 38px; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: #1e2328; }
.ach.got { opacity: 1; border-color: var(--gold3); }
.ach.got .ai { background: radial-gradient(circle at 35% 30%, #fff6d8, #f0c862 45%, #785a28); }
.ach b { display: block; font-family: 'Marcellus', serif; font-weight: normal; color: var(--gold1); }
.ach span { display: block; font-size: 13px; color: var(--grey1); }
.ach em { display: block; font-style: normal; font-size: 12px; color: #9ae4ff; margin-top: 2px; }
#collection { width: 100%; display: flex; flex-direction: column; align-items: center; }
#collection .augs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; width: 100%; }
.augc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; background: #0a1018; border: 1px solid var(--gold5); font-size: 12px; text-align: center; color: var(--gold1); }
.augc img { width: 44px; height: 44px; }
.augc.t1 { border-color: #a8802a; } .augc.t2 { border-color: #c86ad8; box-shadow: 0 0 10px rgba(200,106,216,.3); }
.augc.locked { opacity: .3; } .augc.locked img { filter: grayscale(1) brightness(.5); }
.stats-line { margin-top: 14px; color: var(--grey1); letter-spacing: 1px; }

/* augment cards */
.card.aug .cimg { border-radius: 50%; overflow: hidden; }
.card.aug.t0 .cimg { border-color: #c8d2de; } .card.aug.t0 .csub { color: #c8d2de; }
.card.aug.t1 .cimg { border-color: #ffd27a; box-shadow: 0 0 22px rgba(255,200,90,.45); } .card.aug.t1 .csub { color: #ffd27a; }
.card.aug.t2 { background: linear-gradient(180deg, #24123a, #0a0616); }
.card.aug.t2 .cimg { border-color: #ff9af0; box-shadow: 0 0 26px rgba(255,140,240,.55); } .card.aug.t2 .csub { color: #ff9af0; }
.card.aug.t2:hover { border-color: #ff9af0; box-shadow: 0 0 0 1px #c86ad8, 0 0 36px rgba(255,140,240,.4); }
.card.banishing:hover { border-color: #ff5a4a; box-shadow: 0 0 0 1px #ff5a4a, 0 0 36px rgba(255,80,60,.45); }
.card.banishing::after { content: 'BANISH'; position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Marcellus', serif; letter-spacing: 4px; color: #ff8a7a; background: rgba(40,0,0,.45); opacity: 0; transition: .15s; }
.card.banishing:hover::after { opacity: 1; }
#lu-tools { display: flex; gap: 10px; min-height: 36px; }
/* co-op: choices float over the live game instead of freezing it */
#levelup.live { inset: auto 0 calc(170px * var(--ui) + 20px) 0; background: none; gap: 10px; pointer-events: none; }
#levelup.live .card, #levelup.live #lu-tools { pointer-events: auto; }
#levelup.live .lu-title { font-size: 26px; }
#levelup.live .card { width: min(210px, 28vw); padding: 14px 12px 12px; }
#levelup.live .card p { min-height: 0; font-size: 12px; }
#levelup.live .cimg { width: 58px; height: 58px; }

/* ───── HUD additions ───── */
#score .ico.tower::before { content: ''; display: inline-block; width: 10px; height: 13px; background: #5ac8ff; clip-path: polygon(0 0, 30% 0, 30% 20%, 70% 20%, 70% 0, 100% 0, 85% 40%, 85% 100%, 15% 100%, 15% 40%); }
#score.danger { box-shadow: inset 0 -2px 0 #ff5a4a, 0 0 18px rgba(255,80,60,.35); }
#core { position: relative; }
#augs { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); display: flex; gap: 5px; }
#augs .aug { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #c8d2de; overflow: hidden; box-shadow: 0 0 8px #000; pointer-events: auto; background: #000; }
#augs .aug img { width: 100%; height: 100%; display: block; }
#augs .aug.t1 { border-color: #ffd27a; } #augs .aug.t2 { border-color: #ff9af0; box-shadow: 0 0 10px rgba(255,140,240,.6); }
#augs .aug span { position: absolute; right: 0; bottom: 0; font-size: 10px; background: rgba(0,0,0,.8); padding: 0 3px; border-radius: 3px; }
#party { position: absolute; left: 10px; top: 50%; transform: translateY(-50%) scale(var(--ui)); transform-origin: 0 50%; display: flex; flex-direction: column; gap: 8px; }
.pm { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; width: 190px; background: linear-gradient(90deg, rgba(4,10,18,.92), rgba(4,10,18,.6)); border: 1px solid var(--gold5); }
.pm .pp { width: 46px; height: 46px; border: 2px solid #3a8ae8; overflow: hidden; flex: none; }
.pm .pp canvas { width: 100%; height: 100%; display: block; }
.pm .pi { flex: 1; }
.pm .pn { font-size: 13px; color: #9ac8ff; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm .pb { height: 8px; background: #111; border: 1px solid #000; } .pm .pb i { display: block; height: 100%; background: linear-gradient(180deg, #6ab0ff, #2a6ad8); }
.pm .pl { position: absolute; left: 34px; bottom: 2px; font-size: 11px; background: #0a1018; border: 1px solid var(--gold4); padding: 0 3px; }
.pm .pr { position: absolute; left: 4px; top: 4px; width: 46px; height: 46px; display: grid; place-items: center; font-size: 20px; color: #fff; text-shadow: 0 0 4px #000; }
.pm.dead .pp { filter: grayscale(1) brightness(.45); border-color: #555; }
#respawn { position: absolute; top: 30%; left: 0; right: 0; text-align: center; opacity: 0; transition: .3s; pointer-events: none; }
#respawn.show { opacity: 1; }
#respawn span { display: block; color: var(--grey1); letter-spacing: 3px; text-transform: uppercase; font-size: 14px; }
#respawn b { font-family: 'Marcellus', serif; font-size: 64px; color: var(--gold1); text-shadow: 0 0 20px rgba(0,0,0,.9); font-weight: normal; }
#end-reward { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0 4px; }
.be-gain { font-size: 22px; color: #9ae4ff; text-shadow: 0 0 12px rgba(58,200,255,.6); }
.ach-new { color: var(--gold1); font-size: 14px; } .ach-new b { color: #ffd27a; font-weight: normal; font-family: 'Marcellus', serif; }

/* ───── polish: compact menu on shorter screens, sticky lock-in, lobby slots ───── */
#lockin { position: sticky; bottom: 14px; z-index: 3; }
.rp.empty { border-left-style: dashed; color: var(--grey2); font-style: italic; }
.rp.empty .rn { grid-column: 1 / -1; }
.upg .ut b small { font-family: 'Barlow'; font-size: 12px; color: var(--grey1); margin-left: 6px; }
.upg .ut span em { font-style: normal; color: #9ae4ff; }
body.choosing #announce { opacity: 0 !important; }
@media (max-height: 860px) {
  .logo { font-size: clamp(32px, 4.6vw, 52px); }
  .brand { margin-bottom: 6px; }
  .pick-label { margin: 10px 0 8px; }
  .splash { height: 130px; }
  .info { margin-top: -24px; padding: 0 14px 12px; }
  .cname { font-size: 24px; }
  .meta { margin: 6px 0 4px; }
  .info p { min-height: 0; font-size: 12px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .kit img { width: 30px; height: 30px; }
  .hex-btn { margin-top: 14px; padding: 10px 28px; }
  .controls { margin-top: 12px; }
}

/* augment tiers: steel, gold, prismatic */
.card.aug { border-top-width: 3px; }
.card.aug.t0 { background: linear-gradient(180deg, #1c2632, #070d16 70%); border-color: #6f7c8c; }
.card.aug.t1 { background: linear-gradient(180deg, #2c2210, #0b0905 70%); border-color: #a8802a; }
.card.aug.t1:hover { border-color: #ffd27a; box-shadow: 0 0 0 1px #c89b3c, 0 0 36px rgba(255,200,90,.4); }
.card.aug.t2 { border-color: #a65ab8; }
.card.aug .cimg { width: 92px; height: 92px; }
.card.aug.t0 .cimg { box-shadow: 0 0 18px rgba(200,215,235,.25); }
.card.aug .badge { border-radius: 8px; }
.card.aug.t2 .ctit { background: linear-gradient(90deg, #ffd6f8, #b8e6ff, #ffe9b0); -webkit-background-clip: text; background-clip: text; color: transparent; }
/* party frames: champion line + level badge */
.pm .pc { font-size: 11px; color: var(--grey1); margin-top: 3px; }
.pm .pl { left: 36px; bottom: 3px; min-width: 16px; text-align: center; color: var(--gold1); }

/* co-op: compact horizontal cards above the ability bar, so your champion stays in view */
#levelup.live { inset: auto 0 calc(190px * var(--ui) + 16px) 0; flex-direction: column; gap: 6px; }
#levelup.live .lu-head { display: flex; align-items: baseline; gap: 12px; }
#levelup.live .lu-title { font-size: 18px; letter-spacing: 3px; }
#levelup.live .lu-sub { font-size: 11px; }
#levelup.live #cards { gap: 8px; }
#levelup.live .card { display: grid; grid-template-columns: 48px 1fr; grid-template-rows: auto auto auto; column-gap: 10px; align-items: center; text-align: left;
  width: min(250px, 30vw); padding: 8px 10px; animation-duration: .25s; }
#levelup.live .card:hover { transform: translateY(-3px); }
#levelup.live .cimg { grid-row: 1 / 4; width: 48px; height: 48px; margin: 0; }
#levelup.live .card.aug .cimg { width: 48px; height: 48px; }
#levelup.live .badge { display: none; }
#levelup.live .csub { margin: 0; font-size: 10px; }
#levelup.live .ctit { font-size: 15px; margin: 0; }
#levelup.live .card p { font-size: 11px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#levelup.live .hk { top: 4px; right: 6px; }
#levelup.live #lu-tools { min-height: 0; }
#levelup.live .small-btn { padding: 4px 10px; font-size: 11px; }
#levelup.live .lu-head { background: rgba(4,10,18,.85); border: 1px solid var(--gold5); padding: 2px 14px; }

/* end of run: rewards panel */
#end-reward { min-width: min(530px, 90vw); margin: 14px auto 0; padding: 14px 24px 12px; background: linear-gradient(180deg, rgba(10,22,32,.92), rgba(4,10,18,.92)); border: 1px solid var(--gold4); box-shadow: inset 0 0 0 1px rgba(200,170,110,.08); }
#end-reward .record { font-family: 'Marcellus', serif; letter-spacing: 3px; text-transform: uppercase; font-size: 13px; color: #1a1006; background: linear-gradient(180deg, #fff2c8, #e0b050); padding: 2px 14px; box-shadow: 0 0 18px rgba(240,200,98,.5); animation: pulse 1.6s infinite; }
#end-reward .best { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--grey1); }
#end-reward .be-gain { font-size: 26px; animation: begain .8s cubic-bezier(.2,1.4,.4,1) both .4s; }
@keyframes begain { from { opacity: 0; transform: scale(.6); } }
.ach-new { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 12px; margin-top: 4px; border-left: 3px solid #ffd27a; background: linear-gradient(90deg, rgba(90,66,16,.45), rgba(90,66,16,0)); text-align: left; animation: tabin .5s both .8s; }
.ach-new i { width: 26px; height: 26px; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: radial-gradient(circle at 35% 30%, #fff6d8, #f0c862 45%, #785a28); }
.ach-new b { display: block; font-size: 16px; }
.ach-new span { display: block; font-size: 12px; color: #9ae4ff; }
#end-stats { margin-top: 22px; }
#end-stats b { font-family: 'Marcellus', serif; font-weight: normal; font-size: 22px; }

/* ───── spectator panel (?spectate) ───── */
#spectate { display: none; position: absolute; left: 10px; top: 10px; min-width: 320px; padding: 8px 10px; background: rgba(4,10,18,.88); border: 1px solid var(--gold4); font-size: 13px; pointer-events: auto; }
#spectate.show { display: block; }
#spectate .sh { font-family: 'Marcellus', serif; letter-spacing: 1.5px; color: var(--gold2); margin-bottom: 6px; }
#spectate .sb { display: grid; grid-template-columns: 18px 1fr 42px 42px 90px 40px; gap: 6px; padding: 3px 4px; color: var(--grey1); border-left: 2px solid transparent; }
#spectate .sb.on { color: var(--gold1); border-left-color: #50dc78; background: rgba(80,220,120,.08); }
#spectate .sb b { color: var(--gold2); font-weight: normal; }
#spectate .sj { color: #9ae4ff; }
#spectate .sk { margin-top: 6px; color: var(--grey2); font-size: 11px; }
#spectate .sk kbd { font-size: 10px; padding: 0 4px; }
#spectate ~ #party { top: 62%; }
