:root {
  --bg: #000;
  --panel: rgba(4, 10, 14, 0.72);
  --line: rgba(61, 245, 255, 0.18);
  --text: #d8f6ff;
  --muted: #6d8a96;
  --accent: #3df5ff;
  --good: #6bffb0;
  --bad: #ff4d6d;
  --warn: #ffb627;
  --font: 'Rajdhani', 'Segoe UI', 'Noto Sans', 'Microsoft YaHei', 'Yu Gothic UI', 'Malgun Gothic', 'Nirmala UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', Consolas, 'Microsoft YaHei', monospace;
  --ui: 1;
  --divine: #ffe680;
}

* { box-sizing: border-box; }
/* Letter-spacing breaks the joined letters of Devanagari, Arabic and Hebrew. */
html:lang(hi) *, html:lang(ar) *, html:lang(he) * { letter-spacing: 0 !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; user-select: none; }
#view, #view canvas { position: fixed; inset: 0; display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; box-shadow: 0 0 8px currentColor; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 15px; letter-spacing: 0.06em;
  color: var(--text); background: rgba(61, 245, 255, 0.06); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(61, 245, 255, 0.14); box-shadow: 0 0 14px rgba(61, 245, 255, 0.25); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: rgba(61, 245, 255, 0.16); border-color: var(--accent); color: #fff; font-size: 20px; }
.btn.primary b { display: block; font-weight: 700; }
.btn.primary span { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0.1em; font-weight: 500; }
.btn.primary.outbreak { background: linear-gradient(90deg, rgba(140, 255, 46, 0.18), rgba(61, 245, 255, 0.12)); border-color: #8cff2e; }
.btn.primary.outbreak:hover { box-shadow: 0 0 14px rgba(140, 255, 46, 0.35); }
.btn.small { padding: 5px 11px; font-size: 13px; }
.btn.primary.teams { background: linear-gradient(90deg, rgba(77, 155, 255, 0.22), rgba(255, 77, 109, 0.22)); border-color: #b07cff; }
.btn.primary.teams:hover { box-shadow: 0 0 14px rgba(176, 124, 255, 0.35); }
.btn.primary.infinite { background: linear-gradient(90deg, rgba(242, 193, 78, 0.2), rgba(255, 155, 61, 0.2)); border-color: #f2c14e; }
.btn.primary.infinite:hover { box-shadow: 0 0 14px rgba(242, 193, 78, 0.35); }
#team-bar { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; margin-top: 4px; font-family: var(--mono); }
#allies-box { margin-bottom: 10px; }
.contact.dead { opacity: 0.4; text-decoration: line-through; }
.team-score { font-family: var(--mono); font-size: 15px; margin: 4px 0; }
#rank-table tr.team-0 td:first-child { box-shadow: inset 3px 0 0 #4d9bff; }
#rank-table tr.team-1 td:first-child { box-shadow: inset 3px 0 0 #ff4d6d; }
.btn.tiny { padding: 2px 8px; font-size: 12px; margin-left: auto; }
.btn.active { border-color: var(--accent); color: #fff; background: rgba(61, 245, 255, 0.2); }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; }
.screen.dim { background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(3px); }
.dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 28px 34px; display: flex; flex-direction: column; gap: 12px; min-width: 320px; text-align: center; }
.dialog h2 { margin: 0 0 6px; letter-spacing: 0.15em; }

#menu { background: radial-gradient(ellipse at center, rgba(61, 245, 255, 0.07), transparent 60%); overflow-y: auto; align-items: safe center; padding: 16px 0; }
.menu-inner { display: flex; flex-direction: column; align-items: stretch; gap: 11px; width: min(480px, calc(100vw - 32px)); text-align: center; zoom: var(--ui); margin: auto 0; }
.logo { font-size: 72px; margin: 0; letter-spacing: 0.32em; font-weight: 700; padding-left: 0.32em; color: #fff; text-shadow: 0 0 18px var(--accent), 0 0 48px rgba(61, 245, 255, 0.5); }
.tagline { margin: -10px 0 6px; color: var(--muted); letter-spacing: 0.25em; text-transform: uppercase; font-size: 13px; }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.row.end { justify-content: flex-end; margin-top: 14px; }
.row.end .btn { flex: none; }
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.play-grid .btn.primary { padding: 11px 10px; font-size: 18px; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu-grid .btn { padding: 8px 10px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pill { font-style: normal; font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 9px; background: rgba(255, 182, 39, 0.18); color: var(--warn); }
.pill.done { background: rgba(107, 255, 176, 0.15); color: var(--good); }
.pill:empty { display: none; }
#btn-quit { padding: 8px; }
.divinas { color: var(--divine); font-family: var(--mono); text-shadow: 0 0 8px rgba(255, 230, 128, 0.4); white-space: nowrap; }
.divinas.big { font-size: 24px; }
.divinas.big span { font-size: 12px; color: var(--muted); font-family: var(--font); }

.league-card { display: flex; gap: 16px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-align: left; color: var(--text); font-family: var(--font); cursor: pointer; width: 100%; }
.league-card:hover { border-color: var(--accent); }
.card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; min-width: 92px; }
.card-side .lvl { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; }
.card-side .bar { width: 92px; margin: 0; }
.bar.xp > div { background: var(--divine); }
.league-badge {
  --lc: #8a8f98; width: 62px; height: 62px; flex: none; display: grid; place-items: center; font-size: 26px; font-weight: 700; color: var(--lc);
  border: 2px solid var(--lc); border-radius: 50%; box-shadow: 0 0 16px var(--lc), inset 0 0 14px var(--lc);
}
.league-info { flex: 1; }
.league-name { font-size: 22px; font-weight: 700; letter-spacing: 0.08em; }
.league-cups { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.bar { height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.bar.wide { width: 360px; }
.league-next { font-size: 12px; }

.name-field { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; letter-spacing: 0.08em; }
.name-field input { flex: 1; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--text); font-family: var(--font); font-size: 16px; padding: 7px 10px; border-radius: 6px; outline: none; }
.name-field input:focus { border-color: var(--accent); }

.stats { display: flex; justify-content: space-between; margin-top: 6px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 20px; font-family: var(--mono); }
.stats span { font-size: 11px; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }

.modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.7); }
.modal-box { position: relative; background: #050c10; border: 1px solid var(--line); border-radius: 10px; padding: 24px 30px; width: min(620px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; user-select: text; zoom: var(--ui); }
.modal-box.wide { width: min(880px, calc(100vw - 32px)); }
[dir="rtl"] .modal-close { right: auto; left: 14px; }

/* ---------- menu screens ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0 12px; }
.tab { font-family: var(--font); font-weight: 600; font-size: 14px; letter-spacing: 0.05em; color: var(--muted); background: transparent; border: 1px solid transparent; border-bottom-color: var(--line); padding: 6px 12px; cursor: pointer; }
.tab.active { color: #fff; border-color: var(--line); border-bottom-color: var(--accent); background: rgba(61, 245, 255, 0.08); }
.tabs-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tabs-row .tabs { flex: 1; }
select { font-family: var(--font); font-size: 14px; background: #08141a; color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn { --pc: var(--accent); font-family: var(--font); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; color: var(--pc); background: transparent; border: 1px solid var(--line); border-radius: 18px; padding: 6px 16px; cursor: pointer; }
.pill-btn.active { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 16%, transparent); box-shadow: 0 0 10px color-mix(in srgb, var(--pc) 35%, transparent); color: #fff; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.map-card { text-align: left; font-family: var(--font); color: var(--text); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; cursor: pointer; }
.map-card b { display: block; font-size: 15px; letter-spacing: 0.04em; }
.map-card span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.map-card.active { border-color: var(--accent); background: rgba(61, 245, 255, 0.1); }
.map-card:hover { border-color: var(--accent); }

.prof-head { display: flex; gap: 18px; align-items: center; margin-bottom: 10px; }
.prof-icon { font-size: 56px; width: 84px; height: 84px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; box-shadow: 0 0 18px currentColor, inset 0 0 14px currentColor; flex: none; }
.prof-main { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.prof-name { font-size: 28px; font-weight: 700; letter-spacing: 0.06em; }
.lvl-row { display: flex; align-items: center; gap: 10px; }
.lvl-row .bar { flex: 1; margin: 0; height: 7px; }
.lvl-row .bar > div { background: var(--divine); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stat { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; display: flex; flex-direction: column; }
.stat b { font-family: var(--mono); font-size: 20px; color: #fff; }
.stat span { font-size: 12px; color: var(--muted); letter-spacing: 0.05em; }

.mission { display: grid; grid-template-columns: 1fr 160px auto; gap: 12px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 5px; background: rgba(255, 255, 255, 0.02); }
.mission .bar { margin: 0; height: 6px; }
.mission.done { opacity: 0.6; }
.mission.done .bar > div { background: var(--good); }
.ms-side { font-family: var(--mono); font-size: 12px; white-space: nowrap; text-align: right; }
.bonus { padding: 8px 10px; border: 1px dashed var(--divine); border-radius: 6px; margin-bottom: 6px; font-size: 14px; }
.bonus.done { border-style: solid; color: var(--good); }

.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.challenge { border: 1px solid var(--line); border-radius: 9px; padding: 13px; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(160deg, rgba(255, 230, 128, 0.06), transparent 60%); }
.challenge.done { opacity: 0.6; }
.ch-name { font-size: 19px; font-weight: 700; letter-spacing: 0.05em; color: var(--divine); }
.ch-goal { font-size: 15px; }
.ch-meta { font-size: 13px; }
.ch-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.ch-foot .btn, .ch-foot b { margin-left: auto; }

.shop-head { display: flex; align-items: center; justify-content: space-between; }
.shop-head h2 { margin: 0; }
.shop-grid, .packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 9px; }
.shop-grid.skins { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.shop-grid.icons { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.shop-item { border: 1px solid var(--line); border-radius: 8px; padding: 11px; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; background: rgba(255, 255, 255, 0.02); }
.shop-item.locked { opacity: 0.75; }
.shop-item .btn { margin-top: auto; }
.si-icon { font-size: 38px; line-height: 1.1; }
.si-name { font-weight: 700; font-size: 15px; letter-spacing: 0.04em; }
.si-desc { font-size: 12px; line-height: 1.35; }
.si-own { font-family: var(--mono); font-size: 12px; }
.swatch { width: 100%; height: 34px; border-radius: 6px; box-shadow: 0 0 12px rgba(255, 255, 255, 0.08); }

.settings { display: flex; flex-direction: column; gap: 4px; }
.set-row { display: grid; grid-template-columns: 1fr 220px 58px; align-items: center; gap: 12px; padding: 6px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.set-row select, .set-row .btn { grid-column: 2 / 4; justify-self: start; }
.set-row input[type=checkbox] { grid-column: 2; justify-self: start; width: 18px; height: 18px; accent-color: var(--accent); }
.set-row input[type=range] { accent-color: var(--accent); }
.set-row b { font-family: var(--mono); font-size: 13px; font-weight: 400; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.keycap { font-family: var(--mono); min-width: 64px; }

#rewards { text-align: center; }
#rewards:empty { display: none; }
.rw-main { font-size: 17px; font-weight: 600; }
.rw-line { font-size: 13px; color: var(--muted); }
.rw-line.good { color: var(--good); }
.modal-box h2 { margin-top: 0; letter-spacing: 0.15em; }
.modal-box h3 { margin: 16px 0 4px; color: var(--accent); letter-spacing: 0.1em; }
.modal-box p { margin: 4px 0; line-height: 1.45; font-size: 15px; }
.modal-close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; }
.ladder { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.ladder-row { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 4px; font-weight: 600; }
.ladder-row span:last-child { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.ladder-row.current { background: rgba(61, 245, 255, 0.12); outline: 1px solid var(--accent); }

.loading-text { font-size: 22px; letter-spacing: 0.3em; color: var(--muted); animation: breathe 1.6s infinite; }
@keyframes breathe { 50% { opacity: 0.35; } }

/* ---------- HUD ---------- */
#hud, #ob-hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; zoom: var(--ui); }
#ob-hud .panel, #ob-hud button { pointer-events: auto; }
.ob-off { display: none !important; }
#t-world { font-size: 12px; letter-spacing: 0.12em; margin-top: 2px; }
.toxic { color: #9dff3d; }
#hud-items { position: absolute; right: 14px; bottom: 14px; padding: 8px; display: flex; flex-direction: column; gap: 5px; width: 190px; }
.item { display: flex; align-items: center; gap: 8px; font-family: var(--font); font-weight: 600; font-size: 14px; color: var(--text); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; cursor: pointer; text-align: left; }
.item i { font-style: normal; font-size: 18px; width: 20px; text-align: center; color: var(--divine); }
.item .it-name { flex: 1; }
.item .it-n { font-family: var(--mono); font-size: 12px; }
.item .it-key { font-family: var(--mono); font-size: 10px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; color: var(--muted); }
.item:hover:not(:disabled) { border-color: var(--divine); }
.item:disabled { opacity: 0.4; cursor: default; }
.item.active { border-color: var(--divine); box-shadow: 0 0 12px rgba(255, 230, 128, 0.35); opacity: 1; }
#event-banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; font-size: 44px; font-weight: 700; letter-spacing: 0.12em; text-shadow: 0 0 24px currentColor; color: var(--divine); }
#event-banner.go { animation: sd 5s forwards; }
#tutorial-box { position: absolute; top: 150px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; border-color: var(--divine); box-shadow: 0 0 18px rgba(255, 230, 128, 0.15); }
.tb-step { font-size: 12px; letter-spacing: 0.2em; color: var(--divine); text-transform: uppercase; }
.tb-text { font-size: 17px; line-height: 1.35; }
#tutorial-box .bar > div { background: var(--divine); }
#tutorial-box .btn { align-self: flex-end; margin: 0; }
#ob-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); padding: 8px 20px; text-align: center; }
#ob-timer { font-family: var(--mono); font-size: 32px; color: #fff; }
#ob-count { font-size: 14px; letter-spacing: 0.06em; }
#ob-role { font-size: 15px; margin-top: 2px; }
#ob-bottom { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(560px, calc(100vw - 32px)); }
#ob-help { font-size: 14px; color: var(--muted); text-align: center; }
#ob-bottom .btn { white-space: nowrap; }
#hud .panel, #hud button, #hud input { pointer-events: auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; backdrop-filter: blur(4px); }
.panel-title { font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

#hud-stats { position: absolute; top: 14px; left: 14px; padding: 12px 16px; min-width: 200px; max-width: 280px; }
.nt { font-family: var(--mono); font-size: 32px; font-weight: 600; color: #fff; text-shadow: 0 0 12px rgba(61, 245, 255, 0.6); }
.nt small { font-size: 13px; color: var(--accent); margin-left: 6px; }
.income { font-family: var(--mono); font-size: 13px; color: var(--good); margin-bottom: 8px; }
.kv { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); }
.kv b { font-family: var(--mono); color: var(--text); font-weight: 400; }

#hud-top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; }
#t-phase { font-size: 12px; letter-spacing: 0.35em; color: var(--muted); }
#t-timer { font-family: var(--mono); font-size: 34px; color: #fff; }
#t-alive { font-size: 13px; color: var(--muted); letter-spacing: 0.1em; }
#hud-top.sd #t-phase, #hud-top.sd #t-timer { color: var(--bad); text-shadow: 0 0 12px var(--bad); }

#hud-upgrades { position: absolute; top: 14px; right: 14px; padding: 12px; width: 250px; }
.upgrade { display: block; width: 100%; text-align: left; background: rgba(255, 255, 255, 0.02); border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; margin-bottom: 4px; color: var(--muted); font-family: var(--font); cursor: pointer; }
.upgrade.afford { color: var(--text); border-color: var(--line); }
.upgrade.afford:hover { border-color: var(--accent); background: rgba(61, 245, 255, 0.08); }
.upgrade.maxed { opacity: 0.55; }
.up-head { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; }
.up-head .key { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; }
.up-cost { margin-left: auto; font-family: var(--mono); font-size: 12px; }
.upgrade.afford .up-cost { color: var(--accent); }
.up-desc { font-size: 12px; opacity: 0.8; }
.up-lv { display: flex; gap: 2px; margin-top: 3px; }
.up-lv i { flex: 1 1 0; max-width: 14px; height: 3px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
.up-lv i.on { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

#hud-contacts { position: absolute; top: 200px; left: 14px; padding: 12px; width: 240px; max-height: 380px; overflow-y: auto; }
#contact-list { font-size: 13px; }
.contact { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.contact .c-name { font-weight: 600; }
.contact .c-status { color: var(--muted); font-size: 11px; margin-left: 4px; }
.contact.hostile .c-status { color: var(--bad); }

#hud-feed { position: absolute; left: 14px; bottom: 60px; width: 340px; display: flex; flex-direction: column-reverse; gap: 3px; }
.feed-item { font-size: 14px; background: rgba(0, 0, 0, 0.45); padding: 3px 8px; border-left: 2px solid var(--line); transition: opacity 1s; animation: slidein 0.3s; }
.feed-item.old { opacity: 0.35; }
.tag { font-weight: 700; }
@keyframes slidein { from { transform: translateX(-12px); opacity: 0; } }

#hud-bottom { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); padding: 10px 16px; width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 7px; }
.pips-row { display: flex; align-items: center; gap: 10px; justify-content: center; }
.pips { display: flex; gap: 6px; }
.pips { gap: 4px !important; }
.pips i { width: 12px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); transition: background 0.1s; }
.pips i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pips.shake { animation: shake 0.3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row .lbl { font-size: 12px; letter-spacing: 0.15em; white-space: nowrap; }
.slider-row .lbl b { font-family: var(--mono); }
.lbl.def { color: #7fb6ff; }
.lbl.atk { color: var(--bad); }
#att-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #7fb6ff, var(--bad)); outline: none; }
#att-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; cursor: pointer; }
#att-slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: none; cursor: pointer; }
.combat-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.mode-switch { display: flex; align-items: center; gap: 4px; margin-right: auto; }
#btn-auto, #btn-auto-mode { white-space: nowrap; }
.spend-row { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; }
.spend-row .btn { white-space: nowrap; }
.spend-row .radar { margin-left: auto; }
#radar-mark { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 20; transform: translate(-50%, -50%); text-align: center; }
#radar-mark .rm-arrow { width: 26px; height: 26px; margin: 0 auto; border: 2px solid currentColor; transform: rotate(45deg); box-shadow: 0 0 14px currentColor; animation: rm-pulse 0.8s ease-in-out infinite alternate; }
#radar-mark .rm-label { margin-top: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-shadow: 0 0 8px #000, 0 0 4px #000; white-space: nowrap; }
#radar-mark.edge .rm-arrow { border-width: 0 3px 3px 0; box-shadow: none; }
@keyframes rm-pulse { from { opacity: 0.55; } to { opacity: 1; } }
.pips-row { justify-content: flex-end !important; }
#battles { display: flex; flex-direction: column; gap: 6px; }
#battles:empty { display: none; }
.battle { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
.b-head { display: flex; font-size: 14px; font-weight: 600; }
.b-head .tag { margin-left: 5px; }
.b-status { margin-left: auto; font-weight: 500; font-size: 13px; }
.tug { height: 7px; border-radius: 4px; background: var(--bad); margin: 5px 0 4px; overflow: hidden; box-shadow: 0 0 8px rgba(255, 77, 109, 0.4); }
.tug-you { height: 100%; background: linear-gradient(90deg, #3df5ff, #8ff9ff); box-shadow: 0 0 10px var(--accent); transition: width 0.25s; }
.b-stats { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.b-stats b { color: var(--text); }
#attack-status { flex: 1; }

#hud-help { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); font-size: 11px; color: rgba(109, 138, 150, 0.7); white-space: nowrap; display: none; }
@media (min-height: 760px) { #hud-help:not(.off) { display: block; } #hud-bottom { bottom: 22px; } }

#toast { position: absolute; top: 112px; left: 50%; transform: translateX(-50%) translateY(-8px); padding: 8px 18px; border-radius: 6px; background: rgba(0, 0, 0, 0.7); border: 1px solid var(--line); font-size: 16px; font-weight: 600; letter-spacing: 0.05em; opacity: 0; transition: all 0.25s; white-space: nowrap; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { border-color: var(--bad); color: var(--bad); }
#toast.good { border-color: var(--good); color: var(--good); }
#toast.warn { border-color: var(--warn); color: var(--warn); }

#sd-banner { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: 72px; font-weight: 700; letter-spacing: 0.4em; color: var(--bad); text-shadow: 0 0 30px var(--bad); animation: sd 4s forwards; }
@keyframes sd { 0% { opacity: 0; letter-spacing: 1em; } 15% { opacity: 1; letter-spacing: 0.4em; } 80% { opacity: 1; } 100% { opacity: 0; } }

#spectate-bar { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); padding: 8px 14px; display: flex; align-items: center; gap: 8px; z-index: 15; letter-spacing: 0.15em; font-size: 14px; }

/* ---------- end screen ---------- */
#end { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
#end .panel, #end button, #end input { pointer-events: auto; }
#end-title { position: absolute; top: 16px; left: 20px; letter-spacing: 0.4em; color: var(--muted); font-size: 14px; }
#end-panel { position: absolute; top: 16px; right: 16px; bottom: 16px; width: min(470px, calc(100vw - 32px)); padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
#winner { text-align: center; }
.crown { letter-spacing: 0.5em; color: var(--warn); font-size: 13px; }
.w-name { font-size: 40px; font-weight: 700; text-shadow: 0 0 20px currentColor; }
#rank-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#rank-table th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; padding: 4px; border-bottom: 1px solid var(--line); }
#rank-table td { padding: 4px; font-family: var(--mono); font-size: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
#rank-table td:nth-child(2) { font-family: var(--font); font-size: 14px; font-weight: 600; }
#rank-table tr.me td { background: rgba(61, 245, 255, 0.1); }
#cup-result { text-align: center; font-size: 17px; }
.promo { font-size: 22px; font-weight: 700; letter-spacing: 0.1em; margin-top: 4px; text-shadow: 0 0 14px currentColor; }
#replay-bar { position: absolute; left: 16px; bottom: 16px; right: calc(min(470px, 100vw - 32px) + 32px); padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
#rp-seek { flex: 1; accent-color: var(--accent); }
#rp-time { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
#replay-labels { position: absolute; inset: 0; overflow: hidden; }
.rlabel { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; margin: -22px 0 0 8px; text-shadow: 0 0 6px #000, 0 0 2px #000; white-space: nowrap; }
