/* The push ring (js/war-ring.js, Gage 11-04): every counted match fills its side's ring; a full ring lands a push on the land bar.
   An inked disc with a ticked rim, the side's colour for the push so far and gold for your match's share, a burst when it lands.
   Drawn on the finish card, the war battle report and next to your side's score in the War Room. Calm: no motion. */
.wrg { --sz: 48px; --side: #4f86de; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--sz); height: var(--sz); }
.wrg.ca { --side: #d8423a; }
.wrg svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(2px 2px 0 #0d0b09); }
.wrg .wrg-disc { fill: #17120e; stroke: #0d0b09; stroke-width: 3; }
.wrg .wrg-ticks { fill: none; stroke: #9a7f52; stroke-width: 2.2; stroke-dasharray: 1.3 6.45; opacity: .9; }
.wrg .wrg-track { fill: none; stroke: #2b231c; stroke-width: 7.5; }
.wrg .wrg-fill { fill: none; stroke: var(--side); stroke-width: 7.5; }
.wrg .wrg-part { fill: none; stroke: #ffd36e; stroke-width: 7.5; }
.wrg .wrg-rim { fill: none; stroke: #0d0b09; stroke-width: 1.4; }
.wrg-c { position: relative; z-index: 1; font: 400 calc(var(--sz) * .27)/1 var(--display); letter-spacing: .02em; color: #f2eee6; text-shadow: 1px 1px 0 #000; font-variant-numeric: tabular-nums; pointer-events: none; }
.wrg.landed .wrg-fill { stroke: #ffd36e; }
.wrg.landed svg { filter: drop-shadow(2px 2px 0 #0d0b09) drop-shadow(0 0 5px #ffd36ecc); }
/* the burst: a flash ring and twelve inked-gold rays thrown out from the rim */
.wrg-burst { position: absolute; inset: 0; pointer-events: none; }
.wrg-burst i { position: absolute; left: 50%; top: 50%; width: 3px; height: calc(var(--sz) * .2); margin: calc(var(--sz) * -.1) 0 0 -1.5px; background: #ffd36e; box-shadow: 1px 1px 0 #0d0b09; opacity: 0; }
.wrg-burst i:nth-child(1) { --a: 0deg; } .wrg-burst i:nth-child(2) { --a: 30deg; } .wrg-burst i:nth-child(3) { --a: 60deg; } .wrg-burst i:nth-child(4) { --a: 90deg; }
.wrg-burst i:nth-child(5) { --a: 120deg; } .wrg-burst i:nth-child(6) { --a: 150deg; } .wrg-burst i:nth-child(7) { --a: 180deg; } .wrg-burst i:nth-child(8) { --a: 210deg; }
.wrg-burst i:nth-child(9) { --a: 240deg; } .wrg-burst i:nth-child(10) { --a: 270deg; } .wrg-burst i:nth-child(11) { --a: 300deg; } .wrg-burst i:nth-child(12) { --a: 330deg; }
.wrg-burst::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 3px solid #ffd36e; opacity: 0; }
.wrg.go .wrg-burst i { animation: wrg-ray .9s cubic-bezier(.2, .8, .3, 1) both; }
.wrg.go .wrg-burst::before { animation: wrg-flash .8s ease-out both; }
.wrg.go svg { animation: wrg-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes wrg-ray { 0% { opacity: 1; transform: rotate(var(--a)) translateY(calc(var(--sz) * -.42)) scaleY(.4); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--sz) * -.9)) scaleY(1); } }
@keyframes wrg-flash { 0% { opacity: .95; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes wrg-pop { 0% { transform: scale(1); } 40% { transform: scale(1.16); } 100% { transform: scale(1); } }

/* a row after a match: the finish card (#fin-push) and the war battle report (#wa-push) */
.wrg-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 7px 10px 7px 8px; background: linear-gradient(#211a15f0, #14100df0); border: 2px solid #0d0b09; box-shadow: inset 0 0 0 1px #5a4630, inset 4px 0 0 var(--side); --side: #4f86de; }
.wrg-row.ca { --side: #d8423a; }
.wrg-row.landed { box-shadow: inset 0 0 0 1px #b8862f, inset 4px 0 0 #ffd36e; }
.wrg-txt { display: grid; gap: 1px; min-width: 0; }
.wrg-head { display: flex; align-items: center; gap: 5px; min-height: 15px; margin-bottom: 2px; font: 400 11px/1.2 var(--display); letter-spacing: .12em; text-transform: uppercase; color: #bfae92; }
.wrg-head .war-flag { width: 18px; height: 12px; flex: none; }
.wrg-line { font: 400 16px/1.15 var(--display); letter-spacing: .04em; text-transform: uppercase; color: #f2eee6; font-weight: 400; }
.wrg-line.gold { color: #ffd36e; }
.wrg-sub { font: 400 12px/1.25 var(--display); font-style: normal; letter-spacing: .03em; color: #d9c7a8; }
.wrg-sub:empty { display: none; }
.wrg-dots::after { content: ''; animation: wa-dots 1.2s steps(4) infinite; }
/* the land bar a push moves (the War Score's land split, small) */
.wrg-land { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: 15px; margin-top: 4px; background: #d8423a; border: 2px solid #0d0b09; overflow: visible; }
.wrg-land i { position: absolute; left: 0; top: 0; bottom: 0; background: #4f86de; box-shadow: 2px 0 0 #ffd36e; }
.wrg-land s, .wrg-land u { position: relative; z-index: 1; padding: 0 5px; font: 400 11px/11px var(--display); letter-spacing: .06em; text-decoration: none; color: #fff; text-shadow: 1px 1px 0 #000; }
.wrg-land u { justify-self: center; color: #f2eee6cc; text-transform: uppercase; letter-spacing: .14em; }
.wrg-land.tick { animation: wrg-tick .9s ease-out; }
.wrg-chip { position: absolute; z-index: 2; top: -22px; right: 4px; padding: 1px 6px; font: 400 15px/1.1 var(--display); font-weight: 400; color: #fff; background: #2d5bb0; border: 2px solid #0d0b09; box-shadow: 2px 2px 0 #0d0b09; animation: wrg-chip 1.7s ease-out both; }
.wrg-chip.ca { background: #a5221d; }
@keyframes wrg-tick { 0% { box-shadow: 0 0 0 0 #ffd36e00; } 30% { box-shadow: 0 0 0 3px #ffd36ecc; } 100% { box-shadow: 0 0 0 0 #ffd36e00; } }
@keyframes wrg-chip { 0% { opacity: 0; transform: translateY(10px) scale(.7); } 18% { opacity: 1; transform: translateY(0) scale(1.08); } 75% { opacity: 1; transform: translateY(-8px); } 100% { opacity: 0; transform: translateY(-14px); } }
.finish .wrg-row { margin: 2px 0; }
.war-after .wrg-row { padding: 6px 8px; background: #120e0bcc; }
@media (max-height: 600px) { .war-after .wrg-row .wrg { --sz: 42px !important; } .war-after .wrg-row .wrg-land { display: none; } .war-after .wrg-line { font-size: 14px; } }

/* the land meter's push row (css/finale.css .wr-push): a small ring, no number inside */
.wr-ring { display: inline-grid; place-items: center; flex: none; }
.wr-push .wrg-ticks { display: none; } .wr-push .wrg .wrg-track, .wr-push .wrg .wrg-fill { stroke-width: 11; } .wr-push .wrg .wrg-track { stroke: #3a2f25; }

.calm .wrg *, .wr.calm .wrg *, .calm .wrg-row *, .calm .wrg-chip { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { .wrg *, .wrg-row *, .wrg-land, .wrg-chip { animation: none !important; transition: none !important; } .wrg-dots::after { content: '...'; } }
