/* ==========================================================
   FABLEWATCH — UI stylesheet
   ========================================================== */
:root {
  --blue: #38c6ff;
  --red: #ff5a5a;
  --gold: #ffb63d;
  --ink: #0c1524;
  --panel: rgba(10, 20, 38, 0.92);
  --white: #f2f8ff;
  --heal: #7dffb0;
}
* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #060b14; }
body { font-family: "Futura", "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif; color: var(--white); }
#app, #app canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#ui { position: absolute; inset: 0; pointer-events: none; }
.hidden { display: none !important; }
button { font-family: inherit; }

/* ---------- generic screens & panels ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: auto; z-index: 20;
}
#screen-title {
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(56,198,255,0.14), transparent 55%),
    radial-gradient(90% 70% at 80% 95%, rgba(255,182,61,0.12), transparent 50%),
    linear-gradient(180deg, #0a1626 0%, #0c1b30 45%, #142a46 100%);
}
.title-bg-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 22%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(2px 2px at 78% 12%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1.6px 1.6px at 30% 70%, rgba(255,255,255,0.4), transparent 60%),
    radial-gradient(2px 2px at 60% 40%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1.4px 1.4px at 90% 60%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.8px 1.8px at 45% 15%, rgba(255,255,255,0.5), transparent 60%);
  animation: twinkle 6s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.5; } to { opacity: 1; } }
.title-wrap { display: flex; flex-direction: column; align-items: center; z-index: 2; }
.title-emblem { position: relative; width: 120px; height: 120px; margin-bottom: 10px; }
.emblem-ring {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 11px solid var(--gold);
  border-bottom-color: transparent;
  transform: rotate(45deg);
  box-shadow: 0 0 34px rgba(255,182,61,0.55);
  animation: emblemspin 14s linear infinite;
}
@keyframes emblemspin { to { transform: rotate(405deg); } }
.emblem-core {
  position: absolute; left: 50%; top: 50%; width: 34px; height: 34px;
  transform: translate(-50%,-50%); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #aef, var(--blue));
  box-shadow: 0 0 26px var(--blue);
}
.game-title {
  font-size: clamp(52px, 9vw, 108px); font-weight: 800; letter-spacing: 0.06em;
  color: var(--white); font-style: italic;
  text-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 44px rgba(56,198,255,0.45);
}
.game-title span { color: var(--gold); text-shadow: 0 4px 0 rgba(0,0,0,0.35), 0 0 44px rgba(255,182,61,0.5); }
.title-tag { letter-spacing: 0.55em; font-size: 14px; color: #9fc4e8; margin: 6px 0 44px; text-indent: 0.55em; }
.menu-buttons { display: flex; flex-direction: column; gap: 14px; width: 320px; }
.menu-buttons.row { flex-direction: row; width: auto; }
.btn {
  pointer-events: auto; cursor: pointer; border: none; outline: none;
  padding: 14px 30px; font-size: 17px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--white); background: rgba(30, 52, 84, 0.85);
  border-left: 4px solid rgba(56,198,255,0.6);
  transform: skewX(-8deg); transition: all 0.13s ease;
}
.btn > * { transform: skewX(8deg); }
.btn:hover { background: rgba(56,116,178,0.95); transform: skewX(-8deg) translateX(6px); box-shadow: 0 0 24px rgba(56,198,255,0.35); }
.btn:active { transform: skewX(-8deg) translateX(6px) scale(0.98); }
.btn-primary { background: linear-gradient(90deg, #ff9d2e, #ffb63d); color: #221503; border-left-color: #fff; }
.btn-primary:hover { background: linear-gradient(90deg, #ffb04e, #ffc75f); box-shadow: 0 0 30px rgba(255,182,61,0.55); }
.btn-danger { border-left-color: var(--red); }
.btn-danger:hover { background: rgba(178,56,66,0.9); box-shadow: 0 0 24px rgba(255,90,90,0.35); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.btn-big { font-size: 21px; padding: 17px 54px; }
.btn-back { align-self: flex-start; margin-top: 26px; }
.title-footer { position: absolute; bottom: 22px; font-size: 12px; color: #6d8db0; letter-spacing: 0.08em; }

#screen-controls, #screen-settings { background: rgba(5, 10, 20, 0.88); backdrop-filter: blur(6px); z-index: 40; }
.panel {
  background: var(--panel); border: 1px solid rgba(56,198,255,0.25);
  border-top: 4px solid var(--gold); padding: 34px 44px; min-width: 480px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.6); display: flex; flex-direction: column;
}
.panel.wide { min-width: 720px; }
.panel-title { font-size: 30px; letter-spacing: 0.2em; margin-bottom: 24px; font-style: italic; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 44px; }
.ctl { display: flex; align-items: center; gap: 16px; font-size: 15px; color: #cfe3f7; }
.key {
  min-width: 86px; text-align: center; padding: 7px 10px; font-weight: 800; font-size: 13px;
  background: #17293f; border: 1px solid rgba(56,198,255,0.4); border-bottom-width: 3px;
  border-radius: 6px; color: var(--blue); letter-spacing: 0.06em;
}
.hint-line { margin-top: 22px; font-size: 14px; color: var(--gold); line-height: 1.5; max-width: 640px; }
.settings-rows { display: flex; flex-direction: column; gap: 18px; }
.srow { display: grid; grid-template-columns: 180px 1fr 64px; align-items: center; gap: 16px; font-size: 15px; color: #cfe3f7; }
.srow input[type=range] { pointer-events: auto; accent-color: var(--gold); }
.srow select { pointer-events: auto; background: #17293f; color: var(--white); border: 1px solid rgba(56,198,255,0.4); padding: 6px 10px; font-family: inherit; }
.sval { text-align: right; color: var(--blue); font-weight: 700; }

/* ---------- hero select ---------- */
#screen-select {
  justify-content: flex-start;
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(56,198,255,0.10), transparent 55%),
    linear-gradient(180deg, #0a1626, #101f36 60%, #16294a);
  padding: 34px 4vw;
}
.select-header { width: 100%; display: flex; align-items: baseline; gap: 34px; margin-bottom: 22px; flex-wrap: wrap; }
.select-title { font-size: 36px; font-weight: 800; font-style: italic; letter-spacing: 0.1em; }
.select-map { font-size: 15px; color: #9fc4e8; letter-spacing: 0.2em; }
.select-map b { color: var(--gold); }
.select-diff { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: 0.2em; color: #9fc4e8; }
.diff-btns { display: flex; gap: 6px; }
.diff-btn {
  pointer-events: auto; cursor: pointer; padding: 7px 14px; font-size: 12px; font-weight: 800; letter-spacing: 0.12em;
  background: rgba(30,52,84,0.7); color: #9fc4e8; border: 1px solid rgba(56,198,255,0.25);
}
.diff-btn.on { background: var(--gold); color: #221503; border-color: var(--gold); }
.select-body { display: flex; gap: 30px; width: 100%; flex: 1; min-height: 0; }
.hero-grid { display: grid; grid-template-columns: repeat(3, 150px); gap: 14px; align-content: start; }
.hero-cell {
  pointer-events: auto; cursor: pointer; position: relative; width: 150px; height: 190px;
  background: rgba(18, 34, 58, 0.9); border: 2px solid rgba(56,198,255,0.18);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 86% 100%, 0 100%);
  transition: all 0.12s ease; overflow: hidden;
}
.hero-cell:hover { transform: translateY(-4px); border-color: rgba(56,198,255,0.7); }
.hero-cell.picked { border-color: var(--gold); box-shadow: 0 0 26px rgba(255,182,61,0.4); transform: translateY(-4px); }
.hero-cell canvas { width: 100%; height: 140px; display: block; }
.hero-cell .hc-name { position: absolute; left: 10px; bottom: 26px; font-weight: 800; font-size: 17px; letter-spacing: 0.08em; font-style: italic; }
.hero-cell .hc-role { position: absolute; left: 10px; bottom: 9px; font-size: 10px; letter-spacing: 0.24em; color: #9fc4e8; }
.hero-cell .hc-rolemark { position: absolute; right: 8px; top: 8px; font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 3px; background: rgba(0,0,0,0.45); letter-spacing: 0.1em; }
.role-damage .hc-rolemark { color: #ff9d6b; } .role-tank .hc-rolemark { color: #8fd0ff; } .role-support .hc-rolemark { color: #9dffc4; }
.hero-detail {
  flex: 1; background: rgba(10, 21, 38, 0.85); border: 1px solid rgba(56,198,255,0.2);
  border-top: 4px solid var(--gold); padding: 26px 32px; overflow-y: auto; pointer-events: auto; min-height: 0;
}
.hd-top { display: flex; gap: 24px; align-items: center; }
.hd-portrait { width: 118px; height: 118px; border-radius: 10px; overflow: hidden; border: 2px solid rgba(56,198,255,0.35); flex: none; }
.hd-portrait canvas { width: 100%; height: 100%; display: block; }
.hd-name { font-size: 40px; font-weight: 800; font-style: italic; letter-spacing: 0.06em; line-height: 1; }
.hd-epithet { color: var(--gold); font-size: 14px; letter-spacing: 0.22em; margin-top: 6px; }
.hd-role-line { margin-top: 10px; font-size: 12px; color: #9fc4e8; letter-spacing: 0.14em; display: flex; gap: 18px; }
.hd-role-line b { color: var(--white); }
.hd-bio { margin: 18px 0; font-size: 14.5px; line-height: 1.65; color: #cfe3f7; font-style: italic; border-left: 3px solid rgba(255,182,61,0.5); padding-left: 14px; }
.hd-abilities { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hd-ab { background: rgba(23, 41, 63, 0.8); padding: 12px 14px; border-left: 3px solid var(--blue); }
.hd-ab.ult { border-left-color: var(--gold); grid-column: 1 / -1; }
.hd-ab .ab-title { font-weight: 800; font-size: 14px; letter-spacing: 0.08em; display: flex; gap: 10px; align-items: baseline; }
.hd-ab .ab-bind { font-size: 10px; color: var(--blue); background: rgba(56,198,255,0.12); padding: 2px 7px; border-radius: 3px; letter-spacing: 0.1em; }
.hd-ab.ult .ab-bind { color: var(--gold); background: rgba(255,182,61,0.12); }
.hd-ab .ab-desc { font-size: 12.5px; color: #a9c4de; margin-top: 5px; line-height: 1.5; }
.hd-stats { display: flex; gap: 26px; margin-top: 16px; font-size: 12px; letter-spacing: 0.12em; color: #9fc4e8; }
.hd-stats b { color: var(--white); font-size: 15px; }
.select-footer { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.select-footer .btn-back { margin-top: 0; align-self: center; }

/* ---------- HUD ---------- */
#hud { position: absolute; inset: 0; z-index: 10; }
#hud > * { position: absolute; }

#vignette-damage, #vignette-low, #vignette-heal { inset: 0; pointer-events: none; opacity: 0; }
#vignette-damage { background: radial-gradient(ellipse at center, transparent 42%, rgba(255, 40, 40, 0.55) 100%); transition: opacity 0.12s; }
#vignette-low { background: radial-gradient(ellipse at center, transparent 46%, rgba(255, 20, 20, 0.7) 100%); }
#vignette-heal { background: radial-gradient(ellipse at center, transparent 55%, rgba(125,255,176,0.35) 100%); transition: opacity 0.3s; }

#crosshair { left: 50%; top: 50%; transform: translate(-50%,-50%); width: 80px; height: 80px; pointer-events: none; }
#crosshair svg { position: absolute; inset: 0; overflow: visible; }
#hitmarker {
  left: 50%; top: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px;
  pointer-events: none; opacity: 0;
}
#hitmarker::before, #hitmarker::after {
  content: ""; position: absolute; inset: 0;
}
#hitmarker::before {
  background:
    linear-gradient(45deg, transparent 44%, var(--hitcol,#fff) 46%, var(--hitcol,#fff) 54%, transparent 56%);
  clip-path: polygon(0 0, 34% 0, 34% 34%, 0 34%, 0 0,  66% 0, 100% 0, 100% 34%, 66% 34%);
}
#hitmarker::after {
  background:
    linear-gradient(-45deg, transparent 44%, var(--hitcol,#fff) 46%, var(--hitcol,#fff) 54%, transparent 56%);
  clip-path: polygon(0 66%, 34% 66%, 34% 100%, 0 100%, 66% 66%, 100% 66%, 100% 100%, 66% 100%);
}
#hitmarker.pop { animation: hitpop 0.18s ease-out; }
@keyframes hitpop { 0% { opacity: 1; transform: translate(-50%,-50%) scale(1.35); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(0.9); } }

#dmg-arrows { inset: 0; pointer-events: none; }
.dmg-arrow {
  position: absolute; left: 50%; top: 50%; width: 200px; height: 200px; margin: -100px;
  pointer-events: none;
}
.dmg-arrow::before {
  content: ""; position: absolute; left: 50%; top: -46px; transform: translateX(-50%);
  border: 15px solid transparent; border-bottom: 26px solid rgba(255,70,70,0.85);
  filter: drop-shadow(0 0 8px rgba(255,0,0,0.6));
}

/* objective */
#objective-wrap { top: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#obj-status { font-size: 13px; letter-spacing: 0.2em; color: #cfe3f7; background: rgba(8,16,30,0.7); padding: 5px 16px; border-radius: 4px; }
#obj-status b { color: var(--gold); }
#obj-bars { display: flex; align-items: center; gap: 10px; }
.obj-team { position: relative; width: 190px; height: 22px; background: rgba(8,16,30,0.75); border: 1px solid rgba(255,255,255,0.18); overflow: hidden; }
.obj-team span { position: absolute; top: 1px; font-size: 14px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.obj-blue { transform: skewX(-18deg); } .obj-red { transform: skewX(18deg); }
.obj-blue span { right: 8px; transform: skewX(18deg); } .obj-red span { left: 8px; transform: skewX(-18deg); }
#obj-fill-blue, #obj-fill-red { position: absolute; top: 0; bottom: 0; width: 0%; transition: width 0.2s linear; }
#obj-fill-blue { right: 0; background: linear-gradient(90deg, #1d7fb0, var(--blue)); }
#obj-fill-red { left: 0; background: linear-gradient(90deg, var(--red), #b02730); }
#obj-icon {
  position: relative; width: 58px; height: 58px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--white);
}
#obj-icon-letter { z-index: 2; text-shadow: 0 2px 4px #000; }
#obj-cap-ring { position: absolute; inset: 0; border-radius: 12px; transform: rotate(45deg); border: 4px solid #9fb6cf; background: rgba(8,16,30,0.8); transition: border-color 0.2s, box-shadow 0.2s; }
#obj-icon.own-blue #obj-cap-ring { border-color: var(--blue); box-shadow: 0 0 22px rgba(56,198,255,0.6); }
#obj-icon.own-red #obj-cap-ring { border-color: var(--red); box-shadow: 0 0 22px rgba(255,90,90,0.6); }
#obj-icon.contested #obj-cap-ring { animation: contestflash 0.6s steps(2) infinite; }
@keyframes contestflash { 0% { border-color: #fff; } 100% { border-color: var(--gold); } }
#obj-sub { font-size: 12px; letter-spacing: 0.24em; color: var(--gold); min-height: 16px; text-shadow: 0 1px 3px #000; }

/* killfeed */
#killfeed { top: 92px; right: 22px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; pointer-events: none; }
.kf-row {
  display: flex; align-items: center; gap: 8px; background: rgba(8,16,30,0.78);
  padding: 5px 12px; font-size: 13px; font-weight: 700; border-right: 3px solid transparent;
  animation: kfin 0.2s ease-out;
}
@keyframes kfin { from { transform: translateX(30px); opacity: 0; } }
.kf-row.fade { transition: opacity 0.5s; opacity: 0; }
.kf-blue { color: var(--blue); } .kf-red { color: var(--red); }
.kf-row .kf-x { color: #d9e6f5; font-size: 11px; opacity: 0.9; }
.kf-row.me { border-right-color: var(--gold); background: rgba(50,38,8,0.85); }
.kf-skull { font-size: 12px; }

/* team frames */
#team-frames { top: 84px; left: 22px; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.tf {
  display: flex; align-items: center; gap: 9px; background: rgba(8,16,30,0.68); padding: 4px 10px 4px 4px;
  border-left: 3px solid var(--blue); min-width: 190px;
}
.tf.dead { opacity: 0.45; filter: grayscale(0.8); }
.tf .tf-icon { width: 30px; height: 30px; border-radius: 5px; overflow: hidden; flex: none; }
.tf .tf-icon canvas { width: 100%; height: 100%; display: block; }
.tf .tf-mid { flex: 1; }
.tf .tf-name { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; display: flex; justify-content: space-between; }
.tf .tf-name .tf-ult { color: var(--gold); font-size: 10px; }
.tf .tf-bar { position: relative; height: 6px; background: rgba(255,255,255,0.14); margin-top: 3px; border-radius: 2px; overflow: hidden; }
.tf .tf-hp { position: absolute; inset: 0; right: auto; background: var(--heal); width: 100%; transition: width 0.15s; }
.tf .tf-sh { position: absolute; inset: 0; right: auto; background: #bfe3ff; width: 0; opacity: 0.9; }
.tf.me { border-left-color: var(--gold); }

/* bottom-left health */
#hud-bl { left: 26px; bottom: 26px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#hp-wrap { display: flex; align-items: center; gap: 12px; }
#hp-hero-icon { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 2px solid rgba(255,255,255,0.25); }
#hp-hero-icon canvas { width: 100%; height: 100%; display: block; }
#hp-col { display: flex; flex-direction: column; gap: 4px; }
#hp-bar { position: relative; width: 300px; height: 17px; background: rgba(8,16,30,0.75); transform: skewX(-14deg); overflow: hidden; border: 1px solid rgba(255,255,255,0.2); }
#hp-fill { position: absolute; inset: 0; right: auto; width: 100%; background: linear-gradient(180deg, #dff7ff, #9adfff 55%, #5fc4f2); transition: width 0.12s; }
#hp-shield-fill { position: absolute; inset: 0; right: auto; width: 0; background: linear-gradient(180deg,#fff,#bfe3ff); opacity: 0.95; }
#hp-bar.hurt #hp-fill { background: linear-gradient(180deg, #ffd9c9, #ff9a6b 55%, #f2653f); }
#hp-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 29px, rgba(5,12,24,0.85) 29px 31px); }
#hp-num { font-size: 21px; font-weight: 800; text-shadow: 0 2px 3px #000; }
#hp-num .hp-max { font-size: 13px; color: #9fc4e8; margin-left: 3px; }
#status-tags { display: flex; gap: 7px; }
.stag { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; padding: 3px 9px; border-radius: 3px; background: rgba(255,182,61,0.9); color: #221503; animation: stagpulse 0.7s ease-in-out infinite alternate; }
@keyframes stagpulse { to { opacity: 0.7; } }

/* bottom-right ammo + abilities */
#hud-br { right: 26px; bottom: 26px; display: flex; align-items: flex-end; gap: 24px; pointer-events: none; }
#ammo-wrap { text-align: right; position: relative; }
#ammo-cur { font-size: 42px; font-weight: 800; font-style: italic; text-shadow: 0 3px 4px #000; }
#ammo-max { font-size: 17px; color: #9fc4e8; font-weight: 700; }
#reload-note { position: absolute; right: 0; top: -16px; font-size: 11px; letter-spacing: 0.3em; color: var(--gold); opacity: 0; }
#reload-note.on { opacity: 1; animation: stagpulse 0.4s ease-in-out infinite alternate; }
#abilities { display: flex; gap: 12px; }
.ab { position: relative; width: 62px; height: 62px; background: rgba(8,16,30,0.78); border: 2px solid rgba(56,198,255,0.45); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.ab .ab-icon { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px #000); }
.ab .ab-cd {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(4,8,16,0.78); font-size: 22px; font-weight: 800; color: var(--white); border-radius: 6px; opacity: 0;
}
.ab.cooling .ab-cd { opacity: 1; }
.ab.cooling { border-color: rgba(120,140,160,0.4); }
.ab .ab-key { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; background: #17293f; padding: 1px 6px; border-radius: 3px; color: var(--blue); letter-spacing: 0.1em; }
.ab .ab-name { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); font-size: 8.5px; letter-spacing: 0.06em; color: #9fc4e8; white-space: nowrap; max-width: 68px; overflow: hidden; text-overflow: ellipsis; }
.ab.flash { animation: abflash 0.3s ease-out; }
@keyframes abflash { 0% { box-shadow: 0 0 26px var(--blue); } }

/* ultimate */
#ult-wrap { left: 50%; bottom: 34px; transform: translateX(-50%); width: 92px; height: 92px; pointer-events: none; }
#ult-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ult-bg { fill: rgba(8,16,30,0.8); stroke: rgba(255,255,255,0.18); stroke-width: 7; }
.ult-fg { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 264; transition: stroke-dashoffset 0.2s; }
#ult-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 21px; font-weight: 800; font-style: italic; text-shadow: 0 2px 3px #000; }
#ult-ready-label { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; color: var(--gold); opacity: 0; }
#ult-wrap.ready #ult-ready-label { opacity: 1; animation: stagpulse 0.5s ease-in-out infinite alternate; }
#ult-wrap.ready .ult-fg { stroke: #ffe9b0; filter: drop-shadow(0 0 8px var(--gold)); }
#ult-wrap.ready #ult-pct { color: var(--gold); }

/* banners & center messages */
#banner-wrap { top: 22%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
#banner {
  font-size: 54px; font-weight: 800; font-style: italic; letter-spacing: 0.12em;
  text-shadow: 0 4px 0 rgba(0,0,0,0.4), 0 0 40px rgba(56,198,255,0.4); opacity: 0; transform: scale(0.8);
}
#banner.show { animation: bannerin 2.3s ease-out forwards; }
@keyframes bannerin {
  0% { opacity: 0; transform: scale(1.35); } 10% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.92); }
}
#banner-sub { font-size: 15px; letter-spacing: 0.4em; color: var(--gold); margin-top: 8px; opacity: 0; text-shadow: 0 2px 4px #000; }
#banner-sub.show { animation: bannerin 2.3s ease-out forwards; }
#center-msg { top: 58%; left: 0; right: 0; text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 0.14em; color: var(--gold); text-shadow: 0 2px 4px #000; pointer-events: none; }

/* hero reference card */
#hero-card {
  right: 26px; top: 50%; transform: translateY(-50%); width: 320px; background: var(--panel);
  border: 1px solid rgba(56,198,255,0.3); border-top: 3px solid var(--gold); padding: 18px 20px; pointer-events: none;
}
#hero-card h3 { font-style: italic; letter-spacing: 0.1em; margin-bottom: 4px; }
#hero-card .hc-ep { color: var(--gold); font-size: 11px; letter-spacing: 0.2em; margin-bottom: 12px; }
#hero-card .hd-ab { margin-bottom: 8px; }

/* respawn overlay */
#respawn-overlay {
  inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(20,4,8,0.35), rgba(10,2,4,0.82)); pointer-events: none;
}
.respawn-title { font-size: 58px; font-weight: 800; font-style: italic; letter-spacing: 0.16em; color: var(--red); text-shadow: 0 4px 0 rgba(0,0,0,0.5), 0 0 44px rgba(255,60,60,0.4); }
.respawn-by { margin-top: 10px; font-size: 17px; color: #f0d7d7; letter-spacing: 0.1em; }
.respawn-by b { color: var(--red); }
.respawn-count { margin-top: 32px; font-size: 16px; letter-spacing: 0.3em; color: #cfe3f7; }
.respawn-count b { color: var(--gold); font-size: 26px; }
.respawn-tip { margin-top: 20px; font-size: 13px; color: #90a8c4; font-style: italic; max-width: 460px; text-align: center; line-height: 1.6; }

/* scoreboard */
#scoreboard {
  left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(920px, 92vw);
  background: rgba(6,12,24,0.92); border: 1px solid rgba(56,198,255,0.3); border-top: 4px solid var(--gold);
  padding: 22px 28px; pointer-events: none; z-index: 15;
}
.sb-title { text-align: center; font-size: 19px; font-weight: 800; letter-spacing: 0.3em; margin-bottom: 16px; font-style: italic; }
.sb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sb-head { font-size: 14px; font-weight: 800; letter-spacing: 0.24em; padding: 7px 12px; margin-bottom: 8px; }
.sb-head.blue { background: rgba(56,198,255,0.16); color: var(--blue); border-left: 4px solid var(--blue); }
.sb-head.red { background: rgba(255,90,90,0.14); color: var(--red); border-left: 4px solid var(--red); }
.sb-row { display: grid; grid-template-columns: 26px 1fr 34px 34px 52px 52px 42px; align-items: center; gap: 6px; padding: 5px 12px; font-size: 13px; }
.sb-row.hdr { color: #7d97b5; font-size: 10px; letter-spacing: 0.14em; }
.sb-row.me { background: rgba(255,182,61,0.12); }
.sb-row.dead .sbname { color: #7d8ba0; text-decoration: line-through; }
.sb-row .sbicon { width: 20px; height: 20px; border-radius: 4px; overflow: hidden; }
.sb-row .sbicon canvas { width: 100%; height: 100%; display: block; }
.sb-row b { font-weight: 800; }
.sb-hint { margin-top: 14px; text-align: center; font-size: 11px; color: #7d97b5; letter-spacing: 0.1em; }

/* pause */
#pause-menu { inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4,8,16,0.72); backdrop-filter: blur(5px); pointer-events: auto; z-index: 30; }

/* end screen */
#screen-end {
  background: radial-gradient(ellipse at 50% 30%, rgba(56,198,255,0.12), transparent 60%), linear-gradient(180deg, #0a1626, #142a46);
  z-index: 25;
}
#end-word { font-size: clamp(64px, 12vw, 140px); font-weight: 800; font-style: italic; letter-spacing: 0.1em; animation: endin 0.7s cubic-bezier(0.2, 1.6, 0.4, 1); }
#end-word.win { color: var(--gold); text-shadow: 0 6px 0 rgba(0,0,0,0.4), 0 0 70px rgba(255,182,61,0.55); }
#end-word.lose { color: #8fa5c0; text-shadow: 0 6px 0 rgba(0,0,0,0.4), 0 0 40px rgba(80,110,150,0.5); }
@keyframes endin { from { transform: scale(1.6); opacity: 0; } }
#end-sub { font-size: 16px; letter-spacing: 0.4em; color: #cfe3f7; margin: 6px 0 30px; }
#end-stats { display: flex; gap: 34px; margin-bottom: 18px; }
.endstat { text-align: center; background: rgba(10,21,38,0.85); border-top: 3px solid var(--blue); padding: 14px 26px; min-width: 120px; }
.endstat .es-v { font-size: 32px; font-weight: 800; font-style: italic; }
.endstat .es-l { font-size: 10px; letter-spacing: 0.24em; color: #9fc4e8; margin-top: 4px; }
#end-potg { margin-bottom: 30px; font-size: 14px; color: var(--gold); letter-spacing: 0.12em; min-height: 20px; }

/* toast + fade */
#toast {
  position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%);
  background: rgba(8,16,30,0.9); border-left: 3px solid var(--gold); padding: 10px 22px;
  font-size: 14px; letter-spacing: 0.08em; opacity: 0; transition: opacity 0.25s; pointer-events: none; z-index: 50;
}
#toast.show { opacity: 1; }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.45s; z-index: 60; }
#fade.on { opacity: 1; }

/* ult activation flash */
#hud.ultflash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,220,140,0.35), transparent 70%);
  animation: ultflash 0.7s ease-out forwards;
}
@keyframes ultflash { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: repeat(2, 140px); }
  .panel.wide { min-width: unset; width: 92vw; }
  .controls-grid { grid-template-columns: 1fr; }
}
