/* SKYLINE — Combat: comm box, map panel, dogfight cards, results, HUD, plates, cut-ins, eject, initiative, heading, GM units. */
/* combat: the VN box is a compact comm strip so the map stays visible */
#stage.combat #dialogue { height: auto; min-height: 0; max-height: 92px; bottom: 10px; left: 3%; right: 3%; padding: 18px 18px 10px; }
#stage.combat #dl-text { font-size: 15px; }
#map { position: absolute; inset: 0 0 100px 0; width: 100%; height: calc(100% - 100px); cursor: crosshair; z-index: 2; }
#map-tip { position: absolute; z-index: 6; padding: 5px 9px; background: rgba(5,10,18,.92); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; pointer-events: none; white-space: pre; }
#vote { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 8; min-width: 320px;
  background: rgba(10,18,30,.95); border: 1px solid var(--warn); border-radius: 10px; padding: 12px; }
#vote button { display: block; width: 100%; text-align: left; margin: 5px 0; }
#vote .bar { height: 3px; background: var(--warn); margin-top: 3px; border-radius: 2px; }
#toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 12; max-width: 60%; }
.toast { background: #3b1414; border: 1px solid var(--bad); padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; }
.toast.ok { background: #0f2e1c; border-color: var(--good); }
/* combat panel */
#my-unit { margin: 8px; }
.ustat { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; }
.pips { letter-spacing: 2px; }
.pips .on { color: var(--accent); } .pips .f { color: #ce93d8; } .pips .off { color: #334; }
#plan-list { margin: 6px 0; padding-left: 22px; }
#plan-list li { margin: 3px 0; }
#plan-list li button { padding: 0 6px; margin-left: 6px; font-size: 11px; }
#log { padding: 8px; white-space: pre-wrap; }
#log div { margin: 2px 0; border-bottom: 1px dotted #1d2636; padding-bottom: 2px; }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 8px; border: 1px solid var(--line); margin: 1px; }
.tag.bad { border-color: var(--bad); color: #ffab91; }
table.sheet { width: 100%; border-collapse: collapse; }
table.sheet td { border-bottom: 1px solid var(--line); padding: 4px; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; grid-template-rows: auto 60vh 1fr; }
  #side { border-left: 0; border-top: 1px solid var(--line); }
}

/* furball card view */
#furball { position: absolute; top: 12px; left: 12px; z-index: 7; width: min(460px, 46%); padding: 10px;
  background: rgba(20,10,8,.9); border: 1px solid #ff8a65; border-radius: 10px; }
#furball .fcols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: start; }
#furball .vs { font: 700 16px var(--head); color: #ff8a65; align-self: center; }
.fcard { border: 1px solid var(--line); border-left: 4px solid #4fc3f7; border-radius: 8px; padding: 5px 8px; margin: 4px 0;
  background: rgba(8,14,24,.85); cursor: pointer; }
.fcard.foe { border-left-color: #ef5350; }
.fcard.me { box-shadow: 0 0 0 1px #fff inset; }
.fcard:hover { border-color: var(--accent); }
.fcard .hit { color: #ffd54f; }

/* RES: result playback */
#results { position: absolute; top: 12px; right: 12px; z-index: 8; width: min(430px, 44%); max-height: calc(100% - 190px);
  display: flex; flex-direction: column; background: rgba(6,12,22,.93); border: 1px solid var(--line); border-radius: 10px; }
#results .rhead { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--line); gap: 6px; }
#results .rbtns { display: flex; gap: 3px; flex-wrap: wrap; }
#results .rbtns button { padding: 1px 7px; font-size: 12px; }
#results .rlist { overflow: auto; padding: 6px 8px; }
.rcard { padding: 6px 8px; margin: 4px 0; border-radius: 7px; border-left: 4px solid #455a64; background: rgba(255,255,255,.04);
  font-size: 14px; cursor: pointer; }
.rcard.fresh { animation: rin .25s ease-out; }
.rcard.small { font-size: 12px; padding: 3px 8px; color: var(--muted); }
.rcard.mine { box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.rcard.hitc { border-left-color: #ff8a65; } .rcard.crit { border-left-color: #ffd740; background: rgba(255,215,64,.08); }
.rcard.miss { border-left-color: #78909c; color: #b0bec5; } .rcard.save { border-left-color: #4dd0e1; }
.rcard.hurt { border-left-color: #ef5350; } .rcard.down { border-left-color: #ff1744; background: rgba(255,23,68,.12); font-weight: 600; }
.rcard.fur { border-left-color: #ff7043; } .rcard.lock { border-left-color: #ffd740; } .rcard.focus { border-left-color: #ce93d8; }
.rcard.skill { border-left-color: #b388ff; }
.rsub { margin: 3px 0 0 14px; font-size: 13px; }
.rsub.hurt { color: #ff8a80; } .rsub.save { color: #80deea; } .rsub.down { color: #ff5252; font-weight: 700; } .rsub.crit { color: #ffd740; }
.why { font: 11px ui-monospace, Consolas, monospace; color: #ffe082; margin-top: 3px; white-space: pre-wrap; }
.rsum { margin: 8px 0 4px; padding: 8px; border: 1px solid var(--accent); border-radius: 8px; background: rgba(79,195,247,.06); }
.rsum table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rsum th { text-align: left; color: var(--muted); font-weight: 400; font-size: 11px; }
.rsum td, .rsum th { padding: 2px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.rsum tr.mine td { color: #fff; font-weight: 600; }
@keyframes rin { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
#banner { position: absolute; left: 0; right: 0; top: 38%; z-index: 11; text-align: center; pointer-events: none;
  font: 800 clamp(26px, 4.4vw, 54px) var(--head); letter-spacing: .04em; color: #fff; opacity: 0;
  text-shadow: 0 0 18px rgba(0,0,0,.9), 0 2px 0 #000; }
#banner.show { animation: bnr 1.5s ease-out forwards; }
#banner.show::before { content: ""; position: absolute; inset: -14px 0; z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(255,87,34,.55) 20%, rgba(255,87,34,.55) 80%, transparent); transform: skewX(-12deg); }
#banner.crit::before { background: linear-gradient(90deg, transparent, rgba(255,193,7,.55) 20%, rgba(255,193,7,.55) 80%, transparent); }
#banner.fur::before { background: linear-gradient(90deg, transparent, rgba(255,112,67,.6) 20%, rgba(255,112,67,.6) 80%, transparent); }
@keyframes bnr { 0% { opacity: 0; transform: translateX(-60px) scale(1.1); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(40px); } }
#stage.shake { animation: shk .3s linear; }
@keyframes shk { 25% { transform: translate(4px, -2px); } 50% { transform: translate(-4px, 2px); } 75% { transform: translate(2px, 1px); } }
@media (prefers-reduced-motion: reduce) { .rcard, .rsub, #banner.show, #stage.shake { animation: none !important; } #banner.show { opacity: 1; } }
/* VNL-05 radio talk in combat */
.msg.comm .radio { color: #b3e5fc; font-family: "Chakra Petch", "Noto Sans Thai", sans-serif; letter-spacing: .02em; }
#dialogue.comm { border-color: rgba(129,212,250,.8); background: linear-gradient(180deg, rgba(6,22,34,.88), rgba(6,18,28,.95)); }
#dialogue.comm #dl-text { color: #b3e5fc; font-family: "Chakra Petch", "Noto Sans Thai", sans-serif; }
#dl-face { display: none; }
/* Ace Combat style radio box: framed portrait on the left, callsign + channel, plain white text, faint scanlines */
#dialogue.comm { padding-left: 130px; min-height: 124px; background: linear-gradient(90deg, rgba(4,10,16,.9), rgba(6,14,22,.82));
  border: 1px solid rgba(160,220,255,.45); border-radius: 2px; }
#dialogue.comm #dl-face { display: block; position: absolute; left: 16px; top: 14px; width: 96px; height: 96px; overflow: hidden;
  border: 2px solid rgba(200,235,255,.85); box-shadow: 0 0 0 3px rgba(4,10,16,.9), 0 0 0 4px rgba(160,220,255,.35); background: #0b1a26; }
#dialogue.comm #dl-face img, #dialogue.comm #dl-face svg { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: saturate(.75) contrast(1.05); }
#dialogue.comm #dl-face .scan { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(160,220,255,.08) 0 1px, transparent 1px 3px); pointer-events: none; }
#dialogue.comm #dl-face.foe { border-color: rgba(255,120,110,.9); box-shadow: 0 0 0 3px rgba(4,10,16,.9), 0 0 0 4px rgba(255,120,110,.35); }
#dialogue.comm #dl-name { font: 800 15px var(--head); letter-spacing: .12em; text-transform: uppercase; }
#dialogue.comm #dl-name::after { content: attr(data-ch); margin-left: 12px; font: 600 10px var(--head); letter-spacing: .24em; color: rgba(200,235,255,.6); }
#dialogue.comm #dl-text { color: #f2f6fa; font-family: var(--body); }
.msg.narr { font-style: italic; color: #cfd8dc; padding-left: 4px; border-left: 2px solid #455a64; }
/* ------------------------------------------------------------------ combat: action cards (Slay the Spire / Limbus style)
   the bar sits at the bottom of the stage while planning; the comm box moves up to a radio strip */
#stage.planning #map { inset: 0 0 126px 0; height: calc(100% - 126px); }
#stage.planning #dialogue { bottom: auto; top: 10px; left: 12px; right: auto; width: min(520px, 50%); max-height: 78px; }
#stage.planning #furball { top: 100px; }
#actionbar { position: absolute; left: 0; right: 0; bottom: 0; height: 126px; z-index: 9; padding: 6px 10px 8px;
  background: linear-gradient(180deg, rgba(6,12,22,.0), rgba(6,12,22,.92) 22%, rgba(6,12,22,.98)); display: flex; flex-direction: column; gap: 6px; }
#ab-chain { display: flex; align-items: center; gap: 6px; min-height: 30px; font-size: 12px; }
#ab-chain .slot { min-width: 74px; height: 28px; display: flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: 5px;
  border: 1px dashed rgba(79,195,247,.35); color: var(--muted); font-family: var(--head); white-space: nowrap; }
#ab-chain .slot.filled { border-style: solid; color: #e3f2fd; background: rgba(79,195,247,.12); cursor: pointer; }
#ab-chain .slot.filled:hover { border-color: var(--bad); }
#ab-chain .slot.t-atk { border-color: #ef5350; background: rgba(239,83,80,.15); }
#ab-chain .slot.t-def { border-color: #66bb6a; background: rgba(102,187,106,.13); }
#ab-chain .slot.t-clash { border-color: #ffca28; background: rgba(255,202,40,.14); }
#ab-chain .arrow { color: var(--muted); }
#ab-chain .en { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#ab-chain .pips span { font-size: 14px; }
#ab-lock { padding: 6px 16px; font: 700 14px var(--head); background: #0f3b57; border: 1px solid var(--accent); }
#ab-lock:disabled { opacity: .4; }
#ab-auto.on { background: #4a3b0c; border-color: #ffca28; color: #ffe082; }
#ab-cards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.acard { position: relative; flex: 0 0 auto; width: 78px; height: 74px; border-radius: 8px; padding: 6px 6px 4px; cursor: grab; user-select: none;
  touch-action: none; background: #142233; border: 2px solid #2c4a66; display: flex; flex-direction: column; align-items: center;
  justify-content: space-between; transition: transform .12s, border-color .12s, box-shadow .12s; }
.acard:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 6px 14px rgba(0,0,0,.5); }
.acard.sel { transform: translateY(-10px); border-color: #fff; box-shadow: 0 0 0 2px var(--accent), 0 8px 18px rgba(0,0,0,.6); }
.acard.dis { opacity: .35; cursor: not-allowed; transform: none; }
.acard .ic { font-size: 24px; line-height: 1; }
.acard .nm { font: 700 11px var(--head); text-align: center; line-height: 1.1; }
.acard .sub { font: 600 8.5px var(--head); letter-spacing: .04em; color: rgba(255,220,220,.7); text-align: center; white-space: nowrap; }
.acard:has(.sub) { width: 92px; }
.acard:has(.sub) .ic { font-size: 18px; }
.acard .cost { position: absolute; top: -8px; left: -8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 800 12px var(--head); background: #0b1a29; border: 2px solid #4fc3f7; color: #b3e5fc; }
.acard .cost.f { border-color: #ce93d8; color: #e1bee7; left: auto; right: -8px; }
.acard.k-move { background: #10283a; border-color: #2f6e93; }
.acard.k-atk { background: #2a1416; border-color: #8e3b3b; }
.acard.k-def { background: #13261a; border-color: #3f7a4c; }
.acard.k-clash { background: #2c2610; border-color: #a0841f; }
.acard.k-skill { background: #241634; border-color: #6d4a94; }
#stage.dragging #map { cursor: copy; }

/* ------------------------------------------------------------------ cockpit HUD roller */
#hud { position: absolute; top: 12px; left: 28%; transform: translateX(-50%); z-index: 11; min-width: 300px; max-width: 92%;
  font-family: var(--head); color: #b9f6ca; background: rgba(2,14,10,.88); border: 1px solid #2e7d5b;
  box-shadow: 0 0 0 1px rgba(105,240,174,.15), 0 0 26px rgba(0,0,0,.6); border-radius: 4px; padding: 8px 12px 10px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
#hud.mine { border-color: #69f0ae; }
#hud .hd { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; letter-spacing: .14em; color: #69f0ae; border-bottom: 1px solid rgba(105,240,174,.25); padding-bottom: 4px; margin-bottom: 6px; }
#hud .cols { display: flex; gap: 14px; }
#hud .col { flex: 1; min-width: 200px; }
#hud .who { font-size: 13px; color: #e8f5e9; margin-bottom: 4px; }
#hud .row { display: grid; grid-template-columns: 64px 44px 1fr; align-items: center; gap: 6px; margin: 3px 0; font-size: 13px; }
#hud .slotn { width: 44px; height: 30px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff;
  background: #04140d; border: 1px solid #2e7d5b; font-variant-numeric: tabular-nums; }
#hud .slotn.spin { color: #69f0ae; animation: hudspin .08s steps(2) infinite; }
@keyframes hudspin { 50% { transform: translateY(-2px); } }
#hud .steps { font-size: 11px; color: #a5d6a7; }
#hud .tot { display: flex; justify-content: space-between; margin-top: 6px; padding-top: 5px; border-top: 1px solid rgba(105,240,174,.25); font-size: 15px; }
#hud .tot b { font-size: 20px; color: #fff; }
#hud .res { font-weight: 800; letter-spacing: .1em; }
#hud .res.ok { color: #69f0ae; } #hud .res.bad { color: #ff5252; } #hud .res.crit { color: #ffd740; } #hud .res.tie { color: #b0bec5; }
#hud .vs { align-self: center; font-size: 18px; color: #ffca28; }
#hud .focus { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
#hud .focus button { background: #0b2219; border: 1px solid #2e7d5b; color: #b9f6ca; padding: 4px 10px; font-family: var(--head); }
#hud .focus button.sel { background: #3a1f4a; border-color: #ce93d8; color: #f3e5f5; }
#hud .go { margin-top: 8px; width: 100%; padding: 10px; font: 800 18px var(--head); letter-spacing: .2em; color: #04140d;
  background: #69f0ae; border: 0; cursor: pointer; }
#hud .go:hover { background: #b9f6ca; }
#hud .bar { height: 3px; background: #69f0ae; margin-top: 6px; transform-origin: left; }
#hud .yn { display: flex; gap: 8px; margin-top: 8px; } #hud .yn button { flex: 1; padding: 8px; font-family: var(--head); }
#rolling { position: absolute; top: 12px; left: 12px; z-index: 10; font: 600 12px var(--head); color: #b9f6ca;
  background: rgba(2,14,10,.85); border: 1px solid #2e7d5b; padding: 4px 10px; border-radius: 3px; }
.rcard.clash { border-left-color: #ffca28; }
@media (max-width: 760px) {
  #stage.planning #dialogue { width: auto; right: 8px; left: 8px; }
  #stage.planning { height: 72vh; }
  #stage.planning #map { inset: 0 0 118px 0; height: calc(100% - 118px); }
  #actionbar { height: 118px; padding: 4px 6px 6px; gap: 4px; }
  #ab-chain { overflow-x: auto; flex-wrap: nowrap; min-height: 32px; }
  #ab-chain .label, #ab-chain .en > span:first-child { display: none; }
  #ab-chain .slot { min-width: 56px; }
  .acard { width: 64px; height: 66px; }
  .acard .ic { font-size: 20px; }
  #hud { min-width: 0; width: 94%; top: 6px; left: 50%; }
  #hud .cols { flex-direction: column; gap: 6px; } #hud .col { min-width: 0; }
}

#res-open { position: absolute; top: 10px; right: 10px; z-index: 8; }
@media (max-width: 760px) {
  #actionbar { height: 130px; }
  #stage.planning #map { inset: 0 0 130px 0; height: calc(100% - 130px); }
  #ab-chain button { padding: 4px 8px; font-size: 12px; white-space: nowrap; }
  #ab-lock { padding: 4px 10px; font-size: 13px; }
  header #hd-status { font-size: 11px; line-height: 1.25; }
}
@media (max-width: 760px) { #ab-chain .en { order: -1; margin-left: 0; } }

/* ------------------------------------------------------------------ turn flow */
#phasebar { position: absolute; left: 0; right: 0; top: 0; height: 28px; z-index: 10; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 0 12px; font: 600 13px var(--head); color: #e3f2fd; background: linear-gradient(90deg, rgba(8,16,28,.2), rgba(8,16,28,.92) 20%, rgba(8,16,28,.92) 80%, rgba(8,16,28,.2));
  border-bottom: 1px solid rgba(79,195,247,.35); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#phasebar .tag { font-size: 11px; padding: 1px 8px; border-radius: 3px; letter-spacing: .08em; border: 1px solid; }
#phasebar.p-plan .tag { color: #4fc3f7; border-color: #4fc3f7; }
#phasebar.p-wait .tag { color: #ffd54f; border-color: #ffd54f; }
#phasebar.p-res .tag { color: #ff8a65; border-color: #ff8a65; animation: tblink .8s steps(2) infinite; }
#phasebar.p-end .tag { color: #a5d6a7; border-color: #a5d6a7; }
#phasebar.p-you { background: linear-gradient(90deg, rgba(60,40,0,.3), rgba(70,50,0,.95) 20%, rgba(70,50,0,.95) 80%, rgba(60,40,0,.3)); border-bottom-color: #ffd54f; }
#phasebar .who { color: #fff; font-weight: 800; }
#phasebar .muted { color: #90a4ae; font-weight: 400; }
#stage.combat #results { top: 38px; } #stage.combat #hud { top: 38px; } #stage.combat #rolling { top: 38px; }
#stage.combat #res-open { top: 36px; } #stage.combat #furball { top: 38px; }
#stage.planning #dialogue { top: 36px; } #stage.planning #furball { top: 126px; }
#turnflag { position: absolute; left: 0; top: 40px; z-index: 10; padding: 6px 18px 6px 12px; font: 800 15px var(--head); color: #fff;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); background: #1565c0; box-shadow: 0 4px 12px rgba(0,0,0,.5); }
#turnflag.foe { background: #b71c1c; }
#turnflag small { display: block; font: 600 10px var(--head); letter-spacing: .14em; opacity: .85; }
#turnflag.show { animation: tflag .35s ease-out; }
@keyframes tflag { from { transform: translateX(-100%); } to { transform: none; } }
#banner.round::before { background: linear-gradient(90deg, transparent, rgba(79,195,247,.55) 20%, rgba(79,195,247,.55) 80%, transparent); }
#banner.end::before { background: linear-gradient(90deg, transparent, rgba(129,199,132,.55) 20%, rgba(129,199,132,.55) 80%, transparent); }
#banner.clash::before { background: linear-gradient(90deg, transparent, rgba(255,202,40,.55) 20%, rgba(255,202,40,.55) 80%, transparent); }
#banner.lose::before { background: linear-gradient(90deg, transparent, rgba(239,83,80,.6) 20%, rgba(239,83,80,.6) 80%, transparent); }

/* ------------------------------------------------------------------ skill cut-in (anime style) */
#cutin { position: absolute; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
#cutin .band { position: absolute; left: -10%; right: -10%; top: 30%; height: 34%; transform: skewY(-6deg);
  background: var(--ci, #1565c0); box-shadow: 0 0 0 4px #fff, 0 0 0 7px rgba(0,0,0,.6), 0 10px 30px rgba(0,0,0,.6);
  animation: ciband 1.25s cubic-bezier(.2,.8,.2,1) forwards; overflow: hidden; }
#cutin.foe .band { animation-name: ciband-r; }
#cutin .band::before { content: ""; position: absolute; inset: 0; opacity: .35;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.9) 0 2px, transparent 2px 38px); animation: speed .25s linear infinite; }
@keyframes speed { to { background-position: -40px 0; } }
#cutin .face { position: absolute; left: 14%; bottom: -6%; height: 120%; aspect-ratio: 3 / 4; transform: skewY(6deg); }
#cutin.foe .face { left: auto; right: 14%; }
#cutin .face img, #cutin .face svg { height: 100%; width: 100%; object-fit: cover; }
#cutin .txt { position: absolute; left: 38%; top: 50%; transform: translateY(-50%) skewY(6deg); color: #fff; text-shadow: 3px 3px 0 rgba(0,0,0,.55); }
#cutin.foe .txt { left: 12%; }
#cutin .nm { font: 700 clamp(14px, 2.2vw, 22px) var(--head); letter-spacing: .3em; opacity: .9; }
#cutin .sk { font: 900 italic clamp(26px, 5vw, 58px) var(--head); line-height: 1; letter-spacing: .02em; }
@keyframes ciband { 0% { transform: skewY(-6deg) translateX(-110%); } 18% { transform: skewY(-6deg) translateX(0); }
  78% { transform: skewY(-6deg) translateX(2%); opacity: 1; } 100% { transform: skewY(-6deg) translateX(110%); opacity: 0; } }
@keyframes ciband-r { 0% { transform: skewY(-6deg) translateX(110%); } 18% { transform: skewY(-6deg) translateX(0); }
  78% { transform: skewY(-6deg) translateX(-2%); opacity: 1; } 100% { transform: skewY(-6deg) translateX(-110%); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #cutin .band, #turnflag.show { animation: none !important; } }
@media (max-width: 760px) {
  #phasebar { font-size: 11px; justify-content: flex-start; }
  #cutin .band { top: 26%; height: 30%; }
}

/* ------------------------------------------------------------------ warning decals (ref: sci-fi caution / danger labels) */
:root { --hz-y: #f5c518; --hz-k: #15171a; --dg-r: #d7262b; --pl-w: #f2f2ee; }
#alerts { position: absolute; left: 50%; top: 20%; transform: translateX(-50%); z-index: 13; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; }
/* Combat plates (RES-15 v2, ref: DOOM Eternal milestone panels): one wide angled grey panel, icon block, tier tag,
   big condensed title and a colour bar that names the kind — incoming / danger / wingman / kill. */
.decal { --k: #f5c518; position: relative; display: grid; grid-template-columns: 96px 1fr auto; align-items: stretch; width: min(660px, 86vw);
  font-family: var(--head); text-transform: uppercase; color: #f4f4f4; filter: drop-shadow(0 10px 22px rgba(0,0,0,.7));
  animation: plate 1.5s cubic-bezier(.2,.9,.2,1) forwards; }
.decal::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #3b3c40, #232427 60%, #1c1d20);
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 34px 100%, 0 calc(100% - 34px)); z-index: -1; }
.decal::after { content: ""; position: absolute; inset: 3px; border: 2px solid rgba(255,255,255,.75); z-index: -1;
  clip-path: polygon(0 0, calc(100% - 32px) 0, 100% 32px, 100% 100%, 32px 100%, 0 calc(100% - 32px)); }
.decal .pl-icon { display: grid; place-items: center; margin: 12px 0 12px 12px; background: #141518; border: 2px solid rgba(255,255,255,.55);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.decal .pl-icon svg { width: 52px; height: 52px; stroke: var(--k); fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.decal .pl-main { padding: 14px 18px 14px 18px; min-width: 0; }
.decal .pl-tag { display: inline-block; font: 800 13px var(--head); letter-spacing: .22em; color: var(--k); }
.decal .pl-big { font: 900 40px/1.02 var(--head); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.decal .pl-small { font: 700 13px var(--head); letter-spacing: .2em; color: #c9c9c9; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decal .pl-bar { height: 8px; margin-top: 10px; background: #0f1012; border: 1px solid rgba(255,255,255,.35); overflow: hidden; }
.decal .pl-bar i { display: block; height: 100%; width: 100%; background: var(--k); transform-origin: left; animation: plbar 1.5s linear forwards; }
.decal .pl-no { align-self: center; margin-right: 26px; font: 900 54px/1 var(--head); color: transparent; -webkit-text-stroke: 2px var(--k); }
.decal.caution { --k: #f5c518; } .decal.danger { --k: #ff3b3b; } .decal.attention { --k: #ff9e3d; } .decal.splash { --k: #4fd1ff; }
.decal.danger.huge { width: min(760px, 92vw); }
.decal.danger.huge .pl-big { font-size: 56px; }
.decal.danger .pl-icon svg { animation: plblink .35s steps(2) 4; }
@keyframes plate { 0% { opacity: 0; transform: translateX(-60px) skewX(-8deg); } 9% { opacity: 1; transform: none; } 84% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateX(40px); } }
@keyframes plbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes plblink { 50% { opacity: .2; } }
#vignette { position: absolute; inset: 0; z-index: 12; pointer-events: none; opacity: 0;
  box-shadow: inset 0 0 0 4px rgba(215,38,43,.9), inset 0 0 120px 30px rgba(215,38,43,.55); }
#vignette.on { animation: vig .9s ease-out; }
@keyframes vig { 0% { opacity: 0; } 10% { opacity: 1; } 30% { opacity: .35; } 45% { opacity: .9; } 100% { opacity: 0; } }

/* ------------------------------------------------------------------ round end (ref: CHALLENGE SUCCESS screen) */
#roundend { position: absolute; inset: 0; z-index: 14; pointer-events: none; overflow: hidden; }
#roundend .bg { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,12,14,.92), rgba(10,12,14,.75) 60%, rgba(10,12,14,.4)); animation: rfade 2.6s forwards; }
#roundend .ghost { position: absolute; left: -2%; top: 18%; font: 900 clamp(70px, 15vw, 190px)/.85 var(--head); letter-spacing: -.02em; color: transparent;
  -webkit-text-stroke: 2px rgba(var(--re-rgb), .35); white-space: nowrap; animation: rghost 2.6s ease-out forwards; }
#roundend .ghost.b { top: 52%; -webkit-text-stroke-color: rgba(var(--re-rgb), .16); animation-delay: .05s; }
#roundend .stage { position: absolute; left: 6%; top: 24%; font: 700 14px var(--head); letter-spacing: .3em; color: #cfd8dc; animation: rin 2.6s forwards; }
#roundend .title { position: absolute; left: 6%; top: 29%; font: 900 clamp(34px, 6vw, 72px)/1 var(--head); color: #fff; animation: rin 2.6s forwards; }
#roundend .en { position: absolute; left: 6%; top: calc(29% + clamp(40px, 7vw, 82px)); font: 900 italic clamp(26px, 5vw, 60px)/1 var(--head);
  color: rgb(var(--re-rgb)); letter-spacing: .02em; animation: rin 2.6s .08s both; }
#roundend .rule { position: absolute; left: 6%; right: 6%; top: 64%; height: 14px; animation: rin 2.6s .12s both;
  background: repeating-linear-gradient(-45deg, rgb(var(--re-rgb)) 0 9px, transparent 9px 18px); opacity: .85; }
#roundend .next { position: absolute; left: 6%; top: calc(64% + 26px); display: flex; gap: 10px; align-items: center; animation: rin 2.6s .16s both; }
#roundend .next .plate { font: 900 22px var(--head); color: var(--hz-k); background: rgb(var(--re-rgb)); padding: 2px 10px; border-radius: 3px; }
#roundend .next .lab { font: 700 13px var(--head); letter-spacing: .18em; color: #eceff1; border: 2px solid #eceff1; padding: 4px 10px; border-radius: 3px; }
#roundend .corner { position: absolute; width: 40px; height: 40px; border: 4px solid rgb(var(--re-rgb)); animation: rin 2.6s both; }
#roundend .corner.tl { left: 2.5%; top: 9%; border-right: 0; border-bottom: 0; } #roundend .corner.br { right: 2.5%; bottom: 9%; border-left: 0; border-top: 0; }
@keyframes rfade { 0% { opacity: 0; } 10% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rghost { 0% { opacity: 0; transform: translateX(-6%); } 12% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; transform: translateX(3%); } }
@keyframes rin { 0% { opacity: 0; transform: translateX(-30px); } 12% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .decal, #roundend *, #vignette.on { animation-duration: .01s !important; } }
@media (max-width: 760px) {
  #alerts { top: 16%; width: 96%; } .decal { grid-template-columns: 64px 1fr auto; } .decal .pl-icon svg { width: 34px; height: 34px; }
  .decal .pl-big, .decal.danger.huge .pl-big { font-size: 26px; } .decal .pl-no { font-size: 34px; margin-right: 18px; }
}
/* ------------------------------------------------------------------ ACT-08 Lock plan CTA */
#ab-row { display: flex; gap: 10px; align-items: stretch; }
#ab-row #ab-cards-wrap { flex: 1; min-width: 0; gap: 4px; }
#ab-cta { flex: 0 0 150px; height: 74px; border-radius: 8px; border: 0; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; font: 800 18px var(--head); letter-spacing: .08em; color: #04121c;
  background: linear-gradient(180deg, #7fdcff, #29b6f6); box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 6px 18px rgba(41,182,246,.45); }
#ab-cta small { font: 600 11px var(--head); letter-spacing: .04em; opacity: .8; }
#ab-cta:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-2px); }
#ab-cta:disabled { cursor: not-allowed; background: #26323d; color: #8a9aa8; box-shadow: 0 0 0 1px #3b4a57; }
#ab-cta.unlock { background: linear-gradient(180deg, #ffe082, #ffb300); box-shadow: 0 0 0 2px rgba(255,255,255,.75); }
#actionbar.locked .acard { opacity: .35; pointer-events: none; }
@media (max-width: 760px) { #ab-cta { flex-basis: 96px; height: 66px; font-size: 14px; } }
/* ------------------------------------------------------------------ RES-14 cinematic skill cut-in (no bands, no frames) */
#cutin { background: transparent; }
#cutin .lb { position: absolute; left: 0; right: 0; height: 13%; background: #000; animation: lb 1.5s ease forwards; }
#cutin .lb.t { top: 0; transform-origin: top; } #cutin .lb.b { bottom: 0; transform-origin: bottom; }
#cutin .shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.35) 55%, rgba(0,0,0,0)); animation: cfade 1.5s ease forwards; }
#cutin.foe .shade { background: linear-gradient(270deg, rgba(0,0,0,.72), rgba(0,0,0,.35) 55%, rgba(0,0,0,0)); }
#cutin .actor { position: absolute; bottom: 13%; left: 4%; height: 74%; aspect-ratio: 3 / 4; animation: cactor 1.5s cubic-bezier(.16,.84,.3,1) forwards; }
#cutin.foe .actor { left: auto; right: 4%; animation-name: cactor-r; }
#cutin .actor img, #cutin .actor svg { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 0 18px rgba(0,0,0,.6)); }
#cutin .words { position: absolute; left: 34%; top: 50%; transform: translateY(-50%); color: #fff; overflow: hidden; padding-right: 20px; }
#cutin.foe .words { left: auto; right: 34%; text-align: right; padding: 0 0 0 20px; }
#cutin .who { font: 600 13px var(--head); letter-spacing: .45em; opacity: 0; color: #cfd8dc; animation: cword 1.5s .15s ease forwards; }
#cutin .sk { font: 800 clamp(30px, 5.4vw, 64px)/1.05 var(--head); letter-spacing: .02em; opacity: 0; animation: cword 1.5s .22s ease forwards; }
#cutin .rule { height: 2px; margin-top: 8px; background: var(--ci, #4fc3f7); transform-origin: left; transform: scaleX(0); animation: crule 1.5s .3s ease forwards; }
#cutin.foe .rule { transform-origin: right; }
@keyframes lb { 0% { transform: scaleY(0); } 15% { transform: scaleY(1); } 85% { transform: scaleY(1); } 100% { transform: scaleY(0); } }
@keyframes cfade { 0% { opacity: 0; } 14% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
@keyframes cactor { 0% { opacity: 0; transform: translateX(-30%) scale(1); } 18% { opacity: 1; transform: translateX(0) scale(1.02); }
  84% { opacity: 1; transform: translateX(2%) scale(1.12); } 100% { opacity: 0; transform: translateX(4%) scale(1.14); } }
@keyframes cactor-r { 0% { opacity: 0; transform: translateX(30%) scale(1); } 18% { opacity: 1; transform: translateX(0) scale(1.02); }
  84% { opacity: 1; transform: translateX(-2%) scale(1.12); } 100% { opacity: 0; transform: translateX(-4%) scale(1.14); } }
@keyframes cword { 0% { opacity: 0; transform: translateX(-40px); } 16% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(12px); } }
@keyframes crule { 0% { transform: scaleX(0); } 22% { transform: scaleX(1); } 82% { transform: scaleX(1); opacity: 1; } 100% { opacity: 0; } }
/* ------------------------------------------------------------------ RES-17 attack action card (soft, left side) */
#actcard { position: absolute; left: 0; bottom: 136px; z-index: 8; display: flex; align-items: flex-end; gap: 10px; pointer-events: none;
  max-width: 46%; animation: actin 2.6s ease forwards; }
#stage:not(.planning) #actcard { bottom: 18%; }
#actcard .face { width: 120px; height: 160px; opacity: .85; -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  mask-image: linear-gradient(180deg, #000 70%, transparent); }
#actcard .face img, #actcard .face svg { width: 100%; height: 100%; object-fit: cover; object-position: top; }
#actcard .txt { padding: 8px 14px 10px 12px; margin-bottom: 18px; background: linear-gradient(90deg, rgba(6,12,22,.85), rgba(6,12,22,0));
  border-left: 3px solid var(--ac, #4fc3f7); }
#actcard .act { font: 800 18px var(--head); letter-spacing: .06em; color: #fff; }
#actcard .act span { color: var(--ac, #4fc3f7); }
#actcard .desc { font: 500 12px var(--body, sans-serif); color: #cfd8dc; margin-top: 2px; max-width: 320px; }
@keyframes actin { 0% { opacity: 0; transform: translateX(-24px); } 12% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (max-width: 760px) { #actcard .face { width: 80px; height: 110px; } #actcard { max-width: 80%; bottom: 140px; } }
/* the roll HUD must never sit on top of the furball panel's text */
#stage:has(#hud:not(.hidden)) #furball { opacity: .12; pointer-events: none; transition: opacity .2s; }
@media (max-width: 760px) {
  #settings { right: 8px; left: 8px; width: auto; top: 90px; }
  .art-ex-h, .art-ex { grid-template-columns: 70px 1fr 1fr 64px 26px; }
  .slot .lnk { display: none; }
  #location { font-size: 14px; top: 8%; }
  #cast .sprite img.body { max-width: 44vw; max-height: 48vh; }
}
.slot .th.bad { color: var(--warn); border-color: var(--warn); font-size: 18px; }
#cast .sprite .imgwarn { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); width: max-content; max-width: 220px; white-space: normal;
  padding: 5px 9px; border-radius: 6px; background: rgba(40,20,0,.85); border: 1px solid var(--warn); color: #ffe0b2; font-size: 12px; text-align: center; }
#cast .sprite .pic { position: relative; }
/* never stack warnings or the turn flag on top of the roll HUD */
#stage:has(#hud:not(.hidden)) #alerts { top: 58%; }
#stage:has(#hud:not(.hidden)) #turnflag { top: auto; bottom: 130px; }
/* the roll HUD sits in the left half, clear of the results list on the right */
#hud { left: 12px; transform: none; max-width: calc(100% - min(430px, 44%) - 36px); }
#hud .row { grid-template-columns: 58px 38px 1fr; }
@media (max-width: 760px) { #hud { left: 8px; right: 8px; max-width: none; } }
/* RES v2: the round feed sits quietly top-right like a score / kill feed — small rows, no big panel */
#results { width: min(340px, 36%); background: transparent; border: 0; border-radius: 0; max-height: 46%; }
#results .rhead { border: 0; padding: 0 0 4px; justify-content: flex-end; opacity: .55; transition: opacity .2s; }
#results:hover .rhead { opacity: 1; }
#results .rhead .label { font-size: 10px; letter-spacing: .2em; margin: 0; }
#results .rbtns button { padding: 0 6px; font-size: 11px; background: rgba(10,14,20,.7); }
#results .rlist { padding: 0; display: flex; flex-direction: column; align-items: flex-end;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%); mask-image: linear-gradient(180deg, transparent 0, #000 22%); }
#results .rcard { margin: 2px 0; padding: 3px 10px; border-radius: 2px; font: 600 12px/1.35 var(--head); background: rgba(10,13,18,.72);
  border-left-width: 3px; max-width: 100%; text-align: right; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); }
#results .rcard.small { font-size: 11px; padding: 2px 10px; }
#results .rcard.down { background: rgba(120,10,24,.55); }
#results .rcard.mine { box-shadow: none; border-right: 2px solid var(--accent); }
#results .rsub { margin: 1px 0 0; font-size: 11px; }
#results .rsum { background: rgba(10,13,18,.8); padding: 6px 8px; font-size: 11px; align-self: stretch; }
#results .rsum table { width: 100%; }
/* EJ-01 eject handle */
#eject { position: absolute; inset: 0; z-index: 16; display: grid; place-items: center; }
#eject .ej-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(120,0,10,.35), rgba(0,0,0,.82));
  animation: ejpulse 1s ease-in-out infinite alternate; }
@keyframes ejpulse { to { background: radial-gradient(ellipse at center, rgba(170,0,16,.45), rgba(0,0,0,.86)); } }
#eject .ej-panel { position: relative; width: min(520px, 92%); padding: 22px 26px; text-align: center; font-family: var(--head); color: #f4f4f4;
  background: linear-gradient(180deg, #3b3c40, #1c1d20); clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 30px 100%, 0 calc(100% - 30px));
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
#eject .ej-tag { font: 800 12px var(--head); letter-spacing: .24em; color: #ff3b3b; }
#eject .ej-title { font: 900 64px/1 var(--head); letter-spacing: .06em; margin: 6px 0; }
#eject .ej-sub { font: 500 13px var(--body); color: #cfcfcf; max-width: 420px; margin: 0 auto 10px; }
#eject .ej-rail { height: 190px; display: grid; justify-items: center; align-content: start; border-top: 1px dashed rgba(255,255,255,.2); padding-top: 10px; }
#eject .ej-handle { width: 150px; cursor: grab; touch-action: none; transition: transform .12s; display: flex; flex-direction: column; align-items: center; user-select: none; }
#eject .ej-handle:active { cursor: grabbing; }
#eject .ej-handle svg { width: 130px; height: 130px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); animation: ejwig 1.2s ease-in-out infinite; }
#eject .ej-handle span { font: 900 18px var(--head); letter-spacing: .3em; color: #f5c518; margin-top: -6px; }
@keyframes ejwig { 50% { transform: translateY(6px); } }
#eject .ej-btns { margin-top: 4px; }
#eject .ej-stay { background: transparent; border: 2px solid #ff3b3b; color: #ffb3b1; font: 800 14px var(--head); letter-spacing: .14em; padding: 6px 18px; }
#eject .ej-bar { height: 6px; margin-top: 12px; background: #0f1012; border: 1px solid rgba(255,255,255,.3); }
#eject .ej-bar i { display: block; height: 100%; width: 100%; background: #ff3b3b; }
#eject .ej-left { font: 600 11px var(--head); letter-spacing: .14em; color: #aaa; margin-top: 4px; }
#eject.fired .ej-bg { background: #fff; animation: ejflash .6s ease-out forwards; }
@keyframes ejflash { from { opacity: 1; } to { opacity: 0; } }
/* MAP-04 zoom / pan controls */
#map-ctl { position: absolute; left: 10px; bottom: 150px; z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: rgba(8,12,18,.7); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
#map-ctl button { width: 30px; height: 28px; padding: 0; font-size: 16px; }
#map-ctl span { font: 600 10px var(--head); color: var(--muted); }
#map { cursor: grab; touch-action: none; }
#map.panning { cursor: grabbing; }
#map.brush { cursor: crosshair; }
#map-brush button.sel { background: #12405e; border-color: var(--accent); }
/* plates v3: smaller, up top, out of the map's way */
#alerts { top: 7%; }
.decal { width: min(440px, 72vw); grid-template-columns: 62px 1fr auto; }
.decal .pl-icon { margin: 8px 0 8px 8px; }
.decal .pl-icon svg { width: 32px; height: 32px; }
.decal .pl-main { padding: 8px 14px 9px; }
.decal .pl-tag { font-size: 10px; }
.decal .pl-big { font-size: 24px; }
.decal .pl-small { font-size: 11px; margin-top: 2px; }
.decal .pl-bar { height: 5px; margin-top: 6px; }
.decal .pl-no { font-size: 34px; margin-right: 18px; -webkit-text-stroke-width: 1.5px; }
.decal.danger.huge { width: min(520px, 80vw); }
.decal.danger.huge .pl-big { font-size: 32px; }
.decal::before, .decal::after { clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px)); }
.asm-pic { position: relative; max-width: min(640px, 92%); max-height: 70vh; object-fit: contain; filter: drop-shadow(0 30px 30px rgba(0,0,0,.55)); animation: asmfloat2 6s ease-in-out infinite; }
@keyframes asmfloat2 { 50% { transform: translateY(-8px); } }
.asm-part .ap-img { width: 100%; max-height: 110px; object-fit: contain; margin-bottom: 6px; background: rgba(0,0,0,.25); }
.hg-ds { display: grid; grid-template-columns: 150px 1fr; gap: 12px; margin-bottom: 10px; }
.hg-ds-pic { height: 120px; border: 2px dashed var(--line); border-radius: 8px; display: grid; place-items: center; align-content: center; cursor: pointer; font-size: 28px; color: var(--muted); overflow: hidden; }
.hg-ds-pic small { font-size: 11px; } .hg-ds-pic img { width: 100%; height: 100%; object-fit: contain; }
.hg-ds-f { display: flex; flex-direction: column; gap: 6px; }
.hq-ds { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0; }
.hq-ds img { width: 120px; max-height: 90px; object-fit: contain; background: #0d131d; border: 1px solid var(--line); border-radius: 6px; }
.sk-ic { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; float: left; margin-right: 8px; }
/* EJ-03: early eject button + softer backdrop */
#eject .ej-bg.soft { background: radial-gradient(ellipse at center, rgba(60,50,0,.30), rgba(0,0,0,.78)); }
#ej-early { position: absolute; left: 12px; top: 64px; z-index: 14; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px; font: 800 12px var(--head); letter-spacing: .14em; color: #15171a; background: #f5c518;
  border: 2px solid #15171a; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.5); cursor: pointer; }
#ej-early .ej-stripe { width: 14px; height: 18px; background: repeating-linear-gradient(45deg, #15171a 0 4px, #f5c518 4px 8px); }
#ej-early:hover { filter: brightness(1.1); }
#ej-early.hidden { display: none; }
/* RES: hit shake — strength by how bad it is */
#stage.hit1 { animation: hit1 .35s linear; }
#stage.hit2 { animation: hit2 .55s linear; }
#stage.hit3 { animation: hit3 .85s linear; }
@keyframes hit1 { 25% { transform: translate(3px, -2px); } 50% { transform: translate(-3px, 2px); } 75% { transform: translate(2px, 1px); } }
@keyframes hit2 { 10% { transform: translate(-9px, 4px) rotate(-.4deg); } 25% { transform: translate(8px, -5px) rotate(.4deg); } 40% { transform: translate(-6px, 3px); }
  55% { transform: translate(5px, -2px); } 75% { transform: translate(-2px, 1px); } }
@keyframes hit3 { 6% { transform: translate(-16px, 8px) rotate(-.8deg) scale(1.02); } 16% { transform: translate(14px, -9px) rotate(.8deg) scale(1.02); }
  28% { transform: translate(-12px, 6px) rotate(-.5deg); } 40% { transform: translate(10px, -5px); } 55% { transform: translate(-6px, 3px); } 70% { transform: translate(4px, -2px); } 85% { transform: translate(-2px, 1px); } }
body.reduce-motion #stage.hit1, body.reduce-motion #stage.hit2, body.reduce-motion #stage.hit3 { animation: none !important; }
@media (prefers-reduced-motion: reduce) { #stage.hit1, #stage.hit2, #stage.hit3, .mo[class*="m-"] { animation: none !important; } }

/* INI-01 initiative strip */
#init-strip { position: absolute; bottom: 128px; left: 50%; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 4px;
  max-width: 92%; overflow-x: auto; padding: 3px 8px; background: rgba(8,12,18,.72); border: 1px solid rgba(255,255,255,.12); border-radius: 4px;
  font: 600 11px var(--head); white-space: nowrap; pointer-events: auto; scrollbar-width: none; }
#init-strip.hidden { display: none; }
#init-strip .lbl { color: var(--muted); letter-spacing: .14em; font-size: 9px; margin-right: 4px; }
#init-strip i { color: rgba(255,255,255,.3); font-style: normal; }
#init-strip .ini { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 3px; border-left: 3px solid #4fc3f7; background: rgba(79,195,247,.10); }
#init-strip .ini.foe { border-left-color: #ef5350; background: rgba(239,83,80,.10); }
#init-strip .ini b { font-size: 10px; opacity: .7; }
#init-strip .ini small { font-size: 9px; color: var(--muted); }
#init-strip .ini.me { box-shadow: inset 0 0 0 1px rgba(79,195,247,.7); }
#init-strip .ini.now { background: #ffd740; color: #15171a; border-left-color: #15171a; }
#init-strip .ini.now small { color: #15171a; }
#init-strip .ini.done { opacity: .4; }
/* MOV-07 heading rose */
#hdg-pick { position: absolute; right: 12px; bottom: 150px; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#hdg-pick.hidden { display: none; }
#hdg-pick .lbl { font: 700 9px var(--head); letter-spacing: .16em; color: var(--muted); }
#hdg-pick .rose { position: relative; width: 84px; height: 84px; border-radius: 50%; background: rgba(8,12,18,.72); border: 1px solid rgba(255,255,255,.15); }
#hdg-pick .rose button { position: absolute; width: 24px; height: 24px; padding: 0; margin: -12px 0 0 -12px; border-radius: 50%; font-size: 11px; line-height: 24px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #cfd8dc; }
#hdg-pick .rose button i { display: inline-block; font-style: normal; }
#hdg-pick .rose button.sel { background: #4fc3f7; color: #0b1520; border-color: #fff; }
#hdg-pick .rose .me { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 14px; }
/* GM unit table */
#gm-units .gmu { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 6px; margin: 2px 0; border-left: 3px solid #4fc3f7; background: rgba(255,255,255,.03); }
#gm-units .gmu.foe { border-left-color: #ef5350; }
#gm-units .gmu.sel { background: rgba(255,215,64,.12); }
#gm-units .gmu b { min-width: 90px; }
#gm-units .gmu select, #gm-units .gmu input { font-size: 11px; padding: 2px 4px; }
#gm-units .gmu input { width: 90px; }
#gm-units .gmu select { width: auto; }
#gm-units .gmu input { width: 90px !important; }
/* CMS-01: the cast over the combat map — in front of the map, smaller, never in the way of clicks */
#stage.cc #cast { z-index: 3; pointer-events: none; transform: scale(.7) !important; transform-origin: 50% 100%; }
#stage.cc #cast .sprite { pointer-events: none !important; opacity: .5; transition: opacity .3s, left .35s ease, filter .3s, transform .3s; }
#stage.cc #cast .sprite.speaking { opacity: 1; }
#stage.cc #cast .sprite b, #stage.cc #cast .sprite .nm { display: none; }

/* SRT-01 sortie roster */
#gm-roster { margin: 6px 0; } #gm-roster .ro-row { display: flex; align-items: center; gap: 8px; }
#gm-roster .ro-row.damaged .nm { color: #ef9a9a; } #gm-roster .ro-row.downed .nm { color: #ffcc80; }

/* CRD-01 card look from Maker › Cards (size, colour per kind, art, style) */
:is(#ab-cards, #mk-abcards) .acard { width: calc(78px * var(--cs, 1)); height: calc(74px * var(--cs, 1)); }
:is(#ab-cards, #mk-abcards) .acard:has(.sub) { width: calc(92px * var(--cs, 1)); }
:is(#ab-cards, #mk-abcards) .acard .ic { font-size: calc(24px * var(--cs, 1)); }
:is(#ab-cards, #mk-abcards) .acard .nm { font-size: calc(11px * var(--cs, 1)); }
:is(#ab-cards, #mk-abcards) .acard.k-move { border-color: var(--k-move, #2f6e93); background-color: color-mix(in srgb, var(--k-move, #2f6e93) 28%, #070b10); }
:is(#ab-cards, #mk-abcards) .acard.k-atk { border-color: var(--k-atk, #8e3b3b); background-color: color-mix(in srgb, var(--k-atk, #8e3b3b) 28%, #070b10); }
:is(#ab-cards, #mk-abcards) .acard.k-def { border-color: var(--k-def, #3f7a4c); background-color: color-mix(in srgb, var(--k-def, #3f7a4c) 28%, #070b10); }
:is(#ab-cards, #mk-abcards) .acard.k-clash { border-color: var(--k-clash, #a0841f); background-color: color-mix(in srgb, var(--k-clash, #a0841f) 28%, #070b10); }
:is(#ab-cards, #mk-abcards) .acard.k-skill { border-color: var(--k-skill, #6d4a94); background-color: color-mix(in srgb, var(--k-skill, #6d4a94) 28%, #070b10); }
:is(#ab-cards, #mk-abcards) .acard.has-art { background-image: linear-gradient(to top, rgba(0,0,0,.88) 10%, rgba(0,0,0,.2) 70%), var(--art); background-size: cover; background-position: center; }
:is(#ab-cards, #mk-abcards) .acard.has-art .nm, :is(#ab-cards, #mk-abcards) .acard.has-art .sub { text-shadow: 0 1px 2px #000; }
/* slant: angled like a HUD plate */
:is(#ab-cards, #mk-abcards).cs-slant .acard { border-radius: 2px; clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%); padding-left: 12px; padding-right: 12px; border-width: 0 0 3px; }
:is(#ab-cards, #mk-abcards).cs-slant .acard .cost { top: 2px; left: 12%; width: 18px; height: 18px; font-size: 10px; }
:is(#ab-cards, #mk-abcards).cs-slant .acard .cost.f { left: auto; right: 12%; }
:is(#ab-cards, #mk-abcards).cs-slant .acard:hover { transform: translateY(-4px); }
/* art: tall cards, the picture fills, the name in a band at the bottom */
:is(#ab-cards, #mk-abcards).cs-art .acard { height: calc(104px * var(--cs, 1)); width: calc(74px * var(--cs, 1)); justify-content: flex-end; padding: 4px; border-radius: 6px; }
:is(#ab-cards, #mk-abcards).cs-art .acard:has(.sub) { width: calc(84px * var(--cs, 1)); }
:is(#ab-cards, #mk-abcards).cs-art .acard .ic { position: absolute; top: 14px; left: 0; right: 0; text-align: center; font-size: calc(28px * var(--cs, 1)); }
:is(#ab-cards, #mk-abcards).cs-art .acard.has-art .ic { top: auto; bottom: calc(30px * var(--cs, 1)); font-size: calc(14px * var(--cs, 1)); opacity: .9; }
:is(#ab-cards, #mk-abcards).cs-art .acard .nm { width: calc(100% + 8px); margin: 0 -4px -4px; padding: 3px 2px; background: rgba(0,0,0,.7); border-radius: 0 0 4px 4px; }
/* minimal: no fill, a coloured rule under it */
:is(#ab-cards, #mk-abcards).cs-minimal .acard { background: rgba(255,255,255,.03) !important; border-width: 0 0 3px; border-radius: 4px; }
:is(#ab-cards, #mk-abcards).cs-minimal .acard.has-art { background-image: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,.45)), var(--art) !important; }
@media (max-width: 760px) {
  :is(#ab-cards, #mk-abcards) .acard { width: calc(64px * var(--cs-m, 1)); height: calc(66px * var(--cs-m, 1)); }
  :is(#ab-cards, #mk-abcards) .acard:has(.sub) { width: calc(76px * var(--cs-m, 1)); }
  :is(#ab-cards, #mk-abcards) .acard .ic { font-size: calc(20px * var(--cs-m, 1)); }
  :is(#ab-cards, #mk-abcards).cs-art .acard { height: calc(92px * var(--cs-m, 1)); }
}
#actionbar.ab-tall { height: auto; min-height: 126px; }
/* CRD-02 a card's own colour (Maker › Cards › Every card) */
:is(#ab-cards, #mk-abcards) .acard.has-cc { border-color: var(--cc) !important; background-color: color-mix(in srgb, var(--cc) 28%, #070b10) !important; }
/* CMB-UX (22 Nov): easier combos */
#ab-chain .chain-scroll { display: flex; align-items: center; gap: 6px; overflow-x: auto; min-width: 0; flex: 0 1 auto; scrollbar-width: thin; padding: 2px 0; }
#ab-chain .slot .sn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,255,255,.14); font-size: 10px; }
#ab-chain .slot .sc { margin-left: 4px; font-size: 10px; color: #ffd54f; }
#ab-chain .slot .sc::after { content: "E"; opacity: .7; }
#ab-chain .slot.picked { outline: 2px solid #fff; }
#ab-chain .slot.over { outline: 2px dashed var(--accent); }
#ab-chain .slot .sx { display: inline-flex; gap: 2px; margin-left: 4px; }
#ab-chain .slot .sx button { padding: 0 5px; min-width: 0; height: 20px; font-size: 12px; line-height: 1; }
#ab-chain .slot.filled:hover { border-color: #fff; }
#ab-chain .en b.err { color: var(--bad); }
#ab-cards-wrap { position: relative; display: flex; align-items: stretch; min-width: 0; }
#ab-cards-wrap #ab-cards { flex: 1; min-width: 0; scroll-behavior: smooth; }
#ab-cards-wrap .ab-sc { flex: 0 0 22px; padding: 0; min-width: 0; font-size: 16px; background: rgba(20,34,51,.9); border: 1px solid #2c4a66; border-radius: 6px; }
#ab-cards-wrap .ab-sc[hidden] { display: none; }
#ab-chain .chain-scroll > * { flex-shrink: 0; }
/* HLP-01: why — on the card, and the draft check above the combo */
.acard .why { position: absolute; left: 2px; right: 2px; top: 22px; font: 600 9px/1.15 var(--head); color: #ffcdd2; background: rgba(120,20,20,.85);
  border-radius: 4px; padding: 1px 3px; text-align: center; white-space: normal; z-index: 2; }
.acard.dis:has(.why) { opacity: .75; }
.acard.dis:has(.why) .ic, .acard.dis:has(.why) .nm { opacity: .45; }
#ab-warn { position: absolute; left: 10px; right: 10px; bottom: 100%; margin-bottom: 4px; display: grid; gap: 3px; z-index: 10; pointer-events: none; }
#ab-warn > div { background: rgba(20,10,10,.92); border: 1px solid #c62828; border-radius: 6px; padding: 4px 8px; font-size: 12px; color: #ffcdd2; }
#ab-warn > .note { border-color: #f9a825; color: #fff3c4; background: rgba(30,24,6,.92); }
#plan-notes .warn { color: #ffe082; } #plan-notes > div { margin: 2px 0; }
/* HLP-02 tap-to-explain */
.ex { cursor: help; text-decoration: underline dotted rgba(255,255,255,.45); text-underline-offset: 3px; font-style: normal; }
#ex-pop { position: fixed; z-index: 140; max-width: 290px; padding: 8px 10px; background: #0d1522; border: 1px solid #3b5274; border-radius: 8px;
  font-size: 12.5px; line-height: 1.4; display: none; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
#ex-pop.on { display: block; } #ex-pop b { display: block; color: var(--accent); margin-bottom: 2px; }
/* TIN-01 team board */
#team-board .tb { padding: 6px 8px; margin: 6px 0; }
.tb-row { padding: 4px 0; border-bottom: 1px solid var(--line); } .tb-row:last-child { border-bottom: 0; }
.tb-row .tag.draft { opacity: .65; border-style: dashed; } .tb-row .tag.on { background: rgba(79,195,247,.2); }
.tb-pin { margin-left: 6px; font-size: 11px; color: #80deea; } .pin-warn .tb-pin { color: #ffe082; }
.tb-warn { color: #ffcc80; } .tb-joint { color: #80deea; }
/* SDS-01 self-destruct controls */
#sd-box { position: absolute; left: 12px; top: 96px; z-index: 30; }
#sd-box .sd-arm { background: #2a0000; color: #ff5252; border: 1px solid #ff5252; font-weight: 700; letter-spacing: .12em; box-shadow: 0 0 12px #ff525255; }
#sd-box .sd-live { background: #1a0000ee; border: 1px solid #ff5252; padding: 8px 12px; color: #fff; display: flex; flex-direction: column; gap: 4px; font-size: 13px;
  animation: sdPulse 1s steps(2) infinite; }
#sd-box .sd-live b { color: #ff5252; letter-spacing: .15em; }
@keyframes sdPulse { 50% { box-shadow: 0 0 18px #ff5252aa; } }
