/* Era Clash · Arena feedback: verdict stamp, answer line, power effects, rematch stake pop-out.
   Loaded after ui-overhaul.css and powers.css, so these rules win. */

/* ------------------------------------------------------------ Verdict stamp */
/* Right / wrong: a thin glow round the very edge of the whole screen. Fully opaque at the edge,
   fading to nothing a few pixels in, and gone again in well under a second. */
.answer-edge {
  --edge: #3fdc6a; --edge-w: clamp(14px, 2.2vmin, 26px);
  position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  background:
    linear-gradient(to right, var(--edge), transparent var(--edge-w)),
    linear-gradient(to left, var(--edge), transparent var(--edge-w)),
    linear-gradient(to bottom, var(--edge), transparent var(--edge-w)),
    linear-gradient(to top, var(--edge), transparent var(--edge-w));
  animation: vf-edge .7s ease-out forwards;
}
.answer-edge.is-wrong { --edge: #ff3b30; }
.arena[data-answer]::after { content: none; box-shadow: none; animation: none; }   /* the old soft arena glow */
@keyframes vf-edge { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .answer-edge { animation-duration: .9s; } }
.arena[data-answer="correct"] { --verdict-ink: #a9e88f; --verdict-glow: rgb(140 220 120 / .55); }
.arena[data-answer="incorrect"] { --verdict-ink: #ff9d93; --verdict-glow: rgb(240 100 90 / .55); }
.arena[data-answer="timeout"] { --verdict-ink: var(--ec-gold-hi, #f6dc9c); --verdict-glow: rgb(246 200 110 / .5); }

/* The stamp wears the question card's own colours (maroon + gold), with a coloured medallion. */
.arena .arena-verdict {
  position: absolute; z-index: 7; top: 38%; left: 50%; translate: -50% -50%;
  display: flex; align-items: center; gap: 16px; width: max-content; max-width: calc(100% - 32px);
  padding: 12px 30px 12px 12px; border: 1px solid rgb(246 220 156 / .55); border-radius: 999px;
  background: radial-gradient(120% 90% at 50% 0%, rgb(217 171 82 / .12), transparent 60%), linear-gradient(180deg, rgb(50 15 11 / .97), rgb(26 7 5 / .98));
  box-shadow: 0 0 0 1px rgb(0 0 0 / .4), 0 0 46px -6px var(--verdict-glow), 0 26px 60px -20px rgb(0 0 0 / .9), inset 0 1px 0 rgb(255 255 255 / .08);
  color: var(--ec-text, #fff3dc); text-align: left; pointer-events: none;
  animation: vf-stamp 520ms cubic-bezier(.2, 1.4, .4, 1) both;
}
.arena .arena-verdict.is-leaving { animation: vf-leave 380ms ease-in forwards; }
@keyframes vf-stamp { 0% { opacity: 0; transform: scale(1.5); filter: blur(4px); } 60% { opacity: 1; transform: scale(.96); filter: none; } 100% { transform: scale(1); } }
@keyframes vf-leave { to { opacity: 0; transform: translateY(-14px) scale(.96); } }
.arena-verdict .verdict-icon {
  flex: none; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--verdict-ink) 55%, #fff 0%), color-mix(in srgb, var(--verdict-ink) 70%, #000) 75%);
  color: #1a0805; box-shadow: 0 0 0 3px rgb(26 7 5), 0 0 0 4.5px var(--verdict-ink), 0 0 26px var(--verdict-glow);
}
.arena-verdict .verdict-icon svg { width: 40px; height: 40px; }
.arena-verdict.verdict-correct .verdict-icon path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: vf-draw 380ms 160ms ease-out forwards; }
.arena-verdict.verdict-incorrect .verdict-icon { animation: vf-shake 420ms 120ms ease-in-out; }
@keyframes vf-draw { to { stroke-dashoffset: 0; } }
@keyframes vf-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.arena-verdict .verdict-copy { display: grid; gap: 2px; }
.arena-verdict .verdict-copy small { font: 700 11px/1 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .2em; text-transform: uppercase; color: var(--ec-gold, #d9ab52); }
.arena-verdict .verdict-copy strong { font: 600 clamp(30px, 4.4vw, 50px)/1 var(--ec-font-display, 'Cormorant Garamond', serif); color: var(--verdict-ink); letter-spacing: -.005em; text-shadow: 0 0 24px var(--verdict-glow); }
/* Time's up: the alarm clock rings. */
.arena-verdict.verdict-timeout .alarm-clock { animation: vf-ring 90ms linear 12 alternate; transform-origin: 50% 60%; }
.arena-verdict.verdict-timeout .alarm-clock .ring { animation: vf-ring-lines 180ms linear 7; }
@keyframes vf-ring { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes vf-ring-lines { 50% { opacity: 0; } }
/* The time's-up stamp is a quieter, smaller one: a missed clock shouldn't fill the screen. */
.arena .arena-verdict.verdict-timeout { gap: 11px; padding: 7px 22px 7px 7px; }
.arena-verdict.verdict-timeout .verdict-icon { width: 40px; height: 40px; box-shadow: 0 0 0 2px rgb(26 7 5), 0 0 0 3px var(--verdict-ink), 0 0 16px var(--verdict-glow); }
.arena-verdict.verdict-timeout .verdict-icon svg { width: 26px; height: 26px; }
.arena-verdict.verdict-timeout .verdict-copy strong { font-size: clamp(22px, 2.8vw, 32px); }
@media (max-width: 700px) {
  .arena .arena-verdict { top: 30%; gap: 12px; padding: 8px 22px 8px 8px; }
  .arena-verdict .verdict-icon { width: 48px; height: 48px; }
  .arena-verdict .verdict-icon svg { width: 30px; height: 30px; }
  .arena .arena-verdict.verdict-timeout { gap: 9px; padding: 6px 18px 6px 6px; }
  .arena-verdict.verdict-timeout .verdict-icon { width: 34px; height: 34px; }
  .arena-verdict.verdict-timeout .verdict-icon svg { width: 22px; height: 22px; }
}

/* ------------------------------------------- Ready to duel: crossed swords */
/* One look for every start button: 1v1, rooms and free-for-all (#ready, #lan-ready, #party-ready). */
body.duel-view .ready-duel {
  --sw-gap: 150px; position: relative; display: grid; place-items: end center;
  width: 380px; max-width: 100%; height: 230px; margin: 0 auto;
}
body.duel-view .ready-duel .ready-sword {
  position: absolute; bottom: 0; left: 50%; width: 36px; height: 212px; margin-left: -18px;
  transform-origin: 50% 96%; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .6));
  animation: rs-stand 600ms cubic-bezier(.2, 1.3, .4, 1) both;
}
body.duel-view .ready-duel .ready-sword svg { display: block; width: 100%; height: 100%; }
body.duel-view .ready-duel .is-left { translate: calc(var(--sw-gap) * -1) 0; }
body.duel-view .ready-duel .is-right { translate: var(--sw-gap) 0; animation-delay: 80ms; }
@keyframes rs-stand { from { opacity: 0; transform: translateY(40px); } }
/* The plaque: bronze rim, wine face, engraved gold capitals. No pill, no box-shadow ring. */
body.duel-view .ready-duel > .rd-button {
  all: unset; box-sizing: border-box; position: absolute; left: 50%; bottom: 67px; translate: -50% 0; z-index: 2;
  display: grid; place-items: center; width: 260px; height: 78px; cursor: pointer;
  filter: drop-shadow(0 14px 18px rgb(0 0 0 / .75)) drop-shadow(0 0 0 rgb(255 200 110 / 0));
  animation: rd-glow 2.2s ease-in-out infinite; transition: transform 160ms ease, opacity 220ms ease;
}
body.duel-view .ready-duel > .rd-button::before, body.duel-view .ready-duel > .rd-button::after { content: none; }
body.duel-view .ready-duel .rd-plaque { position: absolute; inset: 0; width: 100%; height: 100%; }
body.duel-view .ready-duel .rd-label {
  position: relative; overflow: hidden; padding: 0 6px;
  font: 700 30px/1 'Cinzel', var(--ec-font-display, 'Cormorant Garamond'), serif; letter-spacing: .16em; text-transform: uppercase;
  /* top layer: a soft diagonal band of light that only ever shows on the letters themselves (owner, 2026-11-30:
     the old glint was one hard block flashing over the word) */
  background:
    linear-gradient(118deg, transparent 38%, rgb(255 248 226 / .35) 45%, rgb(255 252 240 / .95) 50%, rgb(255 248 226 / .35) 55%, transparent 62%),
    linear-gradient(180deg, #fff6dc 0%, #f3cf80 48%, #b9802f 52%, #f0c873 100%);
  background-size: 300% 100%, 100% 100%; background-repeat: no-repeat; background-position: 90% 0, 0 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgb(40 6 4 / .9));
  animation: rd-glint 4.2s cubic-bezier(.45, .05, .35, 1) infinite;
}
body.duel-view .ready-duel > .rd-button:hover { transform: scale(1.05); }
body.duel-view .ready-duel > .rd-button:active { transform: scale(.97); }
/* No box round the plaque, ever (owner, 2026-11-26): keyboard focus shows as a brighter glow instead. */
body.duel-view .ready-duel > .rd-button:focus, body.duel-view .ready-duel > .rd-button:focus-visible { outline: none; }
body.duel-view .ready-duel > .rd-button:focus-visible { filter: drop-shadow(0 14px 18px rgb(0 0 0 / .75)) drop-shadow(0 0 18px rgb(255 214 140 / .8)); }
@keyframes rd-glow { 50% { filter: drop-shadow(0 14px 18px rgb(0 0 0 / .75)) drop-shadow(0 0 16px rgb(255 190 100 / .45)); } }
@keyframes rd-glint { 0%, 52% { background-position: 90% 0, 0 0; } 92%, 100% { background-position: 10% 0, 0 0; } }
/* Clicked: the plaque fades out where it stands, the swords slide in and swing across into an X (blades crossing
   mid-length, hilts apart), then a spark where they meet. */
body.duel-view .ready-duel.is-clashing > .rd-button { animation: rs-vanish 380ms ease-out forwards; pointer-events: none; }
body.duel-view .ready-duel.is-clashing .is-left { animation: rs-fall-l 560ms cubic-bezier(.55, 0, .75, .6) forwards, rs-recoil-l 280ms 560ms ease-out forwards; }
body.duel-view .ready-duel.is-clashing .is-right { animation: rs-fall-r 560ms cubic-bezier(.55, 0, .75, .6) forwards, rs-recoil-r 280ms 560ms ease-out forwards; }
@keyframes rs-vanish { to { opacity: 0; } }
@keyframes rs-fall-l { from { rotate: 0deg; translate: calc(var(--sw-gap) * -1) 0; } to { rotate: 42deg; translate: -64px 0; } }
@keyframes rs-fall-r { from { rotate: 0deg; translate: var(--sw-gap) 0; } to { rotate: -42deg; translate: 64px 0; } }
@keyframes rs-recoil-l { 0% { rotate: 42deg; translate: -64px 0; } 40% { rotate: 37deg; translate: -64px 0; } 100% { rotate: 40deg; translate: -64px 0; } }
@keyframes rs-recoil-r { 0% { rotate: -42deg; translate: 64px 0; } 40% { rotate: -37deg; translate: 64px 0; } 100% { rotate: -40deg; translate: 64px 0; } }
body.duel-view .ready-duel .ready-spark {
  position: absolute; left: 50%; bottom: 86px; width: 120px; height: 120px; margin: 0 0 -60px -60px; z-index: 3; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0 6%, rgb(255 236 170 / .95) 12%, rgb(255 190 90 / .5) 30%, transparent 62%),
    conic-gradient(from 0deg, transparent 0 8%, #fff6 9% 10%, transparent 11% 33%, #fff6 34% 35%, transparent 36% 58%, #fff6 59% 60%, transparent 61% 83%, #fff6 84% 85%, transparent 86%);
  border-radius: 50%;
}
body.duel-view .ready-duel.is-clashing .ready-spark { animation: rs-spark 480ms 540ms ease-out forwards; }
@keyframes rs-spark { 0% { opacity: 0; transform: scale(.2) rotate(0deg); } 25% { opacity: 1; transform: scale(1.1) rotate(12deg); } 100% { opacity: 0; transform: scale(1.6) rotate(30deg); } }
/* Rooms: the two-sword ready up (game.js readyPairHTML). Each sword drops to its angle when its player is
   ready; when both are down the late one lands, both jolt and the spark flies. */
body.duel-view .ready-duel.is-pair .ready-sword.is-left.is-down, body.duel-view .ready-duel.is-pair .ready-sword.is-left.is-set { rotate: 40deg; translate: -64px 0; }
body.duel-view .ready-duel.is-pair .ready-sword.is-right.is-down, body.duel-view .ready-duel.is-pair .ready-sword.is-right.is-set { rotate: -40deg; translate: 64px 0; }
body.duel-view .ready-duel.is-pair .ready-sword.is-set { animation: none; }
body.duel-view .ready-duel.is-pair .ready-sword.is-left.is-down { animation: rs-fall-l 560ms cubic-bezier(.55, 0, .75, .6) forwards, rs-recoil-l 280ms 560ms ease-out forwards; }
body.duel-view .ready-duel.is-pair .ready-sword.is-right.is-down { animation: rs-fall-r 560ms cubic-bezier(.55, 0, .75, .6) forwards, rs-recoil-r 280ms 560ms ease-out forwards; }
body.duel-view .ready-duel.is-pair .ready-sword.is-left.is-hit { animation: rs-jolt-l 280ms 560ms ease-out both; }
body.duel-view .ready-duel.is-pair .ready-sword.is-right.is-hit { animation: rs-jolt-r 280ms 560ms ease-out both; }
@keyframes rs-jolt-l { 0% { rotate: 40deg; translate: -64px 0; } 40% { rotate: 35deg; translate: -66px 0; } 100% { rotate: 40deg; translate: -64px 0; } }
@keyframes rs-jolt-r { 0% { rotate: -40deg; translate: 64px 0; } 40% { rotate: -35deg; translate: 66px 0; } 100% { rotate: -40deg; translate: 64px 0; } }
body.duel-view .ready-duel.is-pair.is-armed > .rd-button { animation: rs-vanish 380ms ease-out forwards; pointer-events: none; }
body.duel-view .ready-duel.is-pair.is-clashed .ready-spark { animation: rs-spark 480ms 540ms ease-out forwards; }
body.duel-view .ready-duel.is-pair.is-still .ready-spark { animation: none; }
body.duel-view .ready-duel.is-pair .rd-wait {
  position: absolute; left: 50%; bottom: -34px; translate: -50% 0; margin: 0; white-space: nowrap;
  font: 600 .9rem/1.2 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .04em; color: #fff3dc;
  text-shadow: 0 2px 6px rgb(0 0 0 / .9), 0 0 2px rgb(0 0 0 / .9); background: none; border: 0; padding: 0;
}
body.duel-view .ready-duel.is-pair .rd-wait:empty { display: none; }
@media (max-width: 560px) { body.duel-view .ready-duel { width: 320px; transform: scale(.8); transform-origin: 50% 100%; } }
@media (prefers-reduced-motion: reduce) { body.duel-view .ready-duel *, body.duel-view .ready-duel button { animation: none !important; } }

/* -------------------------------------------------- Feedback line in the card */
/* One framed plate, like the question card: verdict chip | right answer. */
body.duel-view #app .panel .feedback {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 16px;
  width: fit-content; max-width: 100%; margin: 6px auto 14px; padding: 8px 20px 8px 8px; border-radius: 16px;
  border: 1px solid rgb(217 171 82 / .32);
  background: linear-gradient(180deg, rgb(12 3 2 / .42), rgb(12 3 2 / .62));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), inset 0 0 0 3px rgb(26 7 5 / .5), 0 12px 26px -16px rgb(0 0 0 / .9);
}
body.duel-view #app .answer-verdict { padding: 7px 16px 7px 10px; font-size: 13px; }
body.duel-view #app .answer-verdict::before { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; background: none; color: inherit; font-size: 11px; font-weight: 900; }
body.duel-view #app .answer-verdict.is-timeout { color: var(--ec-gold-hi, #f6dc9c); background: rgb(246 220 156 / .1); border-color: rgb(246 220 156 / .55); }
/* A drawn alarm clock in the chip's own gold (not the colour emoji). */
body.duel-view #app .answer-verdict.is-timeout::before {
  content: ""; width: 18px; height: 18px; border: 0; border-radius: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='24' cy='26' r='14'/%3E%3Cpath d='M24 18v8l5 4M8 13a7 7 0 0 1 9-6M40 13a7 7 0 0 0-9-6M14 38l-4 5M34 38l4 5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='24' cy='26' r='14'/%3E%3Cpath d='M24 18v8l5 4M8 13a7 7 0 0 1 9-6M40 13a7 7 0 0 0-9-6M14 38l-4 5M34 38l4 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Tick and cross drawn (ring included), not font glyphs: the ✓ / ✕ characters sat a touch left of
   centre inside the ring. One SVG mask = ring + mark, both centred on 24,24. */
body.duel-view #app :is(.answer-verdict, #_):is(.is-correct, .is-incorrect):not(.is-timeout)::before {
  content: ""; width: 20px; height: 20px; border: 0; border-radius: 0; background: currentColor;
}
body.duel-view #app :is(.answer-verdict, #_).is-correct::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='24' cy='24' r='22.2' stroke-width='3.6'/%3E%3Cpath d='M15.5 24.5l5.5 5.5 11.5-12' stroke-width='4.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='24' cy='24' r='22.2' stroke-width='3.6'/%3E%3Cpath d='M15.5 24.5l5.5 5.5 11.5-12' stroke-width='4.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.duel-view #app :is(.answer-verdict, #_).is-incorrect:not(.is-timeout)::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-linecap='round'%3E%3Ccircle cx='24' cy='24' r='22.2' stroke-width='3.6'/%3E%3Cpath d='M17.5 17.5l13 13M30.5 17.5l-13 13' stroke-width='4.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-linecap='round'%3E%3Ccircle cx='24' cy='24' r='22.2' stroke-width='3.6'/%3E%3Cpath d='M17.5 17.5l13 13M30.5 17.5l-13 13' stroke-width='4.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.duel-view #app .accepted-answer { display: inline-grid; gap: 3px; text-align: left; padding-left: 16px; border-left: 1px solid rgb(217 171 82 / .28); }
body.duel-view #app .accepted-answer small { font: 700 10px/1 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .18em; text-transform: uppercase; color: var(--ec-gold, #d9ab52); }
body.duel-view #app .panel .feedback .coin-reward { margin-left: -4px; }
@media (max-width: 520px) {
  body.duel-view #app .panel .feedback { padding: 8px 14px 8px 8px; gap: 8px 12px; }
  body.duel-view #app .accepted-answer { padding-left: 12px; }
}
body.duel-view #app .panel .feedback .pw-notes { flex-basis: 100%; align-items: center; margin-top: 2px; }
body.duel-view #app .panel .lan-next-up { margin: 8px 0 0; color: var(--ec-gold, #d9ab52); font: 700 12px/1.3 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .2em; text-transform: uppercase; animation: vf-pulse 1.1s ease-in-out infinite; }
@keyframes vf-pulse { 50% { opacity: .45; } }
body.duel-view #app .panel #lan-ready:not(.rd-button) { animation: ec-rise 360ms var(--ec-ease, ease) both; }

/* ------------------------------------------------------- Tesla Coil: shock */
/* The card stays exactly where it is (it is centred with translate, so it must never be animated);
   only the arcs, glow and flickering question show the shock. */
.panel.pw-shocked h2 { animation: pw-glitch .23s steps(2) infinite; }
@keyframes pw-glitch { 0% { text-shadow: -2px 0 #7ed9ff, 2px 0 #ff5fd2; opacity: 1; } 50% { text-shadow: 2px 0 #7ed9ff, -2px 0 #ff5fd2; opacity: .55; } 100% { text-shadow: none; opacity: .9; } }
.pw-shock { position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit; overflow: visible; }
.pw-shock::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px rgb(126 217 255 / .7), inset 0 0 60px rgb(126 217 255 / .35), 0 0 40px rgb(126 217 255 / .45); animation: pw-flick .16s steps(2) infinite; }
@keyframes pw-flick { 50% { opacity: .35; } }
.pw-shock svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pw-shock .pw-arc { fill: none; stroke: #f2fbff; stroke-width: 1.8; stroke-linejoin: round; }
.pw-shock .pw-arc-glow { fill: none; stroke: #7ed9ff; stroke-width: 7; stroke-linejoin: round; opacity: .55; filter: blur(2px); }
.pw-shock .pw-spark { fill: #fff; filter: drop-shadow(0 0 4px #7ed9ff); }
.pw-shock-count { position: absolute; left: 50%; top: -18px; translate: -50% -50%; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: #06131f; border: 1.5px solid #7ed9ff; box-shadow: 0 0 22px rgb(126 217 255 / .6); color: #dff6ff; white-space: nowrap; }
.pw-shock-count b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #7ed9ff; color: #06131f; font: 900 15px/1 var(--ec-font-ui, Inter, sans-serif); animation: pw-flick .2s steps(2) infinite; }
.pw-shock-count strong { font: 800 16px/1 var(--ec-font-ui, Inter, sans-serif); font-variant-numeric: tabular-nums; }
.pw-shock-count small { font: 700 10px/1 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: #9fdcff; }
.pw-shock.is-done { opacity: 0; transition: opacity .3s; }
.typed-answer.pw-locked::after { content: none; }
.typed-answer.pw-locked input { cursor: not-allowed; background: rgb(6 19 31 / .85) !important; }
@media (prefers-reduced-motion: reduce) { .panel.pw-shocked h2, .pw-shock::before { animation: none; } }

/* ------------------------------------------------ Program Loop: new question */
.pw-loop { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; pointer-events: none; border-radius: inherit; overflow: hidden; }
.pw-loop-bits { position: absolute; inset: 0; display: grid; align-content: center; gap: 2px; background: color-mix(in srgb, var(--pw) 18%, rgb(20 5 16 / .82)); animation: pw-loop-wash 1.9s ease-out forwards; }
.pw-loop-bits i { display: block; font: 700 15px/1.25 ui-monospace, Consolas, monospace; letter-spacing: .3em; color: var(--pw); white-space: nowrap; opacity: .8; text-shadow: 0 0 8px var(--pw); animation: pw-loop-scroll 1.2s calc(var(--r) * 40ms) linear both; }
.pw-loop-bits i:nth-child(odd) { animation-direction: reverse; }
@keyframes pw-loop-scroll { from { translate: -30% 0; } to { translate: 10% 0; } }
@keyframes pw-loop-wash { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.pw-loop-card { position: relative; display: flex; gap: 12px; align-items: center; padding: 10px 20px 10px 10px; border-radius: 18px; background: rgb(18 6 14 / .95); border: 1.5px solid var(--pw); box-shadow: 0 0 34px color-mix(in srgb, var(--pw) 55%, transparent); animation: pw-card 1.9s cubic-bezier(.2, .9, .3, 1.2) forwards; text-align: left; }
.pw-loop-card .pw-art { width: 52px; height: 52px; border-radius: 12px; }
.pw-loop-card span { display: grid; gap: 2px; }
.pw-loop-card small { font: 800 10px/1 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .18em; text-transform: uppercase; color: var(--pw); }
.pw-loop-card strong { font: 700 22px/1.1 var(--ec-font-display, 'Cormorant Garamond', serif); color: #fff; }
.pw-loop-card em { font: 600 12px/1.2 var(--ec-font-ui, Inter, sans-serif); font-style: normal; color: #f3e6d4; }

/* ------------------------------------------------------- Tesla: +10 HP heal */
.health { position: relative; }
.pw-heal { position: absolute; left: 50%; top: -6px; translate: -50% 0; z-index: 4; padding: 3px 10px; border-radius: 999px; background: #06131f; border: 1px solid var(--pw); color: var(--pw); font: 800 13px/1.2 var(--ec-font-ui, Inter, sans-serif); white-space: nowrap; box-shadow: 0 0 16px color-mix(in srgb, var(--pw) 60%, transparent); pointer-events: none; animation: pw-heal-rise 1.9s ease-out forwards; }
@keyframes pw-heal-rise { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-22px); } }
.health.pw-healing meter { filter: drop-shadow(0 0 6px #7ed9ff); }

/* ------------------------------------------------------------- HUD bits */
.pw-adv.is-armed { border-color: var(--pw); opacity: .9; }
.pw-adv.is-armed .pw-status { animation: pw-blink 1.6s ease-in-out infinite; }
.pw-hud .pw-preview { margin-top: 2px; padding: 8px 10px 8px 8px; border-radius: 14px; background: linear-gradient(160deg, rgb(20 12 16 / .9), rgb(8 5 8 / .92)); font-size: .74rem; line-height: 1.35; max-height: 9.5em; overflow: hidden; backdrop-filter: blur(6px); }
.pw-hud .pw-preview .pw-art { width: 28px; height: 28px; align-self: flex-start; }
@media (max-width: 820px) { .pw-hud .pw-preview { display: none; } }

/* --------------------------------------------- Rematch: stake pop-out on hover */
body.duel-view #app .victory-result .va-stake-hint {
  display: inline-flex; align-items: center; gap: 5px; width: max-content; margin-top: 5px; padding: 2px 9px; border-radius: 999px;
  border: 1px dashed color-mix(in srgb, var(--win-accent, #f6dc9c) 55%, transparent); color: var(--win-accent, #f6dc9c);
  font: 700 10px/1.4 var(--ec-font-ui, Inter, sans-serif); letter-spacing: .12em; text-transform: uppercase;
}
body.duel-view #app .victory-result:not(.victory-left) .va-stake-hint::before { content: "‹"; font-size: 13px; line-height: 1; }
body.duel-view #app .victory-result.victory-left .va-stake-hint::after { content: "›"; font-size: 13px; line-height: 1; }
body.duel-view #app .victory-result .rematch-wrap:is(:hover, :has(.rematch-menu:focus-within), .is-open) .va-stake-hint { opacity: 0; }
/* A bracket joins the choices to the card, so they read as part of it. */
body.duel-view #app .victory-result .rematch-menu::before {
  content: ""; position: absolute; top: 12px; bottom: 12px; right: 4px; width: 10px;
  border: 1.5px solid var(--win-accent, #f6dc9c); border-left: 0; border-radius: 0 10px 10px 0;
  opacity: 0; transform: scaleY(.3); transition: opacity 200ms, transform 320ms var(--ec-spring, ease);
}
body.duel-view #app .victory-result.victory-left .rematch-menu::before { right: auto; left: 4px; border: 1.5px solid var(--win-accent, #f6dc9c); border-right: 0; border-radius: 10px 0 0 10px; }
body.duel-view #app .victory-result .rematch-wrap:is(:hover, :has(.rematch-menu:focus-within), .is-open) .rematch-menu::before { opacity: .7; transform: none; }
@media (max-width: 700px), (max-width: 1000px) and (hover: none) and (pointer: coarse) and (orientation: landscape) {
  body.duel-view #app .victory-result .rematch-menu::before { display: none; }
}
