/* The War Room battle card (Gage 10-28: "relatively no learning curve"). Markup: WarRoom.cardHTML in js/warroom.js, which
   explains the order. This file is the card's one home for styling (it used to be spread over kit.css, dispatch-polish.css and
   warmap.css; the rules that still sit there, like .battle-advantages, are overridden here inside .wr-card). The card sits on
   the map attached to its pin; .wc-in scrolls on a short phone while .wc-go (seats, time, READY UP) stays pinned at the bottom. */
.wr-card { position: absolute; left: 0; top: 0; z-index: 4; box-sizing: border-box; width: min(318px, calc(100vw - 16px)); max-width: calc(100vw - 16px); padding: 10px 12px 12px; background: linear-gradient(#211a15, #14100d); border: 2px solid #0d0b09; border-top: 6px solid var(--us); box-shadow: inset 0 0 0 1px #5a4630, 4px 5px 0 #000a; will-change: transform; }
.wr-card[hidden] { display: none; }
.wr-card.att-ca { border-top-color: var(--ca); }
.wc-tail { position: absolute; left: var(--tx, 50%); top: -26px; margin-left: -12px; width: 0; height: 0; border: 12px solid transparent; border-top-width: 0; border-bottom-color: #0d0b09; pointer-events: none; }
.wc-tail::after { content: ''; position: absolute; left: -8px; top: 4px; border: 8px solid transparent; border-top-width: 0; border-bottom-color: var(--gold); }
.wr-card.up .wc-tail { top: auto; bottom: -22px; border-top-width: 12px; border-bottom-width: 0; border-top-color: #0d0b09; border-bottom-color: transparent; }
.wr-card.up .wc-tail::after { top: auto; bottom: 4px; border-top-width: 8px; border-bottom-width: 0; border-top-color: var(--gold); border-bottom-color: transparent; }
.wc-x { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; color: #d9cdb8; background: #0f0c0a; border: 1px solid #3b2c1c; cursor: pointer; }

/* the scroll: never taller than the room under the header (--wc-mh, set by WarRoom.cardSync) */
.wc-in { display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; min-width: 0; max-height: var(--wc-mh, none); margin: 0; padding: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; scrollbar-width: none; }
.wc-in::-webkit-scrollbar { display: none; }
.wc-in > * { flex: none; min-width: 0; }

/* the battle kind first (build 119, Gage 11-03: "more obvious ... what type of battle it is ... from afar"): its emblem in a tile edged in its
   accent, its name big in that accent, on a band of its colour, its one-line pitch under it; then the place and its ground */
.wc-kind { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin: -2px 36px 0 -4px; padding: 6px 8px 6px 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--k, #d9b56a) 30%, #14100d), #14100d 85%); border: 1px solid #0d0b09; border-left: 4px solid var(--k, #d9b56a); box-shadow: inset 0 0 0 1px #ffffff12; }
.wc-emblem { display: grid; place-items: center; width: 46px; height: 46px; background: #0d0b09; border: 2px solid var(--k, #d9b56a); box-shadow: 0 0 0 1px #000, inset 0 0 8px #000c; }
.wc-emblem .ic { width: 36px; height: 36px; }
.wc-kname { display: block; overflow: hidden; font: 400 27px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; color: var(--k, #d9b56a); text-shadow: 2px 2px 0 #000; }
.wc-head { display: grid; gap: 1px; min-width: 0; }
.wc-head h3 { margin: 0; overflow: hidden; font: 400 22px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; }
.wc-area { display: block; overflow: hidden; font: 400 12px/1.1 var(--display); letter-spacing: .14em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; color: #bfae92; }
.wc-area:empty { display: none; }
.wc-pitch { display: -webkit-box; margin-top: 3px; overflow: hidden; font: 400 12px/1.15 var(--display); letter-spacing: .02em; color: #e6dcc6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }

/* who holds it, and which way the front is moving */
.wc-hold { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.wc-by { flex: none; font: 400 11px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: #bfae92; }
.wc-hold > b { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font: 400 21px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.wc-hold.us > b { color: #9bbcf3; } .wc-hold.ca > b { color: #ff8e82; }
.wc-hold .war-flag, .wc-meter .war-flag { flex: none; width: 24px; height: 15px; box-shadow: 0 0 0 1.5px #0d0b09; }
.wc-trend { display: inline-flex; flex: none; align-items: center; gap: 6px; margin-left: auto; padding: 3px 7px 2px; font: 400 14px/1.1 var(--display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: #120c08; border: 1.5px solid currentColor; }
.wc-trend b { font-weight: 400; color: #fff; }
.wc-trend.us { color: #9bbcf3; } .wc-trend.ca { color: #ff8e82; } .wc-trend.flat { color: #bfae92; }
.wc-chev { position: relative; flex: none; width: 17px; height: 12px; }
.wc-chev::before, .wc-chev::after { content: ''; position: absolute; top: 0; width: 9px; height: 12px; background: currentColor; clip-path: polygon(0 0, 45% 0, 100% 50%, 45% 100%, 0 100%, 55% 50%); animation: wc-flow 1.1s ease-in-out infinite; }
.wc-chev::before { left: 0; } .wc-chev::after { left: 7px; animation-delay: .22s; }
.wc-chev.l { transform: scaleX(-1); }
@keyframes wc-flow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* the control meter */
.wc-meter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 6px; align-items: center; row-gap: 2px; }
.wm-bar { position: relative; display: block; height: 32px; overflow: hidden; background: var(--ca); border: 2px solid #0d0b09; box-shadow: 0 0 0 1px #5a4630; }
.wm-bar::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(135deg, #ffffff12 0 4px, transparent 4px 8px); }
.wm-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--us); box-shadow: 3px 0 0 var(--gold); }
.wm-bar em { position: absolute; top: 0; bottom: 0; z-index: 1; display: grid; place-items: center; padding: 0 8px; font: 400 23px var(--display); font-style: normal; color: #fff; text-shadow: 1px 1px #000, 2px 2px #0006; }
.wm-bar .l { left: 0; } .wm-bar .r { right: 0; }
.wm-bar s { position: absolute; top: 0; bottom: 0; z-index: 1; width: 3px; margin-left: -1.5px; background: repeating-linear-gradient(#fff 0 4px, transparent 4px 7px); }
.wm-under { position: relative; grid-column: 2; height: 14px; }
.wm-under small { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; font: 400 11px/14px var(--display); letter-spacing: .1em; text-transform: uppercase; color: #e6dccb; }
.wm-under small::before { content: ''; position: absolute; left: 50%; top: -3px; margin-left: -3px; border: 3px solid transparent; border-top-width: 0; border-bottom-color: #fff; }

/* your goal, in a few words */
.wc-job { display: flex; align-items: center; gap: 8px; padding: 5px 8px 4px; background: #0f0c0a; border: 1px solid #3b2c1c; border-left: 4px solid var(--gold); }
.wc-job .wi { flex: none; width: 24px; height: 24px; }
.wc-job b { min-width: 0; font: 400 18px/1.05 var(--display); letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.wc-job .b-urgent { flex: none; margin-left: auto; font-size: 12px; }
.wr-card.urgent { box-shadow: inset 0 0 0 1px #5a4630, 0 0 14px #ff3a2e55, 4px 5px 0 #000a; }

/* the edge (War.advantageHTML) in one slim row: label, red-yellow-green strip, the word */
.wr-card .battle-advantages.adv-meter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 0; box-sizing: border-box; padding: 3px 8px; background: #0f0c0a; border: 1px solid #3b2c1c; }
.wr-card .adv-meter .am-head { display: contents; }
.wr-card .adv-meter .am-head em { grid-column: 1; grid-row: 1; font-size: 12px; }
.wr-card .adv-meter .am-head b { grid-column: 3; grid-row: 1; font-size: 18px; }
.wr-card .adv-meter .am-meter { grid-column: 2; grid-row: 1; height: 12px; margin: 0 4px; }
.wr-card .adv-meter .am-split { display: none; }

/* two closed chips: readiness (conditions) and rules; an open one takes the whole row */
.wc-more { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wc-more:empty { display: none; }
.wc-more .battle-detail { min-width: 0; margin: 0; padding: 0 8px; background: #0f0c0a; border: 1px solid #3b2c1c; }
.wc-more .battle-detail[open], .wc-more .battle-detail:only-child { grid-column: 1 / -1; }
.wc-more .battle-detail > summary { min-height: 30px; gap: 6px; font-size: 15px; }
.wc-more .battle-detail > p { margin: 0 0 6px; }
.wc-more .battle-detail > .bc-conditions { padding: 0 0 8px; }
.wc-more .wc-rules { display: grid; gap: 3px; margin: 0 0 8px; padding: 0; list-style: none; }
.wc-more .wc-rules li { position: relative; padding-left: 13px; font-size: 12.5px; line-height: 1.25; color: #e6dccb; overflow-wrap: anywhere; }
.wc-more .wc-rules li::before { content: ''; position: absolute; left: 1px; top: .5em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

/* the battle push (WarRoom.pushSlot; real money only): an inked field-journal strip, label | your share -> after | price, caps under it.
   Takes no space while empty. */
.wc-push:empty { display: none; }
.wc-push-btn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1px 8px; box-sizing: border-box; width: 100%; margin: 0; padding: 4px 8px 3px; text-align: left; font: inherit; color: #fff; cursor: pointer; background: linear-gradient(180deg, #c8222a, var(--red-d)); border: 2px solid #0d0b09; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,214,140,.28), 2px 3px 0 #0d0b09; } /* a filled, stamped button (Gage 10-30: "look like a button rather than ... information on the card") */
.wc-push-btn .wp-l { display: inline-flex; align-items: center; gap: 5px; font: 400 19px/1 var(--display); letter-spacing: .07em; text-transform: uppercase; color: #fff; text-shadow: 1px 1px 0 #0d0b09; }
.wc-push-btn .wp-l svg { flex: none; width: 20px; height: 20px; }
.wc-push-btn .wp-l b { font-weight: 400; }
.wc-push-btn .wp-m { justify-self: center; overflow: hidden; font: 400 19px/1 var(--display); letter-spacing: .03em; white-space: nowrap; color: #fff; }
.wc-push-btn .wp-m i { margin: 0 4px; font-style: normal; color: #ffd98a; }
.wc-push-btn .wp-p { padding: 3px 8px 2px; font: 400 17px/1 var(--display); letter-spacing: .04em; white-space: nowrap; color: #14100d; background: var(--gold); border: 1px solid #0d0b09; box-shadow: 1px 2px 0 #0d0b09; }
.wc-push-btn small { grid-column: 1 / -1; font-size: 11px; line-height: 1.25; letter-spacing: .02em; color: #f6dcd2; } /* the caps, whole: they may wrap on a narrow phone */
@media (max-width: 360px) { .wc-push-btn small { font-size: 10px; letter-spacing: 0; } .wc-push-btn { column-gap: 6px; } }
.wc-push-btn.off { cursor: default; background: repeating-linear-gradient(135deg, #1f1a15 0 6px, #181410 6px 12px); border: 2px dashed #4a3e30; box-shadow: none; color: #c9bba3; }
.wc-push-btn.off .wp-l { color: #c9bba3; text-shadow: none; }
.wc-push-btn.off .wp-l, .wc-push-btn.off .wp-m, .wc-push-btn.off .wp-p { opacity: .5; filter: grayscale(.7); }
.wc-push-btn.off small.wp-why { color: #e8d9ba; font-size: 12px; letter-spacing: .03em; }
.wc-push-btn.off:active { transform: none; }
.wc-push-btn:active { transform: translate(1px, 2px); box-shadow: inset 0 1px 3px rgba(0,0,0,.35), 1px 1px 0 #0d0b09; }
.wc-push-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.push-sheet .push-rules { display: grid; gap: 4px; margin: 4px 0 10px; padding: 0; text-align: left; list-style: none; }
.push-sheet .push-rules li { position: relative; padding-left: 14px; font-size: 13.5px; line-height: 1.3; color: #e6dccb; }
.push-sheet .push-rules li::before { content: ''; position: absolute; left: 2px; top: .5em; width: 6px; height: 6px; background: var(--gold); transform: rotate(45deg); }

/* the ready block, pinned at the bottom of the card: seats, time left, READY UP */
.wc-go { position: sticky; bottom: 0; z-index: 3; display: grid; gap: 6px; padding-top: 6px; background: #14100d; box-shadow: 0 -6px 6px -2px #14100d; }
.wc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 6px; }
.wc-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 1px; font: 400 13px/1.2 var(--display); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; color: #d9cdb8; background: #0f0c0a; border: 1px solid #3b2c1c; }
.wc-pill .ic { flex: none; width: 16px; height: 16px; }
.wc-pill b { font-weight: 400; font-size: 16px; color: #fff; }
.wc-pill.boost { color: var(--gold); border-color: #8a6a2a; } .wc-pill.boost b { color: var(--gold); } .wc-pill em { font-style: normal; }
.wc-ready { position: static; display: block; width: 100%; margin: 0; padding: 7px 10px 6px; text-align: center; color: #fff; cursor: pointer; background: linear-gradient(110deg, #b5232a, #e23a36 55%, #b31f27); border: 2px solid #0d0b09; box-shadow: inset 0 0 0 2px #ffb294a0, inset 0 -5px 0 #7a1519, 3px 4px 0 #0d0b09; }
.wc-ready b { display: block; font: 400 36px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; text-shadow: 2px 3px #6e1519; }
.wc-ready small { display: block; margin-top: 3px; overflow: hidden; font: 400 14px/1.15 var(--display); letter-spacing: .08em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; color: #ffe5cc; }
.wc-ready:active { transform: translate(2px, 3px); box-shadow: inset 0 0 0 2px #ffb294a0, inset 0 -3px 0 #7a1519, 1px 1px 0 #0d0b09; }

/* short screens: the same card, tighter */
@media (max-height: 720px) {
  .wr-card { padding: 8px 10px 10px; }
  .wc-in { gap: 5px; }
  .wc-head h3 { font-size: 20px; } .wc-emblem { width: 40px; height: 40px; } .wc-emblem .ic { width: 30px; height: 30px; } .wc-kname { font-size: 24px; } .wc-kind { padding: 4px 8px 4px 5px; }
  .wm-bar { height: 28px; } .wm-bar em { font-size: 21px; }
  .wc-job { padding: 3px 8px 2px; } .wc-job b { font-size: 16px; }
  .wc-go { gap: 5px; padding-top: 5px; }
  .wc-ready { padding: 5px 10px 5px; } .wc-ready b { font-size: 30px; } .wc-ready small { margin-top: 1px; font-size: 13px; }
}
@media (max-height: 600px) {
  .wc-in { gap: 4px; }
  .wr-card { padding: 6px 10px 8px; } .wc-in { gap: 3px; }
  .wc-pitch { display: none; } /* the kind's one-line pitch gives way here so the push row stays on screen (Gage 10-29) */
  .wc-push-btn { padding: 3px 8px; row-gap: 0; } /* one line: the caps are in the sheet; a disabled row keeps its reason beside the name */
  .wc-push-btn small:not(.wp-why) { display: none; }
  .wc-push-btn .wp-l, .wc-push-btn .wp-m { font-size: 17px; } .wc-push-btn .wp-p { padding: 2px 7px 1px; font-size: 15px; }
  .wc-push-btn.off .wp-m { display: none; }
  .wc-push-btn.off small.wp-why { grid-column: 2; grid-row: 1; justify-self: start; font-size: 11px; line-height: 1.1; }
  .wc-head h3 { font-size: 18px; } .wc-area { font-size: 11px; } .wc-emblem { width: 34px; height: 34px; } .wc-emblem .ic { width: 26px; height: 26px; } .wc-kname { font-size: 21px; } .wc-kind { gap: 8px; padding: 3px 6px 3px 4px; }
  .wc-hold { min-height: 17px; } .wc-hold > b { font-size: 17px; }
  .wm-bar { height: 22px; } .wm-bar em { font-size: 18px; } .wm-under { height: 12px; } .wm-under small { line-height: 12px; }
  .wc-job { padding: 2px 8px 1px; } .wc-job .wi { width: 20px; height: 20px; } .wc-job b { font-size: 15px; }
  .wc-go { gap: 3px; padding-top: 2px; } .wc-pill { padding: 1px 6px 0; }
  .wc-ready { padding: 3px 10px 4px; } .wc-ready b { font-size: 26px; } .wc-ready small { margin-top: 0; font-size: 12px; }
}
@media (max-width: 350px) { .wc-pill { gap: 3px; padding: 1px 5px 0; font-size: 12px; } .wc-pill .ic { width: 14px; height: 14px; } .wc-pill b { font-size: 15px; } .wc-pill.boost em { display: none; } .wc-trend { padding: 2px 5px 1px; font-size: 13px; gap: 4px; } .wc-by { letter-spacing: .08em; } .wc-hold { gap: 6px; } }
@media (prefers-reduced-motion: reduce) { .wc-chev::before, .wc-chev::after, .wc-urgent { animation: none; } }

/* Your own battles at this site, and what they added up to for your side (WarRoom.partHTML): one slim line under the control meter,
   shown only once you have fought there. */
.wc-part { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 18px; font: 400 12px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #d9cdb8; }
.wc-part .wi { flex: none; width: 13px; height: 13px; } .wc-part span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wc-part b { font-weight: 400; color: #f2eee6; }
.wc-part em { flex: none; font-style: normal; color: #d9cdb8; } .wc-part.up em { color: #ffd36e; } .wc-part.down em { color: #ff7a6c; }
