/* THE DUEL SCREEN (screens/duel.js). Phone-first, one column:
   their bar · their hand · the stage · the guide · your hand · your bar.
   No blend modes, masks, backdrop filters or animated filters: they crashed iPhones. */
.dl { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px calc(env(safe-area-inset-bottom, 0px) + 6px); background: var(--bg0) center / cover no-repeat; overflow: hidden; user-select: none; -webkit-user-select: none; }

/* bars */
.dl-bar { flex: none; height: 46px; display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(10, 10, 16, 0.78); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; }
.dl-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.1; }
.dl-who b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-who span { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-res { display: flex; align-items: center; gap: 2px; font-size: 15px; color: var(--focus); }
.dl-res--read { color: var(--read); }
.dl-res.used { opacity: 0.35; }
.dl-voice { display: flex; align-items: center; gap: 5px; width: 104px; flex: none; }
.dl-voice b { font-size: 22px; font-weight: 800; min-width: 24px; text-align: right; font-variant-numeric: tabular-nums; }
.dl-voice__bar { flex: 1; height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 4px; overflow: hidden; }
.dl-voice__bar i { display: block; height: 100%; background: linear-gradient(90deg, #b88a2c, var(--gold)); transition: width 0.5s var(--ease-out); }
.dl-voice.low b { color: var(--danger); }
.dl-voice.low .dl-voice__bar i { background: linear-gradient(90deg, #8a1f1f, var(--danger)); }
.dl-bar.hit { animation: dlHit 0.5s ease-out; }
@keyframes dlHit { 0% { transform: translateX(0); background: rgba(120, 20, 20, 0.85); } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 100% { transform: translateX(0); } }

/* hands */
.dl-hand { flex: none; display: flex; justify-content: center; align-items: center; gap: 6px; }
.dl-hand .card { flex: none; cursor: pointer; transition: transform 0.18s var(--ease-out), opacity 0.2s; }
.dl-hand--opp .card { cursor: default; }
.dl-hand.choosing .card:active { transform: scale(0.96); }
.dl-hand .card.is-selected { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(233, 196, 111, 0.55); }
.dl-hand .card.dl-gone { opacity: 0.25; pointer-events: none; }
.dl-suggest { animation: dlSuggest 1.2s ease-in-out infinite; }
@keyframes dlSuggest { 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(233, 196, 111, 0.7); } }

/* card overlays */
.dl-wound, .dl-ward { position: absolute; z-index: 5; bottom: 4px; padding: 1px 5px; border-radius: 8px; font-size: 12px; font-weight: 800; line-height: 1.3; }
.dl-wound { left: 4px; color: #fff; background: rgba(150, 30, 30, 0.92); }
.dl-ward { right: 4px; display: flex; align-items: center; gap: 2px; color: #04131c; background: var(--guard); }

/* the stage */
.dl-stage { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.dl-count { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); text-align: center; }
.dl-count b { color: var(--bone); }
.dl-final { color: var(--gold); font-weight: 700; }
.dl-arena { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding-top: 8px; }
.dl-slot { position: relative; height: 100%; aspect-ratio: 2 / 3; max-width: 124px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); background: rgba(0, 0, 0, 0.25); }
.dl-slot__tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 6; padding: 0 6px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); background: var(--bg1); border-radius: 6px; white-space: nowrap; }
.dl-vs { flex: none; min-width: 52px; display: flex; flex-direction: column; align-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--dim); }
.dl-vs.on { font-family: var(--font-ui); color: var(--bone); animation: dlPop 0.35s var(--ease-spring); }
.dl-vs b { font-size: 30px; font-weight: 800; line-height: 1; }
.dl-vs span { display: flex; gap: 3px; align-items: center; font-size: 11px; color: var(--muted); }
.dl-atk { color: var(--strike); }
.dl-def { color: var(--guard); }
@keyframes dlPop { from { transform: scale(0.6); opacity: 0; } }

.dl-in { animation: dlIn 0.3s var(--ease-out); }
@keyframes dlIn { from { transform: translateY(14px) scale(0.92); opacity: 0; } }
.dl-focused { box-shadow: 0 0 0 2px var(--focus), 0 0 16px rgba(255, 209, 102, 0.6); }
.dl-winner { animation: dlWin 0.5s var(--ease-spring) forwards; z-index: 3; }
@keyframes dlWin { 40% { transform: scale(1.16); } to { transform: scale(1.1); box-shadow: 0 0 0 3px var(--gold), 0 0 28px rgba(233, 196, 111, 0.85); } }
.dl-loser { animation: dlLose 0.4s ease-out forwards; }
@keyframes dlLose { 15% { transform: translateX(-7px) rotate(-2deg); } 35% { transform: translateX(7px) rotate(2deg); } 55% { transform: translateX(-4px); } 75% { transform: translateX(3px); } to { transform: scale(0.94); opacity: 0.5; } }
.dl-falls { animation: dlFall 0.8s ease-in forwards; }
@keyframes dlFall { to { transform: translateY(30px) rotate(-8deg); opacity: 0; } }

/* the guide */
.dl-guide { flex: none; height: var(--dl-guide, 160px); overflow-y: auto; overscroll-behavior: contain; padding: 8px 12px; border-radius: 12px; background: rgba(10, 10, 16, 0.86); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; line-height: 1.3; }
.dl-guide .ico { width: 0.95em; height: 0.95em; }
.dl-intro p { margin: 0 0 4px; }
.dl-intro .lore { font-size: 16px; }
.dl-ask b { color: var(--gold); }
.dl-pick { display: flex; flex-direction: column; gap: 6px; }
.dl-pick__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 16px; }
.dl-pick__head span:not(.dl-tag) { flex-basis: 100%; font-size: 13px; color: var(--muted); }
.dl-vslist { display: grid; gap: 3px; }
.dl-vsrow { display: flex; justify-content: space-between; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 14px; background: rgba(255, 255, 255, 0.04); }
.dl-vsrow em { font-style: normal; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; }
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-row .btn { flex: 1 1 auto; }
.dl-go { align-self: stretch; }
.dl-tog.on { color: #1b1404; background: var(--focus); box-shadow: none; }
.dl-note { font-size: 12px; color: var(--muted); }
.dl-tag { padding: 0 5px; border-radius: 5px; font-size: 11px; font-weight: 700; color: #1b1404; background: var(--focus); }
.dl-result { display: flex; flex-direction: column; gap: 2px; }
.dl-result b { font-size: 19px; }
.dl-result.good b { color: var(--gold); }
.dl-result.bad b { color: #ff8a7a; }
.dl-result em { font-size: 12px; color: var(--muted); }

/* forfeit sits in the top right, over their bar */
.dl-quit { top: calc(env(safe-area-inset-top, 0px) + 14px); right: 16px; }

/* inspect + result */
.dl-insp { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 10px 0; font-size: 14px; color: var(--muted); }
.dl-insp b { color: var(--bone); }
.dl-spoils { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dl-spoils__name { font-size: 15px; }


/* training: the coach talks at the top of the guide */
.dl-coach { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 6px 10px; border-radius: 8px; font-size: 15px; color: #1b1404; background: linear-gradient(180deg, #fff1c9, #f0d48a); }
.dl-coach b { color: #6b4a0c; }
.btn.dl-suggest { animation: dlSuggest 1.2s ease-in-out infinite; }

/* online: the shot clock sits by the stage, a warning when they drop */
.dl-clock { top: 38%; }
.dl-emote { top: calc(38% - 3px); }
.dl-emote-pick { top: calc(38% + 34px); }
.dl-away { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); z-index: 30; padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700; color: #ffd6cf; background: rgba(90, 20, 20, 0.92); white-space: nowrap; pointer-events: none; }

/* Bonds: the bonus on a card, the line in the intro */
.dl-bond { position: absolute; z-index: 5; top: 4px; right: 4px; padding: 0 5px; border-radius: 8px; font-size: 11px; font-weight: 800; line-height: 1.5; color: #1b1404; background: var(--gold); }
.dl-bondline { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.dl-bondline b { color: var(--gold); }
.dl-insp-bond { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--gold); text-align: center; }

/* the clash as numbers (no verdicts) */
.dl-cmp { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; font-weight: 800; font-size: 22px; }
.dl-cmp b { display: inline-flex; align-items: center; gap: 3px; }
.dl-cmp span { font-size: 13px; font-weight: 600; color: var(--muted); }
.dl-cmp em { flex-basis: 100%; font-style: normal; font-weight: 500; font-size: 12px; color: var(--muted); }
.dl-vsnum { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.dl-vsnum b { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; }

/* danger: what they could still do glows */
.dl-res.live { animation: dlLive 1.1s ease-in-out infinite; }
@keyframes dlLive { 50% { transform: scale(1.18); text-shadow: 0 0 10px currentColor; } }
.dl-slam { animation: dlSlam 0.45s var(--ease-slam); }
@keyframes dlSlam { 0% { transform: translateY(-40px) scale(1.15); } 70% { transform: translateY(4px) scale(0.98); } 100% { transform: none; } }
.dl-bark { position: absolute; z-index: 32; top: 27%; left: 50%; transform: translateX(-50%); white-space: nowrap; max-width: 80%; overflow: hidden; text-overflow: ellipsis; padding: 7px 12px; border-radius: 14px; border-top-left-radius: 4px; font-family: var(--font-display); font-style: italic; font-size: 16px; color: #1a1408; background: var(--bone); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); pointer-events: none; animation: dlBark 0.2s var(--ease-out); }
@keyframes dlBark { from { opacity: 0; transform: translate(-50%, 8px); } }

/* after the reveal: the stamp */
.dl-arena { position: relative; }
.dl-stamp { position: absolute; left: 50%; top: 50%; z-index: 20; transform: translate(-50%, -50%) rotate(-6deg); padding: 4px 14px; border-radius: 8px; font-family: var(--font-display); font-weight: 700; font-size: 34px; letter-spacing: 0.04em; white-space: nowrap; color: var(--bone); background: rgba(10, 10, 16, 0.9); box-shadow: inset 0 0 0 2px var(--muted); pointer-events: none; animation: dlStamp 0.35s var(--ease-spring); }
.dl-stamp.good { color: var(--gold-hi); box-shadow: inset 0 0 0 2px var(--gold), 0 0 24px rgba(233, 196, 111, 0.45); }
.dl-stamp.bad { color: #ffb3a8; box-shadow: inset 0 0 0 2px #c0473a; }
@keyframes dlStamp { from { transform: translate(-50%, -50%) rotate(-6deg) scale(2.2); opacity: 0; } }

.dl-bond .ico { width: 0.9em; height: 0.9em; vertical-align: -1px; }

/* the piles live in the bars now */
.dl-piles { display: flex; gap: 6px; font-size: 15px; font-weight: 800; color: var(--bone); }
.dl-piles span { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.dl-piles i { font-style: normal; font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dl-piles .dl-fell { color: #ff8a7a; }
.dl-bar--opp { padding-right: 52px; }

/* readable numbers on cards in a match: big stats (never under 17px), the name above them */
.dl .card--mini .stat { height: 4.1em; }
.dl .card--mini .card__stats { left: 0.25em; right: 0.25em; bottom: 0.25em; gap: 0.08em; }
.dl .card--mini .card__stats:has(.stat--hp) { gap: 0.06em; }
.dl .card--mini .card__stats:has(.stat--hp) .stat b,
.dl .card--mini .card__stats .stat b { font-size: max(2.6em, 17px); letter-spacing: -0.04em; text-shadow: 0 1px 2px #000; }
.dl .card--mini .card__stats .stat .ico { width: max(1.4em, 11px); height: max(1.4em, 11px); }
.dl .card--mini .card__name { bottom: 4.5em; }
.dl .card--mini .card__name b { font-size: 1.6em; }
.dl .dl-hand--me .card--mini .card__sigil, .dl .dl-hand--me .card--mini .card__gem { transform: scale(1.1); }

/* the guide: the choices fit, the buttons never scroll away */
.dl-vslist { grid-template-columns: repeat(3, 1fr); gap: 4px; }
.dl-vsrow { flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 7px; }
.dl-vsrow > span:first-child { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.dl-vsnum { gap: 8px; }
.dl-guide .dl-row { position: sticky; bottom: -8px; z-index: 2; margin: 0 -12px -8px; padding: 6px 12px 8px; background: linear-gradient(rgba(10, 10, 16, 0), rgba(10, 10, 16, 0.96) 30%); }
.dl-guide .dl-pick { gap: 5px; }
.dl-pick__head span:not(.dl-tag) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-power { position: absolute; z-index: 8; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 3px; padding: 2px 10px; border-radius: 12px; font-size: 24px; font-weight: 800; line-height: 1.1; background: rgba(8, 8, 12, 0.94); box-shadow: inset 0 0 0 1.5px currentColor; pointer-events: none; }
.dl-power .ico { width: 0.8em; height: 0.8em; }
.dl-voice > .ico { width: 16px; height: 16px; flex: none; color: var(--gold); }
.dl-voice.low > .ico { color: var(--danger); }

/* beside the card, toward the VS, so it never covers the card's own numbers */
[data-slot="0"] .dl-power { right: -16px; }
[data-slot="1"] .dl-power { left: -16px; }

/* training: the glowing hero really glows, with a TAP tag */
.dl-hand .card.dl-suggest { animation: dlSuggest 1s ease-in-out infinite; box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(233, 196, 111, 0.75); }
.dl-hand .card.dl-suggest::before { content: ''; position: absolute; z-index: 9; top: -22px; left: 50%; width: 0; height: 0; margin-left: -11px; border: 11px solid transparent; border-top: 15px solid var(--gold); border-bottom: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); animation: dlTap 0.9s ease-in-out infinite; pointer-events: none; }
.dl-hand .card.dl-suggest.is-selected::before { display: none; }
@keyframes dlTap { 50% { transform: translateY(-6px); } }
.dl-hand { padding-top: 12px; }

/* live voice chat: the chip under the emote button, its sheet */
.vc-chip { position: absolute; top: calc(38% + 36px); left: 6px; z-index: 31; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 12px); min-height: 32px; padding: 0 12px 0 9px; border: 0; border-radius: 16px; font: inherit; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; color: var(--bone); background: rgba(10, 9, 14, 0.85); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); cursor: pointer; }
.vc-chip .ico { width: 16px; height: 16px; flex: none; }
.vc-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-chip:active { transform: scale(0.96); }
.vc-chip[data-state="off"] { color: #1b1404; background: var(--gold); box-shadow: none; }
.vc-chip[data-state="live"] { color: #c9f5d2; box-shadow: 0 0 0 1.5px #4fc76d; }
.vc-chip[data-state="waiting"], .vc-chip[data-state="joining"] { color: var(--muted); }
.vc-chip[data-state="needs_tap"], .vc-chip[data-state="interrupted"], .vc-chip[data-state="error"] { color: #ffd6cf; background: rgba(90, 20, 20, 0.92); box-shadow: 0 0 0 1px #ff8a7a; }
.vc-chip[data-state="locked"] { opacity: 0.7; }
.vc-sheet { position: absolute; top: calc(38% + 74px); left: 6px; z-index: 42; width: min(270px, calc(100% - 12px)); padding: 10px; border-radius: 12px; background: rgba(12, 10, 16, 0.97); box-shadow: 0 0 0 1px rgba(233, 196, 111, 0.35), 0 10px 30px rgba(0, 0, 0, 0.6); animation: emoteIn 0.14s ease-out; }
.vc-sheet p { margin: 4px 0 8px; font-size: 13px; line-height: 1.4; }
.vc-sheet__t { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.vc-sheet__sep { height: 1px; margin: 6px 0; background: rgba(255, 255, 255, 0.1); }
.vc-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; font: inherit; font-size: 15px; text-align: left; color: var(--bone); background: none; cursor: pointer; }
.vc-row .ico { width: 18px; height: 18px; flex: none; }
.vc-row:active { background: rgba(233, 196, 111, 0.18); }
.vc-row--warn { color: #ff9c8c; }
.vc-row.armed { background: rgba(140, 30, 30, 0.6); color: #fff; }
.vc-chip[hidden] { display: none; }

/* newly drawn cards are dealt in from the reserve, one after another */
.dl-hand--me .card.dl-deal { animation: dealMe 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1) backwards; animation-delay: calc(var(--deal-i, 0) * 0.12s); }
.dl-hand--opp .card.dl-deal { animation: dealOpp 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.1) backwards; animation-delay: calc(var(--deal-i, 0) * 0.12s); }
@keyframes dealMe { from { opacity: 0; transform: translate(60vw, 30px) rotate(18deg) scale(0.7); } }
@keyframes dealOpp { from { opacity: 0; transform: translate(60vw, -30px) rotate(-18deg) scale(0.7); } }
@media (prefers-reduced-motion: reduce) { .card.dl-deal { animation: none; } }

/* --- match intro: both duelists slide in, the VS lands between them --- */
.vs-intro { position: absolute; inset: 0; z-index: 60; display: grid; grid-template-rows: 1fr auto 1fr; overflow: hidden; cursor: pointer;
  background: linear-gradient(180deg, rgba(233, 196, 111, 0.22), transparent 40%), linear-gradient(0deg, rgba(139, 92, 246, 0.24), transparent 40%), #07070b center / cover no-repeat;
  animation: vsFade 0.25s ease-out; }
.vs-intro[style*="url"] { background-size: cover; background-position: center; background-repeat: no-repeat; }
.vs-intro.vs-out { animation: vsOut 0.32s ease-in forwards; }
@keyframes vsFade { from { opacity: 0; } }
@keyframes vsOut { to { opacity: 0; transform: scale(1.06); } }
.vs-half { display: flex; align-items: center; gap: 16px; padding: 0 20px; }
.vs-half--them { flex-direction: row-reverse; justify-content: flex-start; align-self: end; padding-bottom: 18px; animation: vsFromRight 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.05) 0.05s backwards; }
.vs-half--me { justify-content: flex-start; align-self: start; padding-top: 18px; animation: vsFromLeft 0.5s cubic-bezier(0.2, 0.9, 0.25, 1.05) 0.05s backwards; }
.vs-half--me .vs-name { order: 2; }
.vs-half--me .vs-card { order: 1; }
.vs-card .card { box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); }
.vs-half--them .vs-card { transform: rotate(4deg); }
.vs-half--me .vs-card { transform: rotate(-4deg); }
.vs-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.vs-half--them .vs-name { text-align: right; align-items: flex-end; }
.vs-name b { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.05; overflow-wrap: anywhere; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.vs-half--them .vs-name b { color: var(--gold-hi, #f6d98a); }
.vs-half--me .vs-name b { color: #e6dcff; }
.vs-name span { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; color: #e8e2d4; text-shadow: 0 1px 6px #000, 0 0 12px rgba(0, 0, 0, 0.9); }
@keyframes vsFromRight { from { transform: translateX(110%); opacity: 0; } }
@keyframes vsFromLeft { from { transform: translateX(-110%); opacity: 0; } }
.vs-crack { height: 2px; background: linear-gradient(90deg, transparent, #fff 20%, #fff7d6 50%, #fff 80%, transparent); box-shadow: 0 0 18px 4px rgba(255, 240, 200, 0.7); transform-origin: center; animation: vsCrack 0.3s ease-out 0.4s backwards; }
@keyframes vsCrack { from { transform: scaleX(0); opacity: 0; } }
.vs-mark { position: absolute; left: 50%; top: 50%; width: 132px; height: 132px; margin: -66px; display: grid; place-items: center; pointer-events: none; animation: vsSlam 0.42s cubic-bezier(0.3, 1.6, 0.5, 1) 0.4s backwards; }
.vs-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 20px rgba(233, 196, 111, 0.7)); }
.vs-mark span { font-family: var(--font-display); font-weight: 700; font-size: 64px; letter-spacing: 0.04em; color: transparent; background: linear-gradient(180deg, #fff6d8, #e9c46f 55%, #9b7219); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 18px rgba(233, 196, 111, 0.8)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.8)); }
@keyframes vsSlam { from { transform: scale(3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .vs-intro, .vs-half, .vs-crack, .vs-mark, .vs-intro.vs-out { animation: none; } }

/* THE TRAINING DEMOS (ui/clash-demo.js): each rule shown, not told */
.cd { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px calc(env(safe-area-inset-bottom, 0px) + 12px); background: rgba(6, 4, 10, 0.92); opacity: 0; transition: opacity 0.3s; cursor: pointer; }
.cd.is-in { opacity: 1; }
.cd.is-out { opacity: 0; }
.cd-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 46px; }
.cd-slot { position: relative; opacity: 0; transition: transform 0.5s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.4s, filter 0.5s; }
.cd-slot--them { transform: translateY(-60px); }
.cd-slot--me { transform: translateY(60px); }
.cd-slot.is-in { opacity: 1; transform: none; }
.cd.is-clash .cd-slot--them.is-in { transform: translateY(14px) scale(1.04); }
.cd.is-clash .cd-slot--me.is-in { transform: translateY(-14px) scale(1.04); }
.cd-slot.is-won { z-index: 2; filter: drop-shadow(0 0 18px rgba(233, 196, 111, 0.9)); }
.cd-slot.is-lost { opacity: 0.45; filter: grayscale(1) brightness(0.7); animation: cdShake 0.45s; }
.cd-slot.is-lost::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 46%, #000 47% 49%, transparent 50%), linear-gradient(60deg, transparent 58%, #000 59% 60%, transparent 61%); pointer-events: none; }
.cd-slot.is-short { animation: cdShake 0.45s; filter: drop-shadow(0 0 12px rgba(255, 90, 80, 0.8)); }
.cd-slot.is-swap { opacity: 0; transform: translateY(80px) scale(0.9) !important; }
.cd-slot.is-fresh { animation: cdIn 0.45s ease-out; filter: drop-shadow(0 0 18px rgba(233, 196, 111, 0.9)); }
@keyframes cdShake { 20% { translate: -7px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
.cd-badge { position: absolute; top: 50%; right: -20px; z-index: 3; display: flex; align-items: center; gap: 4px; padding: 5px 12px 5px 8px; border-radius: 20px; font: 800 28px/1 var(--font-ui); color: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.7); transform: translateY(-50%); }
.cd-badge svg { width: 26px; height: 26px; }
.cd-badge--atk { background: linear-gradient(180deg, #e0463c, #8c1b16); }
.cd-badge--def { background: linear-gradient(180deg, #4b8fe0, #1f4b8a); }
.cd-badge--wnd { top: auto; bottom: 18%; left: -20px; right: auto; transform: none; background: linear-gradient(180deg, #b24ad6, #5a1f77); animation: cdIn 0.4s ease-out; }
.cd-badge.is-boost { background: linear-gradient(180deg, #f3d36a, #b0791c); color: #231500; animation: cdPop 0.6s ease-out; }
.cd.is-clash .cd-badge { animation: cdPop 0.5s ease-out; }
@keyframes cdPop { 40% { transform: translateY(-50%) scale(1.4); } }
.cd-vs { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 4; font: 700 30px/1 var(--font-display); color: var(--gold); text-shadow: 0 0 14px rgba(233, 196, 111, 0.8); opacity: 0; transition: opacity 0.3s; }
.cd.is-clash .cd-vs { opacity: 1; }
.cd-chips { min-height: 44px; display: grid; place-items: center; }
.cd-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border-radius: 22px; font: 800 20px/1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: #231500; background: linear-gradient(180deg, #f3d36a, #c8942c); box-shadow: 0 0 22px rgba(233, 196, 111, 0.7); animation: cdPop2 0.5s ease-out; }
.cd-chip svg { width: 22px; height: 22px; }
@keyframes cdPop2 { from { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.15); } }
.cd-cap { min-height: 40px; display: grid; place-items: center; text-align: center; }
.cd-w { display: inline-flex; align-items: center; gap: 8px; font: 800 24px/1.1 var(--font-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--bone); animation: cdIn 0.35s ease-out; }
.cd-w svg { width: 26px; height: 26px; }
.cd-w--atk { color: #ff6a5c; }
.cd-w--def { color: #6ea8f0; }
.cd-w--hit { color: #ff8a7a; }
.cd-w--focus { color: #f3d36a; }
@keyframes cdIn { from { opacity: 0; transform: scale(0.8); } }
.cd-bar { position: relative; height: 16px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); }
.cd-bar [data-fill] { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #e9c46f, #b08a2c); transition: width 0.9s ease-out; width: 100%; }
.cd-hit { position: absolute; right: 0; top: -34px; display: flex; align-items: center; gap: 3px; font: 800 22px/1 var(--font-ui); color: #ff6a5c; opacity: 0; }
.cd-hit svg { width: 20px; height: 20px; }
.cd-bar.is-hit { box-shadow: 0 0 0 2px rgba(255, 106, 92, 0.6); }
.cd-bar.is-hit .cd-hit { animation: cdHit 1.2s ease-out forwards; }
@keyframes cdHit { 0% { opacity: 0; transform: translateY(14px) scale(0.6); } 30% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }
.cd-skip { position: absolute; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); min-height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, 0.08); color: rgba(235, 229, 216, 0.7); font: 600 13px/1 var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; }
/* the card tour */
.cd-anat { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.cd-anat__rows { display: grid; gap: 8px; width: min(100%, 330px); }
.cd-anat__row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); color: var(--muted); font: 500 16px/1.2 var(--font-ui); transition: background 0.3s, color 0.3s, transform 0.3s; }
.cd-anat__row svg { width: 26px; height: 26px; flex: none; }
.cd-anat__row b { color: var(--bone); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.cd-anat__row--strike svg { color: var(--strike); } .cd-anat__row--guard svg { color: var(--guard); } .cd-anat__row--scheme svg { color: var(--scheme); } .cd-anat__row--hp svg { color: #ff5a6e; }
.cd-anat__row.is-lit { background: rgba(233, 196, 111, 0.16); color: var(--bone); transform: scale(1.04); box-shadow: 0 0 0 2px var(--gold); }
.cd .stat.cd-hl { box-shadow: 0 0 0 0.18em var(--gold), 0 0 1em rgba(233, 196, 111, 0.9); transform: scale(1.18); position: relative; z-index: 3; transition: transform 0.3s; }
@media (prefers-reduced-motion: reduce) { .cd-slot, .cd-slot.is-lost, .cd-slot.is-short, .cd-w, .cd.is-clash .cd-badge, .cd-bar [data-fill], .cd-chip { animation: none; transition: none; } }

.dl-insp-asc { display: grid; gap: 2px; text-align: center; padding: 8px 12px; border-radius: 10px; background: rgba(233, 196, 111, 0.1); box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.35); color: #ffe08a; font: 600 15px/1.3 var(--font-ui); }
.dl-insp-asc b { letter-spacing: 0.16em; text-transform: uppercase; }
.dl-insp-asc small { color: var(--muted); font-weight: 500; font-size: 12px; }

.dl-note--warn { color: #ffd9a0; padding: 6px 10px; border-radius: 8px; background: rgba(255, 150, 60, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 170, 80, 0.35); }
.dl-note--warn b { color: #ffb05a; }

/* ===== BATTLE CLARITY: say what to do, make it obvious, show what happened =====
   Opacity, transform and box-shadow only (no filters, no blur): safe on iPhone. */

/* the cue: what you are choosing right now (the new-player tip sits inside it, one line) */
.dl-cue { margin: 0 0 5px; padding: 4px 10px; border-radius: 9px; text-align: center; font: 700 17px/1.15 var(--font-display); letter-spacing: 0.02em; }
.dl-cue--act { color: var(--gold-hi); background: rgba(233, 196, 111, 0.1); box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.5), 0 0 16px rgba(233, 196, 111, 0.16); }
.dl-cue--wait { color: var(--muted); font-weight: 600; font-size: 15px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.dl-cue b { font-weight: inherit; }
.dl-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 3px; padding-top: 3px; border-top: 1px solid rgba(233, 196, 111, 0.22); font: 500 12px/1.2 var(--font-ui); letter-spacing: 0; color: #eadfc4; }
.dl-hint span { flex: 0 1 auto; }
.dl-hint button { flex: none; min-height: 28px; padding: 0 6px; border: 0; background: none; color: var(--muted); font: 600 11px var(--font-ui); text-decoration: underline; cursor: pointer; }

/* your hand: bright while you choose, quiet while you wait, one clearly raised */
.dl-hand--me .card { transition: transform 0.18s var(--ease-out), opacity 0.22s, box-shadow 0.2s; }
.dl-hand--me:not(.choosing) .card:not(.dl-gone) { opacity: 0.6; }
.dl-hand--opp .card { opacity: 0.88; }
.dl-hand--me.choosing .card:not(.dl-gone) { opacity: 1; box-shadow: 0 0 0 1px rgba(233, 196, 111, 0.4); }
.dl-hand--me.choosing:has(.is-selected) .card:not(.is-selected):not(.dl-gone) { opacity: 0.62; box-shadow: none; }
.dl-hand--me.choosing .card.is-selected, .dl-hand .card.is-selected { transform: translateY(-9px) scale(1.04); z-index: 3; opacity: 1; box-shadow: 0 0 0 3px var(--gold-hi), 0 0 26px rgba(233, 196, 111, 0.8); }

/* the actions: Clash / Defend is the one main button; Focus and READ are secondary, each with a "?" */
.dl-actions { display: flex; flex-direction: column; gap: 6px; }
.dl-tac { display: flex; gap: 8px; }
.dl-opt { position: relative; flex: 1 1 0; display: flex; min-width: 0; }
.dl-opt .btn { flex: 1; min-height: 40px; padding-right: 38px; white-space: nowrap; }
.dl-q { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid rgba(233, 196, 111, 0.65); background: rgba(0, 0, 0, 0.5); color: var(--gold-hi); font: 800 14px/1 var(--font-ui); display: grid; place-items: center; cursor: pointer; }
.dl-q::after { content: ''; position: absolute; inset: -9px; }
.dl-tog.is-off { opacity: 0.42; box-shadow: none; border-style: dashed; }
.dl-go--main { min-height: 50px; font-size: 20px; letter-spacing: 0.16em; text-transform: uppercase; box-shadow: 0 0 24px rgba(233, 196, 111, 0.4); }
.dl-guide .dl-actions { position: sticky; bottom: -8px; z-index: 2; margin: 0 -12px -8px; padding: 6px 12px 8px; background: linear-gradient(rgba(10, 10, 16, 0), rgba(10, 10, 16, 0.97) 22%); }
.dl-tipbox { position: absolute; left: 14px; right: 14px; z-index: 60; padding: 10px 12px; border-radius: 10px; background: rgba(14, 12, 20, 0.98); box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.55), 0 8px 24px rgba(0, 0, 0, 0.6); color: var(--bone); font: 600 15px/1.35 var(--font-ui); animation: dlTipIn 0.18s ease-out; cursor: pointer; }
@keyframes dlTipIn { from { opacity: 0; transform: translateY(6px); } }

/* the result: who won, why, what it did to the Voice (the guide has a fixed height, so nothing moves) */
.dl-result { gap: 4px; }
.dl-result b { font: 700 22px/1.15 var(--font-display); letter-spacing: 0.02em; }
.dl-result.tie b { color: var(--bone); }
.dl-result > span { font-size: 15px; color: #eadfc4; }
.dl-final-tag { align-self: flex-start; padding: 1px 8px; border-radius: 6px; font: 700 11px var(--font-ui); letter-spacing: 0.14em; text-transform: uppercase; font-style: normal; color: #1b1404; background: var(--gold); }
.dl-vmove { font: 700 14px var(--font-ui); font-variant-numeric: tabular-nums; }
.dl-vmove.dmg { color: var(--gold-hi); }
.dl-vmove.loss { color: #ff8a7a; }
.dl-result small { font-size: 12px; color: var(--muted); }

/* the Voice number moves, and the change floats off it */
.dl-voice { position: relative; }
.dl-delta { position: absolute; right: 0; top: -17px; z-index: 5; font: 800 17px/1 var(--font-ui); pointer-events: none; animation: dlDelta 1.2s ease-out forwards; text-shadow: 0 1px 3px #000; }
.dl-delta.loss { color: #ff7a6a; }
.dl-delta.dmg { color: var(--gold-hi); }
@keyframes dlDelta { 0% { opacity: 0; transform: translateY(8px) scale(0.7); } 22% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-12px); } }
.dl-voice.pulse-loss b { animation: dlPulseLoss 0.7s ease-out; }
.dl-voice.pulse-dmg b { animation: dlPulseDmg 0.7s ease-out; }
@keyframes dlPulseLoss { 25% { color: #ff5a4a; transform: scale(1.35); } 100% { transform: none; } }
@keyframes dlPulseDmg { 25% { color: var(--gold-hi); transform: scale(1.35); } 100% { transform: none; } }

/* reading a card: a magnifier on every card, a bigger sheet */
.dl-zoom { position: absolute; z-index: 8; right: 3px; top: 34%; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid rgba(233, 196, 111, 0.6); background: rgba(8, 6, 12, 0.62); color: var(--gold-hi); display: grid; place-items: center; cursor: pointer; }
.dl-zoom::after { content: ''; position: absolute; inset: -9px; }
.dl-zoom svg { width: 14px; height: 14px; }
.dl-insp-text { max-width: 340px; text-align: center; font: 500 17px/1.45 var(--font-display); color: #eee5d2; }

/* the end: the best moment and why */
.result__sum { display: grid; gap: 6px; width: 100%; max-width: 340px; }
.result__sum > div { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--line); }
.result__sum span { font: 600 11px var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.result__sum b { font: 700 16px/1.3 var(--font-ui); color: var(--bone); }

/* short phones: drop the extras, keep the cue and the buttons */
.dl--tight .dl-note:not(.dl-note--warn) { display: none; }
.dl--tight .dl-hint { display: none; }
.dl--tight .dl-cue { font-size: 15px; padding: 4px 8px; margin-bottom: 4px; }
.dl--tight .dl-go--main { min-height: 48px; }
.dl--tight .dl-opt .btn { min-height: 40px; }

@media (prefers-reduced-motion: reduce) {
  .dl-tipbox, .dl-delta, .dl-voice.pulse-loss b, .dl-voice.pulse-dmg b { animation: none; }
  .dl-delta { opacity: 1; transform: translateY(-8px); }
  .dl-hand--me .card { transition: none; }
}

/* the card's ability line is one tap away (the magnifier): the panel keeps the numbers and the buttons */
.dl-guide .dl-pick__head span:not(.dl-tag) { display: none; }
.dl-slot .dl-zoom { display: none; }

/* tap to continue: the result waits for you (online it also moves on after 8 s, shown by a thin bar) */
.dl-tapnext { position: relative; margin-top: auto; padding-top: 6px; text-align: center; }
.dl-tapnext span { display: inline-block; padding: 5px 16px; border-radius: 16px; font: 700 12px var(--font-ui); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-hi); box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.5); animation: dlTapPulse 1.6s ease-in-out infinite; }
@keyframes dlTapPulse { 50% { opacity: 0.55; } }
.dl-tapnext i { display: block; height: 2px; margin-top: 7px; border-radius: 1px; background: linear-gradient(90deg, var(--gold), rgba(233, 196, 111, 0.2)); transform-origin: left; animation: dlHold var(--hold, 8000ms) linear forwards; }
@keyframes dlHold { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.dl-result { min-height: 100%; }
@media (prefers-reduced-motion: reduce) { .dl-tapnext span { animation: none; } .dl-tapnext i { animation-duration: 0.01ms; transform: scaleX(0.5); } }

/* the clash: both cards slam toward the middle, flash, then the winner surges and the loser cracks */
.dl-clashing .dl-slot[data-slot="0"] { animation: dlLungeL 0.78s var(--ease-slam); }
.dl-clashing .dl-slot[data-slot="1"] { animation: dlLungeR 0.78s var(--ease-slam); }
@keyframes dlLungeL { 0% { transform: none; } 60% { transform: translateX(26px) scale(1.08); } 100% { transform: translateX(8px) scale(1.04); } }
@keyframes dlLungeR { 0% { transform: none; } 60% { transform: translateX(-26px) scale(1.08); } 100% { transform: translateX(-8px) scale(1.04); } }
.dl-arena { position: relative; }
.dl-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255, 244, 214, 0.85), rgba(255, 244, 214, 0) 55%); animation: dlFlash 0.42s ease-out forwards; }
@keyframes dlFlash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
.dl-cracked::after { content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: 10px; opacity: 0; animation: dlCrack 0.35s 0.15s ease-out forwards; background: linear-gradient(115deg, transparent 44%, rgba(0, 0, 0, 0.85) 45% 46%, transparent 47%), linear-gradient(62deg, transparent 52%, rgba(0, 0, 0, 0.85) 53% 54%, transparent 55%), linear-gradient(170deg, transparent 30%, rgba(0, 0, 0, 0.7) 31% 32%, transparent 33%); }
@keyframes dlCrack { to { opacity: 1; } }
.result__lesson { width: 100%; max-width: 360px; padding: 9px 12px; border-radius: 10px; text-align: left; background: rgba(233, 196, 111, 0.07); box-shadow: inset 0 0 0 1px rgba(233, 196, 111, 0.25); }
.result__lesson span { display: block; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.result__lesson b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.result__next { width: 100%; max-width: 360px; gap: 10px; }
@media (prefers-reduced-motion: reduce) { .dl-clashing .dl-slot { animation: none !important; } .dl-flash { animation-duration: 0.01s; } .dl-winner, .dl-loser { animation-duration: 0.01s; } }
