:root {
  --bg: #07090d;
  --panel: rgba(12, 16, 23, 0.86);
  --line: rgba(255, 255, 255, 0.1);
  --text: #e8edf5;
  --dim: #9aa6b8;
  --protector: #4e9cf0;
  --rioter: #ef5a42;
  --good: #5fd38a;
  --warn: #f5c451;
  --ui: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { position: fixed; inset: 0; }
#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
kbd {
  display: inline-block; min-width: 1.5em; padding: 1px 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
  background: rgba(255,255,255,.06); font: 600 11px/1.5 var(--mono); text-align: center;
}

/* ============================================================ HUD shell */
#hud { position: absolute; inset: 0; pointer-events: none; user-select: none; }

/* --- crosshair */
.ch {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px;
  transform: translate(-50%, -50%);
  --spread: 6px; --len: 7px;
  transition: opacity .12s;
}
.ch-dot {
  position: absolute; left: 50%; top: 50%; width: 2px; height: 2px;
  margin: -1px 0 0 -1px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 2px #000;
}
.ch-arm {
  position: absolute; left: 50%; top: 50%; background: #f2f6ff;
  box-shadow: 0 0 2px rgba(0,0,0,.9);
  transition: transform .07s ease-out;
}
.ch-arm.t, .ch-arm.b { width: 2px; height: var(--len); margin-left: -1px; }
.ch-arm.l, .ch-arm.r { height: 2px; width: var(--len); margin-top: -1px; }
.ch-arm.t { transform: translateY(calc(-1 * (var(--spread) + var(--len)))); }
.ch-arm.b { transform: translateY(var(--spread)); }
.ch-arm.l { transform: translateX(calc(-1 * (var(--spread) + var(--len)))); }
.ch-arm.r { transform: translateX(var(--spread)); }
.ch.ads { --spread: 3px; --len: 4px; opacity: .85; }
.ch.enemy .ch-arm { background: var(--rioter); }

#hitmarker {
  position: absolute; inset: 0; width: 100%; height: 100%;
  stroke: #fff; stroke-width: 2.5; stroke-linecap: round; fill: none;
  opacity: 0; transform: scale(.7);
}
#hitmarker.show { animation: hm .22s ease-out; }
#hitmarker.kill { stroke: #ff5d4a; }
@keyframes hm {
  0% { opacity: 1; transform: scale(.65); }
  100% { opacity: 0; transform: scale(1.15); }
}

/* --- top bar */
#topbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: stretch; gap: 10px;
}
.team-tally {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 15px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.team-tally b { font: 700 20px/1 var(--mono); color: var(--protector); }
.team-tally span { font-size: 10.5px; letter-spacing: .13em; color: var(--dim); text-transform: uppercase; }
.team-tally.rioter b { color: var(--rioter); }

#roundclock {
  min-width: 118px; text-align: center; padding: 6px 16px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px);
}
#clock { font: 700 25px/1.1 var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
#clock.urgent { color: var(--rioter); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
#phaselabel { font-size: 9.5px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; margin-top: 2px; }

/* --- objective meter */
#objective {
  position: absolute; top: 94px; left: 50%; transform: translateX(-50%);
  width: 320px; padding: 9px 12px 8px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.obj-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; letter-spacing: .15em; color: var(--dim); margin-bottom: 6px;
}
.obj-head #vandalPct { font: 700 14px/1 var(--mono); color: var(--text); letter-spacing: 0; }
.obj-track {
  position: relative; height: 7px; border-radius: 4px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
.obj-track::after {
  content: ''; position: absolute; top: -2px; bottom: -2px; left: var(--goal, 90%);
  width: 2px; background: rgba(255,255,255,.55); border-radius: 1px;
}
#objective.close #vandalFill { animation: meterPulse .9s ease-in-out infinite; }
@keyframes meterPulse { 50% { box-shadow: 0 0 18px rgba(239,90,66,.95); } }
#vandalFill {
  height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, var(--warn), var(--rioter));
  transition: width .35s ease-out;
  box-shadow: 0 0 10px rgba(239,90,66,.55);
}
.obj-note { font-size: 10px; color: var(--dim); margin-top: 5px; }

/* --- killfeed */
#killfeed {
  position: absolute; top: 14px; right: 16px; width: 330px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.kf {
  display: flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 5px 9px; border-radius: 6px; font-size: 12.5px;
  background: rgba(10,13,19,.8); border: 1px solid var(--line);
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } }
.kf .n { font-weight: 600; }
.kf .n.p { color: var(--protector); }
.kf .n.r { color: var(--rioter); }
.kf .w { color: var(--dim); font-size: 11px; font-family: var(--mono); }
.kf .hs { color: var(--warn); font-weight: 700; }
.kf.obj { color: var(--warn); }

/* --- toasts (score pops) */
#toasts {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.toast {
  font: 700 13px/1 var(--mono); color: var(--warn);
  text-shadow: 0 2px 6px rgba(0,0,0,.9);
  animation: pop 1.3s ease-out forwards;
}
@keyframes pop {
  0% { opacity: 0; transform: translateY(8px) scale(.9); }
  14% { opacity: 1; transform: translateY(0) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-16px); }
}

/* --- bottom left: health */
#bottomleft { position: absolute; left: 22px; bottom: 20px; }
#healthwrap { display: flex; align-items: center; gap: 10px; }
#healthwrap .icon { width: 22px; height: 22px; fill: var(--good); filter: drop-shadow(0 1px 3px #000); }
#hpNum {
  font: 700 30px/1 var(--mono); min-width: 68px; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0,0,0,.85);
}
#hpTrack { width: 150px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
#hpFill { height: 100%; width: 100%; background: var(--good); transition: width .2s, background .2s; }
#hpFill.hurt { background: var(--warn); }
#hpFill.crit { background: var(--rioter); }
#rolehint { margin-top: 8px; font-size: 11.5px; color: var(--dim); max-width: 300px; }

/* --- bottom right: weapon */
#bottomright { position: absolute; right: 22px; bottom: 20px; text-align: right; }
#weaponName { font-size: 11.5px; letter-spacing: .13em; color: var(--dim); text-transform: uppercase; }
#ammo { display: flex; align-items: baseline; justify-content: flex-end; gap: 7px; text-shadow: 0 2px 8px rgba(0,0,0,.85); }
#ammoMag { font: 700 36px/1 var(--mono); font-variant-numeric: tabular-nums; }
#ammoMag.empty { color: var(--rioter); }
#ammoRes { font: 500 16px/1 var(--mono); color: var(--dim); }
#slots { display: flex; justify-content: flex-end; gap: 5px; margin-top: 8px; }
.slot {
  padding: 3px 9px; border-radius: 5px; font-size: 11px; font-family: var(--mono);
  background: rgba(10,13,19,.75); border: 1px solid var(--line); color: var(--dim);
}
.slot.on { background: rgba(78,156,240,.2); border-color: var(--protector); color: #fff; }
body.rioter .slot.on { background: rgba(239,90,66,.2); border-color: var(--rioter); }

/* --- interact prompt */
#interact {
  position: absolute; left: 50%; top: 58%; transform: translateX(-50%);
  padding: 8px 14px; border-radius: 8px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px;
}
.repair-track { margin-top: 6px; width: 140px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
#repairFill { height: 100%; width: 0%; background: var(--good); transition: width .1s linear; }

/* --- damage feedback */
#damageIndicators { position: absolute; inset: 0; }
.dmgdir {
  position: absolute; left: 50%; top: 50%; width: 220px; height: 220px;
  margin: -110px 0 0 -110px; pointer-events: none;
  background: conic-gradient(from -18deg, rgba(239,90,66,.85), rgba(239,90,66,0) 36deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%, #000 76%, transparent 78%);
  mask: radial-gradient(circle, transparent 58%, #000 60%, #000 76%, transparent 78%);
  animation: fadeOut 1.1s ease-out forwards;
}
@keyframes fadeOut { to { opacity: 0; } }

#hurtvig {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(190,24,20,.62) 100%);
  transition: opacity .35s;
}
#lowhp {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 36%, rgba(150,10,10,.5) 100%);
  transition: opacity .6s;
}
#lowhp.on { opacity: 1; animation: breathe 2.2s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }

/* --- death */
#deathscreen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(6,8,12,.55); backdrop-filter: blur(3px) saturate(.5);
}
.dead-title { font: 700 30px/1 var(--ui); letter-spacing: .1em; color: #fff; }
.dead-by { font-size: 14px; color: var(--dim); }
.dead-timer { font-size: 15px; color: var(--dim); }
.dead-timer b { font-family: var(--mono); color: #fff; font-size: 20px; }

/* --- round banner */
#banner {
  position: absolute; left: 50%; top: 32%; transform: translateX(-50%);
  text-align: center; animation: bannerIn .4s cubic-bezier(.2,.9,.3,1);
}
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
#bannerMain { font: 800 44px/1 var(--ui); letter-spacing: .06em; text-shadow: 0 4px 24px rgba(0,0,0,.9); }
#bannerSub { margin-top: 8px; font-size: 14px; color: var(--dim); letter-spacing: .08em; }

/* --- chat */
#chatlog {
  position: absolute; left: 22px; bottom: 118px; width: 420px;
  display: flex; flex-direction: column; gap: 3px; font-size: 13px;
}
.chatline { opacity: .95; text-shadow: 0 1px 4px #000; animation: slideIn .15s; }
.chatline .who { font-weight: 600; }
.chatline .who.p { color: var(--protector); }
.chatline .who.r { color: var(--rioter); }
.chatline.sys { color: var(--dim); font-style: italic; }
#chatinput {
  position: absolute; left: 22px; bottom: 88px; display: flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line);
  pointer-events: auto;
}
#chatinput span { font: 600 10px/1 var(--mono); letter-spacing: .14em; color: var(--dim); }
#chatfield {
  width: 360px; background: none; border: none; outline: none;
  color: var(--text); font-family: var(--ui); font-size: 13.5px;
}

/* --- scoreboard */
#scoreboard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(900px, 92vw); padding: 18px 20px 14px; border-radius: 13px;
  background: rgba(9, 12, 18, .93); border: 1px solid var(--line);
  backdrop-filter: blur(10px); box-shadow: 0 30px 90px rgba(0,0,0,.6);
}
.sb-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sb-title { font: 700 17px/1 var(--ui); letter-spacing: .22em; }
.sb-rounds { font: 700 19px/1 var(--mono); }
#sbWinP { color: var(--protector); }
#sbWinR { color: var(--rioter); }
.sb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sb-teamname { font-size: 11px; letter-spacing: .18em; margin-bottom: 7px; }
.sb-team.protector .sb-teamname { color: var(--protector); }
.sb-team.rioter .sb-teamname { color: var(--rioter); }
#scoreboard table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#scoreboard th {
  text-align: right; font-weight: 500; font-size: 10px; letter-spacing: .1em;
  color: var(--dim); padding: 4px 5px; border-bottom: 1px solid var(--line);
}
#scoreboard th:first-child, #scoreboard td:first-child { text-align: left; }
#scoreboard td { text-align: right; padding: 4px 5px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
#scoreboard td:first-child { font-family: var(--ui); }
#scoreboard tr.me td { background: rgba(255,255,255,.07); }
#scoreboard tr.down td { opacity: .42; }
.sb-bot { font-size: 9px; letter-spacing: .1em; color: var(--dim); border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; margin-left: 5px; }
.sb-foot { margin-top: 12px; font-size: 11px; color: var(--dim); text-align: center; }

/* ============================================================ menu */
#menu {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 24px;
  background:
    radial-gradient(1100px 600px at 50% -10%, rgba(78,156,240,.1), transparent 70%),
    radial-gradient(900px 500px at 50% 110%, rgba(239,90,66,.1), transparent 70%),
    #05070a;
  overflow: auto;
}
.menu-card {
  width: min(560px, 100%); padding: 26px; border-radius: 15px;
  background: rgba(13, 17, 24, .9); border: 1px solid var(--line);
  box-shadow: 0 32px 90px rgba(0,0,0,.65);
}
.brand { display: flex; gap: 15px; align-items: center; margin-bottom: 22px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, var(--protector), var(--rioter));
  box-shadow: 0 8px 26px rgba(239,90,66,.3);
}
.brand h1 { font: 800 25px/1 var(--ui); letter-spacing: .13em; }
.tag { font-size: 12px; color: var(--dim); margin-top: 5px; }

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 7px;
}
#nameField, #walletField {
  width: 100%; padding: 11px 13px; border-radius: 9px; font-size: 14.5px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line);
  color: var(--text); outline: none; font-family: var(--ui);
}
#nameField:focus, #walletField:focus { border-color: var(--protector); background: rgba(78,156,240,.09); }

.teampick { display: grid; gap: 8px; }
.team-btn {
  display: block; width: 100%; text-align: left; padding: 11px 14px;
  border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.035);
  color: var(--text); cursor: pointer; font-family: var(--ui); transition: .14s;
}
.team-btn:hover { background: rgba(255,255,255,.07); }
.team-btn strong { display: block; font-size: 12.5px; letter-spacing: .13em; }
.team-btn em { display: block; font-style: normal; font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.team-btn.protector.selected { border-color: var(--protector); background: rgba(78,156,240,.14); }
.team-btn.rioter.selected { border-color: var(--rioter); background: rgba(239,90,66,.14); }
.team-btn.auto.selected { border-color: #8b93a3; background: rgba(255,255,255,.1); }
.team-btn.protector strong { color: var(--protector); }
.team-btn.rioter strong { color: var(--rioter); }

#playBtn {
  width: 100%; margin-top: 6px; padding: 14px; border: none; border-radius: 10px;
  font: 700 14px/1 var(--ui); letter-spacing: .16em; cursor: pointer; color: #07090d;
  background: linear-gradient(135deg, #7fc0ff, #4e9cf0);
  box-shadow: 0 10px 30px rgba(78,156,240,.3); transition: .14s;
}
#playBtn:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(78,156,240,.42); }
#playBtn:disabled { opacity: .5; cursor: wait; transform: none; }
#connStatus { margin-top: 10px; font-size: 12px; color: var(--dim); text-align: center; min-height: 16px; }
#connStatus.err { color: var(--rioter); }

.help { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.help summary { cursor: pointer; font-size: 12px; letter-spacing: .1em; color: var(--dim); }
.help-grid {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 14px;
  margin-top: 12px; font-size: 12.5px; align-items: center;
}
.help-grid > div:nth-child(odd) { white-space: nowrap; }
.help-grid > div:nth-child(even) { color: var(--dim); }
.help-note { margin-top: 14px; font-size: 12px; line-height: 1.6; color: var(--dim); }
.help-note b { color: var(--text); }
.menu-foot { font-size: 11.5px; color: var(--dim); }

/* ============================================================ loading */
#loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; background: #05070a; z-index: 10;
}
#loading.done { opacity: 0; pointer-events: none; transition: opacity .5s; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.12); border-top-color: var(--protector);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loadText { font-size: 12.5px; color: var(--dim); letter-spacing: .1em; }

@media (max-width: 700px) {
  #objective { width: 240px; }
  #killfeed { width: 210px; }
  .sb-cols { grid-template-columns: 1fr; }
  #chatlog { width: 60vw; }
}

/* --- team picker cards -------------------------------------------------- */

.teampick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.team-card {
  position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px;
  background: #05070b; padding: 0; aspect-ratio: 1 / 1;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.team-card img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  filter: saturate(.55) brightness(.6); transition: filter .25s ease, transform .35s ease;
}
.team-card .tc-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(4,6,10,.96) 12%, rgba(4,6,10,.25) 55%, transparent 80%);
}
.team-card .tc-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 11px;
  display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.team-card strong { font: 800 14px/1 var(--mono); letter-spacing: .08em; }
.team-card em { font: 400 11px/1.35 var(--ui); color: var(--dim); font-style: normal; }
.team-card.protector strong { color: var(--protector); }
.team-card.rioter strong { color: var(--rioter); }

.team-card:hover { transform: translateY(-2px); }
.team-card:hover img { filter: saturate(.9) brightness(.85); transform: scale(1.04); }
.team-card.protector:hover { border-color: var(--protector); }
.team-card.rioter:hover { border-color: var(--rioter); }

.team-card.selected img { filter: saturate(1.05) brightness(.95); }
.team-card.protector.selected {
  border-color: var(--protector); box-shadow: 0 0 0 1px var(--protector), 0 10px 30px rgba(78,156,240,.25);
}
.team-card.rioter.selected {
  border-color: var(--rioter); box-shadow: 0 0 0 1px var(--rioter), 0 10px 30px rgba(239,90,66,.25);
}

.field > span i { color: var(--dim); font-style: normal; font-weight: 400; }

/* --- team intro --------------------------------------------------------- */

#teamIntro {
  position: fixed; inset: 0; z-index: 60; overflow: hidden;
  background: #04060a; opacity: 1;
  transition: opacity .5s ease;
}
#teamIntro.hidden { display: none; }
#teamIntro.leaving { opacity: 0; pointer-events: none; }

#tiImage {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%;
  transform: scale(1.14); opacity: 0;
  animation: ti-push 2.9s cubic-bezier(.16,.8,.3,1) forwards;
}
@keyframes ti-push {
  0%   { transform: scale(1.14); opacity: 0; filter: brightness(.3) saturate(.4); }
  22%  { opacity: 1; }
  100% { transform: scale(1.0); opacity: 1; filter: brightness(.78) saturate(1); }
}

#tiVignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 85% at 50% 35%, transparent 25%, rgba(4,6,10,.75) 78%),
    linear-gradient(to top, rgba(4,6,10,.97) 8%, rgba(4,6,10,.2) 45%, transparent 70%);
}

#tiContent {
  position: absolute; left: 0; right: 0; bottom: 8vh;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 24px; text-align: center;
}

#tiKicker {
  font: 600 12px/1 var(--mono); letter-spacing: .4em; color: var(--dim);
  opacity: 0; animation: ti-rise .5s ease .25s forwards;
}
#tiTitle {
  font: 900 clamp(26px, 6.2vw, 62px)/1.02 var(--mono);
  letter-spacing: .02em; text-transform: uppercase;
  opacity: 0; animation: ti-rise .6s cubic-bezier(.16,.8,.3,1) .42s forwards;
}
#tiTitle .accent { display: block; }
#teamIntro.protector #tiTitle .accent { color: var(--protector); text-shadow: 0 0 34px rgba(78,156,240,.6); }
#teamIntro.rioter    #tiTitle .accent { color: var(--rioter);    text-shadow: 0 0 34px rgba(239,90,66,.6); }

#tiObjective {
  max-width: 44ch;
  font: 600 clamp(12px, 1.6vw, 15px)/1.5 var(--ui); color: var(--text);
  opacity: 0; animation: ti-rise .6s ease .95s forwards;
}
#tiObjective b { color: var(--warn); }

@keyframes ti-rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(5px); }
  to   { opacity: 1; transform: none; filter: none; }
}

#tiBarWrap {
  width: min(320px, 70vw); height: 3px; margin-top: 6px;
  background: rgba(255,255,255,.12); border-radius: 2px; overflow: hidden;
  opacity: 0; animation: ti-rise .4s ease 1.25s forwards;
}
#tiBar { width: 0; height: 100%; border-radius: 2px; animation: ti-load 1.45s cubic-bezier(.4,0,.2,1) 1.3s forwards; }
#teamIntro.protector #tiBar { background: linear-gradient(90deg, #2d6fc0, var(--protector)); box-shadow: 0 0 12px var(--protector); }
#teamIntro.rioter    #tiBar { background: linear-gradient(90deg, #a8321f, var(--rioter));    box-shadow: 0 0 12px var(--rioter); }
@keyframes ti-load { from { width: 0; } to { width: 100%; } }

#tiStatus {
  font: 600 10px/1 var(--mono); letter-spacing: .34em; color: var(--dim);
  opacity: 0; animation: ti-rise .4s ease 1.35s forwards, ti-pulse 1.1s ease-in-out 1.7s infinite;
}
@keyframes ti-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* A few embers / sparks drifting up, tinted per side. */
#teamIntro .ember {
  position: absolute; bottom: -12px; width: 3px; height: 3px; border-radius: 50%;
  animation: ti-ember linear forwards;
}
#teamIntro.protector .ember { background: #8fc4ff; box-shadow: 0 0 8px 2px rgba(78,156,240,.75); }
#teamIntro.rioter    .ember { background: #ff9a6b; box-shadow: 0 0 8px 2px rgba(239,90,66,.8); }
@keyframes ti-ember {
  from { transform: translateY(0) scale(1); opacity: 0; }
  12%  { opacity: 1; }
  to   { transform: translateY(-96vh) scale(.3); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #tiImage, #tiKicker, #tiTitle, #tiObjective, #tiBarWrap, #tiStatus, #teamIntro .ember {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
  }
}

/* --- running pot (display only) ----------------------------------------- */

#potbox {
  position: absolute; top: 12px; left: 12px; z-index: 6;
  padding: 8px 12px 9px; min-width: 132px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 2px solid var(--warn); border-radius: 8px;
  backdrop-filter: blur(6px); pointer-events: none;
}
.pot-label { font: 700 9px/1 var(--mono); letter-spacing: .3em; color: var(--dim); }
.pot-value { display: flex; align-items: baseline; gap: 4px; margin-top: 3px; }
.pot-value #potAmount {
  font: 800 23px/1 var(--mono); color: var(--warn);
  text-shadow: 0 0 18px rgba(245,196,81,.45); transition: transform .2s ease;
}
#potbox.bump .pot-value #potAmount { transform: scale(1.22); }
.pot-sub { font: 600 8px/1 var(--mono); letter-spacing: .18em; color: var(--dim); margin-top: 5px; }
.pot-score { font: 800 13px/1 var(--mono); margin-top: 5px; display: flex; gap: 4px; align-items: baseline; }
.pot-score b { color: var(--protector); }
.pot-score b.r { color: var(--rioter); }
.pot-score i { color: var(--dim); font-style: normal; font-size: 10px; }

/* match-over banner gets a gold treatment */
#banner.match #bannerMain { color: var(--warn); text-shadow: 0 0 40px rgba(245,196,81,.55); }
#banner.match.won #bannerMain { font-size: 64px; animation: matchWon 1.6s ease-in-out infinite alternate; }
@keyframes matchWon { to { text-shadow: 0 0 60px rgba(245,196,81,.9), 0 4px 24px rgba(0,0,0,.9); } }
#bannerNote:empty { display: none; }
#bannerNote {
  display: inline-block; margin-top: 16px; padding: 10px 22px; border-radius: 999px;
  font: 800 17px/1.2 var(--ui); letter-spacing: .05em; color: #1b1405;
  background: linear-gradient(180deg, #ffd978, #f5c451); box-shadow: 0 6px 30px rgba(245,196,81,.45);
}

#walletField { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }

/* Material hitmarker: amber corner brackets, deliberately quieter than the
   white X you get for hitting a person. */
#hitmarkerProp {
  position: absolute; inset: 0; width: 100%; height: 100%;
  stroke: #f5c451; stroke-width: 2.2; stroke-linecap: round;
  stroke-linejoin: round; fill: none;
  opacity: 0; transform: scale(.7);
}
#hitmarkerProp.show { animation: hmp .2s ease-out; }
#hitmarkerProp.broke { stroke: #ff9a3c; stroke-width: 3; }
@keyframes hmp {
  0% { opacity: .95; transform: scale(.72); }
  100% { opacity: 0; transform: scale(1.1); }
}
