/* Rumble Ring's how-to demo (brawl-demo.js), in the how-to's box on both screens: the big screen's .tut-demo (16:10)
   and the phone's .ptut-demo (4:3), each a size container - so everything here is in cqw of that box. The phone's box is
   a few centimetres wide, so its type and parts are --k times the big screen's, and its box is taller to make the room.
   The box itself is the dark simulated display (toy-stage.css); inside it, the arena's sand, as in the round. */
.bwd{ --bwd-ink:var(--toy-ink-color, #1E1E24); --k:1; --pt:13cqw; --card-w:21.5cqw; --hand-w:22cqw; --hand-h:11.5cqw; --own-w:9cqw;
  --cap-h:calc(var(--k) * 7.4cqw); --chip-h:calc(var(--k) * 8.6cqw); --under:calc(2.6cqw + var(--cap-h));
  position:absolute; inset:0; overflow:hidden; font-family:'Lilita One',sans-serif; color:var(--bwd-ink);
  background:#ead7a0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' shape-rendering='crispEdges'%3E%3Crect x='8' y='0' width='4' height='4' fill='%23dcc68a'/%3E%3Crect x='0' y='8' width='4' height='4' fill='%23dcc68a'/%3E%3C/svg%3E") 0 0 / 1.6cqw 1.6cqw;
  transition:opacity .35s; }
.ptut-demo .bwd{ --k:1.45; --pt:15.5cqw; --card-w:22.5cqw; --hand-w:24cqw; --hand-h:15cqw; --own-w:11cqw; }
.bwd.fade{ opacity:0; }
.bwd img{ image-rendering:pixelated; }

/* THE PICK: the lineup (or the draft's hands) over the sand, above the caption */
.bwd-pick{ position:absolute; left:0; right:0; top:0; bottom:var(--under); display:flex; align-items:center; justify-content:center; transition:opacity .3s, transform .3s; opacity:0; transform:scale(.96); }
.bwd.on .bwd-pick{ opacity:1; transform:none; }
.bwd.fighting .bwd-pick{ opacity:0; transform:scale(1.04); pointer-events:none; }
.bwd-line{ display:flex; gap:1.4cqw; }
.bwd-card{ position:relative; box-sizing:border-box; border:calc(var(--k) * .45cqw) solid var(--bwd-ink); border-radius:calc(var(--k) * 1.8cqw); background:var(--t-cream-l, #FFFEEA);
  transition:transform .25s, opacity .3s, background-color .25s;
  --toy-drop:calc(var(--k) * .6cqw); --toy-drop-c:var(--bwd-ink); --toy-under:opacity(1); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1)); }
.bwd-line .bwd-card{ width:var(--card-w); padding:1.4cqw .8cqw 1.2cqw; display:flex; flex-direction:column; align-items:center; gap:calc(var(--k) * .7cqw); }
.bwd-pt{ width:var(--pt); height:var(--pt); border-radius:50%; }
.bwd-pt img{ width:118%; height:118%; object-fit:contain; }
.bwd-nm{ font-size:calc(var(--k) * 2.8cqw); line-height:1; white-space:nowrap; min-width:0; }
.bwd-line .bwd-nm{ align-self:stretch; text-align:center; }
.bwd-bk{ display:flex; align-items:center; gap:.6cqw; font-size:calc(var(--k) * 2.7cqw); line-height:1; opacity:0; transition:opacity .3s; }
.bwd-bk svg, .bwd-cb svg{ width:calc(var(--k) * 2.9cqw); height:calc(var(--k) * 2.2cqw); fill:currentColor; flex:none; }
.bwd-boost{ font-size:calc(var(--k) * 2.7cqw); line-height:1; padding:.3cqw 1.1cqw .5cqw; border-radius:1.2cqw; border:calc(var(--k) * .35cqw) solid var(--bwd-ink); background:var(--toy-gold, #FFE066); opacity:0; transform:scale(.6); transition:opacity .3s, transform .3s; }
.bwd-boost.lo{ background:#E2E8F0; }
.bwd.locked .bwd-bk, .bwd.locked .bwd-boost{ opacity:1; transform:none; }
/* your pick: tapped (a ring goes out from it), then gold with YOU on it */
.bwd.tapped .bwd-card.pick{ background:var(--toy-gold, #FFE066); transform:translateY(-.8cqw); }
.bwd-card.pick::before{ content:'YOU'; position:absolute; left:50%; top:calc(var(--k) * -2.4cqw); z-index:1; transform:translateX(-50%) scale(0); font-size:calc(var(--k) * 2.3cqw); line-height:1; color:#fff; padding:.4cqw 1.2cqw .6cqw;
  border-radius:99px; background:var(--t-red, #E11D48); border:calc(var(--k) * .35cqw) solid var(--bwd-ink); transition:transform .25s; }
.bwd.tapped .bwd-card.pick::before{ transform:translateX(-50%) scale(1); }
.bwd.tapped .bwd-card.pick::after{ content:''; position:absolute; left:50%; top:50%; width:8cqw; height:8cqw; margin:-4cqw 0 0 -4cqw; border-radius:50%;
  border:.6cqw solid #fff; opacity:0; animation:bwdTap .6s ease-out; pointer-events:none; }
.bwd-hand:not(.you) .bwd-card.pick::before, .bwd-hand:not(.you) .bwd-card.pick::after{ content:none; }
@keyframes bwdTap{ 0%{ opacity:.95; transform:scale(.4); } 100%{ opacity:0; transform:scale(2.2); } }

/* THE DRAFT'S HANDS: a row each, the owner on the left, yours on a gold plate */
.bwd-hands{ display:flex; flex-direction:column; gap:1.2cqw; }
.bwd-hand{ display:flex; align-items:center; gap:1.2cqw; padding:.8cqw 1.2cqw; border-radius:calc(var(--k) * 2cqw); border:calc(var(--k) * .35cqw) solid transparent; transition:opacity .3s; }
.bwd-hand.you{ background:rgba(255,224,102,.6); border-color:var(--bwd-ink); }
.bwd-own{ width:var(--own-w); font-size:calc(var(--k) * 2.7cqw); line-height:1; color:#fff; -webkit-text-stroke:calc(var(--k) * .32cqw) var(--bwd-ink); paint-order:stroke fill; }
.bwd-hands .bwd-card{ width:var(--hand-w); height:var(--hand-h); }
/* a hand's card: the sprite over its name, so the name has the card's whole width (beside the sprite, "Charmander" ran off
   the card even at its smallest - Daniel, 2026-11-25) */
.bwd-face, .bwd-back{ position:absolute; inset:0; display:flex; border-radius:calc(var(--k) * 1.4cqw); }
.bwd-face{ flex-direction:column; align-items:center; justify-content:center; gap:.2cqw; padding:.4cqw .8cqw .6cqw; }
.bwd-face img{ height:64%; aspect-ratio:1; flex:none; }
.bwd-hands .bwd-nm{ align-self:stretch; text-align:center; font-size:calc(var(--k) * 2.3cqw); }
/* the back: a Poke Ball's halves, shown while a pick is hidden */
.bwd-back{ opacity:0; background:linear-gradient(180deg, var(--t-red, #E11D48) 0 46%, var(--bwd-ink) 46% 54%, #fff 54%); }
.bwd-back::after{ content:''; position:absolute; left:50%; top:50%; width:calc(var(--k) * 4cqw); height:calc(var(--k) * 4cqw); margin:calc(var(--k) * -2cqw) 0 0 calc(var(--k) * -2cqw); border-radius:50%; background:#fff; border:calc(var(--k) * .55cqw) solid var(--bwd-ink); box-sizing:border-box; }
/* locked: what wasn't picked steps back, the picks turn face down, and each turns back up on its beat (a squash, flat:
   a 3D turn needs preserve-3d, which the part's drop filter flattens - the face showed through mirrored) */
.bwd.locked .bwd-hands .bwd-card:not(.pick){ opacity:.25; transform:scale(.9); }
.bwd.locked .bwd-hand:not(.flipped) .bwd-card.pick .bwd-back{ opacity:1; }
.bwd.locked .bwd-hand.flipped .bwd-card.pick{ background:var(--toy-gold, #FFE066); animation:bwdFlip .4s ease-out; }
@keyframes bwdFlip{ 0%{ transform:scaleX(1); } 45%{ transform:scaleX(0); } 100%{ transform:scaleX(1); } }

/* THE FIGHT: the arena (brawl-pixel.js's 560x392 canvas, crisp, the camera's transform on it), each fighter's chip under it */
.bwd-fight{ position:absolute; inset:0; opacity:0; transition:opacity .35s; }
.bwd.fighting .bwd-fight{ opacity:1; }
.bwd-floor{ position:absolute; left:50%; top:1.4cqw; bottom:calc(var(--under) + var(--chip-h) + 1.2cqw); aspect-ratio:560/392; transform:translateX(-50%); overflow:hidden;
  border-radius:calc(var(--k) * 1.2cqw); border:calc(var(--k) * .45cqw) solid var(--bwd-ink); background:inherit; }
.bwd-cv{ display:block; width:100%; height:100%; image-rendering:pixelated; transform-origin:0 0; }
.bwd-chips{ position:absolute; left:2cqw; right:2cqw; bottom:var(--under); height:var(--chip-h); display:flex; justify-content:center; gap:1.2cqw; }
/* as wide as the row allows (four share it; the draft's three get more), so a long name has room */
.bwd-chip{ position:relative; flex:1 1 0; max-width:29cqw; min-width:0; box-sizing:border-box; display:grid; grid-template-columns:calc(var(--chip-h) * .8) minmax(0, 1fr); grid-template-rows:1fr 1fr; align-items:center; column-gap:.5cqw;
  padding:0 .9cqw 0 .3cqw; border-radius:calc(var(--k) * 1.5cqw); border:calc(var(--k) * .35cqw) solid var(--bwd-ink); background:var(--t-cream-l, #FFFEEA); transition:background-color .3s, opacity .3s; }
.bwd-chip img{ grid-row:1 / 3; width:100%; aspect-ratio:1; }
.bwd-cn{ font-size:calc(var(--k) * 2.3cqw); line-height:1; align-self:end; white-space:nowrap; min-width:0; }
.bwd-cb{ display:flex; align-items:center; gap:.5cqw; font-size:calc(var(--k) * 2.2cqw); line-height:1; align-self:start; color:#4A4E63; white-space:nowrap; min-width:0; }
.bwd-chip.you{ background:var(--toy-gold, #FFE066); }
.bwd-ko{ position:absolute; left:-.8cqw; top:calc(var(--k) * -1.6cqw); font-style:normal; font-size:calc(var(--k) * 2.3cqw); line-height:1; color:#fff; padding:.3cqw 1cqw .5cqw; border-radius:1cqw; background:var(--t-red, #E11D48);
  border:calc(var(--k) * .35cqw) solid var(--bwd-ink); transform:scale(0) rotate(-12deg); transition:transform .25s cubic-bezier(.3,1.6,.5,1); }
.bwd-chip.ko{ background:#CBD0D8; }
.bwd-chip.ko img{ opacity:.6; --toy-fx:grayscale(1); filter:var(--toy-fx, opacity(1)) drop-shadow(0 var(--toy-drop, 0px) 0 var(--toy-drop-c, transparent)) var(--toy-under, opacity(1)); }
.bwd-chip.ko .bwd-ko{ transform:scale(1) rotate(-12deg); }

/* THE CAPTION: the step it's on and one line, on a white plate along the bottom */
.bwd-cap{ position:absolute; left:2.4cqw; right:2.4cqw; bottom:1.4cqw; height:var(--cap-h); box-sizing:border-box; display:flex; align-items:center; gap:1.2cqw; padding:0 2cqw 0 calc(var(--k) * .9cqw);
  border-radius:99px; border:calc(var(--k) * .45cqw) solid var(--bwd-ink); background:#fff; font-size:calc(var(--k) * 3cqw); line-height:1; white-space:nowrap; transition:background-color .25s; }
.bwd-n{ flex:none; width:calc(var(--cap-h) * .7); height:calc(var(--cap-h) * .7); border-radius:50%; display:grid; place-items:center; color:#fff; background:var(--t-blue, #2563EB); font-size:calc(var(--k) * 2.9cqw); font-weight:normal; }
.bwd-tx{ flex:1 1 0; min-width:0; text-align:center; }
.bwd-cap.bwd-bad{ background:var(--t-red-l, #FFD3DC); } .bwd-cap.bwd-bad .bwd-n{ background:var(--t-red, #E11D48); }
.bwd-cap.bwd-good{ background:#D3F9D8; } .bwd-cap.bwd-good .bwd-n{ background:#2F9E44; }
@media (prefers-reduced-motion:reduce){ .bwd *{ transition:none !important; animation:none !important; } }
