/* Layout: the pixel battle map fills the screen; menus and the HUD are flat black panels with
   hard pixel frames over it. Red, black and white like a war broadcast; gold, cyan and toxic
   green only mark coins, gems and the Horde. One dark look by design. */
:root {
  color-scheme: dark;
  --bg: #0b0b0b;
  --panel: #141414;
  --panel-2: #1c1b1b;
  --line: #2e2b2a;
  --fg: #f2eee6;
  --muted: #8f8a84;
  --red: #e0242d;
  --red-d: #8a0f14;
  --red-b: #ff4c3c;
  --gold: #f2b705;
  --cyan: #3fd0e0;
  --toxic: #8ee03a;
  /* Built-in fonts (nothing to download, works offline). Big headline text gets a pixel filter (.pxf). */
  --display: "DIN Condensed", "Avenir Next Condensed", "Bahnschrift SemiCondensed", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --fc: var(--line);
}

* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--fg);
  font: 400 16px/1.3 var(--body); -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-font-smoothing: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--red-b); outline-offset: 2px; }
[hidden] { display: none !important; }
.wi { display: inline-flex; flex: none; width: 24px; height: 24px; }
.wi img { width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
.emo { width: 100%; height: 100%; image-rendering: pixelated; display: block; }

/* Pixel frame: a border drawn outside the box with the corners knocked out. */
.px { box-shadow: 0 -3px 0 0 var(--fc), 0 3px 0 0 var(--fc), -3px 0 0 0 var(--fc), 3px 0 0 0 var(--fc); }

#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; background: #0a0b0c; image-rendering: pixelated; }
/* The 3D planet (js/globe.js) sits under the map canvas, which then only holds labels, units and effects. */
#globe { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; background: #08080a; }
#map.over { background: transparent; }
#shade { position: fixed; inset: 0; pointer-events: none; transition: opacity 0.4s; background: linear-gradient(180deg, rgba(11, 11, 11, 0.55), rgba(11, 11, 11, 0.25) 35%, rgba(11, 11, 11, 0.92) 85%); }
body.in-match #shade { opacity: 0; }

/* ---------- shared ---------- */
.card { background: var(--panel); padding: 14px; margin: 3px; box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.card h3, .section-title { margin: 0 0 10px; font: 400 22px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase; color: var(--red-b); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h3 small { font: 400 13px var(--body); text-transform: none; color: var(--muted); letter-spacing: 0; }
.section-title { margin: 4px 2px -4px; }
.bar { flex: 1; height: 8px; background: #2a2626; position: relative; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--red); transition: width 0.9s steps(12); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 14px; margin: 3px;
  background: var(--panel-2); font: 400 22px/1 var(--display); letter-spacing: 0.04em; text-transform: uppercase;
  --fc: #3a3635;
  box-shadow: 0 -3px 0 0 var(--fc), 0 3px 0 0 var(--fc), -3px 0 0 0 var(--fc), 3px 0 0 0 var(--fc), inset 0 -4px 0 rgba(0, 0, 0, 0.45), inset 0 3px 0 rgba(255, 255, 255, 0.07);
}
.btn:active { transform: translateY(2px); }
.btn .wi { width: 24px; height: 24px; }
.btn.primary { background: var(--red); color: #fff; --fc: #fff; }
.btn.danger { background: var(--red-d); color: #fff; --fc: var(--red); }
.btn.good { background: #f2eee6; color: #111; --fc: #f2eee6; }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 19px; }
.btn[disabled] { opacity: 0.35; cursor: default; }
.tag { display: inline-block; padding: 2px 6px; background: var(--red); color: #fff; font: 400 16px/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; font: 400 15px/1.1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; background: #232020; }
.pill.ally { color: var(--cyan); } .pill.war { color: #fff; background: var(--red); } .pill.neutral { color: var(--muted); } .pill.traitor { color: var(--red-b); } .pill.horde { color: var(--toxic); }
.pill.real { color: #fff; background: #3a3635; } .pill.bot { color: var(--muted); } .pill.human { color: #fff; background: #8f1d22; }
.note { color: var(--muted); font-size: 14px; margin: 0; }
.price { display: inline-flex; align-items: center; gap: 4px; }
.price .wi { width: 18px; height: 18px; }

/* ---------- home ---------- */
#home { position: fixed; inset: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--safe-t) + 12px) 16px 6px; max-width: 560px; width: 100%; margin: 0 auto; }
.logo { font: 400 40px/0.8 var(--display); letter-spacing: 0.02em; color: #fff; text-shadow: 3px 3px 0 var(--red-d); }
.logo span { color: var(--red); text-shadow: 3px 3px 0 #000; }
.wallet { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px; margin: 3px; background: var(--panel); font: 400 20px var(--display); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.chip .wi { width: 20px; height: 20px; }
.chip.coin b { color: var(--gold); font-weight: 400; } .chip.gem b { color: var(--cyan); font-weight: 400; }
.chip em { font-style: normal; color: #111; background: var(--cyan); width: 16px; height: 16px; display: grid; place-items: center; font-size: 18px; line-height: 1; }
.pages { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.page { max-width: 560px; margin: 0 auto; padding: 8px 16px calc(var(--safe-b) + 100px); display: flex; flex-direction: column; gap: 14px; }

.profile { display: grid; grid-template-columns: 56px 1fr auto; gap: 4px 12px; align-items: center; }
.avatar { width: 56px; height: 56px; display: block; image-rendering: pixelated; grid-row: 1 / 3; }
.who-name { display: flex; align-items: center; gap: 6px; font: 400 28px/1 var(--display); text-transform: uppercase; min-width: 0; }
.who-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name button { width: 22px; height: 22px; opacity: 0.6; }
.lvl { display: flex; align-items: center; gap: 8px; font: 400 18px var(--display); color: var(--muted); grid-column: 2; }
.lvl b { color: var(--fg); font-weight: 400; }
.rank { grid-row: 1 / 3; grid-column: 3; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.rank-badge { width: 36px; height: 40px; image-rendering: pixelated; }
.rank-text b { font: 400 17px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; }
.rank-text small { display: block; font: 400 15px var(--display); color: var(--muted); }

.play {
  position: relative; display: block; width: calc(100% - 8px); margin: 4px; padding: 16px 12px 14px; text-align: center; background: var(--red); color: #fff;
  box-shadow: 0 -4px 0 0 #fff, 0 4px 0 0 #fff, -4px 0 0 0 #fff, 4px 0 0 0 #fff, inset 0 -6px 0 var(--red-d), inset 0 4px 0 rgba(255, 255, 255, 0.25);
}
.play:active { transform: translateY(3px); box-shadow: 0 -4px 0 0 #fff, 0 4px 0 0 #fff, -4px 0 0 0 #fff, 4px 0 0 0 #fff, inset 0 4px 0 var(--red-d); }
.play b { display: block; font: 400 56px/0.8 var(--display); letter-spacing: 0.03em; text-shadow: 3px 3px 0 var(--red-d); }
.play small { display: block; margin-top: 8px; font: 400 18px var(--display); letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.9; }
.linkrow { display: flex; gap: 8px; }
.nowplaying { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #0b0b0b; font: 400 20px var(--display); text-transform: uppercase; }
.linkrow .btn { flex: 1; }
.mode-row { display: flex; flex-direction: column; gap: 8px; }
.mode-pick { display: grid; grid-template-columns: 40px 1fr 18px; gap: 10px; align-items: center; width: calc(100% - 6px); margin: 3px; padding: 10px 12px; background: var(--panel); text-align: left; box-shadow: 0 -3px 0 0 #fff, 0 3px 0 0 #fff, -3px 0 0 0 #fff, 3px 0 0 0 #fff, inset 0 -4px 0 rgba(0, 0, 0, 0.45); }
.mode-pick .wi, .mode-opt .wi { width: 40px; height: 40px; }
.mode-pick b, .mode-opt b { display: block; font: 400 28px/0.9 var(--display); text-transform: uppercase; }
.mode-pick small, .mode-opt small { display: block; color: var(--muted); font-size: 13px; line-height: 1.2; margin-top: 2px; }
.caret { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 10px solid #fff; }
.mode-list { display: flex; flex-direction: column; gap: 8px; }
.mode-opt { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; padding: 10px 12px; background: #1d1b1b; text-align: left; }
.mode-opt.on { background: var(--red); }
.mode-opt.on small { color: #fff; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode { display: flex; align-items: center; gap: 10px; padding: 10px; margin: 3px; background: var(--panel); text-align: left; box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line), inset 0 -4px 0 rgba(0, 0, 0, 0.4); }
.mode .wi { width: 40px; height: 40px; }
.mode b { display: block; font: 400 24px/1 var(--display); text-transform: uppercase; }
.mode small { color: var(--muted); font-size: 13px; line-height: 1.15; }
.mode.outbreak b { color: var(--toxic); }
.boostbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #11262a; color: var(--cyan); font: 400 18px var(--display); text-transform: uppercase; }

.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; background: #1d1b1b; font: 400 15px var(--display); color: var(--muted); }
.day .wi { width: 24px; height: 24px; }
.day b { font-weight: 400; color: var(--fg); min-height: 15px; }
.day.got { opacity: 0.35; }
.day.next { background: var(--red); color: #fff; }
.supply-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.crates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.crate { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; background: #1d1b1b; }
.crate .wi { width: 40px; height: 40px; }
.crate b { font: 400 17px/1 var(--display); text-transform: uppercase; text-align: center; }
.crate small { font: 400 15px var(--display); color: var(--muted); }
.crate.has { background: #2a1314; }
.crate.has small { color: var(--red-b); }
.quest { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 8px 0; border-top: 2px solid #201e1e; }
.quest:first-of-type { border-top: 0; padding-top: 0; }
.quest p { margin: 0; font-size: 15px; }
.quest .bar { grid-column: 1 / 2; height: 6px; }
.quest .reward { grid-row: 1 / 3; grid-column: 2; font: 400 19px var(--display); color: var(--gold); display: flex; align-items: center; gap: 4px; }
.quest .reward .wi { width: 18px; height: 18px; }
.quest.done p { color: var(--muted); text-decoration: line-through; }
.quest.done .reward { color: var(--fg); }

/* armory */
.loadout { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot { display: flex; align-items: center; gap: 10px; padding: 10px; background: #1d1b1b; text-align: left; min-height: 60px; }
.slot .wi { width: 36px; height: 36px; }
.slot b { display: block; font: 400 22px/1 var(--display); text-transform: uppercase; }
.slot small { color: var(--muted); font-size: 13px; }
.slot.on { background: var(--red); }
.slot.on small { color: #fff; }
.slot.locked { opacity: 0.45; }
.tac, .perk { display: grid; grid-template-columns: 44px 1fr auto; gap: 2px 12px; align-items: center; padding: 10px 0; border-top: 2px solid #201e1e; }
.tac:first-of-type, .perk:first-of-type { border-top: 0; padding-top: 0; }
.tac > .wi, .perk > .wi { width: 44px; height: 44px; grid-row: 1 / 4; }
.tac b, .perk b { font: 400 24px/1 var(--display); text-transform: uppercase; }
.perk b em { font-style: normal; color: var(--red-b); margin-left: 6px; }
.tac p, .perk small { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.2; grid-column: 2; }
.tac .stats { grid-column: 2; font: 400 16px var(--display); color: var(--fg); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tac .act, .perk .act { grid-row: 1 / 4; grid-column: 3; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.tac.locked { opacity: 0.45; }
/* Ability badges: every tactic, superweapon and doctrine on its own war-palette tile. */
.ab { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; background: var(--ab, #8f1d22);
  background: linear-gradient(160deg, color-mix(in srgb, var(--ab, #8f1d22), #fff 22%), var(--ab, #8f1d22) 55%, color-mix(in srgb, var(--ab, #8f1d22), #000 35%));
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.55), inset 0 3px 0 rgba(255, 255, 255, 0.16), 0 2px 0 #000; }
.ab .wi { width: 34px; height: 34px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.7)); }
.tac > .ab, .perk > .ab { grid-row: 1 / 5; align-self: start; }
.slot .ab { width: 40px; height: 40px; } .slot .ab .wi { width: 30px; height: 30px; }
.wrow > .ab { width: 40px; height: 40px; } .wrow > .ab .wi { width: 30px; height: 30px; }
.tac[data-prev], .perk[data-prev] { cursor: pointer; }
.tac .stats em, .perk .stats em { font-style: normal; color: #8fe08a; }
.tac .stats { display: flex; flex-wrap: wrap; gap: 0 12px; white-space: normal; overflow: visible; }
.tac .stats > span { white-space: nowrap; }
.perk .stats { font: 400 16px var(--display); color: var(--fg); }
.peek { grid-column: 2; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font: 400 14px/1 var(--display); text-transform: uppercase; }
.peek .wi { width: 16px; height: 16px; }
.explain { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.explain b { color: var(--fg); font-weight: 600; }
.locker-hint { margin: 8px 2px 6px; }
.ad-offer { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 10px; text-align: left; }
.ad-offer .art { width: 44px; height: 44px; }
.ad-offer span { display: flex; flex-direction: column; font: 400 20px/1.1 var(--display); text-transform: uppercase; }
.ad-offer small { font: 400 13px var(--body); text-transform: none; opacity: 0.85; }
/* Armory preview sheet */
.ab-sheet .ab-head { display: flex; gap: 12px; align-items: center; }
.ab-sheet .ab-head .ab { width: 56px; height: 56px; } .ab-sheet .ab-head .ab .wi { width: 44px; height: 44px; }
.ab-sheet h2 { margin: 0; }
.ab-sheet .ab-head small { color: var(--muted); }
.ab-desc { margin: 10px 0; font-size: 15px; line-height: 1.35; }
.ab-cv { display: block; width: 100%; background: #0d0c0c; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--ab); margin: 8px 0 14px; }
.ab-table { width: 100%; border-collapse: collapse; font: 400 18px var(--display); text-transform: uppercase; }
.ab-table th, .ab-table td { padding: 5px 6px; border-bottom: 2px solid #201e1e; text-align: left; }
.ab-table th { color: var(--muted); font-weight: 400; }
.ab-table td.up { color: #8fe08a; }
.ab-tip { color: var(--muted); font-size: 14px; line-height: 1.35; margin: 10px 0; }
.ab-buy { display: flex; gap: 8px; margin-bottom: 8px; } .ab-buy .btn { flex: 1; }
.pips { display: inline-flex; gap: 3px; vertical-align: middle; margin-left: 8px; }
.pips i { width: 10px; height: 10px; background: #2c2929; }
.pips i.on { background: var(--red); }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font: 400 15px/1 var(--display); text-transform: uppercase; color: var(--muted); }
.medal .wi { width: 44px; height: 44px; }
.medal.none { opacity: 0.25; filter: grayscale(1); }
.medal b { font-weight: 400; color: var(--fg); }

/* locker */
.preview { width: 100%; aspect-ratio: 16 / 8; max-width: 100%; display: block; image-rendering: pixelated; }
.slots { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.slots::-webkit-scrollbar { display: none; }
.slots button { flex: none; height: 36px; padding: 0 12px; background: #1d1b1b; font: 400 20px var(--display); text-transform: uppercase; color: var(--muted); }
.slots button.on { background: var(--fg); color: #111; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.item { display: flex; flex-direction: column; gap: 4px; padding: 6px; background: var(--panel); text-align: center; min-width: 0; outline: 3px solid transparent; outline-offset: -3px; }
.item canvas { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated; }
.item b { font: 400 18px/1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item small { font: 400 17px var(--display); display: inline-flex; gap: 3px; align-items: center; justify-content: center; }
.item small .wi { width: 16px; height: 16px; }
.item.on { outline-color: var(--red); }
.item.on small { color: var(--red-b); }
.item .x { color: var(--muted); text-transform: uppercase; }

/* shop */
.starter { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 16px; margin: 3px; background: var(--red-d); box-shadow: 0 -3px 0 0 var(--red), 0 3px 0 0 var(--red), -3px 0 0 0 var(--red), 3px 0 0 0 var(--red); }
.starter h4 { margin: 0; font: 400 32px/1 var(--display); text-transform: uppercase; }
.starter ul { margin: 0; padding: 0 0 0 18px; font-size: 14px; grid-column: 1; }
.starter .btn { grid-row: 1 / 3; grid-column: 2; }
.warchest { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 12px; margin: 3px; background: #1d1b1b; box-shadow: 0 -3px 0 0 var(--gold), 0 3px 0 0 var(--gold), -3px 0 0 0 var(--gold), 3px 0 0 0 var(--gold); }
.warchest .wi { width: 48px; height: 48px; }
.warchest h4 { margin: 0; font: 400 28px/1 var(--display); text-transform: uppercase; color: var(--gold); }
.warchest p { margin: 2px 0; font-size: 14px; }
.warchest small { color: var(--muted); font-size: 13px; }
.ad { text-align: center; }
.ad-tag { font: 400 16px var(--display); text-transform: uppercase; color: var(--muted); }
.ad-body { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 10px; background: repeating-linear-gradient(-45deg, #1b1919 0 10px, #141313 10px 20px); }
.ad-body .wi { width: 72px; height: 72px; }
.ad-body b { font: 400 36px var(--display); text-transform: uppercase; }
.ad-body small { color: var(--muted); }
.subtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.subtabs button { font-size: 19px !important; gap: 4px !important; }
.carousel { overflow: hidden; touch-action: pan-y; margin: 0 -3px; padding: 0 3px; }
.track { display: flex; align-items: flex-start; will-change: transform; }
.panel { flex: 0 0 100%; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 3px; opacity: 0.4; transform: scale(0.96); transition: opacity 0.25s, transform 0.25s; }
.panel.active { opacity: 1; transform: none; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: -4px; }
.dots i { width: 10px; height: 10px; background: #2c2929; transition: background 0.2s, transform 0.2s; }
.dots i.on { background: var(--red); transform: scale(1.3); }
/* Tap feedback everywhere: a quick flash on whatever you pressed. */
button { transition: transform 0.08s, filter 0.08s; }
button:active { filter: brightness(1.25); }
.tap { animation: tapflash 0.25s steps(3); }
@keyframes tapflash { 0% { filter: brightness(2) saturate(1.4); } 100% { filter: none; } }
.page:not([hidden]) { animation: pageIn 0.18s steps(4); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.seg button.on, .slots button.on, .subtabs button.on, .mode-opt.on { animation: pop 0.2s steps(3); }
.transmission { position: fixed; left: 50%; top: calc(var(--safe-t) + 10px); transform: translate(-50%, -140%); z-index: 45; width: min(440px, calc(100vw - 20px)); display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 10px 12px; background: #0d0d0d; box-shadow: 0 -3px 0 0 var(--red), 0 3px 0 0 var(--red), -3px 0 0 0 var(--red), 3px 0 0 0 var(--red); transition: transform 0.35s steps(5); pointer-events: none; }
.transmission.show { transform: translate(-50%, 0); }
.transmission .wi { width: 36px; height: 36px; }
.transmission small { display: block; font: 400 15px var(--display); color: var(--red-b); text-transform: uppercase; letter-spacing: 0.1em; }
.transmission b { display: block; font-size: 15px; font-weight: 500; line-height: 1.25; }
.transmission em { font: 400 15px var(--display); color: var(--muted); font-style: normal; text-transform: uppercase; }
.subtabs button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; background: #1d1b1b; font: 400 22px var(--display); text-transform: uppercase; color: var(--muted); }
.subtabs button .wi { width: 24px; height: 24px; }
.subtabs button.on { background: var(--red); color: #fff; }
.swipe { display: flex; flex-direction: column; gap: 14px; touch-action: pan-y; animation: dispIn 0.15s steps(3); }
.slots button { display: inline-flex; align-items: center; gap: 6px; }
.slots button .wi { width: 20px; height: 20px; }
.item { position: relative; }
.item .rtag { position: absolute; top: 4px; left: 4px; z-index: 1; padding: 0 4px; font: 400 13px/1.3 var(--display); text-transform: uppercase; background: #000; color: var(--rc, #aaa); }
.item.r-common { --rc: #b9b3a1; } .item.r-rare { --rc: #4f9fe8; } .item.r-epic { --rc: #a15be0; } .item.r-legendary { --rc: #f2b705; } .item.r-mythic { --rc: #ff3b5c; }
.item.r-rare, .item.r-epic, .item.r-legendary, .item.r-mythic { box-shadow: inset 0 -4px 0 var(--rc); }
.item.r-mythic { background: linear-gradient(180deg, rgba(255, 59, 92, 0.16), rgba(255, 59, 92, 0) 60%), #161515; }
.item.r-mythic .rtag { animation: mythic 1.6s steps(6) infinite; }
@keyframes mythic { 50% { color: #fff; } }
#lk-edit { display: flex; align-items: center; gap: 6px; margin: 6px auto 0; }
.pe-cv { display: block; width: min(288px, 76vw); aspect-ratio: 1; margin: 6px auto; image-rendering: pixelated; touch-action: none; box-shadow: 0 0 0 3px var(--line); cursor: crosshair; }
.pe-pal { display: flex; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.pe-pal button { width: 32px; height: 32px; box-shadow: inset 0 0 0 2px #000; }
.pe-pal button.on { outline: 3px solid #fff; outline-offset: 1px; }
.deals .items { grid-template-columns: repeat(3, 1fr); }
.deals .item .rtag { background: var(--red); color: #fff; }
.tryon { text-align: center; }
.tryon .rar { font: 400 20px var(--display); text-transform: uppercase; color: var(--rc); }
.tryon s { opacity: 0.6; }
.celebrate { position: relative; align-items: center; text-align: center; overflow: hidden; }
.celebrate .huge { width: 128px; height: 128px; margin-top: 10px; animation: pop 0.4s steps(5); }
.celebrate .amt { font: 400 56px/1 var(--display); color: var(--rc); text-shadow: 3px 3px 0 #000; }
.burst { position: absolute; left: 50%; top: 90px; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; width: 8px; height: 8px; background: var(--c); animation: burst 0.9s steps(9) forwards; }
@keyframes burst { from { transform: rotate(var(--a)) translateX(0); opacity: 1; } to { transform: rotate(var(--a)) translateX(var(--d)); opacity: 0; } }
.chip.bump { animation: bump 0.5s steps(4); }
@keyframes bump { 50% { transform: scale(1.25); background: var(--red); } }
.packs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pack { position: relative; display: flex; flex-direction: column; align-items: center; padding: 12px 8px 8px; margin: 3px; background: var(--panel); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.pack .wi { width: 44px; height: 44px; }
.pack b { font: 400 30px/1 var(--display); color: var(--cyan); }
.pack small { color: var(--muted); font-size: 13px; min-height: 17px; }
.pack .btn { width: calc(100% - 6px); }
.pack .tag { position: absolute; top: 4px; right: 4px; }
.line-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 2px solid #201e1e; }
.line-item:first-of-type { border-top: 0; padding-top: 0; }
.line-item > .wi { width: 30px; height: 30px; }
.line-item span { flex: 1; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px; padding: 6px 10px calc(var(--safe-b) + 6px); background: #0b0b0b; border-top: 3px solid #1f1d1d; }
.tabbar button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; color: var(--muted); font: 400 18px/1 var(--display); text-transform: uppercase; letter-spacing: 0.05em; }
.tabbar button .wi { width: 28px; height: 28px; filter: grayscale(1) brightness(0.7); }
.tabbar button.on { color: #fff; background: var(--red); }
.tabbar button.on .wi { filter: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 8px) 12px 14px; background: linear-gradient(180deg, rgba(11, 11, 11, 0.95) 55%, rgba(11, 11, 11, 0)); pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-troops b { display: block; font: 400 36px/0.85 var(--display); }
.hud-troops span { font: 400 16px var(--display); color: var(--muted); }
.hud-troops em { font-style: normal; }
.hud-troops .inc { color: var(--fg); }
.hud-mid { display: flex; flex-direction: column; align-items: center; }
.hud-land { font: 400 34px/0.85 var(--display); color: var(--red-b); }
.hud-time { font: 400 17px var(--display); color: var(--muted); }
.hud-time.low { color: var(--red-b); }
.hud-btns { justify-self: end; display: flex; gap: 8px; }
.hud-btn { position: relative; width: 40px; height: 40px; margin: 3px; background: var(--panel); display: grid; place-items: center; box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.hud-btn .wi { width: 26px; height: 26px; }
.hud-btn .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; background: var(--red); }
.board { position: absolute; right: 8px; top: calc(var(--safe-t) + 66px); margin: 0; padding: 4px 8px; list-style: none; background: rgba(11, 11, 11, 0.78); font: 400 18px/1.05 var(--display); min-width: 130px; max-width: 44vw; }
.board li { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; }
.board li i { width: 10px; height: 10px; flex: none; }
.board li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; }
.board li.me { color: var(--red-b); }
.board li.bot { color: var(--muted); }
.board li.real i { outline: 2px solid #fff; }
.board li.ally span { color: var(--cyan); }
.board li.horde span { color: var(--toxic); }
.board li.sep { height: 2px; background: #2c2929; margin: 3px 0; padding: 0; }
body.spawning .board { display: none; }
.board li.rest { display: none; }

.hud-note { position: absolute; left: 8px; top: calc(var(--safe-t) + 90px); display: flex; align-items: flex-start; gap: 6px; max-width: calc(100vw - 190px); pointer-events: none; z-index: 5; }
.hud-note > * { pointer-events: auto; }
.note-tab { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; background: rgba(14, 13, 13, 0.9); box-shadow: inset 0 0 0 2px #2c2929; }
.note-tab .wi { width: 22px; height: 22px; }
.note-tab em { position: absolute; top: -6px; right: -6px; min-width: 16px; padding: 0 3px; background: var(--red); color: #fff; font: 400 14px/16px var(--display); font-style: normal; text-align: center; }
.note-tab em:empty { display: none; }
.note-tab.hot { box-shadow: inset 0 0 0 2px var(--cyan); }
.note-line { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 5px 8px 5px 6px; background: rgba(14, 13, 13, 0.88); border-left: 3px solid var(--kc, #fff); cursor: pointer; opacity: 0; transform: translateX(-12px); transition: opacity 0.2s, transform 0.2s steps(3); pointer-events: none; }
.note-line.show { opacity: 1; transform: none; pointer-events: auto; }
.note-line .wi { width: 18px; height: 18px; flex: none; }
.note-line span { min-width: 0; font-size: 12px; line-height: 1.15; color: #cfc9bd; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-line b { font: 400 16px/1 var(--display); text-transform: uppercase; color: var(--kc, var(--fg)); }
.note-line em { font-style: normal; }
.inrow { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: start; padding: 7px 0; border-top: 2px solid #201e1e; }
.inrow .wi { width: 24px; height: 24px; }
.inrow b { font: 400 18px/1 var(--display); text-transform: uppercase; color: var(--kc, var(--fg)); }
.inrow p { margin: 2px 0 0; font-size: 13px; }
.inrow small { font: 400 14px var(--display); color: var(--muted); }
.inrow .acts { display: flex; gap: 6px; margin-top: 6px; }
.inrow.req { background: rgba(79, 209, 232, 0.06); }
.radial { position: absolute; width: 0; height: 0; z-index: 7; }
.radial .hub { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); min-width: 96px; padding: 6px 8px; background: rgba(12, 11, 11, 0.94); text-align: center; border-top: 4px solid var(--kc, #fff); color: #f2eee6; pointer-events: auto; }
.radial .hub em { display: block; margin-top: 3px; font: 400 12px/1 var(--display); font-style: normal; text-transform: uppercase; color: var(--gold); }
.radial .hub b { display: block; font: 400 18px/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.radial .hub small { font: 400 14px var(--display); color: var(--muted); }
.radial .arm { position: absolute; width: 74px; height: 58px; margin: -29px 0 0 -37px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: #1a1818; box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.radial .arm .wi { width: 26px; height: 26px; }
.radial .arm span { font: 400 15px/1 var(--display); text-transform: uppercase; }
.radial .arm.red { background: var(--red); --line: #fff; }
.radial .up { left: 0; top: -78px; }
.radial .down { left: 0; top: 78px; }
.radial .left { left: -96px; top: 0; }
.radial .right { left: 96px; top: 0; }
.radial.open .arm { animation: armOut 0.14s steps(3); }
@keyframes armOut { from { left: 0; top: 0; opacity: 0; } }
.radial .emo-ring { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; padding: 8px; background: rgba(12, 11, 11, 0.95); box-shadow: 0 0 0 3px var(--line); }
.radial .emo-ring button { width: 46px; height: 46px; display: grid; place-items: center; background: #1d1b1b; }
@keyframes blinkSoft { 50% { background: rgba(122, 11, 16, 0.92); } }
@keyframes blink { 50% { background: var(--red-d); } }

.banner { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 70px); padding: 6px 12px; background: #111; font: 400 20px var(--display); text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.banner.hot { background: var(--red); color: #fff; }

.rail { position: absolute; right: 8px; bottom: calc(var(--dock, 170px) + 8px); display: flex; flex-direction: column; gap: 8px; }
.tool { width: 50px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; margin: 3px; background: var(--panel); box-shadow: 0 -3px 0 0 var(--line), 0 3px 0 0 var(--line), -3px 0 0 0 var(--line), 3px 0 0 0 var(--line); }
.tool .wi { width: 28px; height: 28px; }
.tool span { font: 400 14px/1 var(--display); text-transform: uppercase; color: #d8d2c6; }
.tool.on span { color: #fff; }
.tool.on { background: var(--red); --line: #fff; }
.tool.arsenal { position: relative; opacity: 0.55; }
.tool.arsenal.ready { opacity: 1; --line: var(--gold); }
.tool.arsenal em { position: absolute; top: -8px; right: -8px; min-width: 18px; padding: 0 3px; background: var(--red); color: #fff; font: 400 16px/18px var(--display); font-style: normal; text-align: center; }
.tool.arsenal em:empty { display: none; }
.wrow { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 2px solid #201e1e; }
.wrow .wi { width: 40px; height: 40px; }
.wrow b { font: 400 22px/1 var(--display); text-transform: uppercase; }
.wrow b small { color: var(--red-b); font-size: 16px; }
.wrow p { margin: 2px 0; font-size: 13px; }
.wrow small { color: var(--muted); font: 400 15px var(--display); text-transform: uppercase; }
.wrow.ready { background: rgba(224, 36, 45, 0.08); }

.order {
  position: absolute; left: 10px; right: 10px; margin: 0 auto; bottom: calc(var(--dock, 170px) + 6px); max-width: 420px;
  display: flex; flex-direction: column; gap: 7px; padding: 10px 12px 12px; background: #121111;
  --fc: var(--kc, #fff); box-shadow: 0 -3px 0 0 var(--fc), 0 3px 0 0 var(--fc), -3px 0 0 0 var(--fc), 3px 0 0 0 var(--fc); animation: dispIn 0.15s steps(3);
}
body.ordering .rail { display: none; }
.o-head { display: grid; grid-template-columns: 30px 1fr 34px; gap: 8px; align-items: center; }
.o-head > .wi { width: 30px; height: 30px; }
.o-head b { font: 400 25px/0.95 var(--display); text-transform: uppercase; }
.order .x { width: 34px; height: 34px; display: grid; place-items: center; background: #1d1b1b; }
.order .x .wi { width: 18px; height: 18px; }
.o-detail { margin: 0; font-size: 14px; color: var(--muted); }
.o-detail strong { color: var(--fg); font-weight: 400; font-family: var(--display); font-size: 20px; }
.odds { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 7px 8px; background: #0b0b0b; }
.o-meter { height: 12px; background: #262323; position: relative; background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #0b0b0b calc(10% - 2px) 10%); }
.o-meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width 0.25s steps(5), background 0.2s; -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); mask: repeating-linear-gradient(90deg, #000 0 calc(10% - 2px), transparent calc(10% - 2px) 10%); }
.o-pct { font: 400 24px/1 var(--display); min-width: 52px; text-align: right; }
.o-verdict { grid-column: 1 / -1; font: 400 19px/1.05 var(--display); text-transform: uppercase; color: #fff; quotes: none; }
.o-why { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.o-why:empty { display: none; }
.o-why .up { color: #b9e07a; }
.o-why .down { color: #ff7a6e; }
.order .warn { padding: 6px 8px; background: var(--red-d); font-size: 14px; }
.order .strat { flex-wrap: nowrap; }
.order .strat button { height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 20px; border: 3px solid #2a2727; }
.order .strat button .wi { width: 22px; height: 22px; }
.order .strat button.on { border-color: #fff; animation: none; }
.o-tip { font-size: 12px; color: var(--muted); margin-top: -2px; }
.order #h-undig { align-self: stretch; }
.order .go { margin: 2px 3px 3px; min-height: 54px; font-size: 30px; }

.showdown { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 70px); width: min(360px, calc(100vw - 24px)); padding: 8px 12px 10px; background: rgba(122, 11, 16, 0.28); text-align: center; cursor: pointer; touch-action: manipulation; z-index: 6; box-shadow: 0 -3px 0 0 var(--red-b), 0 3px 0 0 var(--red-b), -3px 0 0 0 var(--red-b), 3px 0 0 0 var(--red-b); text-shadow: 2px 2px 0 #000; }
.showdown.hit { animation: sdHit 0.12s steps(2); }
@keyframes sdHit { 50% { background: rgba(224, 36, 45, 0.45); } }
.showdown b { display: block; font: 400 34px/0.9 var(--display); text-transform: uppercase; }
.showdown p { margin: 2px 0 6px; font-size: 13px; }
.showdown small { display: block; margin-top: 2px; font-size: 12px; color: #f1d3cf; }
.tug { position: relative; height: 16px; background: rgba(0, 0, 0, 0.6); }
.tug i { position: absolute; left: 0; top: 0; bottom: 0; background: #fff; transition: width 0.08s; }
.tug span { position: absolute; top: -4px; bottom: -4px; width: 3px; left: 50%; background: var(--red-b); }
.showdown .row { display: flex; justify-content: space-between; margin-top: 5px; font: 400 17px var(--display); }
.showdown .cta { margin-top: 4px; font: 400 24px var(--display); letter-spacing: 0.1em; text-transform: uppercase; }
body.showdown-on .order, body.showdown-on .hud-note, body.showdown-on .board { opacity: 0.25; pointer-events: none; }
.reward-pop { position: fixed; left: 50%; top: calc(var(--safe-t) + 150px); transform: translate(-50%, -50%); z-index: 90; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; background: rgba(11, 11, 11, 0.72); pointer-events: none; text-align: left; animation: rewardPop 1.3s steps(10) forwards; }
.reward-pop .wi { width: 34px; height: 34px; }
.reward-pop b { display: block; font: 400 26px/0.95 var(--display); text-transform: uppercase; color: #fff; text-shadow: 2px 2px 0 var(--red-d); white-space: nowrap; }
.reward-pop small { display: block; font: 400 14px var(--display); color: var(--gold); }
.reward-pop .spark { display: none; }
.reward-pop .spark { position: absolute; left: 50%; top: 32px; width: 8px; height: 8px; margin: -4px; background: #fff; box-shadow: 40px -30px 0 var(--gold), -46px -22px 0 var(--red-b), 60px 20px 0 #fff, -58px 28px 0 var(--gold), 20px 52px 0 var(--red-b), -24px -54px 0 #fff, 0 -70px 0 var(--gold), 78px -6px 0 var(--red-b), -80px 4px 0 #fff; animation: spark 0.6s steps(6) forwards; }
@keyframes rewardPop { 0% { transform: translate(-50%, -40%); opacity: 0; } 12% { transform: translate(-50%, -50%); opacity: 1; } 80% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -60%); } }
@keyframes spark { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }

.dock { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 12px calc(var(--safe-b) + 10px); background: linear-gradient(0deg, rgba(11, 11, 11, 0.97) 70%, rgba(11, 11, 11, 0)); max-width: 620px; margin: 0 auto; }
.ops { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin-bottom: 4px; }
.ops::-webkit-scrollbar { display: none; }
.ops:empty, .ops .hint { display: none; }
.op { position: relative; flex: none; display: grid; grid-template-columns: 22px auto 26px; gap: 0 6px; align-items: center; padding: 4px 4px 6px 6px; background: #161515; max-width: 220px; border-left: 4px solid var(--kc, #fff); }
.op > .wi { width: 22px; height: 22px; grid-row: 1 / 3; }
.op b { font: 400 17px/1 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.op small { font: 400 17px/1 var(--display); white-space: nowrap; }
.op small em { font-style: normal; color: var(--muted); }
.op .rc { grid-row: 1 / 3; grid-column: 3; width: 26px; height: 26px; display: grid; place-items: center; }
.op .rc .wi { width: 18px; height: 18px; }
.op .prog { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--kc, #fff); }
.op.done { opacity: 0.55; }
.send-row { display: flex; align-items: baseline; gap: 8px; margin: 0 2px; }
.send-label { font: 400 17px var(--display); color: var(--muted); text-transform: uppercase; white-space: nowrap; }
.send-label b { color: var(--fg); font-weight: 400; font-size: 22px; }
.send-label em { font-style: normal; }
.send-chips { display: flex; gap: 6px; }
.send-chips button { height: 26px; min-width: 40px; padding: 0 6px; background: #1d1b1b; font: 400 17px var(--display); }
.send-chips button.on { background: #fff; color: #111; }
.send-row { justify-content: space-between; }
.slider-row { display: flex; align-items: center; gap: 6px; margin: 1px 0 4px; }
.slider-row .step { width: 34px; height: 30px; flex: none; background: #1d1b1b; font: 400 24px/1 var(--display); color: #fff; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.5); touch-action: manipulation; }
.slider-row .step:active { background: var(--red); }
.dock-row .grow { flex: 1; }
.dock-row { display: flex; align-items: center; gap: 10px; }
.tactics-row { display: flex; gap: 8px; }
.tbtn { position: relative; width: 54px; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; margin: 3px; background: var(--panel); --fc: var(--line); box-shadow: 0 -3px 0 0 var(--fc), 0 3px 0 0 var(--fc), -3px 0 0 0 var(--fc), 3px 0 0 0 var(--fc); }
.tbtn > .wi { width: 26px; height: 26px; position: relative; z-index: 1; }
.tbtn .tl { position: relative; z-index: 1; font: 400 13px/1 var(--display); text-transform: uppercase; color: #d8d2c6; white-space: nowrap; }
.tbtn .cd { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--cd, 0) * 100%); background: rgba(0, 0, 0, 0.72); }
.tbtn.ready { --fc: #fff; }
.tbtn[style*="--ab"]::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--ab); }
.tbtn.active { --fc: var(--red-b); background: var(--red-d); }
.tbtn.aim { background: var(--red); --fc: #fff; }
.tbtn.dig em { position: absolute; top: -9px; right: -9px; min-width: 20px; padding: 1px 3px; background: var(--red); text-align: center; font: 400 15px/1 var(--display); font-style: normal; color: #fff; z-index: 2; text-shadow: 1px 1px 0 #000; }
.tbtn.dig em:empty { display: none; }
.cmds { display: flex; flex-direction: column; gap: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 2px; }
.chips .btn { font-size: 17px; min-height: 34px; }
.rally { position: relative; flex: none; width: 72px; height: 52px; margin: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--red); color: #fff; font: 400 18px/1 var(--display); text-transform: uppercase; touch-action: manipulation; box-shadow: 0 -4px 0 0 #fff, 0 4px 0 0 #fff, -4px 0 0 0 #fff, 4px 0 0 0 #fff, inset 0 -5px 0 var(--red-d); }
.rally > .wi { width: 26px; height: 26px; }
.rally em { position: absolute; top: -16px; right: -8px; font: 400 20px var(--display); font-style: normal; color: #fff; background: #000; padding: 0 4px; }
.rally em:empty { display: none; }
.rally.hit { transform: translateY(3px); box-shadow: 0 -4px 0 0 #fff, 0 4px 0 0 #fff, -4px 0 0 0 #fff, 4px 0 0 0 #fff, inset 0 4px 0 var(--red-d); }
.float { position: fixed; pointer-events: none; font: 400 24px var(--display); color: #fff; text-shadow: 2px 2px 0 var(--red-d); animation: floatUp 0.7s steps(7) forwards; z-index: 40; }
@keyframes floatUp { to { transform: translateY(-48px); opacity: 0; } }

input[type=range] { flex: 1; min-width: 0; -webkit-appearance: none; appearance: none; height: 52px; background: transparent; margin: 0; touch-action: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 20px; background: linear-gradient(90deg, var(--red) var(--fill, 35%), #2a2626 0); box-shadow: inset 0 0 0 3px #000; }
input[type=range]::-moz-range-track { height: 20px; background: linear-gradient(90deg, var(--red) var(--fill, 35%), #2a2626 0); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 46px; margin-top: -13px; background: #fff; border: 0; box-shadow: inset 0 -6px 0 #9a948c, 0 0 0 3px #000; }
input[type=range]::-moz-range-thumb { width: 30px; height: 46px; background: #fff; border: 0; border-radius: 0; }
#h-send { height: 30px; }
#h-send::-webkit-slider-runnable-track { height: 10px; box-shadow: inset 0 0 0 2px #000; }
#h-send::-moz-range-track { height: 10px; }
#h-send::-webkit-slider-thumb { width: 18px; height: 26px; margin-top: -8px; box-shadow: inset 0 -4px 0 #9a948c, 0 0 0 2px #000; }
#h-send::-moz-range-thumb { width: 18px; height: 26px; }

/* ---------- sheets, modals, toasts ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 14px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 50; }
.toast { max-width: calc(100vw - 32px); padding: 6px 12px; background: #111; color: var(--fg); font: 400 20px var(--display); text-transform: uppercase; box-shadow: 0 -3px 0 0 #fff, 0 3px 0 0 #fff, -3px 0 0 0 #fff, 3px 0 0 0 #fff; animation: dispIn 0.2s steps(4); transition: opacity 0.3s; }
.toast.bad { background: var(--red); }
.toast.out { opacity: 0; }

#modal, #sheet { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; padding: 14px; padding-bottom: calc(var(--safe-b) + 14px); }
#modal { background: rgba(5, 5, 5, 0.78); }
#sheet { z-index: 25; background: rgba(5, 5, 5, 0.35); }
@media (min-width: 720px) { #modal { align-items: center; } }
.sheet-box {
  width: calc(100% - 8px); max-width: 450px; max-height: calc(100% - var(--safe-t) - 10px); overflow-y: auto; background: var(--panel); margin: 4px;
  padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 12px; animation: dispIn 0.2s steps(4);
  box-shadow: 0 -4px 0 0 #fff, 0 4px 0 0 #fff, -4px 0 0 0 #fff, 4px 0 0 0 #fff;
}
.sheet-box h2 { margin: 0; font: 400 40px/0.9 var(--display); text-transform: uppercase; color: #fff; text-wrap: balance; }
.sheet-box p { margin: 0; color: var(--muted); font-size: 15px; }
.sheet-box .actions { display: flex; gap: 8px; }
.sheet-box .actions .btn { flex: 1; }
.sheet-box input[type=text] { width: 100%; height: 46px; border: 0; background: #0b0b0b; color: var(--fg); padding: 0 12px; font: 400 16px var(--body); -webkit-user-select: text; user-select: text; border-radius: 0; box-shadow: inset 0 0 0 3px var(--line); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 60px; height: 38px; background: #1d1b1b; font: 400 19px var(--display); text-transform: uppercase; color: var(--muted); }
.seg button.on { background: var(--red); color: #fff; }
.field-label { font: 400 18px var(--display); text-transform: uppercase; color: var(--red-b); margin-bottom: -4px; }
.tips { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tips li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: start; }
.tips li .wi { width: 36px; height: 36px; }
.tips li p { color: var(--fg); font-size: 15px; }
.tips li p b { color: var(--red-b); font-weight: 400; }
.fineprint { font-size: 13px; color: var(--muted); text-align: center; }

/* nation panel and chat */
.nation-head { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center; }
.nation-head canvas { width: 60px; height: 60px; display: block; image-rendering: pixelated; }
.nation-head .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; font: 400 17px var(--display); color: var(--muted); }
.dip { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dip .wide { grid-column: 1 / -1; }
.dip .btn { font-size: 19px; }
.loanrow { display: flex; gap: 4px; align-items: center; }
.loanrow span { font: 400 19px var(--display); text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.loanrow .btn { flex: 1; }
.debt { padding: 6px 10px; background: #2a2208; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 180px; min-height: 56px; overflow-y: auto; padding: 8px; background: #0b0b0b; -webkit-user-select: text; user-select: text; }
.msg { max-width: 82%; padding: 5px 9px; font-size: 15px; line-height: 1.2; background: #232020; align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--red-d); }
.msg .emo { width: 48px; height: 48px; }
.msg.sys { align-self: center; background: none; color: var(--muted); font: 400 16px var(--display); text-transform: uppercase; }
.emotes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.emotes button { aspect-ratio: 1; background: #1d1b1b; display: grid; place-items: center; padding: 3px; }
.compose { display: flex; gap: 6px; align-items: center; }
.compose input { flex: 1; }
.nlist { display: flex; flex-direction: column; }
.nrow { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 10px; align-items: center; padding: 8px 2px; border-top: 2px solid #201e1e; text-align: left; }
.nrow:first-child { border-top: 0; }
.nrow i { width: 12px; height: 12px; }
.nrow b { font: 400 22px/1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.nrow small { font: 400 18px var(--display); color: var(--muted); }
.nrow .unread { width: 10px; height: 10px; background: var(--red); }

/* deployment & vote */
.mm-head { display: flex; align-items: center; gap: 14px; }
.mm-head > div:not(.radar) { flex: 1; min-width: 0; }
.mm-head small { font: 400 20px var(--display); color: var(--muted); text-transform: uppercase; }
.radar { width: 76px; height: 76px; position: relative; flex: none; background: #120707; overflow: hidden; box-shadow: inset 0 0 0 3px var(--red-d); background-image: linear-gradient(var(--red-d) 2px, transparent 2px), linear-gradient(90deg, var(--red-d) 2px, transparent 2px); background-size: 19px 19px; }
.radar::after { content: ''; position: absolute; left: 50%; top: 50%; width: 76px; height: 3px; background: var(--red-b); transform-origin: 0 50%; animation: sweep 1.2s steps(16) infinite; }
.radar i { position: absolute; width: 6px; height: 6px; background: #fff; animation: blip 1s steps(3) forwards; }
@keyframes sweep { to { transform: rotate(1turn); } }
@keyframes blip { to { background: var(--red); } }
#mm-vote { display: flex; flex-direction: column; gap: 10px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 3px; }
.rcard { display: grid; grid-template-columns: 10px 1fr auto; gap: 5px; align-items: center; padding: 2px 5px; background: #1b1919; min-height: 24px; min-width: 0; animation: dispIn 0.15s steps(3); }
.rcard i { width: 10px; height: 10px; }
.rcard b { font: 400 16px/1 var(--display); text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.rcard small { font: 400 14px var(--display); color: var(--muted); }
.rcard.real b { color: #fff; } .rcard.bot b { color: var(--muted); }
.rcard.real i { outline: 2px solid #fff; }
.rcard.empty { background: #141313; animation: none; }
.rcard.me { background: var(--red-d); }
.roster.dense { display: grid; grid-template-columns: repeat(auto-fill, 12px); gap: 3px; justify-content: center; }
.rdot { width: 12px; height: 12px; background: #1d1b1b; }
.rdot.real { outline: 2px solid #fff; outline-offset: -1px; }
.rdot.bot { opacity: 0.7; }
.rdot.me { outline: 3px solid var(--red-b); }
.mm-count { text-align: center; font: 400 20px var(--display); color: var(--muted); text-transform: uppercase; }
.mm-count b { color: #fff; font-weight: 400; }
.votes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vote { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 5px; background: #1b1919; text-align: left; min-width: 0; outline: 3px solid transparent; outline-offset: -3px; }
.vote canvas { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated; }
.vote b { font: 400 19px/1 var(--display); text-transform: uppercase; font-weight: 400; }
.vote small { font: 400 14px var(--display); color: var(--muted); text-transform: uppercase; }
.vote .count { position: absolute; top: 8px; right: 8px; min-width: 24px; padding: 0 5px; background: #000; font: 400 20px var(--display); text-align: center; }
.vote.mine { outline-color: #fff; }
.vote.win { outline-color: var(--red); }
.vote.lose { opacity: 0.3; }
.countdown { font: 400 30px var(--display); color: var(--red-b); text-align: center; text-transform: uppercase; }

/* results */
.result-head { text-align: center; }
.result-head .place { font: 400 96px/0.8 var(--display); }
.result-head .verdict { font: 400 36px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 6px; }
.result-head.win .place { color: var(--gold); }
.result-head.win .verdict { color: var(--gold); }
.result-head.out .verdict { color: var(--red-b); }
.score { display: flex; align-items: baseline; justify-content: center; gap: 8px; font: 400 20px var(--display); color: var(--muted); text-transform: uppercase; }
.score b { font: 400 40px var(--display); color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stats div { background: #1b1919; padding: 6px; text-align: center; }
.stats b { display: block; font: 400 26px/1 var(--display); }
.stats small { color: var(--muted); font: 400 14px var(--display); text-transform: uppercase; }
.medal-row { display: flex; gap: 10px; overflow-x: auto; }
.medal-row .medal { flex: none; width: 74px; color: var(--fg); animation: pop 0.3s steps(4) both; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.rewards { display: flex; flex-direction: column; gap: 6px; }
.rewards > div { display: flex; align-items: center; gap: 10px; font: 400 21px var(--display); text-transform: uppercase; }
.rewards .wi { width: 24px; height: 24px; }
.rewards .grow { flex: 1; }
.rewards b { font-weight: 400; }
.up { color: #fff; } .down { color: var(--red-b); }

/* crates */
.crate-stage { display: grid; place-items: center; min-height: 220px; }
.crate-stage .big { width: 144px; height: 144px; cursor: pointer; animation: rattle 0.4s steps(2) infinite; }
.crate-stage .big .wi { width: 144px; height: 144px; }
/* Painted item art: coins, gems, crates, boosters. A dark drop shadow seats them on the panels. */
.art { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; }
.art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.6)); pointer-events: none; image-rendering: pixelated; }
.chip .art { width: 24px; height: 24px; }
.day .art { width: 32px; height: 32px; }
.crate .art { width: 72px; height: 72px; margin: -6px 0 -2px; transition: transform 0.15s; }
.crate.has .art { animation: crate-bob 1.6s ease-in-out infinite; filter: drop-shadow(0 0 10px var(--crate)); }
@keyframes crate-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-2deg); } }
.crate-stage .big .art { width: 168px; height: 168px; }
.art.huge { width: 132px; height: 132px; position: relative; z-index: 1; }
.pack .art { width: 76px; height: 76px; margin: 2px auto; }
.line-item > .art { width: 44px; height: 44px; }
.warchest > .art { width: 84px; height: 84px; }
.starter > .art.side { grid-column: 2; grid-row: 1 / 3; align-self: start; justify-self: center; width: 88px; height: 88px; }
.starter > .btn { grid-row: 3; grid-column: 1 / 3; }

.crate-stage .big.boom { animation: boom 0.4s steps(4) forwards; }
@keyframes rattle { 50% { transform: translateX(4px) rotate(3deg); } }
@keyframes boom { to { transform: scale(1.8); opacity: 0; } }
.loot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px; min-width: 220px; background: #111; animation: pop 0.3s steps(4); box-shadow: 0 -4px 0 0 var(--rc), 0 4px 0 0 var(--rc), -4px 0 0 0 var(--rc), 4px 0 0 0 var(--rc); }
.loot .rar { font: 400 26px var(--display); color: var(--rc); text-transform: uppercase; }
.loot .wi, .loot canvas { width: 96px; height: 96px; display: block; image-rendering: pixelated; }
.loot b { font: 400 30px var(--display); text-transform: uppercase; font-weight: 400; }
.loot small { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.rewards .rw { animation: rowIn 0.32s steps(4) backwards; }
@keyframes rowIn { from { transform: translateX(-24px) scale(0.9); opacity: 0; } 60% { transform: translateX(4px) scale(1.04); opacity: 1; } }
.next-goal { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 8px 10px; background: rgba(242, 183, 5, 0.08); font: 400 17px/1.1 var(--display); color: var(--gold); text-transform: uppercase; }
.next-goal .wi { width: 22px; height: 22px; flex: none; }

/* Pixel filter for big headline text only (defined as an SVG filter in index.html). Small text stays crisp.
   Apple's WebKit (Safari, every iPhone browser, the iOS app) blanks text under this filter, so it's off there. */
html.no-pxf .logo, html.no-pxf .play > b, html.no-pxf .sheet-box > h2, html.no-pxf .verdict, html.no-pxf .result-head .place, html.no-pxf .reward-pop b, html.no-pxf .showdown b, html.no-pxf .hud-troops b, html.no-pxf .hud-land, html.no-pxf .o-head b { filter: none; }
.logo, .play > b, .sheet-box > h2, .verdict, .result-head .place, .reward-pop b, .showdown b, .hud-troops b, .hud-land, .o-head b { filter: url(#pxf); }
.legal-links { display: flex; gap: 18px; justify-content: center; margin: 12px 0 4px; font-size: 14px; }
.legal-links a { color: var(--muted); }
.card.earn p { margin: 0; font-size: 14px; color: var(--muted); }
.logo-img { display: block; height: 62px; width: auto; image-rendering: auto; margin: -4px 0 -6px -4px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.6)); }
.linkbtn { display: inline; padding: 0; margin-left: 4px; color: var(--fg); text-decoration: underline; font: inherit; }

/* ---------- battle controls: odds bar, sword, drawing bar, inbox panel ---------- */
/* The odds bar: full width under the leaderboard while you have a target. */
.oddsbar { position: absolute; left: 8px; right: 8px; top: var(--oddsTop, calc(var(--safe-t) + 210px)); z-index: 6; max-width: 640px; margin: 0 auto; padding: 6px 8px 7px; background: rgba(12, 11, 11, 0.92); box-shadow: inset 0 0 0 2px #2c2929; }
.oddsbar.betray { box-shadow: inset 0 0 0 2px var(--red); }
.ob-row { display: flex; align-items: center; gap: 8px; }
.ob-chip { width: 14px; height: 14px; flex: none; box-shadow: 0 0 0 2px #000; }
.ob-name { flex: 1; min-width: 0; font: 400 19px/1 var(--display); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-pct { font: 400 26px/1 var(--display); min-width: 46px; text-align: right; }
.ob-x { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: #1d1b1b; }
.ob-x .wi { width: 16px; height: 16px; }
.ob-modes { display: flex; gap: 4px; flex: none; }
.ob-modes button { display: flex; align-items: center; gap: 3px; height: 30px; padding: 0 6px; background: #1d1b1b; font: 400 14px/1 var(--display); text-transform: uppercase; color: var(--muted); box-shadow: inset 0 0 0 2px #2c2929; }
.ob-modes button .wi { width: 16px; height: 16px; }
.ob-modes button.on { background: #f2eee6; color: #000; }
.ob-meter { height: 8px; margin: 6px 0 4px; background: #2a2727; }
.ob-meter i { display: block; height: 100%; width: 0; transition: width 0.2s steps(4); }
.ob-verdict { display: block; font: 400 13px/1.2 var(--body); color: #cfc9bd; quotes: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The inbox: a panel over the top of the screen with a big X, not a full sheet. */
.topsheet { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--oddsTop, 220px) + 70px); max-height: 72vh; z-index: 9; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 6px) 10px 8px; background: rgba(10, 9, 9, 0.97); box-shadow: 0 3px 0 #000, 0 6px 0 var(--red); }
.ts-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ts-head h3 { margin: 0; font: 400 26px var(--display); text-transform: uppercase; }
.ts-x { width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: var(--red); }
.ts-x .wi { width: 22px; height: 22px; }
.ts-body { flex: 1; min-height: 0; overflow-y: auto; }
/* Drawing strikes or halt lines: undo, redo, what's next. */
.drawbar { position: absolute; left: 10px; right: 10px; bottom: calc(var(--dock, 170px) + 6px); z-index: 6; max-width: 520px; margin: 0 auto; display: flex; align-items: center; gap: 6px; padding: 6px; background: rgba(12, 11, 11, 0.94); box-shadow: inset 0 0 0 2px var(--red); }
.drawbar .dt { flex: 1; min-width: 0; font: 400 15px/1.1 var(--display); text-transform: uppercase; }
.drawbar .db { width: 42px; height: 42px; flex: none; display: grid; place-items: center; background: #1d1b1b; }
.drawbar .db.wide { width: auto; padding: 0 10px; font: 400 15px var(--display); text-transform: uppercase; }
.drawbar .db:disabled { opacity: 0.35; }
.drawbar .db .wi { width: 22px; height: 22px; }
/* The dock row: tactics, Arsenal, Strike, Halt line, then the sword. */
.dock-row { gap: 2px; }
.dock-row .tbtn { width: 52px; margin: 3px 2px; }
.dock-row .tbtn .tl { font-size: 12px; }
.tool-btn.on { --fc: #fff; background: var(--red); }
.tool-btn.arsenal .energy { position: absolute; left: 5px; right: 5px; bottom: 3px; height: 4px; background: #2a2727; }
.tool-btn.arsenal .energy i { display: block; height: 100%; width: 0; background: var(--gold); }
.tool-btn.arsenal.ready { --fc: var(--gold); }
.sword { position: relative; flex: none; width: 74px; height: 74px; margin: 0 2px 4px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: radial-gradient(circle at 38% 32%, #ff5a4a, var(--red) 55%, #7d0f14); box-shadow: 0 0 0 3px #000, 0 0 0 5px #f2eee6, 0 6px 0 5px #000; color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.sword .wi { width: 34px; height: 34px; }
.sword span { font: 400 13px/1 var(--display); text-transform: uppercase; }
.sword em { position: absolute; top: -10px; right: -8px; font: 400 18px var(--display); font-style: normal; background: #000; padding: 0 4px; }
.sword em:empty { display: none; }
.sword.armed { animation: swordPulse 1.2s steps(2) infinite; }
.sword.hit { animation: swordHit 0.12s steps(2); }
@keyframes swordPulse { 50% { box-shadow: 0 0 0 3px #000, 0 0 0 5px #ffcf5a, 0 6px 0 5px #000; } }
@keyframes swordHit { 0% { transform: scale(0.9) translateY(3px); } 100% { transform: none; } }
body.spawning .sword { filter: grayscale(1) brightness(0.6); }
/* The plus menu (hold a nation): small circles. */
.radial .arm { width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; box-shadow: 0 0 0 3px #000, 0 0 0 5px var(--line, #3a3636); }
.radial .arm .wi { width: 22px; height: 22px; }
.radial .arm span { font-size: 11px; }
.radial .up { top: -66px; } .radial .down { top: 66px; } .radial .left { left: -72px; } .radial .right { left: 72px; }
/* Arsenal: energy */
.energy-big { position: relative; height: 22px; margin: 4px 0 8px; background: #2a2727; }
.energy-big i { display: block; height: 100%; background: linear-gradient(90deg, #b0901a, #f2b705); }
.energy-big span { position: absolute; inset: 0; display: grid; place-items: center; font: 400 16px var(--display); text-transform: uppercase; text-shadow: 0 1px 0 #000; }
.wrow .cost { color: var(--muted); }
.wrow .cost .en { color: var(--gold); }

/* Rally: its own spammable button next to the sword. It heats up (gold) as the multiplier climbs. */
.rally-btn { position: relative; flex: none; width: 62px; height: 62px; margin: 0 4px 4px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  background: color-mix(in srgb, #1d1b1b, #c98a1c calc(var(--heat, 0) * 100%)); box-shadow: 0 -3px 0 0 #f2eee6, 0 3px 0 0 #f2eee6, -3px 0 0 0 #f2eee6, 3px 0 0 0 #f2eee6, inset 0 -4px 0 rgba(0, 0, 0, 0.45); }
.rally-btn .wi { width: 28px; height: 28px; }
.rally-btn span { font: 400 12px/1 var(--display); text-transform: uppercase; }
.rally-btn em { position: absolute; top: -12px; right: -10px; font: 400 16px var(--display); font-style: normal; color: #fff; background: #000; padding: 0 4px; }
.rally-btn em:empty { display: none; }
.rally-btn.hot { box-shadow: 0 -3px 0 0 var(--gold), 0 3px 0 0 var(--gold), -3px 0 0 0 var(--gold), 3px 0 0 0 var(--gold), inset 0 -4px 0 rgba(0, 0, 0, 0.45); }
.rally-btn.hit { animation: swordHit 0.12s steps(2); }
body.spawning .rally-btn { filter: grayscale(1) brightness(0.6); }
/* No target yet: the sword waits (dimmer, no pulse) until you tap something on the map. */
.sword.idle { filter: saturate(0.55) brightness(0.8); }
/* Narrow phones: the tool buttons share the row evenly so the sword and Rally always fit. */
.dock-row .tbtn { flex: 0 1 52px; min-width: 38px; }
.dock-row .tactics-row { flex: 0 1 auto; min-width: 0; gap: 0; }
@media (max-width: 400px) {
  .dock { padding-left: 6px; padding-right: 6px; }
  .dock-row .tbtn { height: 48px; margin: 3px 2px; }
  .dock-row .tbtn > .wi { width: 22px; height: 22px; }
  .dock-row .tbtn .tl { font-size: 10px; }
  .sword { width: 66px; height: 66px; }
  .rally-btn { width: 56px; height: 56px; }
  .dock-row .tbtn { min-width: 36px; }
}

/* Cinematics (js/fx-cinema.js): letterbox bars slide in, the HUD steps back, a caption in the bottom bar. */
body.cine::before, body.cine::after { content: ''; position: fixed; left: 0; right: 0; height: calc(var(--cine, 0) * 9vh); background: #000; z-index: 30; pointer-events: none; }
body.cine::before { top: 0; }
body.cine::after { bottom: 0; }
body.cine .hud-top, body.cine .hud-note, body.cine .dock, body.cine #h-odds, body.cine .board { opacity: calc(1 - var(--cine, 0) * 0.8); }
#cine-cap { position: fixed; left: 0; right: 0; bottom: calc(var(--safe-b, 0px) + 2.2vh); z-index: 31; text-align: center; pointer-events: none; font: 400 22px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: #f2eee6; opacity: 0; text-shadow: 2px 2px 0 #000; }
body.cine #cine-cap.on { opacity: var(--cine, 0); }

/* Flags: the rankings show your flag instead of the colour chip; the flag designer is 12×8. */
#h-board li i.fl { width: 17px; image-rendering: pixelated; }
.fe-cv { width: min(300px, 80vw); height: auto; aspect-ratio: 3 / 2; image-rendering: pixelated; touch-action: none; }

/* War Bond (season pass) and the bundles */
.pass-card { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; color: inherit; border-top: 4px solid var(--gold); }
.pass-card.prem { border-top-color: var(--red); }
.pass-card > div { flex: 1; min-width: 0; }
.pass-card h3 { margin: 0 0 4px; }
.pass-card em { color: var(--gold); font-style: normal; }
.pass-row { display: flex; align-items: center; gap: 8px; font: 400 15px var(--display); }
.pass-row .bar { flex: 1; height: 8px; background: #2a2727; }
.pass-row .bar i { display: block; height: 100%; background: var(--gold); }
.pass-sheet .phead, .ptier { display: grid; grid-template-columns: 34px 1fr 1fr; gap: 6px; align-items: center; }
.pass-sheet .phead { font: 400 14px var(--display); text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.ptiers { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.ptier > b { font: 400 18px var(--display); text-align: center; color: var(--muted); }
.ptier.reached > b { color: #fff; }
.pr { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 6px; background: #1d1b1b; color: #d8d2c6; text-align: left; font: 400 13px/1.1 var(--display); text-transform: uppercase; }
.pr .art, .pr .wi { width: 24px; height: 24px; flex: none; }
.pr.prem { background: #2a2215; }
.pr.open { box-shadow: inset 0 0 0 2px var(--gold); color: #fff; }
.pr.got { opacity: 0.45; }
.pr.big small { color: var(--gold); }
.bundle { display: grid; grid-template-columns: 72px 1fr; gap: 6px 10px; align-items: center; padding: 10px; margin: 0 0 10px; background: var(--panel); box-shadow: inset 0 0 0 2px #3a332a; }
.bundle .art.side { grid-row: span 2; width: 72px; height: 72px; }
.bundle h4 { margin: 0 0 4px; }
.bundle ul { margin: 0; padding-left: 16px; font-size: 13px; color: #d8d2c6; }
.bundle .btn { grid-column: 2; justify-self: start; }
.bundle.b-supreme { box-shadow: inset 0 0 0 2px var(--gold); background: linear-gradient(180deg, #2a2215, var(--panel)); }
.bundle.b-marshal { box-shadow: inset 0 0 0 2px #5d6b34; }

/* Rally pops: the multiplier sprays off the button, spinning out at random angles. */
.rally-pops { position: fixed; inset: 0; pointer-events: none; z-index: 41; }
.rally-pops b { position: absolute; transform: translate(-50%, -50%); font: 400 var(--sz, 18px)/1 var(--display); text-shadow: 2px 2px 0 #000, -1px -1px 0 #000; animation: rallyPop 0.75s steps(9) forwards; white-space: nowrap; }
.rally-pops b.max { text-shadow: 2px 2px 0 #000, 0 0 10px rgba(255, 190, 40, 0.9); }
@keyframes rallyPop {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(0.6); opacity: 1; }
  25% { transform: translate(calc(-50% + var(--dx) * 0.45), calc(-50% + var(--dy) * 0.45)) rotate(var(--rot)) scale(1.15); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(calc(var(--rot) * 1.4)) scale(0.9); opacity: 0; }
}
/* The ×multiplier badge on the button warms to gold too. */
.rally-btn em { color: color-mix(in srgb, #f2eee6, #ffc828 calc(var(--heat, 0) * 100%)); }

/* The pop-up sword: floats beside the target you tapped (js/hud.js placeSword). */
.sword.pop { position: fixed; left: 0; top: 0; width: 72px; height: 72px; margin: 0; z-index: 7; }
.sword.pop[hidden] { display: none; }
.sword.pop.pop-in .wi { animation: swordIn 0.18s steps(3); }
@keyframes swordIn { 0% { transform: scale(0.4); } 100% { transform: none; } }
.sword.pop span { font-size: 12px; }
body.cine .sword.pop { opacity: 0.25; }
/* Rally owns the corner now: a touch bigger. */
.rally-btn { width: 70px; height: 66px; margin-right: 2px; }
.rally-btn .wi { width: 30px; height: 30px; }
.rally-btn span { font-size: 13px; }
@media (max-width: 400px) { .rally-btn { width: 64px; height: 60px; } }

/* The hold menu, in pixel art: square buttons with notched pixel borders, no round corners. */
.radial .arm { width: 60px; height: 58px; margin: -29px 0 0 -30px; border-radius: 0; background: #1a1818; image-rendering: pixelated;
  box-shadow: 0 -3px 0 0 var(--line, #6e6863), 0 3px 0 0 var(--line, #6e6863), -3px 0 0 0 var(--line, #6e6863), 3px 0 0 0 var(--line, #6e6863), inset 0 -4px 0 rgba(0, 0, 0, 0.45), inset 0 3px 0 rgba(255, 255, 255, 0.08); }
.radial .arm.red { background: var(--red); --line: #f2eee6; }
.radial .arm .wi { width: 24px; height: 24px; }
.radial .arm span { font: 400 12px/1 var(--display); letter-spacing: 0.02em; }
.radial .hub { border-radius: 0; box-shadow: 0 -3px 0 0 #000, 0 3px 0 0 #000, -3px 0 0 0 #000, 3px 0 0 0 #000; }

/* Armory live preview: a second little planet (WebGL layer under its 2D canvas). */
.ab-live { position: relative; width: 100%; aspect-ratio: 16 / 10; margin: 8px 0; background: #08080a; box-shadow: 0 -3px 0 0 var(--ab, #8f1d22), 0 3px 0 0 var(--ab, #8f1d22), -3px 0 0 0 var(--ab, #8f1d22), 3px 0 0 0 var(--ab, #8f1d22); overflow: hidden; }
.ab-live .globe-layer, .ab-live .ab-live-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.ab-live .globe-layer { pointer-events: none; }
.ab-live small { position: absolute; left: 6px; bottom: 4px; font: 400 12px var(--display); text-transform: uppercase; color: var(--gold); text-shadow: 1px 1px 0 #000; pointer-events: none; z-index: 2; }
