/* ============================================================================
   RIFTLINE — styles.css (ARCHITECTURE §14 visual style guide)
   Panels rgba(10,14,22,.88) · 1px border rgba(120,150,200,.25) · radius 8
   System font · uppercase 700–800 titles · banner 120ms in / 900ms hold / 300ms fade
   ========================================================================== */

:root {
  --panel-bg: rgba(10, 14, 22, 0.88);
  --panel-border: rgba(120, 150, 200, 0.25);
  --blue: #3fa7ff;
  --blue-bright: #9fd8ff;
  --blue-glow: rgba(63, 167, 255, 0.35);
  --crimson: #ff4f5e;
  --crimson-bright: #ffb3b8;
  --crimson-glow: rgba(255, 79, 94, 0.35);
  --gold: #ffd75e;
  --hp-ally: #46d46a;
  --hp-enemy: #ff5560;
  --hp-neutral: #cfd6e4;
  --mana: #3f7bff;
  --heal: #6ef09a;
  --magic: #c77dff;
  --proc: #ffe14d;
  --dmg-you: #ff6b6b;
  --cache: #5ef0c8;
  --text: #dfe7f5;
  --text-muted: #8fa0bd;
  --bg-deep: #0d1320;
  --bg-mid: #161f31;
  --font: -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  font-family: var(--font);
  color: var(--text);
}

/* ---------------------------------------------------------------- canvas */
#game-canvas {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, calc(100vh * (16 / 9)));
  height: min(100vh, calc(100vw * (9 / 16)));
  background: linear-gradient(#0d1320, #161f31);
  cursor: crosshair;
}

/* ---------------------------------------------------------------- ui root */
#ui-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
}

#screen-root, #hud-root, #shop-root, #spectate-root, #coach-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#screen-root > *, #shop-root > *, #practice-root > *,
#spectate-root > *, #coach-root > * { pointer-events: auto; }

#ui-root button, #ui-root input, #ui-root select,
#ui-root textarea, #ui-root [data-clickable] { pointer-events: auto; }

.hidden { display: none !important; }

/* ---------------------------------------------------------------- type */
#ui-root h1, #ui-root h2, #ui-root h3, #ui-root h4, .title {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}
#ui-root h1 { font-size: 30px; }
#ui-root h2 { font-size: 20px; font-weight: 700; }
#ui-root h3 { font-size: 15px; font-weight: 700; color: var(--blue-bright); }
.muted { color: var(--text-muted); }
.mono, .copyable, .seed-value { font-family: var(--mono); }
.copyable, .seed-value { user-select: all; color: var(--gold); cursor: text; }
.team-blue { color: var(--blue); }
.team-crimson { color: var(--crimson); }
.gold-text { color: var(--gold); }

/* ---------------------------------------------------------------- panel */
.panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.45);
}
.panel.blue-scope { border-color: rgba(63, 167, 255, 0.4); }
.panel.crimson-scope { border-color: rgba(255, 79, 94, 0.4); }

/* ---------------------------------------------------------------- controls */
#ui-root button {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
  background: rgba(20, 28, 44, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, color 0.12s;
}
#ui-root button:hover {
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 12px var(--blue-glow);
}
#ui-root button:active { transform: translateY(1px); }
#ui-root button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
#ui-root button.active, #ui-root button[aria-pressed="true"] {
  border-color: var(--blue);
  color: var(--blue-bright);
  box-shadow: inset 0 0 10px rgba(63, 167, 255, 0.18);
}
.btn-primary {
  font-size: 17px !important;
  padding: 14px 44px !important;
  border-color: var(--blue) !important;
  color: #fff !important;
  background: linear-gradient(rgba(63, 167, 255, 0.22), rgba(20, 28, 44, 0.92)) !important;
}
.btn-danger { border-color: rgba(255, 79, 94, 0.5) !important; color: var(--crimson-bright) !important; }

#ui-root input, #ui-root select, #ui-root textarea {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: rgba(8, 12, 20, 0.92);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 10px;
}
#ui-root input:focus, #ui-root select:focus { outline: none; border-color: var(--blue); }
#ui-root input[type="range"] { padding: 0; height: 22px; accent-color: var(--blue); }
#ui-root input[type="checkbox"] { accent-color: var(--blue); width: 15px; height: 15px; }
#ui-root label { font-size: 12px; color: var(--text-muted); }
#ui-root kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--panel-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(20, 28, 44, 0.9);
}

/* ---------------------------------------------------------------- screens */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at 50% 35%, rgba(22, 31, 49, 0.92), rgba(8, 11, 18, 0.96));
  pointer-events: auto;
}
.title-screen h1, .title-logo {
  font-size: 68px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 28px var(--blue-glow), 0 0 64px var(--blue-glow);
  margin-bottom: 24px;
}
.menu-col { display: flex; flex-direction: column; gap: 12px; width: 280px; }
.menu-col button { font-size: 16px; padding: 13px; }
.volume-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.volume-row input[type="range"] { width: 160px; }

/* splash */
.splash { text-align: center; }
.splash .matchup { font-size: 28px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.splash .vs { color: var(--text-muted); margin: 0 14px; }
.personality-cards { display: flex; gap: 14px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.personality-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 12px 16px;
  width: 230px;
  text-align: left;
}
.personality-card .champ-name { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.personality-card .prior-text { font-size: 12px; color: var(--text-muted); font-style: italic; margin-top: 4px; }
.personality-card .difficulty { font-size: 11px; color: var(--gold); text-transform: uppercase; margin-top: 6px; }
.splash .tip { color: var(--text-muted); font-style: italic; max-width: 560px; margin: 8px auto; }
.splash .seed-row, .seed-row { font-size: 13px; color: var(--text-muted); }

/* pause menu */
.pause-menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 14, 0.6);
  pointer-events: auto;
}
.pause-menu .panel { width: 320px; display: flex; flex-direction: column; gap: 10px; }

/* ---------------------------------------------------------------- setup */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 250px;
  gap: 16px;
  width: min(1160px, 94vw);
  max-height: 80vh;
}
.setup-col { overflow-y: auto; }
.mode-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.mode-tabs button { min-width: 90px; }
.champ-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.champ-card {
  background: rgba(20, 28, 44, 0.9);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: auto;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.champ-card:hover { border-color: var(--blue); }
.champ-card.selected { border-color: var(--blue); box-shadow: 0 0 14px var(--blue-glow); color: #fff; }
.champ-card .role { display: block; font-size: 10px; font-weight: 400; color: var(--text-muted); text-transform: none; }
.bot-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}
.noise-sliders { display: grid; gap: 6px; margin-top: 8px; padding: 8px; border-top: 1px dashed var(--panel-border); }
.slider-row {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) 110px 44px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.slider-row .value { font-family: var(--mono); color: var(--text); text-align: right; }
.setup-rail { display: flex; flex-direction: column; gap: 12px; }
.start-row { margin-top: 14px; }

/* tooltip */
.tooltip {
  position: fixed;
  z-index: 60;
  max-width: 320px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  pointer-events: none;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}
.tooltip .ability-line { margin: 3px 0; }
.tooltip .ability-line b { color: var(--blue-bright); }

/* ---------------------------------------------------------------- forge */
.forge-grid {
  display: grid;
  grid-template-columns: 270px 1fr 330px;
  gap: 16px;
  width: min(1200px, 96vw);
  max-height: 84vh;
}
.forge-col { overflow-y: auto; }
.template-card {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 12px;
}
.template-card:hover { border-color: var(--blue); }
.template-card.selected { border-color: var(--blue); box-shadow: 0 0 14px var(--blue-glow); }
.slot-row { margin-bottom: 12px; }
.slot-row .slot-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-bright);
  margin-bottom: 4px;
}
.ability-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ability-card {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  cursor: pointer;
}
.ability-card:hover { border-color: var(--blue); }
.ability-card.selected { border-color: var(--blue); box-shadow: 0 0 12px var(--blue-glow); }
.preview-panel { font-size: 12px; }
.preview-panel table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11px; }
.preview-panel td, .preview-panel th { padding: 2px 6px; text-align: right; border-bottom: 1px solid rgba(120, 150, 200, 0.12); }
.audit-badge { display: inline-block; padding: 3px 10px; border-radius: 8px; font-weight: 800; font-size: 11px; text-transform: uppercase; }
.audit-badge.ok { color: var(--heal); border: 1px solid rgba(110, 240, 154, 0.5); }
.audit-badge.fail { color: var(--dmg-you); border: 1px solid rgba(255, 107, 107, 0.5); }
.warn-text { color: var(--proc); font-size: 11px; }
.forged-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; max-height: 180px; overflow-y: auto; }
.forged-list .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }

/* ---------------------------------------------------------------- HUD */
#hud-root { font-size: 13px; }

.hud-clock {
  position: fixed;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}

#lanebar-canvas {
  position: fixed;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  pointer-events: none;
}

.hud-kda {
  position: fixed;
  top: 10px;
  left: 12px;
  display: flex;
  gap: 14px;
  align-items: baseline;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 12px;
  pointer-events: none;
}
.hud-kda .cs.pulse { animation: cs-pulse 0.5s ease-out; }
@keyframes cs-pulse { 0% { transform: scale(1.5); color: var(--gold); } 100% { transform: scale(1); } }

.hud-topright {
  position: fixed;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 12px;
  pointer-events: none;
}

.event-feed {
  position: fixed;
  left: 12px;
  top: 26%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  pointer-events: none;
  max-width: 300px;
}
.event-feed .feed-line {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 3px 10px;
  animation: feed-in 0.15s ease-out;
}
@keyframes feed-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; } }

/* bottom-center plate */
.hud-plate {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 16px;
  pointer-events: none;
}
.hud-portrait { position: relative; width: 64px; height: 64px; }
.hud-portrait canvas, .hud-portrait .portrait { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--panel-border); }
.hud-portrait .level-ring {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #0a0e16;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hud-bars { display: flex; flex-direction: column; gap: 5px; min-width: 240px; }
.bar { position: relative; height: 16px; border-radius: 4px; background: rgba(0, 0, 0, 0.55); overflow: hidden; border: 1px solid rgba(120, 150, 200, 0.18); }
.bar .fill { position: absolute; inset: 0; transform-origin: left; transition: none; }
.bar.hp .fill { background: var(--hp-ally); }
.bar.hp .ghost { position: absolute; inset: 0; background: rgba(255, 255, 255, 0.65); transform-origin: left; }
.bar.mana .fill { background: var(--mana); }
.bar .num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}
.ability-row { display: flex; gap: 8px; align-items: flex-end; }
.ability-icon {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: rgba(20, 28, 44, 0.95);
  border: 1px solid var(--panel-border);
  pointer-events: auto;
}
.ability-icon.riftstep { width: 44px; height: 44px; }
.ability-icon .key {
  position: absolute;
  bottom: 2px;
  left: 4px;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
}
.ability-icon .cd-sweep { position: absolute; inset: 0; border-radius: 8px; }
.ability-icon .cd-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px #000;
}
.ability-icon.mana-gated { box-shadow: inset 0 0 0 50px rgba(63, 123, 255, 0.30); }
.ability-icon.ready-flash { animation: ready-flash 0.4s ease-out; }
@keyframes ready-flash { 0% { box-shadow: 0 0 22px var(--blue-glow); } 100% { box-shadow: none; } }
.ability-icon.ult-ready { animation: ult-pulse 1.4s ease-in-out infinite; }
@keyframes ult-pulse { 0%, 100% { box-shadow: 0 0 4px var(--blue-glow); } 50% { box-shadow: 0 0 18px var(--blue-glow); } }
.rank-pips { display: flex; gap: 2px; justify-content: center; margin-top: 2px; }
.rank-pips .pip { width: 8px; height: 3px; background: rgba(120, 150, 200, 0.3); border-radius: 1px; }
.rank-pips .pip.lit { background: var(--gold); }
.level-up-btn {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 14px;
  font-size: 11px !important;
  line-height: 1 !important;
  padding: 0 !important;
  color: var(--gold) !important;
  border-color: var(--gold) !important;
  animation: ult-pulse 1.2s infinite;
}

/* bottom-right: items + gold */
.hud-items {
  position: fixed;
  bottom: 8px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.item-slots { display: grid; grid-template-columns: repeat(3, 38px); gap: 4px; }
.item-slot {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: rgba(20, 28, 44, 0.95);
  border: 1px solid var(--panel-border);
  font-size: 9px;
  overflow: hidden;
}
.item-slot .count {
  position: absolute;
  bottom: 0;
  right: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gold);
}
.gold-counter {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 4px 12px;
}
.status-icons { display: flex; gap: 6px; }
.status-icons .icon {
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  background: var(--panel-bg);
}

/* ---------------------------------------------------------------- banners */
.banner-stack {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 30;
}
.banner {
  font-size: 36px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 0 18px var(--blue-glow), 0 2px 6px rgba(0, 0, 0, 0.8);
  animation: banner 1.32s ease-out forwards; /* 120ms in · 900ms hold · 300ms fade */
}
.banner.crimson { text-shadow: 0 0 18px var(--crimson-glow), 0 2px 6px rgba(0, 0, 0, 0.8); }
.banner.gold { color: var(--gold); text-shadow: 0 0 18px rgba(255, 215, 94, 0.45), 0 2px 6px rgba(0, 0, 0, 0.8); }
@keyframes banner {
  0%    { transform: scale(0.55); opacity: 0; }
  9.1%  { transform: scale(1);    opacity: 1; }   /* 120 ms scale-in */
  77.3% { transform: scale(1);    opacity: 1; }   /* +900 ms hold    */
  100%  { transform: scale(1.05); opacity: 0; }   /* +300 ms fade    */
}

/* ---------------------------------------------------------------- shop */
.shop-panel {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%);
  width: min(720px, 84vw);
  max-height: 62vh;
  overflow-y: auto;
}
.shop-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.shop-warning { color: var(--proc); font-size: 11px; }
.item-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(120, 150, 200, 0.12);
  font-size: 12px;
}
.item-row:hover { background: rgba(63, 167, 255, 0.07); }
.item-row.recommended { border-left: 2px solid var(--gold); }
.item-row .item-name { font-weight: 700; }
.item-row .item-stats { color: var(--text-muted); font-size: 11px; }
.item-row .hint { color: var(--blue-bright); font-size: 11px; font-style: italic; }
.item-row .cost { font-family: var(--mono); color: var(--gold); }
.page-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; font-size: 11px; }
.page-strip .page-item { border: 1px solid var(--panel-border); border-radius: 6px; padding: 2px 8px; }
.page-strip .owned { border-color: var(--heal); color: var(--heal); }

/* ---------------------------------------------------------------- practice panel */
#practice-root {
  position: fixed;
  top: 60px;
  right: 0;
  bottom: 110px;
  width: 260px;
  pointer-events: none;
}
.practice-panel {
  width: 260px;
  max-height: 100%;
  overflow-y: auto;
  border-radius: 8px 0 0 8px;
  border-right: none;
  transition: transform 0.16s ease-out;
  font-size: 12px;
}
.practice-panel.collapsed { transform: translateX(232px); }
.practice-panel .ctl-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.practice-panel .ctl-row .hotkey { color: var(--text-muted); font-size: 10px; }
.practice-panel .seg { display: flex; gap: 4px; }
.practice-panel .seg button { padding: 4px 8px; font-size: 11px; }
.practice-panel hr { border: none; border-top: 1px dashed var(--panel-border); margin: 8px 0; }
.paused-badge {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--proc);
  background: var(--panel-bg);
  border: 1px solid var(--proc);
  border-radius: 8px;
  padding: 4px 16px;
  pointer-events: none;
}

/* ---------------------------------------------------------------- spectate */
.spectate-bar {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 4px 12px;
  pointer-events: none;
}
.scoreboard {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, 90vw);
}
.scoreboard table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--mono); }
.scoreboard th {
  text-align: left;
  font-family: var(--font);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 8px;
  border-bottom: 1px solid var(--panel-border);
}
.scoreboard td { padding: 5px 8px; border-bottom: 1px solid rgba(120, 150, 200, 0.1); }
.trace-ticker {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 92vw);
  max-height: 132px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 12px;
}
.trace-ticker .trace-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- end screen */
.end-screen { width: min(960px, 92vw); max-height: 86vh; display: flex; flex-direction: column; }
.end-verdict { text-align: center; font-size: 44px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; margin-bottom: 8px; }
.end-verdict.victory { color: #fff; text-shadow: 0 0 30px var(--blue-glow); }
.end-verdict.defeat { color: var(--crimson-bright); text-shadow: 0 0 30px var(--crimson-glow); }
.end-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--panel-border); margin-bottom: 12px; }
.end-tabs .tab {
  padding: 8px 22px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  pointer-events: auto;
}
.end-tabs .tab:hover { color: var(--text); }
.end-tabs .tab.active { color: #fff; border-bottom-color: var(--blue); }
.end-body { overflow-y: auto; flex: 1; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--mono); }
.stats-table td, .stats-table th { padding: 4px 8px; border-bottom: 1px solid rgba(120, 150, 200, 0.1); text-align: right; }
.stats-table th { font-family: var(--font); text-transform: uppercase; font-size: 10px; color: var(--text-muted); }
.stats-table td:first-child, .stats-table th:first-child { text-align: left; }
.graph-canvas { width: 100%; height: 160px; background: rgba(0, 0, 0, 0.3); border-radius: 8px; display: block; }
.end-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

/* ---------------------------------------------------------------- coach */
.coach-panel { font-size: 13px; }
.coach-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.radar-canvas { width: 280px; height: 280px; display: block; }
.metric-rows { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.metric-rows .row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.metric-rows .ewma { color: var(--text-muted); font-family: var(--mono); }
.moment-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.moment {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid rgba(120, 150, 200, 0.15);
  border-radius: 8px;
  font-size: 12px;
}
.moment .ts { font-family: var(--mono); color: var(--gold); }
.moment.kill-window { border-left: 2px solid var(--crimson); }
.moment.divergence { border-left: 2px solid var(--proc); }
.rps-log { font-family: var(--mono); font-size: 11px; color: var(--text-muted); max-height: 140px; overflow-y: auto; }

/* ---------------------------------------------------------------- scoreboard-hold body flag */
body.scoreboard-open .trace-ticker { opacity: 0.25; }

/* ---------------------------------------------------------------- scrollbars */
#ui-root ::-webkit-scrollbar { width: 8px; height: 8px; }
#ui-root ::-webkit-scrollbar-thumb { background: rgba(120, 150, 200, 0.3); border-radius: 4px; }
#ui-root ::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   RIFTLINE 3D — FUTURISTIC HOLO-UI OVERRIDE LAYER
   Layered over the base sheet (cascade wins): glassmorphic panels, neon chamfered
   controls, scanline frame, and a transparent title screen so the live 3D rift
   attract scene shows through. Gameplay-critical colors (team/hp/mana/telegraph)
   are UNCHANGED.
   ========================================================================== */

:root {
  --panel-bg: rgba(8, 13, 24, 0.72);
  --panel-bg-strong: rgba(7, 11, 20, 0.86);
  --panel-border: rgba(96, 178, 255, 0.28);
  --holo: #6fd3ff;
  --holo-dim: rgba(111, 211, 255, 0.5);
  --holo-glow: rgba(63, 167, 255, 0.45);
  --chamfer: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
  --chamfer-sm: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

/* ------------------------------------------------ canvas stack + frame */
#overlay-canvas {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(100vw, calc(100vh * (16 / 9)));
  height: min(100vh, calc(100vw * (9 / 16)));
  pointer-events: none;
  z-index: 2;
}
#game-canvas { z-index: 1; background: #05070f; }
#ui-root { z-index: 3; }

/* holographic scanlines + corner brackets over the scene, under the UI */
#ui-root::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, rgba(140, 200, 255, 0.014) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}

/* ------------------------------------------------ type */
#ui-root h1, #ui-root h2, #ui-root h3, #ui-root h4, .title {
  letter-spacing: 0.22em;
}

/* ------------------------------------------------ panels: holo-glass */
.panel {
  background: linear-gradient(160deg, rgba(14, 24, 44, 0.78), rgba(6, 10, 19, 0.82));
  border: 1px solid var(--panel-border);
  box-shadow: 0 0 0 1px rgba(6, 10, 18, 0.6), 0 8px 40px rgba(0, 0, 0, 0.5),
    inset 0 0 24px rgba(63, 167, 255, 0.05);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

/* ------------------------------------------------ controls: chamfered neon */
#ui-root button {
  background: linear-gradient(170deg, rgba(22, 36, 62, 0.85), rgba(10, 16, 30, 0.9));
  border: 1px solid rgba(111, 211, 255, 0.30);
  border-radius: 3px;
  clip-path: var(--chamfer-sm);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  transition: border-color 0.15s, box-shadow 0.15s, color 0.15s, transform 0.06s;
  position: relative;
  overflow: hidden;
}
#ui-root button::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -80%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(140, 220, 255, 0.16), transparent);
  transform: skewX(-18deg);
  transition: left 0.35s ease;
  pointer-events: none;
}
#ui-root button:hover {
  border-color: var(--holo);
  color: #fff;
  box-shadow: 0 0 18px rgba(63, 167, 255, 0.35), inset 0 0 14px rgba(63, 167, 255, 0.12);
}
#ui-root button:hover::after { left: 120%; }
.btn-primary {
  border-color: rgba(111, 211, 255, 0.65) !important;
  background: linear-gradient(170deg, rgba(28, 62, 105, 0.9), rgba(12, 26, 48, 0.92)) !important;
  box-shadow: 0 0 22px rgba(63, 167, 255, 0.3);
}
#ui-root input, #ui-root select, #ui-root textarea {
  background: rgba(8, 14, 26, 0.85);
  border: 1px solid rgba(96, 178, 255, 0.22);
  border-radius: 3px;
}

/* ------------------------------------------------ screens over the live scene */
.screen {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(5, 9, 18, 0.30) 0%, rgba(4, 7, 14, 0.78) 78%),
    linear-gradient(rgba(4, 7, 14, 0.25), rgba(4, 7, 14, 0.55));
  /* no backdrop-filter here: it creates a containing block that would break
     position:fixed children (.back-chip) inside scrollable screens */
  justify-content: safe center;
}
.title-screen {
  background:
    radial-gradient(ellipse at 50% 46%, transparent 0%, rgba(3, 5, 11, 0.66) 82%);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.title-screen h1, .title-logo {
  font-size: 92px;
  letter-spacing: 0.30em;
  margin-bottom: 10px;
  padding-left: 0.30em; /* optically recenter the tracked-out caps */
  background: linear-gradient(180deg, #ffffff 18%, #bfe3ff 44%, #59b7ff 72%, #2c5f9e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(63, 167, 255, 0.55)) drop-shadow(0 2px 60px rgba(63, 167, 255, 0.30));
  animation: logo-in 1.1s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes logo-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); letter-spacing: 0.5em; }
  to { opacity: 1; transform: none; letter-spacing: 0.30em; }
}
.title-screen::after {
  content: 'A DUEL ON THE FRACTURED LEY';
  order: 1;
  font-size: 12px;
  letter-spacing: 0.55em;
  padding-left: 0.55em;
  color: var(--holo-dim);
  margin-top: -26px;
  animation: sub-in 1.4s 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes sub-in { from { opacity: 0; } to { opacity: 1; } }
.title-screen .menu-col { order: 2; margin-top: 34px; }
.title-screen .volume-row { order: 3; }
.menu-col button {
  font-size: 15px;
  padding: 14px;
  background: linear-gradient(90deg, rgba(16, 28, 50, 0.68), rgba(9, 15, 28, 0.55));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: menu-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.menu-col button:nth-child(1) { animation-delay: 0.35s; }
.menu-col button:nth-child(2) { animation-delay: 0.45s; }
.menu-col button:nth-child(3) { animation-delay: 0.55s; }
.menu-col button:nth-child(4) { animation-delay: 0.65s; }
@keyframes menu-in { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; } }

/* splash cards: holo dossiers */
.personality-card {
  background: linear-gradient(165deg, rgba(14, 24, 44, 0.8), rgba(6, 10, 19, 0.85));
  border: 1px solid var(--panel-border);
  clip-path: var(--chamfer);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.personality-card:nth-child(2) { animation-delay: 0.08s; }
.personality-card:nth-child(3) { animation-delay: 0.16s; }
.personality-card:nth-child(4) { animation-delay: 0.24s; }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; } }

/* ------------------------------------------------ HUD: glass instruments */
.hud-kda, .hud-topright, .hud-plate, .event-feed .feed-line, #lanebar-canvas {
  background: linear-gradient(165deg, rgba(12, 20, 38, 0.72), rgba(6, 10, 19, 0.78));
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35), inset 0 0 18px rgba(63, 167, 255, 0.04);
}
.hud-plate { clip-path: var(--chamfer); border-radius: 3px; padding: 12px 22px; }
.hud-kda, .hud-topright { clip-path: var(--chamfer-sm); border-radius: 3px; }
.bar { border-radius: 2px; border-color: rgba(111, 211, 255, 0.16); }
.bar.hp .fill { box-shadow: 0 0 12px rgba(70, 212, 106, 0.55); }
.bar.mana .fill { box-shadow: 0 0 12px rgba(63, 123, 255, 0.55); }
.hud-portrait canvas, .hud-portrait .portrait {
  border-color: rgba(111, 211, 255, 0.45);
  box-shadow: 0 0 16px rgba(63, 167, 255, 0.25);
}
#lanebar-canvas { border-radius: 3px; clip-path: var(--chamfer-sm); }

/* ------------------------------------------------ selection + scrollbars */
::selection { background: rgba(63, 167, 255, 0.35); }
#ui-root ::-webkit-scrollbar { width: 8px; height: 8px; }
#ui-root ::-webkit-scrollbar-thumb { background: rgba(96, 178, 255, 0.25); border-radius: 4px; }
#ui-root ::-webkit-scrollbar-track { background: rgba(6, 10, 18, 0.5); }

/* screens must scroll rather than push controls off-frame at short viewports */
.screen { overflow-y: auto; }
.setup-grid, .forge-grid { max-height: calc(100vh - 40px); }

/* Warden nameplate: crimson transmission chip under the lane bar */
.warden-plate {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 14px;
  background: linear-gradient(165deg, rgba(46, 14, 22, 0.82), rgba(20, 7, 12, 0.85));
  border: 1px solid rgba(255, 79, 94, 0.45);
  clip-path: var(--chamfer-sm);
  border-radius: 3px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--crimson-bright);
  text-shadow: 0 0 12px rgba(255, 79, 94, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: none;
}

/* Warden banter: holographic transmission lines from the rival */
.warden-banter {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  pointer-events: none;
  z-index: 4;
}
.warden-banter-line {
  max-width: 560px;
  padding: 6px 18px;
  background: linear-gradient(165deg, rgba(46, 14, 22, 0.78), rgba(18, 7, 12, 0.82));
  border: 1px solid rgba(255, 79, 94, 0.4);
  border-left: 3px solid var(--crimson);
  clip-path: var(--chamfer-sm);
  border-radius: 3px;
  color: #ffd7da;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.03em;
  text-shadow: 0 0 10px rgba(255, 79, 94, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: banter-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes banter-in {
  from { opacity: 0; transform: translateY(-8px) scaleY(0.7); filter: blur(3px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* Always-visible back chip on menu screens (beats #ui-root button's position:relative) */
#ui-root button.back-chip {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 6;
  font-size: 13px;
  padding: 10px 20px 10px 15px;
  letter-spacing: 0.16em;
}

/* 5th title menu entry stagger (First Person tab added) */
.menu-col button:nth-child(5) { animation-delay: 0.75s; }

/* ============================================================================
   FPS MODE — helmet HUD (body.fps-mode, first-person matches only)
   Overwatch-inspired: oversized angled ability tiles, segmented health,
   corner brackets + cockpit vignette. Top-down HUD is untouched.
   ========================================================================== */

.fps-mode #game-canvas { cursor: crosshair; }

/* cockpit frame: corner brackets + breathing edge vignette */
.fps-mode #ui-root::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 190px rgba(8, 18, 42, 0.62);
  background:
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) 26px 26px / 52px 2px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) 26px 26px / 2px 52px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) calc(100% - 26px) 26px / 52px 2px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) calc(100% - 26px) 26px / 2px 52px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) 26px calc(100% - 26px) / 52px 2px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) 26px calc(100% - 26px) / 2px 52px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) calc(100% - 26px) calc(100% - 26px) / 52px 2px no-repeat,
    linear-gradient(rgba(111,211,255,.55), rgba(111,211,255,.55)) calc(100% - 26px) calc(100% - 26px) / 2px 52px no-repeat;
  animation: helmet-breathe 5s ease-in-out infinite;
}
@keyframes helmet-breathe {
  0%, 100% { box-shadow: inset 0 0 190px rgba(8, 18, 42, 0.62); }
  50% { box-shadow: inset 0 0 230px rgba(8, 18, 42, 0.5); }
}

/* command plate: bigger, angled, floating */
.fps-mode .hud-plate {
  bottom: 20px;
  gap: 20px;
  padding: 14px 30px;
  background: linear-gradient(170deg, rgba(10, 18, 36, 0.66), rgba(5, 9, 18, 0.72));
  border-color: rgba(111, 211, 255, 0.35);
  box-shadow: 0 10px 44px rgba(0, 0, 0, 0.5), inset 0 0 26px rgba(63, 167, 255, 0.07);
}

/* health/mana: thick segmented power bars */
.fps-mode .hud-bars { min-width: 330px; gap: 7px; }
.fps-mode .bar { height: 24px; border-radius: 2px; }
.fps-mode .bar.hp .fill {
  background: linear-gradient(180deg, #6dff96, #38c05e);
  box-shadow: 0 0 18px rgba(70, 212, 106, 0.7);
}
.fps-mode .bar.mana .fill {
  background: linear-gradient(180deg, #6f9dff, #2f63e0);
  box-shadow: 0 0 18px rgba(63, 123, 255, 0.7);
}
.fps-mode .bar.hp::after, .fps-mode .bar.mana::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(90deg,
    transparent 0 calc(10% - 2px), rgba(5, 8, 14, 0.85) calc(10% - 2px) 10%);
}
.fps-mode .bar .num { font-size: 13px; }

/* ability tiles: big, skewed, glowing — the Overwatch read */
.fps-mode .ability-row { gap: 12px; }
.fps-mode .ability-icon {
  width: 76px;
  height: 76px;
  border-radius: 4px;
  transform: skewX(-7deg);
  background: linear-gradient(170deg, rgba(22, 36, 62, 0.9), rgba(9, 15, 28, 0.94));
  border-color: rgba(111, 211, 255, 0.42);
  box-shadow: 0 0 20px rgba(63, 167, 255, 0.22), inset 0 0 14px rgba(63, 167, 255, 0.08);
}
.fps-mode .ability-icon > * { transform: skewX(7deg); } /* un-skew content */
.fps-mode .ability-icon .key {
  font-size: 13px;
  bottom: 4px;
  left: 7px;
  color: #bfe3ff;
  text-shadow: 0 0 8px rgba(63, 167, 255, 0.8);
}
.fps-mode .ability-icon .cd-num { font-size: 20px; }
.fps-mode .ability-icon.riftstep {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border-color: rgba(255, 215, 94, 0.5);
  box-shadow: 0 0 22px rgba(255, 215, 94, 0.28);
}
/* (W is a plain ability key in first person — movement lives on the arrows/RMB) */

/* floating controls card (first-person matches, self-fading) */
.fps-controls-card {
  position: fixed;
  top: 50%;
  right: 26px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 16px 20px;
  background: linear-gradient(165deg, rgba(12, 20, 38, 0.86), rgba(6, 10, 19, 0.9));
  border: 1px solid rgba(111, 211, 255, 0.4);
  border-left: 3px solid var(--holo);
  clip-path: var(--chamfer);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--text);
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: opacity 1.4s ease;
  z-index: 5;
}
.fps-controls-card b {
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--holo);
  margin-bottom: 4px;
}
.fps-controls-card kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid rgba(111, 211, 255, 0.35);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: rgba(20, 28, 44, 0.9);
}
.fps-controls-card.fade { opacity: 0; }

/* hoverable ability tooltip (both camera modes) */
.hud-ability-tooltip {
  position: fixed;
  transform: translateX(-50%);
  max-width: 340px;
  padding: 12px 16px;
  background: linear-gradient(165deg, rgba(12, 20, 38, 0.94), rgba(6, 10, 19, 0.96));
  border: 1px solid rgba(111, 211, 255, 0.45);
  border-left: 3px solid var(--holo);
  clip-path: var(--chamfer-sm);
  border-radius: 3px;
  pointer-events: none;
  z-index: 7;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: card-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.hud-ability-tooltip .tip-name {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  color: var(--blue-bright);
}
.hud-ability-tooltip .tip-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gold);
  margin: 4px 0 6px;
}
.hud-ability-tooltip .tip-desc { font-size: 12.5px; line-height: 1.45; color: var(--text); }

/* title menu mode descriptors */
.menu-col button { position: relative; text-align: left; padding-left: 22px; }
.menu-col .menu-sub {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--holo-dim);
  pointer-events: none;
}
.menu-col .menu-sub { max-width: 46%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ============================================================================
   HELMET STATES + FPS BANNER GLITZ (crazier-UI pass)
   ========================================================================== */

/* cracked visor at low HP: red-shifted brackets + corner fracture lines */
.fps-mode.low-hp #ui-root::after {
  box-shadow: inset 0 0 210px rgba(90, 8, 18, 0.7);
  background:
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) 26px 26px / 52px 2px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) 26px 26px / 2px 52px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) calc(100% - 26px) 26px / 52px 2px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) calc(100% - 26px) 26px / 2px 52px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) 26px calc(100% - 26px) / 52px 2px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) 26px calc(100% - 26px) / 2px 52px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) calc(100% - 26px) calc(100% - 26px) / 52px 2px no-repeat,
    linear-gradient(rgba(255,70,80,.6), rgba(255,70,80,.6)) calc(100% - 26px) calc(100% - 26px) / 2px 52px no-repeat,
    /* fracture veins across the top corners */
    linear-gradient(104deg, transparent 49.6%, rgba(255,120,130,0.35) 50%, transparent 50.5%) 0 0 / 340px 220px no-repeat,
    linear-gradient(63deg, transparent 49.6%, rgba(255,120,130,0.28) 50%, transparent 50.5%) 40px 0 / 200px 160px no-repeat,
    linear-gradient(-95deg, transparent 49.6%, rgba(255,120,130,0.33) 50%, transparent 50.5%) 100% 0 / 300px 240px no-repeat,
    linear-gradient(-60deg, transparent 49.6%, rgba(255,120,130,0.25) 50%, transparent 50.5%) calc(100% - 30px) 8% / 180px 150px no-repeat;
  animation: visor-pulse 0.9s ease-in-out infinite;
}
@keyframes visor-pulse {
  0%, 100% { box-shadow: inset 0 0 210px rgba(90, 8, 18, 0.7); }
  50% { box-shadow: inset 0 0 250px rgba(120, 10, 22, 0.55); }
}

/* ult ready: the helmet surges gold, the R tile radiates */
.fps-mode.ult-ready #ui-root::after {
  background:
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) 26px 26px / 52px 2px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) 26px 26px / 2px 52px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) calc(100% - 26px) 26px / 52px 2px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) calc(100% - 26px) 26px / 2px 52px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) 26px calc(100% - 26px) / 52px 2px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) 26px calc(100% - 26px) / 2px 52px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) calc(100% - 26px) calc(100% - 26px) / 52px 2px no-repeat,
    linear-gradient(rgba(255,215,94,.7), rgba(255,215,94,.7)) calc(100% - 26px) calc(100% - 26px) / 2px 52px no-repeat;
}
.fps-mode.low-hp.ult-ready #ui-root::after { animation: visor-pulse 0.9s ease-in-out infinite; }
.fps-mode.ult-ready .ability-icon[data-slot="R"] {
  border-color: rgba(255, 215, 94, 0.85);
  box-shadow: 0 0 26px rgba(255, 215, 94, 0.55), inset 0 0 16px rgba(255, 215, 94, 0.2);
  animation: ult-surge 1.6s ease-in-out infinite;
}
@keyframes ult-surge {
  0%, 100% { box-shadow: 0 0 26px rgba(255, 215, 94, 0.55), inset 0 0 16px rgba(255, 215, 94, 0.2); }
  50% { box-shadow: 0 0 44px rgba(255, 215, 94, 0.85), inset 0 0 22px rgba(255, 215, 94, 0.35); }
}

/* FPS kill banners: colossal, skewed, chromatic-glitched */
.fps-mode .banner-stack .banner {
  font-size: 44px;
  letter-spacing: 0.3em;
  transform: skewX(-8deg);
  text-shadow:
    2px 0 rgba(255, 60, 80, 0.75),
    -2px 0 rgba(60, 200, 255, 0.75),
    0 0 26px rgba(255, 255, 255, 0.35);
  animation: banner-glitch 0.5s steps(2) 3, feed-in 0.12s ease-out;
}
@keyframes banner-glitch {
  0% { transform: skewX(-8deg) translateX(0); }
  25% { transform: skewX(-10deg) translateX(-3px); }
  50% { transform: skewX(-6deg) translateX(3px); }
  75% { transform: skewX(-9deg) translateX(-1px); }
  100% { transform: skewX(-8deg) translateX(0); }
}

/* HUD fits smaller windows: scale the command plate + tuck side chrome */
@media (max-width: 1279px) {
  .hud-plate { transform: translateX(-50%) scale(0.82); transform-origin: bottom center; }
  .fps-controls-card { display: none; }
  .hud-items, #shop-root .shop-panel { zoom: 0.9; }
}
@media (max-width: 900px) {
  .hud-plate { transform: translateX(-50%) scale(0.68); }
  .hud-kda, .hud-topright { zoom: 0.85; }
}

/* fps-mode: skill-point badges must be unmissable (mouse is captured; Ctrl+key levels) */
.fps-mode .level-up-btn {
  width: 22px;
  height: 22px;
  font-size: 15px;
  border-color: rgba(255, 215, 94, 0.8) !important;
  color: #ffd75e !important;
  animation: lvl-pulse 1.1s ease-in-out infinite;
}
@keyframes lvl-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 94, 0.4); transform: scale(1); }
  50% { box-shadow: 0 0 20px rgba(255, 215, 94, 0.85); transform: scale(1.18); }
}
