/* Era Clash · Champion question cards (card-themes.js).
   --ct-a accent (the champion's victory-card colour), --ct-s shade, --ct-g second glow. */

/* ---------- The card itself ---------- */
body.duel-view #app .panel.ct-themed { isolation: isolate; }
/* One fixed shape, always: same width and height whatever the text, never a scrollbar.
   Long questions shrink to fit (card-themes.js fit()) instead of stretching the card. */
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) {
  box-sizing: border-box; width: min(680px, calc(100% - 24px)); height: auto; min-height: 236px; max-height: none;
  overflow: hidden; scrollbar-width: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
}
body.duel-view #app .panel.ct-themed::-webkit-scrollbar { display: none; }
/* Clock power chips (Einstein 20s, Newton +4s, Curie −2s…): same size, but pinned to the card's top-right
   corner, hanging half off it (owner, 2026-11-27). The card clips with a small margin so the chip can poke out. */
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) { overflow: clip; overflow-clip-margin: 24px; }
body.duel-view #app .panel.ct-themed .pw-chips {
  position: absolute; top: 0; right: 0; z-index: 5; margin: 0; max-width: none;
  translate: 30% -50%; justify-content: flex-end; flex-wrap: nowrap; pointer-events: auto;
}
body.duel-view #app .panel.ct-themed .pw-chips .pw-chip { box-shadow: 0 4px 12px rgb(0 0 0 / .55), 0 0 0 2px var(--ct-s); }
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) > :not(.ct-fx):not(.quiz-progress) { flex: none; max-width: 100%; }
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) > h2 { width: 100%; overflow-wrap: anywhere; }
/* Question text: ONE font, and a size set only by the question's length (card-themes.js sizeFor). */
body.duel-view #app .panel.ct-themed > h2[data-ct-size] { font-family: var(--ec-font-display); font-weight: 600; line-height: 1.2; }
body.duel-view #app .panel.ct-themed > h2[data-ct-size="l"]  { font-size: 28px; }
body.duel-view #app .panel.ct-themed > h2[data-ct-size="m"]  { font-size: 24px; }
body.duel-view #app .panel.ct-themed > h2[data-ct-size="s"]  { font-size: 21px; }
body.duel-view #app .panel.ct-themed > h2[data-ct-size="xs"] { font-size: 18px; }
@media (max-width: 720px) {
  body.duel-view #app .panel.ct-themed > h2[data-ct-size="l"]  { font-size: 22px; }
  body.duel-view #app .panel.ct-themed > h2[data-ct-size="m"]  { font-size: 20px; }
  body.duel-view #app .panel.ct-themed > h2[data-ct-size="s"],
  body.duel-view #app .panel.ct-themed > h2[data-ct-size="xs"] { font-size: 18px; }
}
/* What the opponent is typing, live: big, bold and bright so it can be read as it appears. */
body.duel-view #app .panel.ct-themed #lan-live-draft { display: inline-block; min-width: 1ch; margin-left: 4px; font: 700 22px/1.3 var(--ec-font-ui); color: #fff; text-shadow: 0 0 12px var(--ct-a); letter-spacing: .01em; }
/* The answering champion's portrait, top-left corner of the card. */
body.duel-view #app .panel.ct-themed > .ct-face {
  position: absolute; left: 16px; top: 18px; z-index: 2; width: 48px; height: 48px; object-fit: cover; object-position: top;
  border-radius: 12px; border: 2px solid var(--ct-a); box-shadow: 0 0 14px -2px var(--ct-a), 0 6px 14px rgb(0 0 0 / .5);
  background: var(--ct-s); pointer-events: none;
}
body.duel-view #app .panel.ct-themed[data-mode="intro"] > .ct-face, body.duel-view #app .panel.ct-themed[data-mode="ready"] > .ct-face, body.duel-view #app .panel.ct-themed[data-mode="finish"] > .ct-face { display: none; }
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) > h2 { padding-inline: 58px; box-sizing: border-box; }
@media (max-width: 720px) {
  body.duel-view #app .panel.ct-themed > .ct-face { left: 10px; top: 14px; width: 36px; height: 36px; border-radius: 9px; }
  body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) > h2 { padding-inline: 42px; }
}
/* The countdown: runs the FULL width of the top edge, thick enough to see, a bright bar on a dark
   track so it stands out on every champion's colours. */
body.duel-view #app .panel.ct-themed > .quiz-progress,
body.duel-view #app .panel.ct-themed > .quiz-progress.wait-bar {
  /* Owner, 2026-11-30 (third pass): the card's TOP is now flat (square corners), bottom stays rounded,
     so the countdown runs the whole top edge, corner to corner, and drains right to left. Nothing (power
     glow, Einstein's tilt) can push it past the edge. */
  position: absolute; inset: 0 0 auto; width: auto; height: 7px; margin: 0; border: 0; border-radius: 0;
  appearance: none; -webkit-appearance: none; background: rgb(0 0 0 / .65); z-index: 3;
  overflow: hidden; transform: none !important; filter: none !important; box-sizing: border-box;
}
@media (max-width: 720px) {
  body.duel-view #app .panel.ct-themed > .quiz-progress, body.duel-view #app .panel.ct-themed > .quiz-progress.wait-bar { inset: 0 0 auto; }
}
/* Flat top, rounded bottom (owner, 2026-11-30). The effects layer and edge light follow via border-radius: inherit. */
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) { border-radius: 0 0 26px 26px; }
body.duel-view #app .panel.ct-themed > .quiz-progress::-webkit-progress-bar { background: rgb(0 0 0 / .65); border-radius: inherit; overflow: hidden; }
body.duel-view #app .panel.ct-themed > .quiz-progress::-webkit-progress-value { background: linear-gradient(90deg, color-mix(in srgb, var(--ct-a) 45%, #fff), #fff); border-radius: 0; box-shadow: 0 0 10px #fff, 0 0 4px var(--ct-a); }
body.duel-view #app .panel.ct-themed > .quiz-progress::-moz-progress-bar { background: linear-gradient(90deg, color-mix(in srgb, var(--ct-a) 45%, #fff), #fff); }
body.duel-view #app .panel.ct-themed > #lan-match-error:empty { display: none; }
/* Busy cards (power notices, answer choices, a long answer line) squeeze their spacing to stay the same size. */
body.duel-view #app .panel.ct-tight { padding-top: 12px; padding-bottom: 12px; }
body.duel-view #app .panel.ct-tight .kicker { margin-bottom: 2px; }
body.duel-view #app .panel.ct-tight h2 { margin: 2px 0 6px; }
body.duel-view #app .panel.ct-tight .typed-answer { margin-top: 2px; }
body.duel-view #app .panel.ct-tight .typed-answer input { min-height: 46px; }
body.duel-view #app .panel.ct-tight .pw-options, body.duel-view #app .panel.ct-tight .pw-hints { margin-top: 4px; gap: 4px; }
body.duel-view #app .panel.ct-tight .feedback { margin: 2px 0; padding-top: 4px; padding-bottom: 4px; }
body.duel-view #app .panel.ct-tight #next, body.duel-view #app .panel.ct-tight #lan-ready { min-height: 38px; margin-top: 4px; }
@media (max-width: 720px) {
  body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) { width: 100%; min-height: 196px; }
}
body.duel-view #app .panel.ct-themed:not([data-mode="intro"]):not([data-mode="ready"]):not([data-mode="finish"]) {
  isolation: isolate;
  border-color: color-mix(in srgb, var(--ct-a) 70%, transparent);
  background:
    radial-gradient(120% 95% at 50% -10%, color-mix(in srgb, var(--ct-a) 24%, transparent), transparent 62%),
    radial-gradient(60% 80% at 100% 100%, color-mix(in srgb, var(--ct-g) 40%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--ct-s) 88%, #000 4%), color-mix(in srgb, var(--ct-s) 70%, #07050a));
  box-shadow: 0 34px 80px -26px rgb(0 0 0 / .9), 0 0 34px -8px color-mix(in srgb, var(--ct-a) 55%, transparent), inset 0 1px 0 color-mix(in srgb, var(--ct-a) 40%, transparent);
  transition: border-color .4s ease, box-shadow .4s ease;
}
body.duel-view #app .ct-themed.quiz-workshop::before { background: linear-gradient(90deg, transparent, var(--ct-a), transparent); z-index: 2; }
body.duel-view #app .panel.ct-themed .kicker { color: var(--ct-a); }
body.duel-view #app .panel.ct-themed .kicker::before, body.duel-view #app .panel.ct-themed .kicker::after { background: linear-gradient(90deg, transparent, var(--ct-a)); }
body.duel-view #app .panel.ct-themed h2 { text-shadow: 0 2px 14px color-mix(in srgb, var(--ct-s) 90%, #000); }
body.duel-view #app .ct-themed .typed-answer input { border-color: color-mix(in srgb, var(--ct-a) 60%, transparent); background: color-mix(in srgb, var(--ct-s) 55%, rgb(8 5 8 / .85)); }
body.duel-view #app .ct-themed .typed-answer input:focus-visible { border-color: var(--ct-a); box-shadow: inset 0 2px 6px rgb(0 0 0 / .45), 0 0 0 5px color-mix(in srgb, var(--ct-a) 38%, transparent); }
/* Submit button in the answering champion's colours (owner, 2026-11-27: it was the site-wide wine/gold button).
   Same shape and lettering as the button standard, cut from the card: shade fill, accent edge and text.
   Three :not(#) lift it over consistency.css's two-ID button standard. */
body.duel-view #app .ct-themed .typed-answer button:not(#_):not(#__):not(#___) {
  border: 1px solid color-mix(in srgb, var(--ct-a) 70%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ct-a) 16%, transparent), color-mix(in srgb, var(--ct-a) 5%, transparent)), color-mix(in srgb, var(--ct-s) 85%, #000);
  color: var(--ct-a); -webkit-text-fill-color: var(--ct-a);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ct-a) 25%, transparent), 0 0 16px -6px var(--ct-a);
}
body.duel-view #app .ct-themed .typed-answer button:not(#_):not(#__):not(#___):hover:not(:disabled) {
  border-color: var(--ct-a);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ct-a) 26%, transparent), color-mix(in srgb, var(--ct-a) 10%, transparent)), color-mix(in srgb, var(--ct-s) 85%, #000);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ct-a) 35%, transparent), 0 0 0 3px color-mix(in srgb, var(--ct-a) 18%, transparent), 0 0 20px -6px var(--ct-a);
}
body.duel-view #app .ct-themed .party-thinking, body.duel-view #app .ct-themed #lan-live-draft { color: var(--ct-a); }

/* Turn change: no flash any more. The old card flies out left (card-themes.js snap/fly); a pure redraw of
   the same card (.ct-same) doesn't replay the verdict / button entrance animations. */
body.duel-view #app .panel.ct-same .feedback, body.duel-view #app .panel.ct-same .answer-verdict,
body.duel-view #app .panel.ct-same #lan-ready { animation: none !important; }
body.duel-view #app .panel.ct-ghost { will-change: translate; }

/* ---------- Effects layer (behind the text) ---------- */
.ct-fx { position: absolute; inset: 0; z-index: -1; overflow: hidden; border-radius: inherit; pointer-events: none; }
.ct-fx .ct-deco, .ct-fx .ct-deco2 { position: absolute; inset: 0; animation-delay: var(--ct-clock, 0s) !important; }
/* A light in the champion's colour runs round the edge of the card, every champion. */
@property --ct-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.ct-fx::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--ct-ang), transparent 0 62%, color-mix(in srgb, var(--ct-a) 60%, transparent) 80%, var(--ct-g) 88%, var(--ct-a) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: ct-ang 5.5s linear var(--ct-clock, 0s) infinite;
}
@keyframes ct-ang { to { --ct-ang: 360deg; } }
.ct-fx .ct-sym {
  position: absolute; right: 16px; bottom: 4px; color: var(--ct-a); opacity: .3; text-shadow: 0 0 18px var(--ct-g);
  font: 700 64px/1 "Cinzel", "Segoe UI Symbol", serif; transform: rotate(-8deg);
}
.ct-p { position: absolute; left: var(--x); top: var(--y); color: var(--ct-a); font: 700 calc(20px * var(--z)) / 1 "Cormorant Garamond", "Segoe UI Symbol", serif; font-style: normal; opacity: 0; animation: var(--ct-anim, ct-twinkle) var(--t) ease-in-out calc(var(--d) + var(--ct-clock, 0s)) infinite; will-change: transform, opacity; }
.ct-fx[data-m="rise"]    .ct-p { --ct-anim: ct-rise;    top: auto; bottom: -12px; animation-timing-function: linear; }
.ct-fx[data-m="fall"]    .ct-p { --ct-anim: ct-fall;    top: -16px; animation-timing-function: linear; }
.ct-fx[data-m="drift"]   .ct-p { --ct-anim: ct-drift;   animation-timing-function: linear; }
.ct-fx[data-m="twinkle"] .ct-p { --ct-anim: ct-twinkle; }
.ct-fx[data-m="flicker"] .ct-p { --ct-anim: ct-flicker; }
@keyframes ct-rise    { 0% { transform: translateY(0) scale(var(--z)); opacity: 0; } 15% { opacity: .95; } 85% { opacity: .7; } 100% { transform: translateY(-190px) translateX(12px) scale(var(--z)); opacity: 0; } }
@keyframes ct-fall    { 0% { transform: translateY(0) rotate(0); opacity: 0; } 12% { opacity: .95; } 50% { transform: translateY(95px) translateX(14px) rotate(160deg); } 88% { opacity: .8; } 100% { transform: translateY(200px) translateX(-6px) rotate(320deg); opacity: 0; } }
@keyframes ct-drift   { 0% { transform: translateX(-30px); opacity: 0; } 20% { opacity: .85; } 80% { opacity: .65; } 100% { transform: translateX(60px) translateY(-14px); opacity: 0; } }
@keyframes ct-twinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 45% { opacity: .95; transform: scale(1.1); } 60% { opacity: .7; } }
@keyframes ct-flicker { 0%, 100% { opacity: 0; } 4% { opacity: .95; } 7% { opacity: .1; } 10% { opacity: .85; } 16% { opacity: 0; } }

/* Shapes */
.ct-dot   { width: 6px; height: 6px; border-radius: 50%; background: var(--ct-g); box-shadow: 0 0 10px 2px var(--ct-g); }
.ct-coin  { width: 13px; height: 13px; border-radius: 50%; background: url("assets/ducat.svg?v=1") center / 100% no-repeat; box-shadow: 0 0 8px color-mix(in srgb, var(--ct-a) 80%, transparent); }
.ct-apple { width: 16px; height: 16px; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 35% 30%, #ffb3a8, #d8342b 55%, #7a1612); }
.ct-apple::before { content: ""; position: absolute; left: 7px; top: -5px; width: 2px; height: 6px; background: #5b3a1d; }
.ct-apple::after  { content: ""; position: absolute; left: 9px; top: -6px; width: 7px; height: 4px; border-radius: 0 6px; background: #6fc35b; }
.ct-petal { width: 11px; height: 8px; border-radius: 80% 0 80% 0; background: linear-gradient(135deg, #ffe0e7, var(--ct-g)); }
.ct-leaf  { width: 12px; height: 6px; border-radius: 0 100% 0 100%; background: linear-gradient(135deg, #f3dc8b, var(--ct-g) 60%, #8a6a22); }
.ct-chip  { width: 8px; height: 6px; clip-path: polygon(0 30%, 60% 0, 100% 55%, 40% 100%); background: linear-gradient(135deg, #fff, #cfc4b8); }
.ct-smoke { width: 70px; height: 26px; border-radius: 50%; background: radial-gradient(closest-side, rgb(200 200 200 / .25), transparent); filter: blur(2px); }
.ct-bolt  { width: 22px; height: 46px; background: var(--ct-g); clip-path: polygon(55% 0, 20% 55%, 45% 55%, 30% 100%, 80% 40%, 55% 40%, 70% 0); filter: drop-shadow(0 0 6px var(--ct-a)); }
.ct-g { text-shadow: 0 0 10px color-mix(in srgb, var(--ct-g) 70%, transparent); }

/* ---------- Each champion's own motif ---------- */
/* Alexander: a Vergina sunburst turning slowly behind the card. */
.ct-fx[data-key="alex"] .ct-deco { inset: -60% -20%; background: repeating-conic-gradient(from 0deg at 50% 0%, color-mix(in srgb, var(--ct-g) 45%, transparent) 0 6deg, transparent 6deg 18deg); animation: ct-spin 40s linear infinite; mask: radial-gradient(closest-side at 50% 0%, #000, transparent); }
/* Cleopatra: Nile waves rolling along the bottom, gold band at the top. */
.ct-fx[data-key="cleo"] .ct-deco { top: auto; height: 38%; background: repeating-linear-gradient(170deg, transparent 0 10px, color-mix(in srgb, var(--ct-g) 38%, transparent) 10px 12px); animation: ct-slide 6s linear infinite; mask: linear-gradient(transparent, #000); }
.ct-fx[data-key="cleo"] .ct-deco2 { top: auto; height: 4px; background: repeating-linear-gradient(90deg, var(--ct-a) 0 10px, var(--ct-g) 10px 14px, var(--ct-s) 14px 18px); opacity: .55; }
/* Shakespeare: theatre curtains swagged at the corners, letters drifting off the page. */
.ct-fx[data-key="shakespeare"] .ct-deco { background: radial-gradient(60% 40% at 0 0, color-mix(in srgb, #7d1f5d 70%, transparent), transparent 70%), radial-gradient(60% 40% at 100% 0, color-mix(in srgb, #7d1f5d 70%, transparent), transparent 70%); }
.ct-fx[data-key="shakespeare"] .ct-p { font-style: italic; font-size: calc(22px * var(--z)); }
/* Tesla: electric arcs crackling round the edge. */
.ct-fx[data-key="tesla"] .ct-deco { border-radius: inherit; box-shadow: inset 0 0 0 1px var(--ct-a), inset 0 0 24px color-mix(in srgb, var(--ct-a) 45%, transparent); animation: ct-buzz 2.6s steps(1) infinite; }
.ct-fx[data-key="tesla"] .ct-deco2 { background: linear-gradient(100deg, transparent 40%, color-mix(in srgb, var(--ct-g) 35%, transparent) 50%, transparent 60%); background-size: 250% 100%; animation: ct-sweep 3.2s ease-in-out infinite; }
/* Einstein: orbits round the card, E=mc² among the stars. */
.ct-fx[data-key="einstein"] .ct-deco { inset: 50% auto auto 50%; width: 520px; height: 150px; margin: -75px 0 0 -260px; border: 1px solid color-mix(in srgb, var(--ct-a) 45%, transparent); border-radius: 50%; animation: ct-orbit 14s linear infinite; }
.ct-fx[data-key="einstein"] .ct-deco2 { inset: 50% auto auto 50%; width: 520px; height: 150px; margin: -75px 0 0 -260px; border: 1px solid color-mix(in srgb, var(--ct-g) 45%, transparent); border-radius: 50%; animation: ct-orbit2 18s linear infinite; }
.ct-fx[data-key="einstein"] .ct-p { font: italic 600 calc(14px * var(--z)) / 1 "Cormorant Garamond", serif; }
/* Da Vinci: a Vitruvian circle-and-square sketch on parchment grid. */
.ct-fx[data-key="davinci"] .ct-deco { background: linear-gradient(color-mix(in srgb, var(--ct-a) 13%, transparent) 1px, transparent 1px) 0 0 / 22px 22px, linear-gradient(90deg, color-mix(in srgb, var(--ct-a) 13%, transparent) 1px, transparent 1px) 0 0 / 22px 22px; }
.ct-fx[data-key="davinci"] .ct-deco2 { inset: 50% auto auto 85%; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 1px solid color-mix(in srgb, var(--ct-a) 45%, transparent); border-radius: 50%; outline: 1px solid color-mix(in srgb, var(--ct-a) 38%, transparent); outline-offset: -18px; animation: ct-spin 30s linear infinite; }
/* Curie: a radium glow pulsing up from below, particles rising. */
.ct-fx[data-key="curie"] .ct-deco { background: radial-gradient(70% 60% at 50% 110%, color-mix(in srgb, var(--ct-g) 45%, transparent), transparent 70%); animation: ct-pulse 3s ease-in-out infinite; }
/* Nightingale: the lamp's warm flicker in the corner, embers rising. */
.ct-fx[data-key="nightingale"] .ct-deco { background: radial-gradient(40% 70% at 8% 100%, color-mix(in srgb, var(--ct-g) 40%, transparent), transparent 70%); animation: ct-candle 2.2s ease-in-out infinite; }
/* Joan: a beam of heavenly light from above, fleur-de-lis. */
.ct-fx[data-key="joan"] .ct-deco { background: conic-gradient(from 165deg at 50% -20%, transparent, color-mix(in srgb, var(--ct-g) 32%, transparent) 10deg 20deg, transparent 30deg); animation: ct-pulse 4s ease-in-out infinite; }
.ct-fx[data-key="joan"] .ct-deco2 { top: auto; height: 3px; background: linear-gradient(90deg, transparent, #c8d4ff, transparent); }
/* Caesar: imperial purple-red stripe, laurel leaves falling. */
.ct-fx[data-key="caesar"] .ct-deco { background: linear-gradient(90deg, transparent 0 46%, color-mix(in srgb, #a0202f 22%, transparent) 46% 54%, transparent 54%); }
.ct-fx[data-key="caesar"] .ct-deco2 { top: auto; height: 3px; background: repeating-linear-gradient(90deg, var(--ct-g) 0 14px, transparent 14px 20px); opacity: .5; }
.ct-fx[data-key="caesar"] .ct-sym { font-size: 30px; letter-spacing: .12em; bottom: 12px; }
/* Napoleon: the tricolour sash along the top, stars. */
.ct-fx[data-key="napoleon"] .ct-deco { top: auto; height: 4px; background: linear-gradient(90deg, #3c5bd6 0 33%, #f4f4f4 33% 66%, #d8303a 66%); opacity: .7; }
.ct-fx[data-key="napoleon"] .ct-deco2 { background: linear-gradient(115deg, transparent 0 70%, color-mix(in srgb, #3c5bd6 18%, transparent) 70% 78%, color-mix(in srgb, #f4f4f4 10%, transparent) 78% 86%, color-mix(in srgb, #d8303a 16%, transparent) 86%); }
/* Spartacus: hot arena sand blowing across, a broken chain at the edges. */
.ct-fx[data-key="spartacus"] .ct-deco { background: radial-gradient(80% 50% at 50% 120%, color-mix(in srgb, var(--ct-g) 40%, transparent), transparent 70%); }
.ct-fx[data-key="spartacus"] .ct-deco2 { top: auto; bottom: 10px; height: 10px; background: radial-gradient(ellipse 7px 4px, transparent 3px, color-mix(in srgb, var(--ct-a) 45%, transparent) 3.5px 5px, transparent 5.5px) 0 0 / 16px 10px repeat-x; mask: linear-gradient(90deg, #000 0 22%, transparent 22% 78%, #000 78%); }
/* Michelangelo: marble veins across the stone, chips falling from the chisel. */
.ct-fx[data-key="michelangelo"] .ct-deco { background: linear-gradient(125deg, transparent 30%, rgb(255 255 255 / .06) 31%, transparent 33%), linear-gradient(160deg, transparent 55%, rgb(255 255 255 / .07) 56%, transparent 57.5%), linear-gradient(105deg, transparent 72%, rgb(255 255 255 / .05) 73%, transparent 74%), radial-gradient(90% 90% at 30% 20%, rgb(255 255 255 / .06), transparent); }
/* Newton: apples falling, orbit-like gravity rings. */
.ct-fx[data-key="newton"] .ct-deco { background: radial-gradient(circle at 50% 160%, transparent 50%, color-mix(in srgb, var(--ct-a) 40%, transparent) 50.4%, transparent 51%), radial-gradient(circle at 50% 160%, transparent 62%, color-mix(in srgb, var(--ct-a) 20%, transparent) 62.4%, transparent 63%); }
/* Lovelace: a punched card scrolling behind, binary blinking. */
.ct-fx[data-key="lovelace"] .ct-deco { background: radial-gradient(circle, color-mix(in srgb, var(--ct-a) 38%, transparent) 2px, transparent 2.5px) 0 0 / 18px 14px; animation: ct-scroll 12s linear infinite; mask: linear-gradient(90deg, #000, transparent 30% 70%, #000); }
.ct-fx[data-key="lovelace"] .ct-p { font: 700 calc(13px * var(--z)) / 1 ui-monospace, Consolas, monospace; }
/* Mansa Musa: gold shimmer sweeping across, coins falling. */
.ct-fx[data-key="mansa-musa"] .ct-deco { background: linear-gradient(105deg, transparent 40%, color-mix(in srgb, var(--ct-g) 45%, transparent) 50%, transparent 60%); background-size: 250% 100%; animation: ct-sweep 4s ease-in-out infinite; }
.ct-fx[data-key="mansa-musa"] .ct-deco2 { border-radius: inherit; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ct-a) 35%, transparent), inset 0 0 30px color-mix(in srgb, var(--ct-a) 32%, transparent); }
/* Blackbeard: dark sea swell along the bottom, cannon smoke drifting. */
.ct-fx[data-key="blackbeard"] .ct-deco { top: auto; height: 30%; background: radial-gradient(ellipse 30px 10px at 50% 0, transparent 70%, color-mix(in srgb, var(--ct-g) 38%, transparent) 72%, transparent 80%) 0 0 / 44px 14px repeat; animation: ct-slide 5s linear infinite; mask: linear-gradient(transparent, #000); }
.ct-fx[data-key="blackbeard"] .ct-sym { opacity: .2; }
/* Musashi: a pale moon, cherry petals falling. */
.ct-fx[data-key="samurai"] .ct-deco { inset: -30px auto auto 6%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgb(255 236 226 / .16), rgb(255 200 190 / .05) 60%, transparent 70%); }
.ct-fx[data-key="samurai"] .ct-deco2 { top: auto; bottom: 16px; height: 1px; background: linear-gradient(90deg, transparent, var(--ct-a), transparent); animation: ct-slash 4s ease-in-out infinite; }
/* Billy the Kid: desert dust blowing, a wanted-poster border. */
.ct-fx[data-key="billy-the-kid"] .ct-deco { background: radial-gradient(90% 60% at 50% 120%, color-mix(in srgb, var(--ct-a) 38%, transparent), transparent 70%); }
.ct-fx[data-key="billy-the-kid"] .ct-deco2 { inset: 7px; border: 1px dashed color-mix(in srgb, var(--ct-a) 45%, transparent); border-radius: 0 0 calc(26px - 7px) calc(26px - 7px); }
/* Mozart: five stave lines, notes floating up. */
/* Owner, 2026-11-26: no staff lines (they clashed) — just his colours and music notes drifting down. */
.ct-fx[data-key="mozart"] .ct-deco { background: radial-gradient(90% 70% at 50% -10%, color-mix(in srgb, var(--ct-g) 22%, transparent), transparent 70%); }
.ct-fx[data-key="mozart"] .ct-p { font-size: calc(22px * var(--z)); --ct-anim: ct-note-fall; }
@keyframes ct-note-fall { 0% { transform: translateY(0) translateX(0) rotate(-8deg); opacity: 0; } 12% { opacity: .9; } 35% { transform: translateY(75px) translateX(10px) rotate(6deg); } 65% { transform: translateY(140px) translateX(-8px) rotate(-6deg); } 88% { opacity: .75; } 100% { transform: translateY(210px) translateX(6px) rotate(8deg); opacity: 0; } }

/* ---------- The answer line on a champion card (owner, 2026-11-26) ----------
   It used to be a gold plate with a boxed "Correct" pill, which didn't belong to the champion's card.
   Now the plate is cut from the card's own colours, and the verdict is just the mark + the word. */
body.duel-view #app .panel.ct-themed .feedback {
  border-color: color-mix(in srgb, var(--ct-a) 45%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ct-s) 70%, rgb(0 0 0 / .35)), color-mix(in srgb, var(--ct-s) 85%, rgb(0 0 0 / .55)));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ct-a) 25%, transparent), 0 0 22px -10px color-mix(in srgb, var(--ct-a) 60%, transparent), 0 12px 26px -16px rgb(0 0 0 / .9);
  padding: 8px 20px 8px 16px;
}
body.duel-view #app .panel.ct-themed .answer-verdict { padding: 0; border: 0; background: none; box-shadow: none; gap: 8px; }
body.duel-view #app .panel.ct-themed .accepted-answer { border-left-color: color-mix(in srgb, var(--ct-a) 40%, transparent); }
body.duel-view #app .panel.ct-themed .accepted-answer small { color: var(--ct-a); }
body.duel-view #app .panel.ct-themed .lan-next-up { color: var(--ct-a); }

@keyframes ct-spin   { to { transform: rotate(360deg); } }
@keyframes ct-slide  { to { background-position: 88px 0; } }
@keyframes ct-scroll { to { background-position: 180px 0; } }
@keyframes ct-sweep  { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes ct-pulse  { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes ct-candle { 0%, 100% { opacity: .8; } 30% { opacity: 1; } 55% { opacity: .65; } 70% { opacity: .95; } }
@keyframes ct-buzz   { 0%, 100% { opacity: .45; } 31% { opacity: 1; } 33% { opacity: .3; } 35% { opacity: .9; } 62% { opacity: .5; } }
@keyframes ct-orbit  { from { transform: rotate(-8deg); } to { transform: rotate(352deg); } }
@keyframes ct-orbit2 { from { transform: rotate(60deg) scaleX(.8); } to { transform: rotate(-300deg) scaleX(.8); } }
@keyframes ct-slash  { 0%, 70%, 100% { transform: scaleX(0); opacity: 0; } 78% { transform: scaleX(1); opacity: 1; } 92% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .ct-fx * { animation: none !important; }
  .ct-p { opacity: .35; }
}

/* ---------- Name banners over the fighters' heads: whole-pixel position (game.js trackHeads sets
   --hb-x/--hb-y) and no GPU text layer, so the text is sharp, not blurry. ---------- */
body.duel-view .arena.heads-tracked .score .health { transform: translate(var(--hb-x, 0px), var(--hb-y, 0px)) !important; will-change: auto !important; }

/* ---------- Floating chat: capped at a quarter of the screen, scroll inside it ---------- */
/* Owner, 2026-11-30: scroll back through the WHOLE chat. It used to stack from the bottom with
   align-content: end, which pushed older lines out the TOP where no scrollbar can reach. Now a column
   whose first line has an auto top margin: short chats still sit at the bottom, long ones scroll. */
.rc-chat .rc-log {
  display: flex; flex-direction: column; align-items: flex-start;
  max-height: 25vh; max-height: 25dvh; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / .25) transparent;
  -webkit-mask: linear-gradient(transparent, #000 14px); mask: linear-gradient(transparent, #000 14px);
}
.rc-chat .rc-log > :first-child { margin-top: auto; }
.rc-chat .rc-log > .rc-msg { flex: none; }
.rc-chat .rc-log::-webkit-scrollbar { width: 5px; }
.rc-chat .rc-log::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .25); border-radius: 4px; }
/* The box itself lets clicks through to the game; only the visible messages catch the mouse wheel. */
/* Owner, 2026-11-25: hover over the chat (or click in it) and the mouse wheel scrolls it. The whole
   message list catches the mouse — faded old lines and the gaps between lines included — so the wheel
   never falls through to the game. Only the chat's own box does; the rest of the screen is untouched. */
.rc-chat .rc-log, .rc-chat .rc-msg, .rc-chat .rc-msg.is-old { pointer-events: auto; }
.rc-chat .rc-log:hover .rc-msg.is-old { opacity: .9; }
.rc-chat .rc-log:hover { scrollbar-color: rgb(255 255 255 / .45) transparent; }
.rc-chat .rc-log:hover::-webkit-scrollbar-thumb { background: rgb(255 255 255 / .45); }

/* The chat lives bottom-left, but when the end-of-match card comes in on the LEFT (the right-hand
   champion won), the chat moves to the bottom-right the moment that card appears, so they never
   overlap (owner, 2026-11-25). Phones stack the card differently, so this is desktop only. */
@media (min-width: 701px) {
  /* Owner, 2026-11-30: on the right it was cut off a touch at the edge; sits a little further in now. */
  body.duel-view:has(#app .victory-result.victory-left) .rc-chat { left: auto; right: max(34px, calc(env(safe-area-inset-right) + 20px)); width: min(270px, calc(100vw - 68px)); box-sizing: border-box; animation: rc-to-right .35s ease-out both; }
}

/* End-of-match cards (winner name, scores, coins earned, stats, buttons): the whole stack is centred
   top-to-bottom on the screen in every mode (owner, 2026-11-30: it sat a little high). Top and bottom 0
   plus auto margins centre it whatever its height (no clipping: the rematch stakes slide out sideways).
   Phones keep their own stacked layout. */
@media (min-width: 701px) {
  body.duel-view #app .victory-result { top: 0 !important; bottom: 0 !important; height: fit-content; margin-block: auto !important; }
}
@keyframes rc-to-right { from { opacity: 0; translate: 24px 0; } to { opacity: 1; translate: 0; } }

/* ---------- Answer log lines in the floating chat (social.js roomLog) ---------- */
.rc-chat .rc-msg.rc-sys { opacity: .62; font-style: italic; }
.rc-chat .rc-msg.rc-sys b { font-style: normal; }
.rc-chat .rc-msg.rc-sys .rc-v-right { color: #8fe3a0; font-style: normal; }
.rc-chat .rc-msg.rc-sys .rc-v-wrong { color: #ff9a8a; font-style: normal; }
