:root {
  --ink: #f4f7ff;
  --bg: #0e1630;
  --panel: rgba(16, 24, 48, 0.88);
  --line: rgba(255, 255, 255, 0.18);
  --accent: #35e0e8;
  --gold: #ffc94a;
  --you: #5aa2ff;
  --them: #ff7a4d;
  --danger: #ff4d5e;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  user-select: none; -webkit-user-select: none;
}
[hidden] { display: none !important; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- overlays & menu ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 80, 150, 0.55), rgba(8, 12, 28, 0.88));
  backdrop-filter: blur(4px); padding: 16px; overflow: auto;
}
.panel {
  width: min(880px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 26px 30px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); margin: auto;
}
.panel.small { width: min(420px, 100%); text-align: center; }
h1 { margin: 0; font-size: 46px; font-weight: 900; font-style: italic; letter-spacing: 8px; }
h1 span { color: var(--accent); }
h2 { margin: 0 0 10px; font-size: 13px; letter-spacing: 3px; text-transform: uppercase; opacity: 0.75; }
.sub { margin: 4px 0 18px; opacity: 0.75; }
#touchNote { background: #5a2330; border: 1px solid var(--danger); padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; }

.heroCard {
  display: flex; gap: 18px; align-items: center; padding: 14px; border-radius: 12px;
  background: linear-gradient(110deg, rgba(53, 224, 232, 0.16), rgba(255, 201, 74, 0.08)); border: 1px solid var(--line);
}
.heroName { font-size: 24px; font-weight: 900; font-style: italic; letter-spacing: 3px; }
.heroName small { font-size: 12px; font-style: normal; letter-spacing: 1px; opacity: 0.7; margin-left: 8px; }
.kit { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13.5px; line-height: 1.75; }
.kit i { font-style: normal; display: inline-block; min-width: 48px; text-align: center; background: rgba(255, 255, 255, 0.12); border-radius: 4px; font-size: 11px; padding: 0 4px; margin-right: 8px; font-weight: 700; }
.kit b { color: var(--accent); margin-right: 6px; }

/* Original hero emblem: helmet with a glowing visor (CSS only). */
.heroArt, #portrait { position: relative; flex: none; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #44507e, #1a2245); border: 3px solid var(--accent); overflow: hidden; }
.helm { position: absolute; left: 22%; right: 22%; top: 18%; bottom: 14%; border-radius: 48% 48% 40% 40%; background: linear-gradient(#3d8bff, #2a5fc0); box-shadow: inset 0 -10px 0 #e9b48f; }
.visor { position: absolute; left: 24%; right: 24%; top: 42%; height: 14%; border-radius: 8px; background: #9ff6ff; box-shadow: 0 0 14px #6ff3ff; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.modes section { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: rgba(255, 255, 255, 0.03); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
label { font-size: 13px; opacity: 0.9; display: inline-flex; gap: 8px; align-items: center; }
select, input[type=text], #joinCode, #shareLink {
  background: #0b1229; color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; font: inherit; font-size: 14px;
}
#joinCode { width: 110px; text-transform: uppercase; letter-spacing: 4px; font-weight: 800; text-align: center; }
#shareLink { flex: 1; min-width: 0; font-size: 12px; user-select: all; -webkit-user-select: all; }
.btn {
  appearance: none; cursor: pointer; border: 0; border-radius: 8px; padding: 11px 26px; margin-top: 6px;
  background: var(--gold); color: #1b1f33; font: inherit; font-weight: 900; font-style: italic; letter-spacing: 2px; font-size: 16px;
  transition: transform 0.08s, filter 0.08s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.alt { background: var(--accent); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
#lobby { margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px dashed var(--accent); background: rgba(53, 224, 232, 0.08); }
#roomCode { font-size: 26px; letter-spacing: 6px; color: var(--accent); margin-left: 8px; }
#lobbyMsg, #menuMsg, #overMsg { font-size: 13px; margin-top: 8px; min-height: 18px; color: var(--gold); }
.settings { margin-top: 16px; justify-content: space-between; }
.keys { font-size: 12px; opacity: 0.7; margin-top: 10px; line-height: 1.9; }
.keys b { background: rgba(255, 255, 255, 0.14); border-radius: 3px; padding: 1px 6px; }
@media (max-width: 720px) {
  .modes { grid-template-columns: 1fr; }
  .heroCard { flex-direction: column; text-align: left; }
  h1 { font-size: 34px; }
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45); }
#fxTint { position: absolute; inset: 0; opacity: 0; transition: opacity 0.15s; background: radial-gradient(ellipse at center, rgba(111, 243, 255, 0) 40%, rgba(80, 160, 255, 0.45) 100%); }
#hurt { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 180px 50px rgba(255, 40, 60, 0.75); }
#blinkFlash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0) 30%, rgba(111, 243, 255, 0.55) 100%); }

#cross { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px; border: 2px solid rgba(255, 255, 255, 0.92); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
#cross i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
#hitmark { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitmark i { position: absolute; width: 10px; height: 3px; background: #fff; border-radius: 2px; box-shadow: 0 0 2px #000; }
#hitmark i:nth-child(1) { transform: translate(-19px, -15px) rotate(45deg); }
#hitmark i:nth-child(2) { transform: translate(9px, -15px) rotate(-45deg); }
#hitmark i:nth-child(3) { transform: translate(-19px, 12px) rotate(-45deg); }
#hitmark i:nth-child(4) { transform: translate(9px, 12px) rotate(45deg); }
#hitmark.kill i { background: var(--danger); }
#pips { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); display: flex; gap: 5px; }
#pips b { width: 16px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.25); transform: skewX(-20deg); }
#pips b.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

#topbar { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; font-weight: 900; font-style: italic; }
.team { display: flex; align-items: center; gap: 10px; padding: 4px 14px; border-radius: 6px; background: rgba(10, 16, 36, 0.55); transform: skewX(-14deg); }
.team b { font-size: 30px; }
.team span { font-size: 13px; letter-spacing: 2px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team.you { border-bottom: 3px solid var(--you); } .team.you b { color: var(--you); }
.team.them { border-bottom: 3px solid var(--them); } .team.them b { color: var(--them); }
#goal { font-size: 11px; letter-spacing: 2px; opacity: 0.8; }
#netTag { position: absolute; top: 14px; left: 16px; font-size: 12px; letter-spacing: 1px; opacity: 0.85; }
#feed { position: absolute; top: 14px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; font-weight: 700; }
#feed div { background: rgba(10, 16, 36, 0.6); padding: 4px 10px; border-radius: 4px; }
#callout { position: absolute; top: 28%; left: 0; right: 0; text-align: center; font-size: 28px; font-weight: 900; font-style: italic; letter-spacing: 5px; opacity: 0; transition: opacity 0.2s; }
#dead { position: absolute; top: 34%; left: 0; right: 0; text-align: center; }
#dead b { display: block; font-size: 44px; font-style: italic; letter-spacing: 8px; color: var(--danger); }
#dead em { display: block; font-style: normal; font-size: 18px; margin-top: 6px; opacity: 0.85; }

#bl { position: absolute; left: 24px; bottom: 22px; display: flex; gap: 14px; align-items: flex-end; }
#portrait { width: 74px; height: 74px; }
#hpText b { font-size: 34px; font-weight: 900; font-style: italic; }
#hpText span { font-size: 16px; opacity: 0.75; margin-left: 4px; }
#hpBar { display: flex; gap: 3px; margin-top: 4px; }
#hpBar i { width: 30px; height: 14px; background: rgba(255, 255, 255, 0.18); transform: skewX(-18deg); border-radius: 2px; position: relative; overflow: hidden; }
#hpBar i::after { content: ""; position: absolute; inset: 0; width: var(--f, 100%); background: #fff; }
#hpBar.low i::after { background: var(--danger); }

#ult { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: 82px; height: 82px; display: flex; align-items: center; justify-content: center; }
#ult svg { position: absolute; inset: 0; transform: rotate(-90deg); }
#ult circle { fill: rgba(10, 16, 36, 0.45); stroke-width: 7; stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 276.5; }
#ult circle.track { stroke: rgba(255, 255, 255, 0.18); stroke-dashoffset: 0; }
#ultPct { font-size: 20px; font-weight: 900; font-style: italic; }
#ult em { position: absolute; bottom: -6px; font-style: normal; font-size: 10px; font-weight: 800; background: #fff; color: #1b1f33; border-radius: 3px; padding: 0 5px; text-shadow: none; }
#ult.ready circle#ultArc { stroke: var(--gold); }
#ult.ready { animation: ultPulse 0.7s infinite alternate; }
#ult.ready #ultPct { color: var(--gold); }
@keyframes ultPulse { to { filter: drop-shadow(0 0 12px var(--gold)); } }

#br { position: absolute; right: 26px; bottom: 22px; text-align: right; }
#ammo b { font-size: 34px; font-weight: 900; font-style: italic; }
#ammo span { opacity: 0.75; margin-left: 4px; }
#ammo.low b { color: var(--danger); }
#abilities { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.ab { position: relative; width: 58px; height: 58px; border-radius: 8px; transform: skewX(-12deg); background: rgba(10, 16, 36, 0.55); border: 2px solid rgba(255, 255, 255, 0.85); display: flex; align-items: center; justify-content: center; }
.ab em { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%) skewX(12deg); font-style: normal; font-size: 9px; font-weight: 800; background: #fff; color: #1b1f33; border-radius: 3px; padding: 0 4px; text-shadow: none; }
.ab .cd { position: absolute; font-size: 20px; font-weight: 900; transform: skewX(12deg); }
.ab .charges { position: absolute; top: -9px; right: -6px; font-size: 12px; font-weight: 900; background: var(--accent); color: #0b1229; border-radius: 10px; padding: 0 6px; transform: skewX(12deg); text-shadow: none; }
.ab.cool { border-color: rgba(255, 255, 255, 0.25); }
.ab.cool .icon { opacity: 0.25; }
.icon { width: 30px; height: 30px; transform: skewX(12deg); }
.icon.blink { background: linear-gradient(90deg, transparent 0 10%, var(--accent) 10% 30%, transparent 30% 42%, var(--accent) 42% 62%, transparent 62% 74%, #fff 74% 100%); clip-path: polygon(0 20%, 60% 20%, 100% 50%, 60% 80%, 0 80%); }
.icon.rewind { border: 4px solid #fff; border-radius: 50%; border-left-color: transparent; position: relative; }
.icon.rewind::after { content: ""; position: absolute; left: -7px; top: 1px; border: 6px solid transparent; border-bottom-color: #fff; transform: rotate(-30deg); }
#nolock { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.65); padding: 6px 12px; border-radius: 6px; font-size: 13px; }
@media (max-width: 720px) {
  #hpBar i { width: 18px; }
  #portrait { display: none; }
  .ab { width: 46px; height: 46px; }
}
