/* Armageddon 0 (docs/plans/armageddon.md). The Home card is the design file Codex made on Nov 12
   (docs/designs/armageddon-0/card/armageddon-0-card.html), ported with its own class names (.arma-*); the in-match pieces wear the
   same red-on-black, the extruded frame and the pixel title. Barlow Condensed: SIL OFL, assets/armageddon/barlow-license.txt. */
@font-face {
  font-family: "Barlow Condensed";
  src: url("../assets/armageddon/barlow-condensed.ttf") format("truetype");
  font-weight: 800;
  font-display: swap;
}

/* ---------- the Home card ---------- */
.arma-slot { display: block; width: 100%; margin: 0 0 14px; padding: 0 12px 12px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.arma-slot:focus-visible { outline: 2px solid #ff7486; outline-offset: 4px; }
.arma-slot.soon .arma-card { filter: saturate(.92); }
.arma-card {
  --war: 0; --flare: 0; --glow: #ff293d; --depth: 12px;
  position: relative; isolation: isolate; width: 100%; aspect-ratio: 3.4; min-height: 150px;
  display: flex; align-items: center; background: #09090b; color: #f1f1f3; max-height: 210px; /* a banner on a wide Battle column, not a poster */
}
.arma-card.compact { aspect-ratio: 2.5; min-height: 128px; align-items: flex-start; --depth: 8px; }
.arma-card::before {
  content: ""; position: absolute; z-index: -3; inset: 0 0 -7px;
  box-shadow: 0 0 12px #ff1737ba, 0 0 36px #e9194160, 0 14px 60px #ae153d55;
  opacity: calc(.62 + var(--war) * .14 + var(--flare) * .2);
}
.arma-slot.on .arma-card::before { box-shadow: 0 0 0 2px #ff2b43, 0 0 16px #ff1737d0, 0 0 46px #e9194180, 0 14px 70px #ae153d66; }
.arma-card::after {
  content: ""; pointer-events: none; position: absolute; z-index: -2;
  inset: 0 calc(-1 * var(--depth)) calc(-1 * var(--depth)) 0;
  clip-path: polygon(0 0, calc(100% - var(--depth)) 0, 100% var(--depth), 100% 100%, var(--depth) 100%, 0 calc(100% - var(--depth)));
  background:
    linear-gradient(90deg, transparent calc(100% - var(--depth)), #161418 calc(100% - var(--depth)), color-mix(in srgb, #39111a, #bf1539 calc(var(--flare) * 51%)) 100%),
    linear-gradient(180deg, transparent calc(100% - var(--depth)), #64626a calc(100% - var(--depth)), #303037 calc(100% - 6px), #1d1b21 calc(100% - 5px), #0d0c0f calc(100% - 2px));
}
.arma-visual {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  border: 3px solid #45414a; border-top-color: color-mix(in srgb, var(--glow) 79%, #ffe2e8); border-left-color: #db2639; border-right-color: #4a2930; border-bottom-color: #48454e;
  background: radial-gradient(ellipse at 76% 55%, #1a1118, #09090b 61%);
}
.arma-visual canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.arma-visual::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #10090ebc 0%, #0b080bad 25%, #0c080b69 42%, #0c080b16 58%, transparent 71%), linear-gradient(0deg, #0b070e9d, transparent 29%, transparent 82%, #18081025);
}
.arma-card.compact .arma-visual::after { background: linear-gradient(180deg, #0b0b0fe8 0, #0b0b0fbd 30%, transparent 62%, transparent 88%, #0c0c104f); }
.arma-card.no-globe .arma-visual { background: radial-gradient(ellipse at 70% 120%, #7a1a10 0, #2a0d12 40%, #09090b 70%); }
.arma-frame {
  z-index: 2; pointer-events: none; position: absolute; inset: 0;
  border: 1px solid #ff56662a; box-shadow: inset 0 0 0 4px #0a080b9c, inset 0 0 16px #ff132228;
  background:
    linear-gradient(var(--glow), var(--glow)) 0 0 / 63px 3px no-repeat, linear-gradient(var(--glow), var(--glow)) 0 0 / 3px 24px no-repeat,
    linear-gradient(#d3243e, #d3243e) 100% 100% / 64px 3px no-repeat, linear-gradient(#d3243e, #d3243e) 100% 100% / 3px 26px no-repeat,
    linear-gradient(#6a303b, #6a303b) 0 100% / 82px 2px no-repeat;
}
.arma-frame::before, .arma-frame::after { content: ""; position: absolute; bottom: 3px; width: 40px; height: 5px; background: repeating-linear-gradient(-45deg, #e22f4b 0 4px, #35101a 4px 9px); opacity: calc(.7 + var(--flare) * .3); }
.arma-frame::before { left: 4px; } .arma-frame::after { right: 4px; }
.arma-copy { position: relative; padding: 16px 0 20px clamp(18px, 4vw, 46px); }
.arma-card.compact .arma-copy { padding: 14px 0 0 16px; }
.arma-copy::before { content: ""; position: absolute; inset: 9% -14% 7% 0; z-index: -1; background: radial-gradient(ellipse at 23% 60%, #4607148f, #1b0b1136 59%, transparent 75%); }
.arma-eyebrow, .arma-meta, .arma-corner { font: 650 .62rem/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; text-transform: uppercase; letter-spacing: .15em; }
.arma-eyebrow { margin: 0; display: flex; align-items: center; gap: 8px; color: #ff5362; }
.arma-eyebrow::before { content: ""; width: 6px; height: 6px; background: #ff2b41; box-shadow: 0 0 13px #ff1738; }
.arma-title {
  font: 800 clamp(48px, 6vw, 84px)/.82 "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  text-transform: uppercase; letter-spacing: -.018em; margin: 10px 0 16px; color: #eeeeef; text-shadow: 0 4px #535357, 3px 6px #1c171b;
}
.arma-card.compact .arma-title { font-size: clamp(36px, 10.6vw, 56px); margin: 7px 0 8px; }
.arma-title span { color: #ff2b43; }
.arma-title.pixel-ready { position: relative; color: transparent; text-shadow: none; }
.arma-title.pixel-ready span { color: transparent; }
.arma-pixel-title { position: absolute; inset: 0 auto auto 0; display: block; pointer-events: none; image-rendering: pixelated; }
.arma-meta { color: #d5d5dc; margin: 0; }
.arma-meta b { font-weight: inherit; color: #fff; white-space: nowrap; }
.arma-card.compact .arma-eyebrow, .arma-card.compact .arma-meta { font-size: .56rem; }
.arma-corner {
  position: absolute; z-index: 1; top: 20px; right: -46px; width: 160px; padding: 5px 0 6px; text-align: center; transform: rotate(42deg);
  border-block: 1px solid #ff6b7888; background: #a21327ee; color: #fff1f2; font-size: .52rem; letter-spacing: .17em;
}
/* A failing light (Gage 11-15): one short burst every 4 to 11 s, hard steps, never eased (js/armageddon-card.js schedules it). */
.arma-card.flick-a { animation: arma-bulb-a .64s steps(1, end); }
.arma-card.flick-b { animation: arma-bulb-b 1.1s steps(1, end); }
.arma-card.flick-c { animation: arma-bulb-c .3s steps(1, end); }
@keyframes arma-bulb-a { 0% { filter: brightness(.3) } 9% { filter: none } 17% { filter: brightness(.55) } 24% { filter: brightness(1.45) saturate(1.3) } 31% { filter: brightness(.1) } 45% { filter: none } 58% { filter: brightness(.62) } 66%, 100% { filter: none } }
@keyframes arma-bulb-b { 0% { filter: brightness(.5) } 6% { filter: brightness(1.3) } 11% { filter: brightness(.08) } 29% { filter: brightness(.85) } 34% { filter: brightness(.08) } 40% { filter: brightness(1.5) saturate(1.35) } 46% { filter: brightness(.4) } 52% { filter: none } 71% { filter: brightness(.2) } 77%, 100% { filter: none } }
@keyframes arma-bulb-c { 0% { filter: brightness(1.5) saturate(1.3) } 35% { filter: brightness(.15) } 70%, 100% { filter: none } }
.arma-visual::before {
  content: ""; position: absolute; z-index: 1; left: -20px; right: -20px; top: var(--tear, 40%); height: var(--tear-h, 9%); pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, #ff2b4366, #ffffff2e 38%, #33d6ff40 61%, #ff2b4352); mix-blend-mode: screen; box-shadow: 0 1px #000c, 0 -1px #ffffff33;
}
.arma-card.flick-a .arma-visual::before { animation: arma-tear .64s steps(1, end); }
.arma-card.flick-b .arma-visual::before { animation: arma-tear 1.1s steps(1, end); }
@keyframes arma-tear { 0%, 31%, 100% { opacity: 0; transform: none } 17% { opacity: 1; transform: translateX(-14px) } 24% { opacity: 1; transform: translateX(9px) } }
.arma-card.flick-a .arma-visual canvas { animation: arma-slip .64s steps(1, end); }
.arma-card.flick-b .arma-visual canvas { animation: arma-slip 1.1s steps(1, end); }
@keyframes arma-slip { 0%, 31%, 100% { transform: none } 17% { transform: translateX(-7px) } 24% { transform: translateX(4px) } }
.arma-card.flick-a .arma-copy { animation: arma-jolt .64s steps(1, end); }
.arma-card.flick-b .arma-copy { animation: arma-jolt 1.1s steps(1, end); }
@keyframes arma-jolt { 0%, 31%, 100% { transform: none; filter: none } 17% { transform: translateX(5px); filter: drop-shadow(-4px 0 #33d6ffb0) drop-shadow(4px 0 #ff2b43b0) } 24% { transform: translateX(-3px) skewX(-4deg); filter: drop-shadow(3px 0 #33d6ff90) } }
@media (prefers-reduced-motion: reduce) { .arma-card, .arma-card .arma-copy, .arma-card .arma-visual canvas, .arma-card .arma-visual::before { animation: none !important; } }

/* ---------- in the match: the chip under Normal's top bar ---------- */
#arma-chip {
  position: fixed; z-index: 30; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 62px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: min(92vw, 420px); min-height: 30px; padding: 4px 12px 5px 10px;
  border: 1px solid #5a2a31; border-top: 2px solid #c8202a; background: linear-gradient(170deg, #1d1416, #0e0b0c 72%); color: #f2eee6;
  box-shadow: 0 2px 0 #000a, 0 0 18px #ff17370f; font: 400 12px/1.1 var(--display); letter-spacing: .05em; text-transform: uppercase; cursor: pointer;
}
#arma-chip em { font: 650 9px/1 ui-monospace, Menlo, monospace; letter-spacing: .16em; color: #ff5362; font-style: normal; white-space: nowrap; }
#arma-chip b { font-weight: 400; font-size: 14px; white-space: nowrap; }
#arma-chip b small { font-size: 11px; color: #b3aaa0; }
#arma-chip i { font-style: normal; font-size: 11px; color: #e4d3bb; white-space: nowrap; }
#arma-chip.power { border-color: #6a3a30; }
#arma-chip.ready { border-color: #ff2b43; box-shadow: 0 0 0 1px #ff2b4355, 0 0 22px #ff173744; }
#arma-chip.ready i { color: #ff8a96; }
#arma-chip.launch { border-color: #ff2b43; background: linear-gradient(170deg, #3a0d14, #140709 72%); animation: arma-throb 1s steps(2, end) infinite; }
#arma-chip.launch i { font: 400 18px/1 var(--display); color: #fff; letter-spacing: .04em; }
@keyframes arma-throb { 50% { box-shadow: 0 0 0 1px #ff2b43aa, 0 0 26px #ff1737aa; } }
@media (prefers-reduced-motion: reduce) { #arma-chip.launch { animation: none; } }
body.calm #arma-chip.launch { animation: none; }
.arma-bar { position: relative; display: inline-block; width: 70px; height: 5px; background: #2a2224; border: 1px solid #4a3a36; }
.arma-bar > span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #8a0f14, #ff2b43); }
.arma-bar.big { display: block; width: 100%; height: 8px; margin: 8px 0 2px; }

/* ---------- the announcement: a dark card that fades in slowly over the whole match, then leaves ---------- */
#arma-announce {
  position: fixed; inset: 0; z-index: 9700; display: grid; place-items: center; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, #2a060c99, #0006 55%, transparent 80%); opacity: 0; transition: opacity 2.4s cubic-bezier(.3, 0, .2, 1);
}
#arma-announce.on { opacity: 1; }
#arma-announce.out { opacity: 0; transition-duration: 1.8s; }
.arma-ann-card {
  position: relative; width: min(88vw, 520px); padding: 20px 24px 22px; text-align: center; color: #f2eee6;
  background: linear-gradient(170deg, #1a1114f2, #0b090af2 72%); border: 1px solid #5a2a31; border-top: 3px solid #ff2b43;
  box-shadow: 0 0 0 1px #000, 0 0 40px #ff173744, 0 20px 60px #000c; transform: scale(1.06); transition: transform 3.2s cubic-bezier(.2, 0, .1, 1);
}
#arma-announce.on .arma-ann-card { transform: none; }
.arma-ann-frame { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 4px #0a080b9c, inset 0 0 22px #ff132230; }
.arma-ann-frame::before, .arma-ann-frame::after { content: ""; position: absolute; bottom: 4px; width: 46px; height: 5px; background: repeating-linear-gradient(-45deg, #e22f4b 0 4px, #35101a 4px 9px); }
.arma-ann-frame::before { left: 5px; } .arma-ann-frame::after { right: 5px; }
.arma-ann-eyebrow { margin: 0; font: 650 11px/1.2 ui-monospace, Menlo, monospace; letter-spacing: .2em; text-transform: uppercase; color: #ff5362; }
.arma-ann-title { margin: 8px 0 10px; font: 800 clamp(44px, 12vw, 72px)/.84 "Barlow Condensed", Impact, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: -.01em;
  color: #eeeeef; text-shadow: 0 3px #5a5961, 2px 5px #191319, 3px 7px #460919; }
.arma-ann-title span { color: #ff2b43; }
.arma-ann-body { margin: 0 auto; max-width: 40ch; font: 15px/1.35 var(--body); color: #e4d3bb; }
#arma-announce.you .arma-ann-card { border-top-color: #f2b705; }
#arma-announce.you .arma-ann-eyebrow { color: #f2b705; }
#arma-announce.declare .arma-ann-card, #arma-announce.launch .arma-ann-card { border-color: #ff2b43; box-shadow: 0 0 0 1px #000, 0 0 60px #ff1737aa, 0 20px 60px #000c; }
@media (prefers-reduced-motion: reduce) { #arma-announce, .arma-ann-card { transition-duration: .4s !important; } }
body.calm #arma-announce, body.calm .arma-ann-card { transition-duration: .4s; }

/* ---------- the launch: a red curtain over the map while the salvo leaves, and the silo cut-in ---------- */
#arma-curtain { position: fixed; inset: 0; z-index: 9600; pointer-events: none; opacity: 0; transition: opacity 1.2s;
  background: radial-gradient(ellipse at 50% 60%, transparent 40%, #4a0610aa 100%); mix-blend-mode: multiply; }
#arma-curtain.on { opacity: 1; animation: arma-curtain 5s forwards; }
@keyframes arma-curtain { 0% { opacity: 0 } 10% { opacity: 1 } 70% { opacity: 1 } 100% { opacity: 0 } }
#arma-silo {
  position: fixed; z-index: 9650; left: 50%; top: 24%; width: min(80vw, 440px); transform: translateX(-50%) scale(.96); opacity: 0; pointer-events: none;
  border: 3px solid #45414a; border-top-color: #ff2b43; border-left-color: #db2639; background: #0b0a0a; box-shadow: 0 0 0 1px #000, 0 0 30px #ff17375a, 0 18px 50px #000c;
  transition: opacity .25s steps(2, end), transform .25s steps(2, end);
}
#arma-silo.on { opacity: 1; transform: translateX(-50%); }
#arma-silo.out { opacity: 0; }
#arma-silo canvas { display: block; width: 100%; aspect-ratio: 16 / 9; image-rendering: pixelated; }
#arma-silo span { position: absolute; left: 8px; top: 6px; font: 650 10px/1 ui-monospace, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; color: #ff5362; text-shadow: 0 1px #000; }
#arma-silo::after { content: "REC"; position: absolute; right: 8px; top: 6px; font: 650 10px/1 ui-monospace, Menlo, monospace; letter-spacing: .16em; color: #ff2b43; }

/* ---------- the Arsenal sheet's Armageddon section (Normal's journal page; nothing changes a size of the sheet's own rows) ---------- */
#modal .normal-sheet .arma-sec { margin: 0 0 10px; padding: 10px 12px 12px; border: 1px solid #5a2a31; border-top: 2px solid #ff2b43; background: linear-gradient(170deg, #241417, #121012 72%); box-shadow: inset 0 0 18px #ff13220f; }
#modal .arma-sec-title { margin: 0 0 6px; font: 800 26px/.9 "Barlow Condensed", Impact, "Arial Narrow", sans-serif; text-transform: uppercase; color: #eeeeef; text-shadow: 0 2px #5a5961, 1px 3px #460919; }
#modal .arma-sec-title span { color: #ff2b43; }
#modal .arma-sec-line { margin: 0; font-size: 13px; line-height: 1.35; color: #e4d3bb; }
#modal .arma-count { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 8px; }
#modal .arma-count > b { font: 400 38px/1 var(--display); color: #fff; }
#modal .arma-count > span { font: 400 15px/1.15 var(--display); text-transform: uppercase; letter-spacing: .05em; color: #e4d3bb; }
#modal .arma-count small { display: block; font: 12px/1.3 var(--body); text-transform: none; letter-spacing: 0; color: #b3aaa0; }
#modal .arma-buy { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
#modal .arma-buy .btn { display: grid; gap: 2px; min-height: 48px; padding: 6px 8px; text-align: center; }
#modal .arma-buy .btn small { font: 11px/1.2 var(--body); text-transform: none; letter-spacing: 0; opacity: .8; }
#modal .arma-declare { display: flex; gap: 8px; align-items: stretch; }
#modal .arma-go { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; text-align: left; border: 1px solid #8a0f14; background: linear-gradient(170deg, #5a0d14, #2a070b); color: #fff; }
#modal .arma-go svg { width: 28px; height: 28px; flex: none; }
#modal .arma-go span { display: grid; gap: 2px; font: 400 17px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; }
#modal .arma-go small { font: 12px/1.25 var(--body); text-transform: none; letter-spacing: 0; color: #f2c9cd; }
#modal .arma-go[disabled] { opacity: .55; filter: saturate(.5); }
#modal .arma-declare.armed .arma-go { border-color: #ff2b43; box-shadow: 0 0 0 1px #ff2b43, 0 0 18px #ff173766; }
#modal .arma-sword { flex: none; width: 58px; min-height: 52px; display: grid; place-items: center; border: 1px solid #ff2b43; background: #c8202a; color: #fff; box-shadow: 0 3px 0 #5a0d14, 0 0 18px #ff1737aa; cursor: pointer; }
#modal .arma-sword svg { width: 30px; height: 30px; }
#modal .arma-powers { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed #5a4d40; display: grid; gap: 4px; }
#modal .arma-powers li { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #e4d3bb; }
#modal .arma-powers li b { font-weight: 600; color: #f2eee6; }
#modal .arma-powers li.me b { color: #f2b705; }
#modal .arma-powers li.hot { color: #ff8a96; }
