/* ==========================================================================
   Overwatch Hero Minigames — shared shell, HUD and touch styles
   ========================================================================== */
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: italic; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-italic.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: italic; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-italic.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: italic; font-display: swap; src: url(../fonts/barlow-condensed-latin-800-italic.woff2) format('woff2'); }
@font-face { font-family: 'Big Shoulders Display'; font-weight: 800; font-display: swap; src: url(../fonts/big-shoulders-display-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Big Shoulders Display'; font-weight: 900; font-display: swap; src: url(../fonts/big-shoulders-display-latin-900-normal.woff2) format('woff2'); }

:root {
  --hero: #f8911b;
  --hero2: #ffd23f;
  --ink: #0b0e1a;
  --ink2: #141a2e;
  --panel: rgba(12, 17, 34, 0.78);
  --line: rgba(255, 255, 255, 0.16);
  --txt: #f4f6fb;
  --dim: #a9b2c9;
  --ow: #f99e1a;
  --blue: #3fb6ff;
  --red: #ff4655;
  --good: #7cf29a;
  --ui: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --disp: 'Big Shoulders Display', 'Barlow Condensed', Impact, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--txt); font-family: var(--ui); -webkit-font-smoothing: antialiased; }
body { overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#ui > div { position: absolute; inset: 0; }
#overlay > *, #hub-layer > * { pointer-events: auto; }
#overlay[data-state="playing"], #overlay[data-state="countdown"], #overlay[data-state="potg"] { pointer-events: none; }
#fade { background: var(--ink); opacity: 0; transition: opacity .28s ease; pointer-events: none; z-index: 50; }
#fade.on { opacity: 1; }

button { font-family: var(--ui); }
.kbd { display: inline-block; min-width: 1.7em; padding: 1px 7px; border: 1px solid rgba(255,255,255,.35); border-bottom-width: 3px; border-radius: 6px; font-weight: 700; font-size: .82em; letter-spacing: .04em; background: rgba(255,255,255,.08); text-align: center; line-height: 1.35; font-style: normal; }
.kbd.touch { border-color: var(--hero); color: var(--hero); }
.or { font-style: italic; opacity: .55; margin: 0 6px; font-size: .85em; }

/* ---------- buttons ---------- */
.btn {
  pointer-events: auto; cursor: pointer; border: 0; color: #fff; background: rgba(255,255,255,.1);
  font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: .04em; padding: 12px 22px; min-height: 48px;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: transform .12s ease, background .15s ease, filter .15s;
  display: inline-flex; align-items: center; gap: 10px; text-transform: uppercase;
}
.btn:hover, .btn:focus-visible { background: rgba(255,255,255,.2); transform: translateY(-2px); outline: none; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: var(--hero); color: #111; text-shadow: none; }
.btn.primary .kbd { border-color: rgba(0,0,0,.4); background: rgba(0,0,0,.12); }
.btn.primary:hover { filter: brightness(1.12); background: var(--hero); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); clip-path: none; border-radius: 4px; }

.toggle { pointer-events: auto; cursor: pointer; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--dim); font-weight: 600; font-size: 16px; padding: 8px 12px; border-radius: 6px; min-height: 40px; }
.toggle.on { color: #fff; border-color: var(--hero); background: color-mix(in srgb, var(--hero) 22%, transparent); }
.slider { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--dim); font-size: 16px; }
.slider input { accent-color: var(--hero); width: 110px; }

/* ---------- loading / error ---------- */
.loading-card, .error-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
.lc-logo { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%; border: 8px solid var(--hero); border-right-color: transparent; animation: spin 0.8s linear infinite; }
.lc-text { font-weight: 800; font-style: italic; font-size: 26px; letter-spacing: .06em; text-transform: uppercase; }
.error-card { background: var(--panel); padding: 28px; border: 2px solid var(--red); max-width: 90vw; }
.error-card pre { white-space: pre-wrap; color: var(--dim); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- title card ---------- */
.title-card, .pause-card, .results {
  position: absolute; left: clamp(12px, 5vw, 64px); top: 50%; transform: translateY(-50%);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 28px 24px; background: linear-gradient(135deg, rgba(10,14,30,.9), rgba(10,14,30,.72));
  border-left: 6px solid var(--hero); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 20px 60px rgba(0,0,0,.45); animation: cardIn .45s cubic-bezier(.2,1.2,.3,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translate(-40px, -50%) skewX(-4deg); } to { opacity: 1; transform: translate(0, -50%); } }
.tc-top { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; background: var(--hero); color: #111; font-weight: 800; font-style: italic; clip-path: polygon(6px 0,100% 0,calc(100% - 6px) 100%,0 100%); }
.role-ico { width: 16px; height: 16px; }
.tc-hero { font-size: 18px; color: #fff; }
.tc-title { margin: 6px 0 0; font-family: var(--disp); font-weight: 900; font-size: clamp(48px, 9vw, 86px); line-height: .9; letter-spacing: .01em; text-transform: uppercase; color: #fff; text-shadow: 4px 4px 0 color-mix(in srgb, var(--hero) 70%, #000); }
.tc-tag { font-style: italic; font-weight: 700; font-size: 22px; color: var(--hero); margin-top: 6px; }
.tc-goal { font-size: 18px; line-height: 1.35; color: #dfe4f2; font-weight: 500; margin: 12px 0 14px; }
.controls { width: 100%; border-collapse: collapse; font-size: 16px; margin-bottom: 12px; }
.controls td { padding: 5px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.controls .c-act { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); width: 38%; padding-right: 10px; }
.controls .c-keys { text-align: right; }
.tc-ult { font-size: 16px; color: #e8ecf8; background: color-mix(in srgb, var(--hero) 16%, transparent); border: 1px solid color-mix(in srgb, var(--hero) 50%, transparent); padding: 8px 12px; margin-bottom: 12px; }
.tc-ult b { color: var(--hero); font-style: italic; letter-spacing: .05em; margin-right: 6px; }
.tc-best { font-weight: 700; letter-spacing: .12em; color: var(--dim); margin-bottom: 14px; }
.tc-best b { color: #fff; font-size: 22px; margin-left: 6px; }
.tc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ---------- countdown ---------- */
.countdown { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.cd-num { font-family: var(--disp); font-weight: 900; font-size: clamp(110px, 22vw, 220px); line-height: 1; color: #fff; text-shadow: 0 0 40px var(--hero), 6px 6px 0 color-mix(in srgb, var(--hero) 70%, #000); }
.cd-num.pop { animation: cdPop .9s ease-out both; }
@keyframes cdPop { 0% { transform: scale(2.2); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(.85); opacity: 0; } }
.cd-sub { font-weight: 800; font-style: italic; font-size: 24px; letter-spacing: .2em; color: var(--hero); }

/* ---------- pause ---------- */
.pause-btn { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(10,14,30,.5); color: #fff; font-size: 16px; cursor: pointer; pointer-events: auto; z-index: 5; }
.pause-card h2 { margin: 0; font-family: var(--disp); font-size: 64px; line-height: 1; letter-spacing: .04em; }
.pc-title { color: var(--hero); font-weight: 800; font-style: italic; font-size: 20px; margin-bottom: 12px; letter-spacing: .08em; }
.settings-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 6px 0 14px; }

/* ---------- play of the game ---------- */
.potg { position: absolute; inset: 0; pointer-events: none; }
.potg::before, .potg::after { content: ''; position: absolute; left: 0; right: 0; height: 11vh; background: #000; animation: bars .5s ease-out both; }
.potg::before { top: 0; } .potg::after { bottom: 0; }
@keyframes bars { from { transform: scaleY(0); } }
.potg-bar { position: absolute; left: clamp(16px, 6vw, 80px); bottom: calc(11vh + 24px); animation: potgIn .6s .2s cubic-bezier(.2,1.3,.3,1) both; }
.potg-label { font-weight: 800; font-style: italic; letter-spacing: .25em; color: var(--ow); font-size: clamp(16px, 2.4vw, 24px); }
.potg-name { font-family: var(--disp); font-weight: 900; font-size: clamp(56px, 11vw, 120px); line-height: .9; text-transform: uppercase; text-shadow: 5px 5px 0 color-mix(in srgb, var(--hero) 80%, #000); }
.potg-sub { font-weight: 700; font-style: italic; font-size: clamp(18px, 2.6vw, 28px); color: var(--hero); }
@keyframes potgIn { from { opacity: 0; transform: translateX(-80px) skewX(-10deg); } }

/* ---------- results ---------- */
.results { text-align: left; }
.rs-title { font-family: var(--disp); font-weight: 900; font-size: clamp(64px, 12vw, 110px); line-height: .9; letter-spacing: .02em; }
.results.won .rs-title { color: var(--ow); text-shadow: 0 0 30px rgba(249,158,26,.45); }
.results.lost .rs-title { color: var(--red); text-shadow: 0 0 30px rgba(255,70,85,.35); }
.rs-reason { font-weight: 600; font-size: 20px; color: #dfe4f2; margin: 4px 0 14px; }
.rs-score { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rs-label { font-weight: 700; letter-spacing: .12em; color: var(--dim); }
.rs-value { font-family: var(--disp); font-weight: 900; font-size: 58px; color: #fff; line-height: 1; }
.rs-new { font-weight: 800; font-style: italic; color: #111; background: var(--hero); padding: 3px 10px; letter-spacing: .08em; animation: pulse 1s ease-in-out infinite alternate; }
.rs-best { font-weight: 700; color: var(--dim); letter-spacing: .08em; }
.rs-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin: 12px 0; }
.rs-stat { display: flex; justify-content: space-between; gap: 8px; font-size: 17px; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.rs-stat span { color: var(--dim); font-weight: 600; } .rs-stat b { color: #fff; }
.rs-quote { font-style: italic; font-weight: 600; font-size: 19px; color: var(--hero); margin: 6px 0 12px; }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }

/* ---------- subtitle ---------- */
#subtitle { top: auto !important; bottom: calc(150px + var(--safe-b)) !important; left: 50% !important; right: auto !important; transform: translateX(-50%); max-width: min(90vw, 700px); text-align: center; font-size: 20px; font-weight: 600; padding: 6px 14px; background: rgba(0,0,0,.55); border-radius: 4px; opacity: 0; transition: opacity .3s; pointer-events: none; }
#subtitle b { color: var(--hero); }
#subtitle.show { opacity: 1; }

/* ==========================================================================
   HUD
   ========================================================================== */
.hud { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s; font-weight: 700; text-shadow: 0 2px 4px rgba(0,0,0,.5); }
.hud.live { opacity: 1; }
.hud > div { position: absolute; display: flex; flex-direction: column; gap: 8px; }
.hud-tl { top: calc(14px + var(--safe-t)); left: 16px; align-items: flex-start; }
.hud-tc { top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); align-items: center; }
.hud-tr { top: calc(70px + var(--safe-t)); right: 16px; align-items: flex-end; }
.hud-bl { bottom: calc(18px + var(--safe-b)); left: 18px; align-items: flex-start; }
.hud-bc { bottom: calc(14px + var(--safe-b)); left: 50%; transform: translateX(-50%); align-items: center; }
.hud-br { bottom: calc(18px + var(--safe-b)); right: 18px; align-items: flex-end; }
.hud-center { left: 50%; top: 50%; width: 0; height: 0; }
.hud-callouts { left: 50%; top: 26%; transform: translateX(-50%); align-items: center; width: 90vw; }

.hud-score { text-align: center; transform-origin: 50% 0; }
.hs-label { font-size: 14px; letter-spacing: .2em; color: var(--dim); }
.hs-value { font-family: var(--disp); font-weight: 900; font-size: 44px; line-height: 1; color: #fff; }
.hud-score.bump .hs-value { animation: bump .25s ease-out; }
.hs-mult { font-style: italic; font-weight: 800; color: var(--hero); font-size: 20px; opacity: 0; transition: opacity .2s; }
.hs-mult.on { opacity: 1; }
@keyframes bump { 40% { transform: scale(1.18); color: var(--hero); } }

.hud-timer { text-align: center; }
.ht-label { font-size: 13px; letter-spacing: .2em; color: var(--dim); }
.ht-value { font-family: var(--disp); font-weight: 900; font-size: 34px; line-height: 1; }
.hud-timer.urgent .ht-value { color: var(--red); animation: pulse .5s infinite alternate; }

.hud-ult { position: relative; width: 104px; height: 104px; display: flex; align-items: center; justify-content: center; }
.hud-ult svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.hud-ult .u-bg { fill: rgba(10,14,30,.55); stroke: rgba(255,255,255,.18); stroke-width: 8; }
.hud-ult .u-fg { fill: none; stroke: var(--hero); stroke-width: 8; stroke-linecap: butt; stroke-dasharray: 0 100; transition: stroke-dasharray .2s; filter: drop-shadow(0 0 6px var(--hero)); }
.u-inner { position: relative; text-align: center; }
.u-pct { font-family: var(--disp); font-weight: 900; font-size: 28px; line-height: 1; }
.u-icon { font-size: 18px; }
.u-key { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); background: #fff; color: #111; font-size: 13px; padding: 0 8px; border-radius: 3px; font-weight: 800; }
.u-name { position: absolute; top: -18px; white-space: nowrap; font-size: 12px; letter-spacing: .16em; color: var(--dim); }
.hud-ult.ready .u-pct { color: var(--hero); font-size: 22px; }
.hud-ult.ready svg { filter: drop-shadow(0 0 14px var(--hero)); }
.hud-ult.ready .u-bg { fill: color-mix(in srgb, var(--hero) 25%, rgba(10,14,30,.6)); }
.hud-ult.pulse { animation: ultPulse .8s ease-out; }
.hud-ult.ready { animation: ultGlow 1.2s ease-in-out infinite alternate; }
.hud-ult.active { animation: none; transform: scale(1.1); }
@keyframes ultPulse { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes ultGlow { to { transform: scale(1.06); } }

.abilities { display: flex; gap: 10px; }
.hud-ability { position: relative; width: 64px; text-align: center; }
.ab-box { position: relative; width: 60px; height: 60px; margin: 0 auto; background: rgba(10,14,30,.6); border: 2px solid rgba(255,255,255,.55); transform: skewX(-10deg); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ab-icon { font-size: 28px; transform: skewX(10deg); }
.ab-icon svg { width: 34px; height: 34px; }
.ab-cd { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: rgba(0,0,0,.65); }
.ab-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--disp); font-weight: 900; font-size: 24px; transform: skewX(10deg); }
.ab-charges { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; transform: skewX(10deg); }
.ab-charges i { width: 9px; height: 5px; background: rgba(255,255,255,.25); }
.ab-charges i.on { background: var(--hero); box-shadow: 0 0 6px var(--hero); }
.ab-key { display: inline-block; margin-top: 4px; font-size: 12px; background: rgba(255,255,255,.9); color: #111; padding: 0 6px; border-radius: 3px; }
.ab-name { font-size: 12px; letter-spacing: .08em; color: var(--dim); text-transform: uppercase; }
.hud-ability.cooling .ab-box { border-color: rgba(255,255,255,.2); }
.hud-ability.cooling .ab-icon { opacity: .4; }
.hud-ability.active .ab-box { border-color: var(--hero); box-shadow: 0 0 14px var(--hero); background: color-mix(in srgb, var(--hero) 30%, rgba(10,14,30,.6)); }
.hud-ability.flash .ab-box { animation: abFlash .4s ease-out; }
@keyframes abFlash { 0% { background: #fff; } }

.hud-health { min-width: 240px; }
.hh-label { font-size: 14px; letter-spacing: .16em; color: var(--dim); }
.hh-bar { position: relative; height: 18px; width: 260px; max-width: 42vw; background: rgba(10,14,30,.6); transform: skewX(-14deg); border: 1px solid rgba(255,255,255,.25); overflow: hidden; }
.hh-fill, .hh-lag { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; }
.hh-fill { background: var(--hh, #fff); transition: width .08s; }
.hh-lag { background: #ff5b5b; transition: width .6s .25s; }
.hh-segs { position: absolute; inset: 0; background-image: linear-gradient(90deg, transparent calc(100% - 2px), rgba(10,14,30,.8) 0); }
.hh-num { font-family: var(--disp); font-weight: 900; }
.hh-num b { font-size: 30px; } .hh-num span { color: var(--dim); font-size: 16px; margin-left: 4px; }
.hud-health.low .hh-fill { background: var(--red); animation: pulse .4s infinite alternate; }

.hud-meter { min-width: 180px; }
.hm-label { font-size: 13px; letter-spacing: .16em; color: var(--dim); }
.hm-bar { height: 10px; width: 200px; max-width: 40vw; background: rgba(10,14,30,.6); border: 1px solid rgba(255,255,255,.25); transform: skewX(-14deg); overflow: hidden; }
.hm-fill { height: 100%; width: 0; background: var(--hm, var(--hero)); transition: width .15s; }
.hm-text { font-size: 15px; }
.hud-label { font-size: 18px; padding: 3px 10px; background: rgba(10,14,30,.5); border-left: 3px solid var(--hero); }

.killfeed { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.kf-row { display: flex; align-items: center; gap: 8px; padding: 3px 10px; background: rgba(10,14,30,.7); font-size: 16px; animation: kfIn .25s ease-out; border-right: 3px solid var(--hero); transition: opacity .5s, transform .5s; }
.kf-row.out { opacity: 0; transform: translateX(20px); }
.kf-l.me { color: var(--hero); } .kf-r { color: var(--red); }
.kf-row.heal .kf-r { color: var(--good); }
.kf-g { font-size: 18px; color: #fff; }
.kf-crit { color: #ffda3d; font-style: normal; margin-left: 2px; }
@keyframes kfIn { from { transform: translateX(40px); opacity: 0; } }

.callout { text-align: center; animation: coIn .35s cubic-bezier(.2,1.4,.4,1) both; transition: opacity .5s, transform .5s; }
.callout.out { opacity: 0; transform: translateY(-20px); }
.co-main { font-weight: 800; font-style: italic; font-size: clamp(22px, 3.6vw, 36px); letter-spacing: .04em; text-transform: uppercase; color: var(--cc, #fff); text-shadow: 0 0 16px rgba(0,0,0,.6), 3px 3px 0 rgba(0,0,0,.35); }
.co-sub { font-weight: 700; font-size: 17px; letter-spacing: .14em; color: var(--dim); text-transform: uppercase; }
.callout.big .co-main { font-family: var(--disp); font-style: normal; font-weight: 900; font-size: clamp(46px, 9vw, 104px); line-height: .95; }
.callout.ult .co-main { color: var(--cc, var(--hero)); text-shadow: 0 0 30px var(--hero), 5px 5px 0 rgba(0,0,0,.45); }
@keyframes coIn { from { transform: scale(1.8); opacity: 0; } }

.hud-medal { position: absolute; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 8px; background: linear-gradient(90deg, var(--hero), color-mix(in srgb, var(--hero) 40%, transparent)); color: #111; font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: .05em; text-transform: uppercase; animation: medalIn .4s cubic-bezier(.2,1.4,.4,1) both; transition: opacity .5s; text-shadow: none; clip-path: polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%); }
.hud-medal i { font-style: normal; background: #111; color: var(--hero); width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.hud-medal.out { opacity: 0; }
@keyframes medalIn { from { transform: translate(-50%, 30px) scale(.6); opacity: 0; } }

/* crosshair + hitmarker */
.crosshair { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); }
.crosshair.ch-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.crosshair.ch-cross { width: 26px; height: 26px; background:
  linear-gradient(#fff,#fff) center/2px 9px no-repeat, linear-gradient(#fff,#fff) center/9px 2px no-repeat; }
.crosshair.ch-cross::before { content: ''; position: absolute; inset: 0; background:
  linear-gradient(#fff,#fff) 50% 0/2px 8px no-repeat, linear-gradient(#fff,#fff) 50% 100%/2px 8px no-repeat,
  linear-gradient(#fff,#fff) 0 50%/8px 2px no-repeat, linear-gradient(#fff,#fff) 100% 50%/8px 2px no-repeat; filter: drop-shadow(0 0 1px #000); }
.crosshair.ch-circle { width: 34px; height: 34px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
.crosshair.ch-circle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; background: #fff; border-radius: 50%; }
.crosshair.ch-none { display: none; }
.hitmarker { position: absolute; left: 0; top: 0; width: 30px; height: 30px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; background:
  linear-gradient(#fff,#fff) 50% 0/2px 9px no-repeat, linear-gradient(#fff,#fff) 50% 100%/2px 9px no-repeat,
  linear-gradient(#fff,#fff) 0 50%/9px 2px no-repeat, linear-gradient(#fff,#fff) 100% 50%/9px 2px no-repeat; }
.hitmarker.show { animation: hm .22s ease-out; }
.hitmarker.crit { background:
  linear-gradient(var(--red),var(--red)) 50% 0/3px 11px no-repeat, linear-gradient(var(--red),var(--red)) 50% 100%/3px 11px no-repeat,
  linear-gradient(var(--red),var(--red)) 0 50%/11px 3px no-repeat, linear-gradient(var(--red),var(--red)) 100% 50%/11px 3px no-repeat; }
@keyframes hm { 0% { opacity: 1; transform: translate(-50%,-50%) rotate(45deg) scale(1.4); } 100% { opacity: 0; transform: translate(-50%,-50%) rotate(45deg) scale(1); } }

/* screen fx */
.fx-flash { position: absolute; inset: 0; opacity: 0; pointer-events: none; mix-blend-mode: screen; }
.fx-vignette { position: absolute; inset: 0; pointer-events: none; }
.fx-pop { position: absolute; left: 0; top: 0; font-weight: 800; font-style: italic; font-size: 22px; color: #fff; white-space: nowrap; pointer-events: none; text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 8px rgba(0,0,0,.4); will-change: transform; }
.fx-pop.crit { color: #ffda3d; font-size: 28px; }
.fx-pop.heal { color: #ffe98a; }
.fx-pop.bad { color: var(--red); }
.fx-pop.gold { color: var(--ow); font-size: 30px; }
.fx-pop.hero { color: var(--hero); font-size: 26px; }

/* ==========================================================================
   Touch controls
   ========================================================================== */
#touch-layer { z-index: 3; }
.touch-root { position: absolute; inset: 0; display: none; }
.touch-root.show { display: block; }
#touch-layer:not(.live) .touch-root { display: none; }
.touch-root > * { pointer-events: auto; }
.touch-stick { position: absolute; bottom: calc(26px + var(--safe-b)); width: 150px; height: 150px; touch-action: none; }
.touch-stick.left { left: 18px; } .touch-stick.right { right: 18px; }
.ts-ring { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.08), rgba(255,255,255,.02)); border: 2px solid rgba(255,255,255,.35); touch-action: none; }
.ts-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: color-mix(in srgb, var(--hero) 70%, rgba(255,255,255,.3)); box-shadow: 0 0 16px color-mix(in srgb, var(--hero) 60%, transparent); transition: transform .05s; }
.ts-arrow { position: absolute; font-size: 13px; color: rgba(255,255,255,.55); }
.ts-arrow.u { top: 6px; left: 50%; transform: translateX(-50%); } .ts-arrow.d { bottom: 6px; left: 50%; transform: translateX(-50%); }
.ts-arrow.l { left: 8px; top: 50%; transform: translateY(-50%); } .ts-arrow.r { right: 8px; top: 50%; transform: translateY(-50%); }
.ts-label { position: absolute; top: -22px; width: 100%; text-align: center; font-weight: 800; font-size: 13px; letter-spacing: .14em; color: rgba(255,255,255,.75); }
.ts-hint { position: absolute; bottom: -18px; width: 100%; text-align: center; font-size: 11px; color: rgba(255,255,255,.55); }
.touch-btn { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(10,14,30,.45); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; touch-action: none; padding: 0; --btn: var(--hero); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--btn) 40%, transparent); }
.touch-btn.down { background: color-mix(in srgb, var(--btn) 55%, rgba(10,14,30,.5)); transform: scale(.94); }
.touch-btn.active { border-color: var(--btn); box-shadow: 0 0 18px var(--btn), inset 0 0 0 3px var(--btn); }
.tb-icon { font-size: 22px; line-height: 1; position: relative; z-index: 1; }
.tb-label { font-weight: 800; font-size: 11px; letter-spacing: .06em; position: relative; z-index: 1; text-transform: uppercase; }
.tb-key { display: none; }
.tb-cd { position: absolute; inset: 0; border-radius: 50%; z-index: 2; display: flex; align-items: center; justify-content: center; font-family: var(--disp); font-weight: 900; font-size: 22px; background: conic-gradient(rgba(0,0,0,.65) calc(var(--cd, 0) * 360deg), transparent 0); pointer-events: none; }
.touch-btn.cooling { border-color: rgba(255,255,255,.2); }
.touch-dpad { position: absolute; display: flex; gap: 12px; flex-wrap: wrap; width: auto; }
.touch-dpad .touch-btn { position: relative; }
.touch-dpad[data-dirs~="up"] { display: grid; grid-template-columns: repeat(3, auto); grid-template-rows: repeat(3, auto); gap: 4px; }
.touch-dpad .dpad-up { grid-column: 2; grid-row: 1; } .touch-dpad .dpad-left { grid-column: 1; grid-row: 2; }
.touch-dpad .dpad-right { grid-column: 3; grid-row: 2; } .touch-dpad .dpad-down { grid-column: 2; grid-row: 3; }

/* On touch devices the on-screen buttons carry cooldowns, so desktop ability boxes shrink away. */
.is-touch .hud-br .abilities { display: none; }
.is-touch .hud-bc { bottom: calc(10px + var(--safe-b)); }
.is-touch .hud-ult { width: 78px; height: 78px; }
.is-touch .hud-ult .u-pct { font-size: 20px; }
.is-touch .hud-bl { bottom: auto; top: calc(66px + var(--safe-t)); }
.is-touch .hud-health .hh-bar { width: 170px; }
.is-touch .hud-tr { top: calc(66px + var(--safe-t)); }
.is-touch #subtitle { bottom: calc(210px + var(--safe-b)) !important; }
.is-touch .hud-medal { bottom: calc(200px + var(--safe-b)); }

/* ==========================================================================
   Small screens
   ========================================================================== */
@media (max-width: 720px) {
  .title-card, .pause-card, .results { left: 50%; top: auto; bottom: 8px; transform: translateX(-50%); padding: 18px 16px 16px; max-height: calc(100dvh - 16px); animation: sheetIn .4s cubic-bezier(.2,1.2,.3,1) both; border-left: 0; border-top: 5px solid var(--hero); }
  @keyframes sheetIn { from { opacity: 0; transform: translate(-50%, 60px); } to { opacity: 1; transform: translate(-50%, 0); } }
  .tc-goal { font-size: 16px; margin: 8px 0 10px; }
  .controls { font-size: 14px; }
  .btn { font-size: 17px; padding: 10px 16px; }
  .hs-value { font-size: 34px; }
  .hud-ult { width: 80px; height: 80px; }
  .ab-box { width: 48px; height: 48px; } .hud-ability { width: 52px; }
  .hud-tr { top: calc(64px + var(--safe-t)); right: 8px; }
  .kf-row { font-size: 13px; }
  .hud-health { min-width: 0; }
  .hh-bar { width: 170px; }
  #subtitle { font-size: 16px; }
}
@media (max-height: 520px) {
  .title-card, .pause-card, .results { top: 8px; bottom: 8px; transform: none; left: 12px; max-height: none; animation: fadeIn .3s ease both; }
  @keyframes fadeIn { from { opacity: 0; } }
  .tc-title { font-size: 44px; }
  .rs-title { font-size: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
