/* =====================================================================
   THE TWO-PLAYER GAMES (src/minigames/duel/duel-view.js): the Ready screen with its tutorial, the board, the cue line,
   "Judging..." and the result. The board itself is a minigame board (.mg-board, 19-minigames.css); everything that
   moves on it moves with transforms and opacity, and stops while the tab is hidden.
   ===================================================================== */
.modal.duel-modal { width: min(1600px, calc(96 * var(--hvw)), 100%); }
.duel { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.duel-top { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; text-align: center; }
.duel-top b { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--gold-2); }
.duel-tag { padding: 1px 9px; border: 2px solid var(--ink); background: var(--claw); color: var(--ivory); font: 13px var(--font-display); letter-spacing: .05em; box-shadow: 2px 2px 0 var(--ink-45); }
.duel[data-kind="cart"] .duel-tag, .duel[data-kind="ram"] .duel-tag, .duel[data-kind="skittles"] .duel-tag { background: var(--royal); }
.duel-stake { color: var(--muted); font-size: 14px; }
.duel-hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 20px; color: var(--muted); font-size: 14px; }
.duel-hud b { color: var(--text); }
.duel-meter { display: inline-block; width: 120px; height: 12px; margin: 0 6px; border: 2px solid var(--ink); background: var(--paper-2); vertical-align: -1px; overflow: hidden; }
.duel-meter i { display: block; height: 100%; background: var(--claw); transform-origin: 0 50%; transition: transform .15s linear; }
.duel-pip { display: inline-block; width: 12px; height: 12px; margin: 0 2px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-2); vertical-align: -1px; }
.duel-pip.on { background: var(--gilt); box-shadow: 0 0 6px var(--gilt); }
.duel-h-l { justify-self: start; } .duel-h-r { justify-self: end; text-align: right; } .duel-h-m { justify-self: center; }
.duel-board { width: min(100%, 1500px, max(560px, calc((100 * var(--hvh) - 340px) * 2.1333))); margin: 0 auto; cursor: pointer; touch-action: manipulation; }
.duel[data-stage="wait"] .duel-board { cursor: default; pointer-events: none; }
.duel-stage { position: relative; }
.duel-stage.mirror { transform: scaleX(-1); }
.duel-svg { pointer-events: none; }
.duel-you { position: absolute; z-index: 4; transform: translate(-50%, -100%); padding: 1px 8px; background: var(--gilt); color: var(--ink); border: 2px solid var(--ink);
  font: 13px var(--font-display); letter-spacing: .05em; box-shadow: 2px 2px 0 var(--ink-45); pointer-events: none; white-space: nowrap; }
.duel-tip { margin: 2px auto 0; max-width: 640px; text-align: center; color: var(--text); font: italic 15px var(--font-body); }
.duel-ctl { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; min-height: 44px; margin-top: 2px; }
.duel-wait { color: var(--gold-2); font: italic 15px var(--font-body); animation: duelBreathe 1.6s ease-in-out infinite; }
.duel-mate-ready { color: var(--moss); font-size: 14px; }
.duel-cue { min-width: 160px; min-height: 30px; text-align: center; font: 26px/30px var(--font-display); color: var(--text); letter-spacing: .04em; }
.duel-cue.hot { color: var(--gold); text-shadow: 0 0 8px var(--gilt-light); }
.duel-cue.warn { color: var(--attack-2); animation: duelShake .3s linear infinite; }
.duel-cue.judge { color: var(--gold-2); font-size: 22px; animation: duelBreathe 1s ease-in-out infinite; }
.duel-count b.go { pointer-events: none; }
.duel-result { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; animation: duelRise .35s ease-out both; }
.duel-result b { font: 26px var(--font-display); color: var(--gold); }
.duel-result.lose b { color: var(--text); }
.duel-result span { color: var(--text); font-size: 15px; }
/* art that moves on its own: lantern glow, a ringing bell, the moon's halo */
.duel-glow { animation: duelGlow 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.duel-ring { animation: duelRing .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
.duel-bob { animation: duelBob 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
body.duel-hidden .duel *, body.no-fx .duel * { animation-play-state: paused !important; }
body.reduce-motion .duel * { animation: none !important; transition: none !important; }   /* Reduce motion (backdrop.js): no glow, ring or shake */
body.gfx-low .duel-glow { animation: none; }
@keyframes duelGlow { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes duelRing { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes duelBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes duelBreathe { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes duelShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes duelRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
