/* xtrade — two game worlds, one trade. A pixel-art backdrop (cool fantasy dusk | hot ruined sunset) with the trade window in the middle. */

@font-face { font-family: "Pixelify Sans"; src: url(/fonts/f-jerseyfull.woff2) format("woff2"); font-weight: 400 700; size-adjust: 118%; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(/fonts/hanken.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }

@font-face { font-family: "Cinzel"; src: url(/fonts/f-ember.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Black Ops One"; src: url(/fonts/f-rust.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url(/fonts/f-neon.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Metamorphous"; src: url(/fonts/f-gloom.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Pirata One"; src: url(/fonts/f-tide.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url(/fonts/f-verdant.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Saira Stencil One"; src: url(/fonts/f-steel.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Almendra"; src: url(/fonts/f-alch.woff2) format("woff2"); font-weight: 700; font-display: swap; }

@font-face { font-family: "Alfa Slab One"; src: url(/fonts/f-cog.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #120d26; --cream: #fbf1d6; --sun: #ff5560; --cool: #cdeff0; --warm: #ffd3b8; --teal: #14a58a;
  --px: "Pixelify Sans", "Hanken Grotesk", system-ui, sans-serif;
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: linear-gradient(90deg, #0b1030 50%, #1a0a2e 50%); color: var(--cream); font: 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

.stage { --pad: clamp(12px, 1.8vw, 24px); position: relative; min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: auto auto 1fr auto; justify-items: center; padding: clamp(18px, 3vw, 36px) clamp(18px, 4vw, 56px) 0; overflow: hidden; isolation: isolate; }
.stage > * { position: relative; z-index: 1; }
.stage > .scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; object-fit: cover; object-position: 50% 80%; }
/* soft vignette keeps the headline and the footer legible over the art */
.stage::before { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, #0b103099 0%, #0b103000 30%, #0b103000 55%, #0b1030cc 100%); }

.top { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.top .btn { justify-self: end; }
.topnav { display: flex; gap: clamp(14px, 2.4vw, 30px); justify-content: center; font-size: 15px; font-weight: 600; text-shadow: 2px 2px 0 var(--ink); }
.topnav a { color: var(--cream); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a:hover { border-bottom-color: var(--sun); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--cream); text-decoration: none; font: 700 28px/1 var(--px); text-shadow: 3px 3px 0 var(--ink); }
.brand .mark { width: 64px; height: 36px; display: block; filter: drop-shadow(0 3px 0 #120d26); }
.gold { --co: #3a2608; --ch: #fff0b3; --cb: #ffc73a; --cd: #b87a10; }
.gem { --co: #2a0a22; --ch: #ffd6f2; --cb: #e04fa8; --cd: #8a1f66; }
.co { fill: var(--co); } .ch { fill: var(--ch); } .cb { fill: var(--cb); } .cd { fill: var(--cd); }

.btn { display: inline-block; background: var(--sun); color: var(--ink); font: 600 15px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; padding: 14px 22px; text-decoration: none; box-shadow: 0 0 0 3px var(--ink), 0 6px 0 3px var(--ink); transition: transform .1s, box-shadow .1s; margin-bottom: 6px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px var(--ink), 0 8px 0 3px var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 3px var(--ink), 0 2px 0 3px var(--ink); }

/* ---- headline ---- */
.hero { text-align: center; margin-top: clamp(2px, 1vh, 14px); }
h1 { font: 700 clamp(30px, min(5vw, 8.2vh), 66px)/1 var(--px); margin: 0; text-wrap: balance; text-shadow: 4px 4px 0 var(--ink), 0 0 40px #0b103088; }
.sub { display: inline-block; font: 500 clamp(15px, 1.4vw, 18px)/1.3 var(--body); margin: clamp(6px, 1.2vh, 12px) auto 0; padding: 6px 14px; background: #0b1030e6; box-shadow: 0 0 0 3px var(--ink); }

/* ---- the trade window: no frame, the cards float over the artwork ---- */
.win { position: relative; align-self: center; width: min(100%, 1100px); margin: 4px 0 8px; color: var(--cream); }
/* per-game card themes: colour, backdrop, pattern, display font. A card's left and right halves each wear their own game's theme. */
.t-ember { --glow: #ff4b3a; --top: #5a1410; --bot: #1a0b0d; --pat: radial-gradient(circle at 50% 0%, #ff4b3a40, transparent 62%); --disp: "Cinzel", var(--body); --amt: 36px; }
.ta-ember { --ga: #ff4b3a; } .tb-ember { --gb: #ff4b3a; }
.t-cog { --glow: #aebfce; --top: #32414f; --bot: #0e151c; --pat: radial-gradient(circle, #aebfce26 2.5px, transparent 3px) 0 0 / 20px 20px; --disp: "Alfa Slab One", var(--body); --amt: 30px; }
.ta-cog { --ga: #aebfce; } .tb-cog { --gb: #aebfce; }
.t-neon { --glow: #3df0ff; --top: #0c3550; --bot: #0a0a26; --pat: linear-gradient(#3df0ff18 1px, transparent 1px) 0 0 / 100% 14px, linear-gradient(90deg, #3df0ff18 1px, transparent 1px) 0 0 / 14px 100%; --disp: "Orbitron", var(--body); --amt: 28px; }
.ta-neon { --ga: #3df0ff; } .tb-neon { --gb: #3df0ff; }
.t-gloom { --glow: #b57bff; --top: #3a2070; --bot: #130a2c; --pat: radial-gradient(#ffffff30 1px, transparent 1.6px) 0 0 / 13px 13px; --disp: "Metamorphous", var(--body); --amt: 34px; }
.ta-gloom { --ga: #b57bff; } .tb-gloom { --gb: #b57bff; }
.t-tide { --glow: #4fd1c5; --top: #0d4452; --bot: #08192b; --pat: repeating-linear-gradient(180deg, #ffffff0e 0 2px, transparent 2px 10px); --disp: "Pirata One", var(--body); --amt: 44px; }
.ta-tide { --ga: #4fd1c5; } .tb-tide { --gb: #4fd1c5; }
.t-verdant { --glow: #8be36b; --top: #234a22; --bot: #0c1a12; --pat: repeating-linear-gradient(-45deg, #ffffff0c 0 3px, transparent 3px 9px); --disp: "Fredoka", var(--body); --amt: 38px; }
.ta-verdant { --ga: #8be36b; } .tb-verdant { --gb: #8be36b; }
.t-steel { --glow: #c3cf8a; --top: #3a4a2c; --bot: #12170e; --pat: repeating-linear-gradient(90deg, #ffffff0a 0 2px, transparent 2px 7px); --disp: "Saira Stencil One", var(--body); --amt: 32px; }
.ta-steel { --ga: #c3cf8a; } .tb-steel { --gb: #c3cf8a; }
.t-alch { --glow: #ff5d8f; --top: #5a1630; --bot: #1a0a18; --pat: radial-gradient(circle at 25% 18%, #ff5d8f40, transparent 42%), radial-gradient(circle at 80% 85%, #ffffff14, transparent 38%); --disp: "Almendra", var(--body); --amt: 40px; }
.ta-alch { --ga: #ff5d8f; } .tb-alch { --gb: #ff5d8f; }

.t-lyrania { --glow: #e0b44c; --top: #2b2b30; --bot: #09090b; --pat: repeating-linear-gradient(135deg, #e0b44c14 0 1px, transparent 1px 7px); --disp: "Cinzel", var(--body); --amt: 36px; }
.ta-lyrania { --ga: #e0b44c; } .tb-lyrania { --gb: #e0b44c; }
.t-eoe { --glow: #d9772f; --top: #3c3a22; --bot: #100f0b; --pat: radial-gradient(#ffffff12 1px, transparent 1.6px) 0 0 / 9px 9px; --disp: "Black Ops One", var(--body); --amt: 34px; }
.ta-eoe { --ga: #d9772f; } .tb-eoe { --gb: #d9772f; }

/* painted card frames (Gemini): each game's card wears its own; --fpad is the room its border leaves for content */
.t-ember { --frame: url(/img/f-ember-frame.png); --fs: 78; --fw: 43px; --fpad: 50px 47px 42px 43px; }
.t-lyrania { --frame: url(/img/f-lyrania-frame.png); --fs: 90; --fw: 50px; --fpad: 30px 47px 40px 43px; }
.t-eoe { --frame: url(/img/f-eoe-frame.png); --fs: 60; --fw: 33px; --fpad: 28px 43px 46px 39px; }
.t-cog { --frame: url(/img/f-cog-frame.png); --fs: 100; --fw: 55px; --fpad: 30px 47px 40px 43px; }
.t-neon { --frame: url(/img/f-neon-frame.png); --fs: 70; --fw: 39px; --fpad: 30px 45px 40px 41px; }
.t-gloom { --frame: url(/img/f-gloom-frame.png); --fs: 95; --fw: 52px; --fpad: 34px 49px 42px 45px; }
.t-tide { --frame: url(/img/f-tide-frame.png); --fs: 85; --fw: 47px; --fpad: 32px 47px 42px 43px; }
.t-verdant { --frame: url(/img/f-verdant-frame.png); --fs: 100; --fw: 55px; --fpad: 34px 49px 42px 45px; }
.t-steel { --frame: url(/img/f-steel-frame.png); --fs: 100; --fw: 55px; --fpad: 32px 49px 42px 45px; }
.t-alch { --frame: url(/img/f-alch-frame.png); --fs: 80; --fw: 44px; --fpad: 34px 49px 44px 45px; }

/* ...and its own shape: each game frames its half, portrait and item slot differently */
.t-cog .slot { border-radius: 2px; } .t-cog .slot::after { box-shadow: inset 0 0 0 2px var(--glow), inset 0 0 0 4px #120d26, inset 0 0 0 6px #aebfce55; }
.t-neon .slot { display: block; width: 52px; height: 52px; border-radius: 4px; box-shadow: 0 0 0 2px #120d26, 0 0 0 4px var(--glow), 0 0 14px var(--glow); }
.t-gloom .slot { border-radius: 50%; }
.t-tide .slot { border-radius: 18px; }
.t-verdant .slot { border-radius: 28px; }
.t-steel .slot { clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px); border-radius: 0; }
.t-alch .slot { border-radius: 50% 50% 14px 14px; }
.t-ember .portrait img, .t-ember .slot { border-radius: 4px; }
.t-lyrania .slot { border-radius: 12px; }
.t-eoe .slot { border-radius: 0; }

/* the stage: one Player 1, one Player 2, and the two games between them showing the trade as it happens */
.deck { --k: 1; position: relative; height: calc(290px * var(--k)); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; }
@media (max-height: 880px) { .deck { --k: .9; } }
@media (max-height: 800px) { .deck { --k: .84; } }
@media (max-height: 740px) { .deck { --k: .8; } }
@media (max-height: 690px) { .deck { --k: .72; } }
.arena { display: grid; grid-template-columns: 124px minmax(0,1fr) 124px; grid-template-rows: auto auto; align-items: center; column-gap: 18px; row-gap: 20px; width: min(100%, 1000px); transform: scale(var(--k)); transform-origin: 50% 50%; animation: arenaIn .6s cubic-bezier(.2,.8,.2,1) both; }
.arena.gone { animation: vanish .75s ease-in forwards; pointer-events: none; }
@keyframes arenaIn { from { opacity: 0; translate: 0 18px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
.pl { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; --pc: #ff5a5a; --pr: 4px; }
.pl .badge { width: 68px; height: 68px; display: grid; place-items: center; font: 700 34px/1 var(--px); color: var(--pc); background: #120d26; border-radius: var(--pr); box-shadow: 0 0 0 3px #120d26, 0 0 0 6px var(--pc), 0 0 22px color-mix(in srgb, var(--pc) 70%, transparent); text-shadow: 0 0 12px var(--pc); }
.pl b { font: 700 17px/1 var(--body); margin-top: 6px; text-shadow: 2px 2px 0 var(--ink); }
.pl small { font: 600 11px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: #efeaff; background: #0b1030d9; padding: 4px 8px; border-radius: 3px; }
.gp { position: relative; transition: opacity .5s, filter .5s; grid-column: 2; }
.gp.a { grid-row: 1; } .gp.b { grid-row: 2; }
.arena .pl.pl1 { grid-column: 1; grid-row: 1 / 3; } .arena .pl.pl2 { grid-column: 3; grid-row: 1 / 3; }
.gp .pc, .gp { filter: drop-shadow(0 10px 12px #000d) drop-shadow(0 0 16px color-mix(in srgb, var(--glow) 40%, transparent)); }
.gp .half { aspect-ratio: auto; min-height: 0; border-image-width: calc(var(--fw, 40px) * .78); padding: 32px 60px 30px; display: flex; flex-direction: column; justify-content: center; gap: 0; }
.gp .gname { position: absolute; left: 66px; top: 2px; margin: 0; font-size: 12px; white-space: nowrap; padding: 2px 10px; background: #0b0a1fcc; border-radius: 3px; }
.lane { display: grid; grid-template-columns: 74px 1fr 74px; align-items: center; }
.acc { display: flex; flex-direction: column; align-items: center; gap: 6px; transition: opacity .5s, filter .5s; }
.face { width: 40px; height: 40px; border-radius: var(--pr, 4px); box-shadow: 0 0 0 2px #120d26, 0 0 0 4px var(--pc, #fff), 0 0 12px color-mix(in srgb, var(--pc, #fff) 60%, transparent); }
.bal { font: 700 calc(var(--amt, 34px) * .6)/1 var(--num, var(--disp)); color: #fff; text-shadow: 0 2px 0 #000a, 0 0 12px var(--glow); font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }
.bal i { font-style: normal; } .b1 { display: none; }
.pl1 { --pc: #ff5a5a; --pr: 4px; } .pl2 { --pc: #ff5560; --pr: 50%; }
.mid { position: relative; height: 62px; display: block; }
.rail2 { position: absolute; left: 6px; right: 6px; top: 50%; height: 4px; margin-top: -2px; background: repeating-linear-gradient(90deg, #ffffff44 0 8px, transparent 8px 14px); }
.chev { position: absolute; top: 50%; width: 0; height: 0; margin-top: -9px; border-top: 9px solid transparent; border-bottom: 9px solid transparent; opacity: .5; }
.ltr .chev { right: 4px; border-left: 14px solid var(--glow); } .rtl .chev { left: 4px; border-right: 14px solid var(--glow); }
.tok { position: absolute; top: 50%; width: 52px; height: 52px; margin-top: -26px; border-radius: 6px; background: #0b0a1f; box-shadow: inset 0 0 0 2px #ff5560, 0 0 0 2px #120d26, 0 0 16px color-mix(in srgb, var(--glow) 70%, transparent); overflow: visible; }
.tok img { width: 100%; height: 100%; border-radius: 4px; display: block; }
.ltr .tok { left: 0; } .rtl .tok { right: 0; }
.unit { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); margin: 0; text-align: center; white-space: nowrap; font: 600 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: #cfc8ee; }
.lock { display: none; position: absolute; left: -9px; top: -10px; width: 18px; height: 16px; z-index: 3; }
.lock::before { content: ""; position: absolute; left: 4px; top: -8px; width: 7px; height: 10px; border: 3px solid #ff5560; border-bottom: 0; border-radius: 7px 7px 0 0; }
.lock::after { content: ""; position: absolute; left: 0; top: 1px; width: 18px; height: 15px; border-radius: 3px; background: radial-gradient(circle at 50% 45%, #120d26 2px, transparent 2.5px), #ff5560; box-shadow: 0 0 0 2px #120d26, 0 0 10px #ff5560; }
.arena .swap { position: relative; left: auto; top: auto; margin: 0; width: 58px; height: 58px; z-index: 3; grid-column: 2; grid-row: 1 / 3; align-self: center; justify-self: center; display: grid; place-items: center; }
.arena .swap .swapsvg { width: 58px; height: 58px; transform: rotate(90deg); }
.sp { position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; background: #ff5560; box-shadow: 0 0 8px #ff5560; z-index: 8; pointer-events: none; animation: sparkle .8s ease-out forwards; }
.sp:nth-child(3n) { background: #7ff0d2; } .sp:nth-child(3n+1) { background: #fff3b0; }

/* ---- the trade, stage by stage, in each game on its own ---- */
.arena[data-st="0"] .gp.b { opacity: .45; filter: grayscale(.8) brightness(.8); }
.arena[data-st="1"] .gp.b { animation: wake .9s ease-out; }
.arena[data-st="1"] .tok { animation: setAside 1.1s ease-in-out; }
.arena[data-st="1"] .swap { animation: swapPulse 1s ease-in-out; }
.arena[data-st="2"] .lock, .arena[data-st="3"] .lock { display: block; animation: lockIn .45s cubic-bezier(.3,1.6,.5,1) both; }
.arena[data-st="2"] .tok { box-shadow: inset 0 0 0 2px #ff5560, 0 0 0 2px #120d26, 0 0 22px #ff5560cc; }
.arena[data-st="3"] .tok { animation: flash 1.2s ease-in-out; }
.arena[data-st="3"] .swap { animation: swapSpin 1.4s ease-in-out; }
/* done: in each game the currency now sits with the other player; opposite directions */
.arena[data-st="4"] .acc.give .b0, .arena[data-st="4"] .acc.get .b0 { display: none; }
.arena[data-st="4"] .b1 { display: inline; }
.arena[data-st="4"] .acc.give { opacity: .45; filter: grayscale(.7); }
.arena[data-st="4"] .acc.get .b1::before { content: "+"; color: #7ff0d2; }
.arena[data-st="4"] .acc.get .face { box-shadow: 0 0 0 2px #120d26, 0 0 0 4px #7ff0d2, 0 0 18px #52d6b5aa; }
.arena[data-st="4"] .ltr .tok { animation: slideR 1.5s cubic-bezier(.5,0,.25,1) both; }
.arena[data-st="4"] .rtl .tok { animation: slideL 1.5s cubic-bezier(.5,0,.25,1) both; }
.arena[data-st="4"] .gp { filter: drop-shadow(0 10px 12px #000d) drop-shadow(0 0 20px #52d6b588); }
.arena[data-st="4"] .pl .badge { animation: arenaIn .6s ease-out both; }
@keyframes flash { 0%, 100% { filter: none; transform: scale(1); } 40% { filter: brightness(2.4) saturate(1.6); transform: scale(1.15); } }
@keyframes slideR { from { left: 0; } to { left: calc(100% - 52px); } }
@keyframes slideL { from { right: 0; } to { right: calc(100% - 52px); } }

/* each player card is its own object: an outline in its game colour that follows the card shape, a glow and a drop shadow */
.pc { position: relative; filter: drop-shadow(0 10px 12px #000d) drop-shadow(0 0 14px color-mix(in srgb, var(--glow) 40%, transparent)); }
.pc .half { height: 100%; }
/* the chosen card breathes a little, and a gold pointer ties it to the trade log below */
@keyframes bob { 50% { translate: 0 -4px; } }
.deck::after { content: ""; position: absolute; left: 50%; bottom: calc(-30px * var(--k)); margin-left: -11px; border: 11px solid transparent; border-bottom: 13px solid #ff5560; border-top: 0; filter: drop-shadow(0 0 6px #ff5560aa); }
.deck:focus-visible { outline-offset: -4px; }
.half { position: relative; aspect-ratio: 1.34; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 0; padding: var(--fpad, 30px 36px 28px); box-sizing: border-box;
  border: 1px solid transparent; border-image-source: var(--frame); border-image-slice: var(--fs, 70) fill; border-image-width: var(--fw, 40px); border-image-repeat: round; }
.who { margin: 0; display: flex; align-items: center; justify-content: center; gap: 14px; }
.portrait { position: relative; flex: none; width: 52px; height: 52px; }
.portrait img { display: block; width: 52px; height: 52px; border-radius: 4px; box-shadow: 0 0 0 2px #120d26, 0 0 0 4px var(--glow), 0 0 14px var(--glow); }
.nm { display: flex; flex-direction: column; gap: 7px; } .nm b { font: 700 17px/1 var(--body); } .nm em { font: 600 12px/1 var(--body); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--glow); }
.deal { display: flex; align-items: center; justify-content: center; gap: 16px; }
.slot { flex: none; width: 68px; height: 68px; display: grid; place-items: center; border-radius: 4px; background: #0b0a1f; box-shadow: 0 0 22px color-mix(in srgb, var(--glow) 60%, transparent); }
.slot { position: relative; overflow: hidden; }
.slot img.tile { width: 100%; height: 100%; object-fit: cover; filter: none; }
.slot::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--glow), inset 0 0 0 4px #120d26; pointer-events: none; }
.amt { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.amt b { font: 700 38px/1 var(--body); font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 3px 0 #000a, 0 0 18px var(--glow); }
.amt span { font: 600 12px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: #cfc8ee; }
.swap { z-index: 3; position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px; display: grid; place-items: center; filter: drop-shadow(0 4px 6px #000c) drop-shadow(0 0 12px #ff556066); }
.swap .swapsvg { width: 68px; height: 68px; display: block; overflow: visible; }
.swapsvg .sa { stop-color: var(--ga, #ff5560); } .swapsvg .sb { stop-color: var(--gb, #ff5560); }
.swapsvg .ar { fill: #ff5560; stroke: #120d26; stroke-width: 1.2; stroke-linejoin: round; }

/* ---- the trade log: a game-style status bar (stage chevrons + a dialogue line) ---- */
.hud { position: relative; width: min(100%, 800px); margin: calc(40px * var(--k, 1)) auto 0; filter: drop-shadow(3px 0 0 #ff5560) drop-shadow(-3px 0 0 #ff5560) drop-shadow(0 3px 0 #ff5560) drop-shadow(0 -3px 0 #ff5560) drop-shadow(0 12px 18px #000c); }
.hud::before { content: "TRADE LOG"; position: absolute; left: 26px; top: -12px; z-index: 2; padding: 4px 12px 3px; font: 700 12px/1 var(--px); letter-spacing: .14em; color: var(--ink); background: var(--sun); clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 100%, 0 100%); }
.hudin { padding: 12px 20px 10px; background: repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 4px), linear-gradient(180deg, #1c1748, #0b0a24); box-shadow: inset 0 0 0 2px #ff556055, inset 0 0 0 5px #0b0a24; clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); }
.rail { list-style: none; margin: 0 0 8px; padding: 0 4px; display: grid; grid-template-columns: repeat(4, 1fr); }
.rail li { height: 24px; display: grid; place-items: center; margin-left: -9px; font: 700 12px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: #b9b3dd; background: #ffffff1a; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 13px 50%); transition: background .25s, color .25s; }
.rail li:first-child { margin-left: 0; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%); }
.log { margin: 0; display: flex; align-items: center; gap: 14px; min-height: 2.3em; }
.state { flex: none; min-width: 108px; text-align: center; padding: 8px 10px 7px; font: 700 15px/1 var(--px); letter-spacing: .08em; text-transform: uppercase; color: var(--sun); background: #ff55601c; box-shadow: inset 0 0 0 2px #ff556088; }
.cap { font: 500 14.5px/1.3 var(--body); color: #efeaff; }
.cap::before { content: "\25B6"; color: var(--sun); margin-right: 9px; font-size: 11px; vertical-align: 1px; }

/* stage n lights the first n steps; at rest the page shows stage 4, fully done */
[data-stage="1"] .s1, [data-stage="2"] .s1, [data-stage="2"] .s2,
[data-stage="3"] .s1, [data-stage="3"] .s2, [data-stage="3"] .s3,
[data-stage="4"] .rail li { color: var(--ink); background: linear-gradient(180deg, #7ff0d2, #34c9a3); }
[data-stage="4"] .state { color: #7ff0d2; background: #52d6b51f; box-shadow: inset 0 0 0 2px #52d6b5aa; }

/* ---- the ground strip ---- */
.ground { width: 100%; max-width: 1140px; padding: 0 0 clamp(8px, 1.8vh, 18px); display: grid; gap: 8px; align-self: end; }
/* three steps, dressed like the example cards: each has its own game theme, shape, icon and display type */
.quest { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stepw { position: relative; --glow: #ff5560; filter: drop-shadow(3px 0 0 #ff5560) drop-shadow(-3px 0 0 #ff5560) drop-shadow(0 3px 0 #ff5560) drop-shadow(0 -3px 0 #ff5560) drop-shadow(0 10px 16px #000c) drop-shadow(0 0 16px #ff556033); transition: transform .25s; }
.stepw:hover { transform: translateY(-4px); }
.step { display: flex; align-items: center; gap: 14px; padding: 8px 16px; height: 100%; background: repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 4px), linear-gradient(180deg, #1c1748, #0b0a24); box-shadow: inset 0 0 0 2px #ff556055, inset 0 0 0 5px #0b0a24; clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); }
.step .slot { width: 56px; height: 56px; flex: none; border-radius: 4px; }
.step .slot img.tile { width: 100%; height: 100%; }
.stx small { display: block; font: 700 11px/1 var(--px); letter-spacing: .16em; text-transform: uppercase; color: var(--sun); margin-bottom: 5px; }
.stx b { display: block; font: 700 22px/1.1 var(--px); color: #fff; text-shadow: 0 2px 0 #000a; margin-bottom: 4px; letter-spacing: .02em; }
.stx p { margin: 0; font-size: 13px; line-height: 1.25; color: #e7e2ff; }
.live { margin: 0; font: 600 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; text-align: center; color: #efeaff; text-shadow: 2px 2px 0 var(--ink); }


/* ---- the trade plays out in each game's ledger: two accounts, one currency, moving one way ---- */
.t-gloom, .t-tide, .t-alch { --num: var(--body); }
.gname { margin: 0 0 12px; text-align: center; font: 400 14px/1 var(--disp); letter-spacing: .12em; text-transform: uppercase; color: var(--glow); text-shadow: 0 2px 0 #000a; }
.ledger { position: relative; display: grid; gap: 14px; width: 100%; }
.acct { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.acct .portrait, .acct .portrait img { width: 44px; height: 44px; }
/* every player has their own colour and shape, the same in both games, so two players on one card never look alike */
.portrait { --pc: #e9edf2; --pr: 4px; }
.acct .portrait img { border-radius: var(--pr); box-shadow: 0 0 0 2px #120d26, 0 0 0 4px var(--pc), 0 0 14px color-mix(in srgb, var(--pc) 65%, transparent); }
.pl1 { --pc: #ff6b6b; --pr: 4px; }
.acct:has(.pl1) .nm b { color: #ffc4c4; }
.pl2 { --pc: #ff5560; --pr: 50%; }
.acct:has(.pl2) .nm b { color: #fff0ad; }
.pl3 { --pc: #52d6b5; --pr: 14px; }
.acct:has(.pl3) .nm b { color: #b8f3e2; }
.pl4 { --pc: #5bc0ff; --pr: 50% 50% 6px 6px; }
.acct:has(.pl4) .nm b { color: #c4e6ff; }
.pl5 { --pc: #c08bff; --pr: 2px 16px 2px 16px; }
.acct:has(.pl5) .nm b { color: #e3d0ff; }
.pl6 { --pc: #a24f86; --pr: 4px; }
.acct:has(.pl6) .nm b { color: #ffd6b3; }
.pl7 { --pc: #9be86b; --pr: 50%; }
.acct:has(.pl7) .nm b { color: #d3f6bd; }
.pl8 { --pc: #ff77c2; --pr: 14px; }
.acct:has(.pl8) .nm b { color: #ffc9e6; }
.pl9 { --pc: #e9edf2; --pr: 50% 50% 6px 6px; }
.acct:has(.pl9) .nm b { color: #ffffff; }

.acct .nm b { font: 700 14px/1 var(--body); white-space: nowrap; }
.bal { display: flex; align-items: center; gap: 7px; transition: opacity .5s, filter .5s; }
.bal .slot { width: 34px; height: 34px; }
.val { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.val b { font: 700 calc(var(--amt, 34px) * .66)/1 var(--num, var(--disp)); color: #fff; text-shadow: 0 2px 0 #000a, 0 0 14px var(--glow); font-variant-numeric: tabular-nums; }
.val b i { font-style: normal; }
.val span { font: 600 10px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: #cfc8ee; }
.vb { display: none; }
.sl { position: relative; display: block; flex: none; }
.lock { display: none; position: absolute; left: -9px; top: -9px; width: 18px; height: 16px; z-index: 3; pointer-events: none; }
.lock::before { content: ""; position: absolute; left: 4px; top: -8px; width: 7px; height: 10px; border: 3px solid #ff5560; border-bottom: 0; border-radius: 7px 7px 0 0; }
.lock::after { content: ""; position: absolute; left: 0; top: 1px; width: 18px; height: 15px; border-radius: 3px; background: radial-gradient(circle at 50% 45%, #120d26 2px, transparent 2.5px), #ff5560; box-shadow: 0 0 0 2px #120d26, 0 0 10px #ff5560; }
.acct.get .bal { opacity: .36; filter: grayscale(.8); }
.flow { position: absolute; right: 58px; top: 50%; width: 0; height: 0; margin-top: -9px; opacity: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; }
.pc.a .flow { border-top: 13px solid #7ff0d2; filter: drop-shadow(0 0 6px #52d6b5); }
.pc.b .flow { border-bottom: 13px solid #7ff0d2; filter: drop-shadow(0 0 6px #52d6b5); }
.pc .half > * { transition: opacity .5s, filter .5s; }

/* 0 Open: Player 1 has listed in Game A; Game B is still waiting */
/* 1 Offer: Player 2 takes it, both games set the amounts aside */
/* 2 Locked */
/* 3 Confirmed: the held amounts are burned from the giving accounts */
/* 4 Done: the same currency, in the same game, now sits in the other account. Opposite directions in the two games. */

/* the finished card dissolves in a burst of pixels */
.sp { position: absolute; left: 50%; top: 42%; width: 7px; height: 7px; background: #ff5560; box-shadow: 0 0 8px #ff5560; z-index: 8; pointer-events: none; animation: sparkle .8s ease-out forwards; }
.sp:nth-child(3n) { background: #7ff0d2; box-shadow: 0 0 8px #52d6b5; } .sp:nth-child(3n+1) { background: #fff3b0; }

@keyframes wake { 0% { filter: brightness(2.2); } 100% { filter: brightness(1); } }
@keyframes setAside { 0%, 100% { transform: scale(1); } 45% { transform: scale(.88); } }
@keyframes swapPulse { 50% { filter: drop-shadow(0 4px 6px #000c) drop-shadow(0 0 22px #ff5560); } }
@keyframes swapSpin { 0% { rotate: 0deg; } 100% { rotate: 360deg; } }
@keyframes lockIn { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes burn { 0% { filter: brightness(1); opacity: 1; transform: scale(1); } 35% { filter: brightness(2.6) saturate(1.8) drop-shadow(0 0 14px #ff5560); transform: scale(1.12); } 100% { filter: brightness(3); opacity: 0; transform: scale(.4); } }
@keyframes fadeAway { 0%, 40% { opacity: 1; } 100% { opacity: 0; } }
@keyframes rise { from { translate: 0 20px; scale: .4; opacity: 0; filter: brightness(2.6); } to { translate: 0 0; scale: 1; opacity: 1; filter: none; } }
@keyframes flowIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes flowDown { 0%, 100% { translate: 0 -12px; opacity: .3; } 50% { translate: 0 12px; opacity: 1; } }
@keyframes flowUp { 0%, 100% { translate: 0 12px; opacity: .3; } 50% { translate: 0 -12px; opacity: 1; } }
@keyframes vanish { 0% { scale: 1; opacity: 1; filter: brightness(1); } 28% { scale: 1.08; filter: brightness(1.7); } 100% { scale: .5; translate: 0 -34px; opacity: 0; filter: brightness(2.8) blur(4px); } }
@keyframes sparkle { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .btn:hover, .btn:active { transform: none; } .sp { display: none; } }

/* ---- phones: the scene shrinks to a strip along the bottom; content stacks above it ---- */
@media (max-width: 800px) {
  .stage { grid-template-rows: auto auto auto auto; padding-bottom: 56vw; }
  .stage > .scene { inset: auto 0 0 0; height: auto; aspect-ratio: 16 / 9; }
  .hero { margin-top: 28px; }
  .win { margin: 24px 0; }
  .deck { height: auto; min-height: 330px; }
  .arena { grid-template-columns: 1fr 1fr; grid-template-rows: auto; row-gap: 14px; transform: none; }
  .arena .gp { grid-column: 1 / -1 !important; grid-row: auto !important; } .arena .swap { display: none; }
  .arena .pl.pl1 { grid-row: 1 !important; grid-column: 1 !important; } .arena .pl.pl2 { grid-row: 1 !important; grid-column: 2 !important; }
    .half { aspect-ratio: auto; gap: 10px; padding: 16% 12%; }
  .who { flex-direction: column; gap: 8px; }
  .portrait, .portrait img { width: 56px; height: 56px; }
  .nm { align-items: center; } .nm b { font-size: 15px; }
  .deal { flex-direction: column; gap: 8px; }
  .slot { width: 62px; height: 62px; }
  .amt { align-items: center; } .half .amt b { font-size: calc(var(--amt, 38px) * .7); }
  .swap, .swap .swapsvg { width: 46px; height: 46px; } .swap { margin: -23px 0 0 -23px; }
  .hudin { padding: 14px 14px 12px; } .log { flex-direction: column; align-items: stretch; gap: 8px; } .state { min-width: 0; } .rail li { font-size: 11px; letter-spacing: .08em; }
  .ground { padding-bottom: 12px; }
  .quest { grid-template-columns: 1fr; gap: 18px; }
  .top { grid-template-columns: 1fr auto; row-gap: 10px; } .topnav { grid-column: 1 / -1; grid-row: 2; font-size: 14px; gap: 18px; flex-wrap: wrap; }
  .brand { font-size: 24px; } .btn { font-size: 13px; padding: 11px 14px; }
}

/* ---- stage, final pass: the two players hug the two games; everything shares the trade-log's plate style ---- */
.arena { grid-template-columns: 112px minmax(0, 650px) 112px; justify-content: center; column-gap: 8px; row-gap: 18px; width: auto; }
.arena .pl { align-self: stretch; justify-content: center; gap: 8px; padding: 14px 8px; position: relative;
  background: repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 4px), linear-gradient(180deg, #1c1748, #0b0a24);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pc) 80%, transparent), inset 0 0 0 5px #0b0a24; }
.arena .pl.pl1 { margin-right: -2px; } .arena .pl.pl2 { margin-left: -2px; }
.arena .pl::before { content: ""; position: absolute; top: 24px; bottom: 24px; width: 5px; background: var(--pc); box-shadow: 0 0 14px var(--pc); }
.arena .pl.pl1::before { right: 7px; } .arena .pl.pl2::before { left: 7px; }
.arena .pl .badge { width: 62px; height: 62px; font-size: 32px; box-shadow: 0 0 0 3px #120d26, 0 0 0 5px var(--pc), 0 0 18px color-mix(in srgb, var(--pc) 70%, transparent); }
.arena .pl b { margin-top: 4px; font-size: 16px; text-shadow: none; }
.arena .pl small { background: transparent; padding: 0; color: color-mix(in srgb, var(--pc) 70%, #fff); font-size: 10px; letter-spacing: .12em; }
.arena .pl-wrap { display: contents; }
.gp, .gp .pc { filter: drop-shadow(0 8px 10px #000d) drop-shadow(0 0 12px color-mix(in srgb, var(--glow) 35%, transparent)); }
.gp .half { padding: 34px 54px 30px; }
.lane { grid-template-columns: 70px 1fr 70px; }
.face { width: 44px; height: 44px; }
.rail2 { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--glow) 55%, transparent) 0 8px, transparent 8px 14px); height: 3px; }
.arena[data-st="4"] .pl .badge { animation: none; }
@media (max-width: 800px) { .arena .pl { clip-path: none; } .arena .pl::before { display: none; } .arena { column-gap: 12px; } }
.arena .pl small { white-space: normal; line-height: 1.25; max-width: 84px; }

/* numbers: one clean face everywhere (no per-game number fonts), and the currency name always shown beside the balance */
.bal { font: 700 24px/1 var(--body); letter-spacing: .01em; min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.val b { font-family: var(--body); }
.acc { gap: 4px; min-width: 70px; }
.acc .un { font: 700 10px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: #efeaff; background: #0b0a1fcc; padding: 3px 6px; border-radius: 3px; white-space: nowrap; max-width: 86px; overflow: hidden; text-overflow: ellipsis; }
.acc.give .un { color: color-mix(in srgb, var(--glow) 55%, #fff); }
.unit { display: none; }
.lane { grid-template-columns: 92px 1fr 92px; }
.arena .pl .badge, .pl .badge { font-family: var(--body); font-weight: 800; }
.stx small { font-family: var(--body); letter-spacing: .14em; }
.gp .half { padding: 34px 40px 28px; }
.gp .half { padding: 28px 40px 18px; }
.arena { row-gap: 12px; }
.acc { gap: 3px; }
.deck { height: calc(318px * var(--k)); }
@media (max-height: 740px) { .deck { --k: .72; } }
@media (max-height: 690px) { .deck { --k: .66; } }
/* game names: centred on the top edge of each strip, on their own plate */
.gp .gname { left: 50%; right: auto; top: -12px; transform: translateX(-50%); margin: 0; z-index: 4; padding: 5px 16px 4px; font: 400 15px/1 var(--disp); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; color: #fff; text-shadow: 0 0 10px var(--glow), 0 2px 0 #000a; background: #0b0a24; border-radius: 0; box-shadow: inset 0 0 0 2px var(--glow), 0 4px 10px #000a; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.gp .half { padding-top: 34px; }
.gp .gname { font-size: 20px; padding: 6px 20px 5px; top: -15px; letter-spacing: .12em; }
.gp .half { padding-top: 38px; }

/* ---- final art pass: wide strip backgrounds and title banners (Gemini), 9-sliced so all the detail fits ---- */
.t-ember { --strip: url(/img/f-ember-strip.png); --banner: url(/img/f-ember-banner.png); --ba: 4.1; --bp: 9%; }
.t-lyrania { --strip: url(/img/f-lyrania-strip.png); --banner: url(/img/f-lyrania-banner.png); --ba: 6.64; --bp: 17%; }
.t-eoe { --strip: url(/img/f-eoe-strip.png); --banner: url(/img/f-eoe-banner.png); --ba: 5.82; --bp: 7%; }
.t-cog { --strip: url(/img/f-cog-strip.png); --banner: url(/img/f-cog-banner.png); --ba: 4.13; --bp: 17%; }
.t-neon { --strip: url(/img/f-neon-strip.png); --banner: url(/img/f-neon-banner.png); --ba: 5.76; --bp: 15%; }
.t-gloom { --strip: url(/img/f-gloom-strip.png); --banner: url(/img/f-gloom-banner.png); --ba: 4.04; --bp: 15%; }
.t-tide { --strip: url(/img/f-tide-strip.png); --banner: url(/img/f-tide-banner.png); --ba: 3.86; --bp: 12%; }
.t-verdant { --strip: url(/img/f-verdant-strip.png); --banner: url(/img/f-verdant-banner.png); --ba: 4.43; --bp: 13%; }
.t-steel { --strip: url(/img/f-steel-strip.png); --banner: url(/img/f-steel-banner.png); --ba: 5.36; --bp: 10%; }
.t-alch { --strip: url(/img/f-alch-strip.png); --banner: url(/img/f-alch-banner.png); --ba: 4.96; --bp: 15%; }
.gp .half { border-image-source: var(--strip); border-image-slice: 38 60 fill; border-image-width: 28px 44px; border-image-repeat: stretch; padding: 46px 56px 22px; }
.t-ember { --sw: 40px 44px; } .t-ember.gp .half, .gp.t-ember .half { border-image-slice: 62 60 fill; border-image-width: 36px 44px; padding-top: 50px; }
.gp.t-eoe .half { border-image-slice: 40 60 fill; padding-bottom: 28px; }
.gp.t-tide .half, .gp.t-verdant .half, .gp.t-gloom .half { border-image-slice: 46 70 fill; border-image-width: 32px 48px; }
.gp.t-alch .half { border-image-slice: 46 70 fill; border-image-width: 32px 50px; }
.gp .gname { top: 0; left: 50%; transform: translate(-50%, -52%); width: 240px; aspect-ratio: var(--ba); padding: 0 var(--bp); display: grid; place-items: center; background: var(--banner) center / 100% 100% no-repeat; clip-path: none; box-shadow: none; border-radius: 0; font: 400 17px/1 var(--disp); letter-spacing: .08em; color: #fff; text-shadow: 0 2px 0 #000c, 0 0 8px #000c, 0 0 10px var(--glow); z-index: 4; filter: drop-shadow(0 4px 6px #000a); text-align: center; overflow: visible; }
.lane { margin-top: 2px; }
.gp .half { border-image-width: 22px 36px; padding: 34px 50px 14px; }
.gp.t-ember .half { border-image-width: 30px 36px; padding-top: 40px; }
.gp.t-tide .half, .gp.t-verdant .half, .gp.t-gloom .half, .gp.t-alch .half { border-image-width: 26px 40px; }
.gp .gname { width: 210px; font-size: 15px; transform: translate(-50%, -46%); }
.arena { row-gap: 26px; }
.deck { height: calc(340px * var(--k)); }

/* balances sit beside the portrait (not under it) so nothing reaches the border */
.lane { grid-template-columns: 138px 1fr 138px; }
.acc { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; row-gap: 2px; align-items: center; justify-items: start; min-width: 0; }
.acc > .face { grid-column: 1; grid-row: 1 / 3; width: 46px; height: 46px; }
.acc .bal { grid-column: 2; grid-row: 1; align-self: end; text-align: left; font-size: 24px; }
.acc .un { grid-column: 2; grid-row: 2; align-self: start; }
.lane > .acc:last-child { grid-template-columns: 1fr auto; justify-items: end; }
.lane > .acc:last-child > .face { grid-column: 2; }
.lane > .acc:last-child .bal, .lane > .acc:last-child .un { grid-column: 1; text-align: right; }
.gp .half { padding: 34px 46px 16px; }
.mid { height: 54px; }
.arena { row-gap: 22px; }
.deck { height: calc(300px * var(--k)); }
.deck { height: calc(262px * var(--k)); }
@media (max-height: 880px) { .deck { --k: 1; } }
@media (max-height: 800px) { .deck { --k: .96; } }
@media (max-height: 740px) { .deck { --k: .9; } }
@media (max-height: 690px) { .deck { --k: .82; } }

/* one generic avatar per player (on the plates); the strips only carry a small colour chip so you can see who holds what */
.arena .pl .badge { width: 74px; height: 74px; padding: 0; overflow: hidden; font-size: 0; background: #120d26; box-shadow: 0 0 0 3px #120d26, 0 0 0 5px var(--pc), 0 0 20px color-mix(in srgb, var(--pc) 70%, transparent); }
.arena .pl .badge img { width: 100%; height: 100%; display: block; object-fit: cover; }
.chip { display: grid; place-items: center; width: 34px; height: 34px; font: 800 17px/1 var(--body); color: var(--ink); background: var(--pc); border-radius: var(--pr); box-shadow: 0 0 0 2px #120d26, 0 0 12px color-mix(in srgb, var(--pc) 70%, transparent); }
.acc > .face.chip { width: 34px; height: 34px; }
.lane { grid-template-columns: 124px 1fr 124px; }
.acc > .face { grid-row: 1 / 3; }

/* ---- red accents (borders, buttons, pointers) and a re-coloured pair of players; yellow retired ---- */
.pl1 { --pc: #a24f86; --pr: 4px; } .pl2 { --pc: #4f86b4; --pr: 50%; }
.arena .pl { --pc: #a24f86; } .arena .pl.pl2 { --pc: #4f86b4; }
.acct:has(.pl1) .nm b { color: #ffd6b3; } .acct:has(.pl2) .nm b { color: #bff7ff; }
/* titles sit on the banner art, shrunk to fit */
.gp .gname { width: 252px; padding: 0 var(--bp); overflow: hidden; white-space: nowrap; font-size: 17px; }
.gp .gname span { display: block; text-align: center; white-space: nowrap; }
/* the currency is drawn as a bare icon: no box, no frame, a soft shadow so it reads on any strip */
.tok { background: none; box-shadow: none; border-radius: 0; overflow: visible; width: 56px; height: 56px; margin-top: -28px; filter: drop-shadow(0 3px 3px #000b) drop-shadow(0 0 8px color-mix(in srgb, var(--glow) 55%, transparent)); }
.tok img { border-radius: 0; object-fit: contain; image-rendering: auto; }
.arena[data-st="2"] .tok { box-shadow: none; filter: drop-shadow(0 3px 3px #000b) drop-shadow(0 0 12px #ff5560); }
@keyframes flash { 0%, 100% { filter: drop-shadow(0 3px 3px #000b); transform: scale(1); } 40% { filter: brightness(2.2) drop-shadow(0 0 14px #fff); transform: scale(1.15); } }
@keyframes slideR { from { left: 0; } to { left: calc(100% - 56px); } }
@keyframes slideL { from { right: 0; } to { right: calc(100% - 56px); } }
.lock::before { border-color: #ff5560; } .lock::after { background: radial-gradient(circle at 50% 45%, #120d26 2px, transparent 2.5px), #ff5560; box-shadow: 0 0 0 2px #120d26, 0 0 10px #ff5560; }

/* ---- final stage polish: solid lane with a filling trail, tokens slide as transforms, a real padlock that rides across and unlocks ---- */
.rail2 { left: 28px; right: 28px; height: 4px; margin-top: -2px; background: #ffffff22; background-image: none; border-radius: 2px; box-shadow: inset 0 0 0 1px #0006; overflow: hidden; }
.rail2 .trail { position: absolute; top: 0; bottom: 0; width: 0; background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.ltr .rail2 .trail { left: 0; } .rtl .rail2 .trail { right: 0; }
.chev { display: none; }
.tok { z-index: 3; }
.arena[data-st="4"] .ltr .tok { left: 0; right: auto; animation: runR 1.5s cubic-bezier(.55,0,.2,1) both; }
.arena[data-st="4"] .rtl .tok { right: 0; left: auto; animation: runL 1.5s cubic-bezier(.55,0,.2,1) both; }
.arena[data-st="4"] .ltr .rail2 .trail { animation: trailGrow 1.5s cubic-bezier(.55,0,.2,1) both; }
.arena[data-st="4"] .rtl .rail2 .trail { animation: trailGrow 1.5s cubic-bezier(.55,0,.2,1) both; }
@keyframes runR { from { transform: translateX(0); } to { transform: translateX(var(--run, 0px)); } }
@keyframes runL { from { transform: translateX(0); } to { transform: translateX(calc(var(--run, 0px) * -1)); } }
@keyframes trailGrow { from { width: 0; } to { width: 100%; } }
.lk { position: absolute; left: -10px; top: -14px; z-index: 4; display: none; filter: drop-shadow(0 2px 2px #000b); overflow: visible; }
.lk .sh { fill: none; stroke: #dfe6f2; stroke-width: 3; stroke-linecap: round; transform-origin: 14.5px 11px; }
.lk .bd { fill: #ff5560; stroke: #120d26; stroke-width: 1.6; }
.lk .kh { fill: #120d26; }
.arena[data-st="2"] .lk, .arena[data-st="3"] .lk, .arena[data-st="4"] .lk { display: block; }
.arena[data-st="2"] .lk { animation: lockIn .45s cubic-bezier(.3,1.6,.5,1) both; }
.arena[data-st="4"] .lk .sh { animation: shackleOpen .45s ease-out 1.5s both; }
.arena[data-st="4"] .lk .bd { animation: lockGreen .3s ease-out 1.5s both; }
@keyframes shackleOpen { from { transform: none; } to { transform: translateY(-3px) rotate(-32deg); } }
@keyframes lockGreen { to { fill: #52d6b5; } }
/* balances stand alone now that the number circles are gone */
.acc { grid-template-columns: auto; grid-template-rows: auto auto; justify-items: start; }
.lane > .acc:last-child { grid-template-columns: auto; justify-items: end; }
.lane > .acc .bal, .lane > .acc .un { grid-column: 1; }
.lane > .acc:last-child .bal, .lane > .acc:last-child .un { text-align: right; }
.lane { grid-template-columns: 100px 1fr 100px; }
.arena[data-st="3"] .tok { animation: flash 1.2s ease-in-out; }

/* ---- trade lane v2: icon over number at each end; the stake is paid in to the middle, locked, carried across, and cashed out ---- */
.gp .half { padding: 40px 34px 14px; }
.lane2 { --ww: 100px; position: relative; display: flex; justify-content: space-between; align-items: flex-end; height: 104px; margin: 0; }
.lane2.ltr { --o: 0px; --m: calc(var(--run, 0px) / 2); --e: var(--run, 0px); }
.lane2.rtl { --o: var(--run, 0px); --m: calc(var(--run, 0px) / 2); --e: 0px; }
.wal { position: relative; z-index: 2; width: var(--ww); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wal.pl1 { --pc: #a24f86; } .wal.pl2 { --pc: #4f86b4; }
.wal .wic { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 3px #000b) drop-shadow(0 0 8px color-mix(in srgb, var(--glow) 55%, transparent)); transition: opacity .35s, filter .35s; }
.wal .wn { font: 800 21px/22px var(--body); letter-spacing: .01em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 2px 0 #000a, 0 0 12px var(--glow); }
.wal .wu { font: 700 10px/14px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #efeaff; background: #0b0a1fcc; padding: 0 6px; border-radius: 3px; border-bottom: 2px solid var(--pc); max-width: calc(var(--ww) - 2px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl { position: absolute; z-index: 1; left: calc(var(--ww) / 2); right: calc(var(--ww) / 2); top: 42px; height: 4px; margin-top: -2px; border-radius: 2px; background: #ffffff22; box-shadow: inset 0 0 0 1px #0006; overflow: hidden; }
.rl .trail { position: absolute; top: 0; bottom: 0; width: 0; background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.rtl .rl .trail { right: 0; } .ltr .rl .trail { left: 0; }
.tk { position: absolute; z-index: 3; left: 0; top: 0; width: var(--ww); height: 104px; display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; pointer-events: none; transform: translateX(var(--o)); }
.tkg { height: 18px; padding: 0 8px; font: 800 13px/16px var(--body); color: #fff; background: #0b0a1fe8; border: 1px solid var(--glow); border-radius: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 0 10px color-mix(in srgb, var(--glow) 50%, transparent); }
.tki { position: relative; width: 44px; height: 44px; }
.tki img { width: 44px; height: 44px; object-fit: contain; display: block; filter: drop-shadow(0 3px 3px #000b) drop-shadow(0 0 10px color-mix(in srgb, var(--glow) 65%, transparent)); }
.tki .lk { left: auto; right: -14px; top: 18px; }
/* stage 0: the giver's stake sits at home */
.arena[data-st="1"] .wal.give .wic, .arena[data-st="2"] .wal.give .wic, .arena[data-st="3"] .wal.give .wic, .arena[data-st="4"] .wal.give .wic { opacity: .3; filter: grayscale(1) drop-shadow(0 3px 3px #000b); }
.arena[data-st="0"] .wal.get .wic, .arena[data-st="1"] .wal.get .wic, .arena[data-st="2"] .wal.get .wic, .arena[data-st="3"] .wal.get .wic { opacity: .3; filter: grayscale(1) drop-shadow(0 3px 3px #000b); }
.arena[data-st="4"] .wal.get .wic { animation: lightUp .5s ease-out 1.9s both; }
.arena[data-st="4"] .wal.get .wn { animation: gotIt .7s ease-out 1.9s both; }
/* 1: pay in (to the middle) */
.arena[data-st="1"] .tk { opacity: 1; transform: translateX(var(--m)); animation: payIn 1.1s cubic-bezier(.5,0,.25,1) .15s both; }
.arena[data-st="1"] .rl .trail { width: 50%; animation: trailA 1.1s cubic-bezier(.5,0,.25,1) .15s both; }
/* 2-3: held and locked in the middle */
.arena[data-st="2"] .tk, .arena[data-st="3"] .tk { opacity: 1; transform: translateX(var(--m)); }
.arena[data-st="2"] .rl .trail, .arena[data-st="3"] .rl .trail { width: 50%; }
.arena[data-st="3"] .tki img { animation: flash 1.2s ease-in-out; }
/* 4: carried across, unlocked, cashed out */
.arena[data-st="4"] .tk { opacity: 0; transform: translateX(var(--e)); animation: carry 1.4s cubic-bezier(.5,0,.25,1) both; }
.arena[data-st="4"] .rl .trail { width: 100%; animation: trailB 1.4s cubic-bezier(.5,0,.25,1) both; }
.arena[data-st="4"] .tkg, .arena[data-st="4"] .tki { animation: cashOut .5s ease-in 1.9s both; }
.arena[data-st="4"] .lk .sh { animation: shackleOpen .45s ease-out 1.4s both; }
.arena[data-st="4"] .lk .bd { animation: lockGreen .3s ease-out 1.4s both; }
@keyframes payIn { from { opacity: 1; transform: translateX(var(--o)); } to { opacity: 1; transform: translateX(var(--m)); } }
@keyframes carry { from { opacity: 1; transform: translateX(var(--m)); } to { opacity: 1; transform: translateX(var(--e)); } }
@keyframes trailA { from { width: 0; } to { width: 50%; } }
@keyframes trailB { from { width: 50%; } to { width: 100%; } }
@keyframes cashOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(14px) scale(.35); } }
@keyframes lightUp { from { opacity: .3; filter: grayscale(1) drop-shadow(0 3px 3px #000b); } to { opacity: 1; filter: drop-shadow(0 3px 3px #000b) drop-shadow(0 0 8px color-mix(in srgb, var(--glow) 55%, transparent)); } }
@keyframes gotIt { 0% { color: #fff; transform: scale(1); } 40% { color: #7ff0d2; transform: scale(1.2); } 100% { color: #7ff0d2; transform: scale(1); } }
@media (max-width: 520px) { .lane2 { --ww: 80px; } .wal .wn { font-size: 18px; } .gp .half { padding: 40px 22px 14px; } }
.deck { height: calc(352px * var(--k)); }
@media (max-height: 880px) { .deck { --k: .9; } }
@media (max-height: 800px) { .deck { --k: .8; } }
@media (max-height: 740px) { .deck { --k: .72; } }
@media (max-height: 690px) { .deck { --k: .64; } }
/* the safe area is a share of the banner itself (percent padding would have used the strip's width) */
.gp .gname { width: 270px; padding: 0; }
.gp .gname span { width: calc(100% - var(--bp) - var(--bp)); margin: 0 auto; overflow: visible; }
/* padlock v2: steel shackle with a highlight, a bevelled body with rivets and a keyhole; the body colour changes with the state */
.lk { width: 28px; height: 34px; }
.tki .lk { left: auto; right: -17px; top: 14px; }
.lk .sh { transform-origin: 19.5px 15px; }
.lk .s1 { fill: none; stroke: #8b97ab; stroke-width: 3.8; stroke-linecap: round; }
.lk .s2 { fill: none; stroke: #f2f6fc; stroke-width: 1.3; stroke-linecap: round; opacity: .85; }
.lk .bd { fill: #ff5560; stroke: #120d26; stroke-width: 1.8; }
.lk .hl { fill: #fff; opacity: .28; }
.lk .sd { fill: #000; opacity: .22; }
.lk .rv { fill: #120d26; opacity: .7; }
.lk .kh { fill: #120d26; }
@keyframes shackleOpen { from { transform: none; } to { transform: translate(1px, -3.5px) rotate(-36deg); } }
/* the xtrade mark marks the middle of each lane, where the stake pauses; the token covers it on arrival */
.esc { position: absolute; z-index: 2; left: 50%; top: 42px; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: grid; place-items: center; border-radius: 50%; background: #0b0a1fd9; box-shadow: 0 0 0 2px #ff5560, 0 0 14px #ff556088; }
.esc img { width: 26px; height: 26px; display: block; }
.arena[data-st="1"] .esc { opacity: 0; animation: escOut 1.25s linear .15s both; }
.arena[data-st="2"] .esc, .arena[data-st="3"] .esc { opacity: 0; }
.arena[data-st="4"] .esc { opacity: 1; animation: escIn .4s ease-out .5s both; }
@keyframes escOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes escIn { from { opacity: 0; } to { opacity: 1; } }
/* unit names sit straight on the card: no chip behind them, and clear of the bottom border */
.wal .wu { background: none; padding: 0; border-bottom: 0; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 6px #000, 0 0 10px #000b; text-decoration: underline var(--pc) 2px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
.gp .half { padding-bottom: 22px; }
.arena { transform-origin: 50% 0; margin-top: 20px; }
.deck { height: calc(386px * var(--k)); }

/* ---- choreography v3: from the player's sprite down to the bar, locked on their side, meet in the middle and confirm, cross and unlock, then absorbed into the other player ---- */
.arena .pl { z-index: 1; } .arena .gp { z-index: 2; }
.tk { transform: translate(var(--o), 0); }
.arena[data-st="1"] .tk { opacity: 1; transform: translate(var(--o), 0); animation: payIn 1s cubic-bezier(.3,.7,.3,1) .1s both; }
.arena[data-st="1"] .rl .trail, .arena[data-st="2"] .rl .trail { width: 0; animation: none; }
.arena[data-st="2"] .tk { opacity: 1; transform: translate(var(--m), 0); animation: toMid 1s cubic-bezier(.5,0,.25,1) .9s both; }
.arena[data-st="2"] .rl .trail { animation: trailA 1s cubic-bezier(.5,0,.25,1) .9s both; }
.arena[data-st="3"] .tk { opacity: 1; transform: translate(var(--m), 0); animation: none; }
.arena[data-st="3"] .rl .trail { width: 50%; animation: none; }
.arena[data-st="4"] .tk { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(.15); animation: carry 1.2s cubic-bezier(.5,0,.25,1) both, absorb .7s cubic-bezier(.5,0,.8,.5) 1.8s forwards; }
.arena[data-st="4"] .rl .trail { width: 100%; animation: trailB 1.2s cubic-bezier(.5,0,.25,1) both; }
.arena[data-st="4"] .tkg, .arena[data-st="4"] .tki { animation: none; }
.arena[data-st="4"] .lk .sh { animation: shackleOpen .45s ease-out 1.2s both; }
.arena[data-st="4"] .lk .bd { animation: lockGreen .3s ease-out 1.2s both; }
.arena[data-st="3"] .tki img { animation: none; }
.arena[data-st="4"] .wal.get .wic { animation: lightUp .5s ease-out 2.1s both; }
.arena[data-st="4"] .wal.get .wn { animation: gotIt .7s ease-out 2.15s both; }
.arena[data-st="1"] .esc { opacity: 1; animation: none; }
.arena[data-st="2"] .esc { opacity: 0; animation: escOut 2s linear both; }
.arena[data-st="4"] .esc { opacity: 1; animation: escIn .4s ease-out .5s both; }
@keyframes escOut { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes payIn { from { opacity: 0; transform: translate(var(--ox), var(--oy)) scale(.3); } 25% { opacity: 1; } to { opacity: 1; transform: translate(var(--o), 0) scale(1); } }
@keyframes toMid { from { opacity: 1; transform: translate(var(--o), 0); } to { opacity: 1; transform: translate(var(--m), 0); } }
@keyframes carry { from { opacity: 1; transform: translate(var(--m), 0); } to { opacity: 1; transform: translate(var(--e), 0); } }
@keyframes absorb { from { opacity: 1; transform: translate(var(--e), 0) scale(1); } 80% { opacity: 1; } to { opacity: 0; transform: translate(var(--rx), var(--ry)) scale(.15); } }
/* the confirmation tick pops over the held stakes */
.ck { position: absolute; z-index: 5; left: calc(50% - 38px); top: 16px; width: 26px; height: 26px; opacity: 0; transform: scale(0); pointer-events: none; filter: drop-shadow(0 2px 3px #000b) drop-shadow(0 0 8px #52d6b5aa); }
.ck svg { width: 100%; height: 100%; display: block; }
.ckl { position: absolute; z-index: 5; left: 50%; top: 68px; transform: translateX(-50%) scale(.6); opacity: 0; font: 800 10px/14px var(--body); letter-spacing: .14em; text-transform: uppercase; color: #7ff0d2; text-shadow: 0 1px 0 #000, 0 0 4px #000, 0 0 8px #000; white-space: nowrap; pointer-events: none; }
.arena[data-st="3"] .ck { opacity: 1; transform: scale(1); animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) .15s both; }
.arena[data-st="3"] .ckl { opacity: 1; transform: translateX(-50%) scale(1); animation: ckLab .4s ease-out .35s both; }
@keyframes ckPop { from { opacity: 0; transform: scale(0) rotate(-40deg); } to { opacity: 1; transform: scale(1); } }
@keyframes ckLab { from { opacity: 0; transform: translateX(-50%) translateY(4px) scale(.6); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
/* the players react: a small kick when the stake leaves, a glow when the other side's stake is absorbed */
.arena[data-st="1"] .pl .badge { animation: kick .5s ease-out .05s both; }
.arena[data-st="4"] .pl .badge { animation: absorbed .7s ease-out 2.35s both; }
@keyframes kick { 50% { transform: scale(1.1); } }
@keyframes absorbed { 0% { transform: scale(1); } 35% { transform: scale(1.16); filter: brightness(1.5) drop-shadow(0 0 10px #7ff0d2); } 100% { transform: scale(1); } }
.arena[data-st="1"] .wal.give .wic { transition-delay: .9s; }

/* the bar starts empty: balances are not drawn on it, the stake carries its own number and unit */
.wal { visibility: hidden; }
.tku { margin-top: 0; font: 700 10px/14px var(--body); letter-spacing: .1em; text-transform: uppercase; color: #fff; white-space: nowrap; text-shadow: 0 1px 0 #000, 0 0 3px #000, 0 0 6px #000, 0 0 10px #000b; }
.ckl { top: 86px; }

/* confirmation: each player card washes green with a big tick, Player 1 first and then Player 2, slowly fading out */
.arena .pl::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M12 34l14 14 26-30' fill='none' stroke='%23062b22' stroke-width='15' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M12 34l14 14 26-30' fill='none' stroke='%23b9ffe9' stroke-width='9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 88px no-repeat, radial-gradient(ellipse at center, #52d6b5d9 0%, #2fae8fb3 60%, #1f8f7599 100%); box-shadow: inset 0 0 22px #7ff0d2, 0 0 22px #52d6b5; }
.arena[data-st="3"] .pl.pl1::after { animation: plOk 1.15s ease-in-out .05s both; }
.arena[data-st="3"] .pl.pl2::after { animation: plOk 1.3s ease-in-out .6s both; }
@keyframes plOk { 0% { opacity: 0; } 30% { opacity: 1; } 62% { opacity: 1; } 100% { opacity: 0; } }

/* confirmation order: Player 1 confirms and stays confirmed, then Player 2, and only when both have the middle confirms */
.arena[data-st="3"] .pl.pl1::after { opacity: 1; animation: plIn .6s ease-out .1s both; }
.arena[data-st="3"] .pl.pl2::after { opacity: 1; animation: plIn .6s ease-out .95s both; }
.arena[data-st="4"] .pl::after { animation: plOut .9s ease-in-out .3s both; }
@keyframes plIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes plOut { from { opacity: 1; } to { opacity: 0; } }
.arena[data-st="3"] .ck { animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) 1.95s both; }
.arena[data-st="3"] .ckl { animation: ckLab .4s ease-out 2.15s both; }

/* unlock beat: the lock arrives closed, pops and opens, then drops away before the stake is absorbed */
.arena[data-st="4"] .lk { animation: lockBeat 1.1s ease-in-out 1.25s both; transform-origin: 50% 70%; }
.arena[data-st="4"] .lk .sh { animation: shackleOpen .5s ease-out 1.35s both; }
.arena[data-st="4"] .lk .bd { animation: lockGreen .3s ease-out 1.35s both; }
.arena[data-st="4"] .tk { animation: carry 1.2s cubic-bezier(.5,0,.25,1) both, absorb .7s cubic-bezier(.5,0,.8,.5) 2.4s forwards; }
.arena[data-st="4"] .pl .badge { animation: absorbed .7s ease-out 3s both; }
@keyframes lockBeat { 0% { opacity: 1; transform: scale(1); } 14% { transform: scale(1.45); } 34% { transform: scale(1.1); } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(.4) translateY(-10px); } }
/* each player's card owns the end of the bar where their stake lands: the zone is tinted in their colour and reaches back to the card */
.lane2::before, .lane2::after { content: ""; position: absolute; z-index: 0; top: 4px; bottom: 2px; width: calc(78px + var(--ww) + 6px); pointer-events: none; }
.lane2::before { left: -78px; border-radius: 0 16px 16px 0; background: linear-gradient(90deg, #a24f86a6 0, #a24f8666 62%, #a24f8600 100%); border-top: 2px solid #a24f86cc; border-bottom: 2px solid #a24f86cc; box-shadow: 0 0 18px #a24f8655; }
.lane2::after { right: -78px; border-radius: 16px 0 0 16px; background: linear-gradient(270deg, #4f86b4a6 0, #4f86b466 62%, #4f86b400 100%); border-top: 2px solid #4f86b4cc; border-bottom: 2px solid #4f86b4cc; box-shadow: 0 0 18px #4f86b455; }
.arena[data-st="1"] .lane2::before, .arena[data-st="1"] .lane2::after { animation: zoneGlow 1s ease-out .1s both; }
@keyframes zoneGlow { 50% { filter: brightness(1.6); } }
.lane2::before, .lane2::after { top: -8px; bottom: -10px; width: calc(66px + var(--ww) + 24px); border-top: 0; border-bottom: 0; box-shadow: none; border-radius: 0; }
.lane2::before { left: -66px; background: linear-gradient(90deg, #a24f86c7 0, #a24f8680 55%, #a24f8600 100%); border-left: 4px solid #a24f86; }
.lane2::after { right: -66px; background: linear-gradient(270deg, #4f86b4c7 0, #4f86b480 55%, #4f86b400 100%); border-right: 4px solid #4f86b4; }
.lane2::before, .lane2::after { top: -6px; bottom: -12px; width: calc(66px + var(--ww) + 30px); border: 0; background-repeat: no-repeat; }
.lane2::before { left: -66px; border-radius: 0 18px 18px 0;
  background-image: linear-gradient(#a24f86, #a24f86), linear-gradient(90deg, #0000 0 40px, #a24f86b0 46px, #a24f8655 62%, #a24f8600 100%);
  background-size: 74px 8px, 100% 100%; background-position: 0 44px, 0 0; filter: drop-shadow(0 0 6px #a24f8699); }
.lane2::after { right: -66px; border-radius: 18px 0 0 18px;
  background-image: linear-gradient(#4f86b4, #4f86b4), linear-gradient(270deg, #0000 0 40px, #4f86b4b0 46px, #4f86b455 62%, #4f86b400 100%);
  background-size: 74px 8px, 100% 100%; background-position: 100% 44px, 0 0; filter: drop-shadow(0 0 6px #4f86b499); }

/* player areas: a tinted territory behind the cards, running from each player's card across the first part of both strips and glowing out around their edges */
.lane2::before, .lane2::after { content: none; }
.arena::before, .arena::after { content: ""; position: absolute; z-index: 0; top: 4px; bottom: -14px; width: 410px; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, #000 0, #000 62%, transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 62%, transparent 100%); }
.arena::before { left: 0; border-radius: 22px 0 0 22px; background: linear-gradient(90deg, #a24f86d9, #a24f868c); box-shadow: 0 0 0 3px #a24f86, 0 0 34px 6px #a24f86aa; }
.arena::after { right: 0; border-radius: 0 22px 22px 0; -webkit-mask-image: linear-gradient(270deg, #000 0, #000 62%, transparent 100%); mask-image: linear-gradient(270deg, #000 0, #000 62%, transparent 100%); background: linear-gradient(270deg, #4f86b4d9, #4f86b48c); box-shadow: 0 0 0 3px #4f86b4, 0 0 34px 6px #4f86b4aa; }
.arena[data-st="1"]::before, .arena[data-st="1"]::after { animation: zoneGlow 1s ease-out .1s both; }
@media (max-width: 800px) { .arena::before, .arena::after { display: none; } }
.arena::before, .arena::after { width: 330px; }

/* one long card behind everything: orange from Player 1's side and cyan from Player 2's, each fading toward the middle so the two ends read as separate but belong to the same card */
.arena .pl::before { display: none; }
.arena .pl { background: repeating-linear-gradient(0deg, #ffffff0a 0 2px, transparent 2px 4px), linear-gradient(180deg, color-mix(in srgb, var(--pc) 62%, #120d26), color-mix(in srgb, var(--pc) 30%, #0b0a24)); }
.arena::before, .arena::after { content: ""; position: absolute; z-index: 0; top: -12px; bottom: -14px; left: 0; right: 0; width: auto; border-radius: 24px; box-shadow: none; -webkit-mask-image: none; mask-image: none;
  background: linear-gradient(90deg, #a24f86e6 0, #a24f86b3 22%, #a24f8640 38%, #0000 49%, #0000 51%, #4f86b440 62%, #4f86b4b3 78%, #4f86b4e6 100%); }
.arena::after { z-index: -1; inset: -20px -10px -22px; top: -20px; bottom: -22px; filter: blur(20px); opacity: .85; }

/* stepped pixel corners instead of rounded or chamfered ones: the long card, the player cards and their frames all share them */
.arena .pl { clip-path: polygon(0px 15px, 5px 15px, 5px 10px, 10px 10px, 10px 5px, 15px 5px, 15px 0px, calc(100% - 15px) 0px, calc(100% - 15px) 5px, calc(100% - 10px) 5px, calc(100% - 10px) 10px, calc(100% - 5px) 10px, calc(100% - 5px) 15px, 100% 15px, 100% calc(100% - 15px), calc(100% - 5px) calc(100% - 15px), calc(100% - 5px) calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) calc(100% - 5px), calc(100% - 15px) calc(100% - 5px), calc(100% - 15px) 100%, 15px 100%, 15px calc(100% - 5px), 10px calc(100% - 5px), 10px calc(100% - 10px), 5px calc(100% - 10px), 5px calc(100% - 15px), 0px calc(100% - 15px)); background: var(--pc); box-shadow: none; isolation: isolate; }
.arena .pl::before { display: block; content: ""; position: absolute; inset: 3px; z-index: -1; clip-path: polygon(0px 12px, 4px 12px, 4px 8px, 8px 8px, 8px 4px, 12px 4px, 12px 0px, calc(100% - 12px) 0px, calc(100% - 12px) 4px, calc(100% - 8px) 4px, calc(100% - 8px) 8px, calc(100% - 4px) 8px, calc(100% - 4px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 4px) calc(100% - 12px), calc(100% - 4px) calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) calc(100% - 4px), calc(100% - 12px) calc(100% - 4px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 4px), 8px calc(100% - 4px), 8px calc(100% - 8px), 4px calc(100% - 8px), 4px calc(100% - 12px), 0px calc(100% - 12px)); background: repeating-linear-gradient(0deg, #ffffff0a 0 2px, transparent 2px 4px), linear-gradient(180deg, color-mix(in srgb, var(--pc) 62%, #120d26), color-mix(in srgb, var(--pc) 30%, #0b0a24)); }
.arena::before { border-radius: 0; clip-path: polygon(0px 24px, 8px 24px, 8px 16px, 16px 16px, 16px 8px, 24px 8px, 24px 0px, calc(100% - 24px) 0px, calc(100% - 24px) 8px, calc(100% - 16px) 8px, calc(100% - 16px) 16px, calc(100% - 8px) 16px, calc(100% - 8px) 24px, 100% 24px, 100% calc(100% - 24px), calc(100% - 8px) calc(100% - 24px), calc(100% - 8px) calc(100% - 16px), calc(100% - 16px) calc(100% - 16px), calc(100% - 16px) calc(100% - 8px), calc(100% - 24px) calc(100% - 8px), calc(100% - 24px) 100%, 24px 100%, 24px calc(100% - 8px), 16px calc(100% - 8px), 16px calc(100% - 16px), 8px calc(100% - 16px), 8px calc(100% - 24px), 0px calc(100% - 24px)); }
.arena::after { border-radius: 0; }
.arena .pl::before, .arena .pl.pl1::before, .arena .pl.pl2::before { top: 3px; bottom: 3px; left: 3px; right: 3px; width: auto; height: auto; box-shadow: none; }
/* the long card extends the same distance past the player cards and strips on every side */
.arena::before { top: -14px; bottom: -14px; left: -14px; right: -14px; }
.arena::after { top: -22px; bottom: -22px; left: -22px; right: -22px; }
/* no flashes when the stakes go in: the second game's strip just eases up from dimmed, and the player areas keep a steady glow */
.arena[data-st="1"] .gp.b { animation: none; }
.arena[data-st="1"]::before, .arena[data-st="1"]::after { animation: none; }
.arena[data-st="1"] .lane2::before, .arena[data-st="1"] .lane2::after { animation: none; }
/* the stage is a show, not a control: no focus outline around it */
.deck:focus, .deck:focus-visible { outline: none; }

/* ---- lower half, one pass: every frame is the same pixel kit (9-sliced so corners keep their shape), new icons, matching button ---- */
.hud { filter: drop-shadow(0 10px 16px #000c); }
.hud::before { content: "TRADE LOG"; left: 28px; top: -22px; width: 138px; height: 39px; padding: 11px 0 0; box-sizing: border-box; text-align: center; color: #ffd0d4; background: url(/img/f-ui-tab.png) center / 100% 100% no-repeat; clip-path: none; font: 700 12px/1 var(--px); letter-spacing: .14em; }
.hudin { padding: 6px 12px 4px; border: 18px solid transparent; border-image: url(/img/f-ui-panel.png) 36 / 18px stretch; background: repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 4px), #17123a; background-clip: padding-box; box-shadow: none; clip-path: none; }
.state { padding: 7px 8px 6px; border: 10px solid transparent; border-image: url(/img/f-ui-card.png) 30 / 10px stretch; background: #100b2c; background-clip: padding-box; box-shadow: none; min-width: 120px; }
[data-stage="4"] .state { box-shadow: none; background: #0e2a2e; }
.stepw { filter: drop-shadow(0 8px 12px #000b); }
.stepw:hover { transform: translateY(-3px); filter: drop-shadow(0 8px 12px #000b) brightness(1.1); }
.step { padding: 4px 8px; border: 15px solid transparent; border-image: url(/img/f-ui-card.png) 30 / 15px stretch; background: repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 4px), #17123a; background-clip: padding-box; box-shadow: none; clip-path: none; gap: 12px; }
.step .slot { position: static; overflow: visible; width: 60px; height: 56px; background: none; box-shadow: none; border-radius: 0; display: grid; place-items: center; }
.step .slot::after { display: none; }
.step .slot img.tile { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 0 #0008); }
.btn { padding: 4px 14px 5px; border: 11px solid transparent; border-image: url(/img/f-ui-button.png) 22 fill / 11px stretch; background: none; color: #2b0a12; text-shadow: 0 1px 0 #ffffff66; font: 700 14px/1 var(--px); letter-spacing: .08em; box-shadow: none; margin-bottom: 4px; }
.btn:hover { transform: none; box-shadow: none; filter: brightness(1.12); }
.btn:active { transform: translateY(2px); box-shadow: none; filter: brightness(.94); }
.live { display: flex; justify-content: center; gap: 14px; text-shadow: none; }
.live .stat { display: inline-flex; align-items: center; gap: 9px; padding: 0 6px; border: 8px solid transparent; border-image: url(/img/f-ui-card.png) 30 / 8px stretch; background: #17123a; background-clip: padding-box; font: 700 12px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: #efeaff; }
.live .stat img { height: 20px; width: auto; display: block; }
.live .stat b { font: 700 14px/1 var(--px); color: #ffd0d4; letter-spacing: .04em; margin-right: 3px; }
/* compact the lower half so it fits with the stage on a laptop screen */
.hudin { border-width: 14px; border-image-width: 14px; padding: 2px 8px 0; }
.hud { margin-top: calc(26px * var(--k, 1)); }
.state { border-width: 8px; border-image-width: 8px; min-width: 110px; padding: 5px 6px 4px; font-size: 14px; }
.cap { font-size: 13.5px; line-height: 1.25; }
.rail { margin-bottom: 6px; } .rail li { height: 22px; }
.step { border-width: 12px; border-image-width: 12px; padding: 0 6px; }
.step .slot { width: 52px; height: 48px; }
.stx b { font-size: 20px; margin-bottom: 2px; } .stx p { font-size: 12.5px; }
.live .stat { border-width: 6px; border-image-width: 6px; padding: 0 4px; }
.live .stat img { height: 17px; }
.ground { gap: 6px; padding-bottom: 8px; }
@media (max-height: 760px) { .deck { --k: .66; } }
@media (max-height: 700px) { .deck { --k: .6; } }
.ground { padding-bottom: 2px; }
/* the tagline is drawn in the pixel font on the same framed plate as the rest of the page */
.sub { max-width: min(100%, 860px); font: 600 clamp(12px, 1.35vw, 17px)/1.35 var(--px); letter-spacing: .02em; color: #fff3f0; text-shadow: 0 2px 0 #000a; padding: 0 4px; border: 11px solid transparent; border-image: url(/img/f-ui-card.png) 30 / 11px stretch; background: repeating-linear-gradient(0deg, #ffffff07 0 2px, transparent 2px 4px), #17123a; background-clip: padding-box; box-shadow: none; }
@media (max-height: 760px) { .deck { --k: .62; } }
@media (max-height: 700px) { .deck { --k: .56; } }
/* in sync with the players: Player 1 confirming ticks the first stake, Player 2 confirming ticks the second */
.arena[data-st="3"] .gp.a .ck { animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) .6s both; }
.arena[data-st="3"] .gp.a .ckl { animation: ckLab .4s ease-out .8s both; }
.arena[data-st="3"] .gp.b .ck { animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) 1.45s both; }
.arena[data-st="3"] .gp.b .ckl { animation: ckLab .4s ease-out 1.65s both; }

/* long card v2: solid stepped bands at each end, a dithered fade toward the middle, and pixel rails along the top and bottom; no soft blur */
.arena::before { top: -14px; bottom: -14px; left: -14px; right: -14px; border-radius: 0; opacity: 1; filter: none;
  background:
    linear-gradient(90deg, #ffc690 0 34%, #0000 46% 54%, #95eeff 66% 100%) 0 0 / 100% 4px no-repeat,
    linear-gradient(90deg, #ffc690 0 34%, #0000 46% 54%, #95eeff 66% 100%) 0 100% / 100% 4px no-repeat,
    linear-gradient(90deg, #a24f86e6 0 14%, #a24f86cc 14% 22%, #a24f86b0 22% 30%, #a24f868c 30% 36%, #0000 36% 64%, #4f86b48c 64% 70%, #4f86b4b0 70% 78%, #4f86b4cc 78% 86%, #4f86b4e6 86% 100%); }
.arena::after { z-index: 0; top: -14px; bottom: -14px; left: -14px; right: -14px; border-radius: 0; filter: none; opacity: .8;
  background: linear-gradient(90deg, #a24f86 0 50%, #4f86b4 50% 100%);
  -webkit-mask-image: conic-gradient(#000 25%, #0000 0 50%, #000 0 75%, #0000 0), linear-gradient(90deg, #0000 0 36%, #000 36% 47%, #0000 47% 53%, #000 53% 64%, #0000 64% 100%);
  mask-image: conic-gradient(#000 25%, #0000 0 50%, #000 0 75%, #0000 0), linear-gradient(90deg, #0000 0 36%, #000 36% 47%, #0000 47% 53%, #000 53% 64%, #0000 64% 100%);
  -webkit-mask-size: 8px 8px, 100% 100%; mask-size: 8px 8px, 100% 100%;
  -webkit-mask-composite: source-in; mask-composite: intersect; image-rendering: pixelated; }
/* true pixel portraits: 45 px native, shown at exactly 2x with hard edges */
.arena .pl .badge { width: 90px; height: 90px; }
.arena .pl .badge img { image-rendering: pixelated; }
/* portraits: 32 px native, shown at exactly 3x */
.arena .pl .badge { width: 96px; height: 96px; }

/* deep dither at the middle seam: ordered (Bayer) dither in 4px blocks, 17 density steps, solid on the outside and clear in the centre */
.arena::before { background:
    linear-gradient(90deg, #ffc690 0 34%, #0000 46% 54%, #95eeff 66% 100%) 0 0 / 100% 4px no-repeat,
    linear-gradient(90deg, #ffc690 0 34%, #0000 46% 54%, #95eeff 66% 100%) 0 100% / 100% 4px no-repeat,
    linear-gradient(90deg, #a24f86e6 0 14%, #a24f86d0 14% 24%, #a24f86b8 24% 36%, #0000 36% 64%, #4f86b4b8 64% 76%, #4f86b4d0 76% 86%, #4f86b4e6 86% 100%); }
.arena::after { -webkit-mask-image: none; mask-image: none; opacity: 1; filter: none; background: url(/img/dither-o.png) 330px 0 / 128px 16px repeat-y, url(/img/dither-c.png) 460px 0 / 128px 16px repeat-y; image-rendering: pixelated; }
.arena .pl .badge, .arena .pl .badge img { border-radius: 4px; }

/* players are tiny pixel sprites standing on their card, not framed portraits */
.arena .pl .badge { position: relative; width: auto; height: auto; padding: 0; background: none; box-shadow: none; border-radius: 0; overflow: visible; display: block; margin-top: 6px; }
.arena .pl .badge img { width: auto; height: 124px; max-width: 100%; object-fit: contain; border-radius: 0; image-rendering: auto; display: block; filter: drop-shadow(0 3px 0 #0009); }
.arena .pl .badge::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 64px; height: 12px; margin-left: -32px; border-radius: 50%; background: radial-gradient(ellipse at center, #000a 0, #0000 70%); z-index: -1; }
.arena .pl small { min-height: 2.5em; }
/* sprites are 19x40 native pixels shown at exactly 3x */
.arena .pl .badge img { height: 120px; width: auto; image-rendering: pixelated; }
/* the seam dither is long and irregular: random density that thins out into a faint, ragged middle, and orange and cyan overlap there */
.arena::after { background: url(/img/dither-o.png?v=2) 300px 0 / 256px 128px repeat-y, url(/img/dither-c.png?v=2) 362px 0 / 256px 128px repeat-y; }

/* long card v3: drawn pixel art (tools/gen-seam.cjs), a proper bevelled frame in orange and cyan whose borders and fill break up into ragged dither in the middle */
.arena::before { top: -20px; bottom: -20px; left: -20px; right: -20px; border-radius: 0; clip-path: none; opacity: 1; filter: none; -webkit-mask-image: none; mask-image: none; background: url(/img/f-seam-card.png?v=23) 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.arena::after { content: none; }
/* more room under the stage so the card's lower border has height; the trade log moves down with it */
.arena::before { bottom: -36px; }
.deck { height: calc(402px * var(--k)); }
.hud { margin-top: calc(42px * var(--k, 1)); }
@media (max-height: 760px) { .deck { --k: .57; } }
@media (max-height: 700px) { .deck { --k: .52; } }
.arena::before { top: -26px; bottom: -30px; }

/* ---- celebration: hops, popping currency, confetti, stars and rings, themed by each game's glow ---- */
.cel { position: absolute; inset: 0; z-index: 6; pointer-events: none; overflow: visible; }
.pf { position: absolute; left: var(--x); top: var(--y); pointer-events: none; }
.pf.sq { width: 6px; height: 6px; margin: -3px; background: var(--c); box-shadow: 0 0 0 1px #0b0a1f; opacity: 0; animation: confetti var(--t, 1100ms) cubic-bezier(.2,.75,.4,1) var(--d, 0ms) both; }
.pf.ic { width: 24px; height: 24px; margin: -12px; object-fit: contain; opacity: 0; filter: drop-shadow(0 2px 0 #0009); animation: arc var(--t, 1100ms) cubic-bezier(.2,.75,.4,1) var(--d, 0ms) both; }
.pf.star { width: 11px; height: 11px; margin: -5px; background: var(--c); clip-path: polygon(40% 0, 60% 0, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0 60%, 0 40%, 40% 40%); opacity: 0; animation: starOut 1s ease-out var(--d, 0ms) both; }
.pf.ring { width: 22px; height: 22px; margin: -11px; border: 3px solid var(--c); opacity: 0; animation: ringOut .9s ease-out var(--d, 0ms) both; }
.pf.pop { transform: translate(-50%, 0); margin-top: -96px; white-space: nowrap; font: 700 14px/1 var(--px); letter-spacing: .04em; color: #b8fff0; text-shadow: 0 2px 0 #000, 0 0 8px var(--c), 0 0 3px #000; opacity: 0; animation: popUp 1.5s ease-out both; }
.arena.joy .pl .badge img { animation: hop .46s cubic-bezier(.3,.7,.4,1) 3; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 42% { transform: translateY(-16px); } }
@keyframes confetti { 0% { opacity: 1; transform: translate(0, 0) scale(.4) rotate(0); } 45% { opacity: 1; transform: translate(calc(var(--dx) * .6), var(--dy)) scale(1) rotate(calc(var(--r) * .5)); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 80px)) scale(.9) rotate(var(--r)); } }
@keyframes arc { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 45% { opacity: 1; transform: translate(calc(var(--dx) * .6), var(--dy)) scale(1.1); } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 90px)) scale(.8); } }
@keyframes fall { 0% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.9); } 18% { opacity: 1; } 78% { opacity: 1; transform: translate(var(--dx), 14px) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), 2px) scale(.3); } }
@keyframes starOut { 0% { opacity: 0; transform: translate(0, 0) scale(0); } 30% { opacity: 1; transform: translate(calc(var(--dx) * .6), calc(var(--dy) * .6)) scale(1.3) rotate(45deg); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2) rotate(90deg); } }
@keyframes ringOut { 0% { opacity: .95; transform: scale(.4); } 100% { opacity: 0; transform: scale(5.2); } }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); } 14% { opacity: 1; transform: translate(-50%, 0) scale(1.18); } 26% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px) scale(1); } }
/* the card reaches up far enough to hold both game banners (the first one stands above its strip) */
.arena { margin-top: 44px; }
.arena::before { top: -44px; bottom: -30px; }
.deck { height: calc(426px * var(--k)); }
@media (max-height: 760px) { .deck { --k: .54; } }
@media (max-height: 700px) { .deck { --k: .5; } }

/* trade log label: a plain rectangle sitting flush on the panel, framed like the rest of the kit */
.hud::before { top: -11px; left: 30px; width: 126px; height: 28px; padding: 0; display: grid; place-items: center; box-sizing: border-box; border: 7px solid transparent; border-image: url(/img/f-ui-card.png) 30 / 7px stretch; background: #17123a; background-clip: padding-box; clip-path: none; font: 700 11px/1 var(--px); letter-spacing: .14em; color: #ffd0d4; }
/* the stage and its card sit lower so the card covers the bridge in the background; its colours blend through a dusk mauve */
.arena { margin-top: 54px; }
.arena::before { top: -44px; bottom: -52px; }
.deck { height: calc(440px * var(--k)); }
@media (max-height: 760px) { .deck { --k: .5; } }
@media (max-height: 700px) { .deck { --k: .46; } }
.arena .pl .badge img { height: auto; }

/* spacing: the stats sit right under the tagline, and the sections share the height evenly */
.hero { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2vh, 12px); margin-top: clamp(2px, 1vh, 12px); }
.hero .sub, .hero .live { margin: 0; }
.hero .live { gap: 12px; }
.stage { row-gap: clamp(4px, 1vh, 12px); }
.ground { padding-bottom: clamp(10px, 2vh, 20px); }
h1 { font-size: clamp(28px, min(4.8vw, 7vh), 62px); }
@media (max-height: 760px) { .deck { --k: .47; } }
@media (max-height: 700px) { .deck { --k: .44; } }
.ground { padding-bottom: 4px; }

/* strips: the frame art is drawn at one uniform scale (0.92 of native, matching the strip width) and its straight edges tile instead of stretching, so corners and ornaments keep their proportions */
.gp .half { border-image-slice: 38 60 fill; border-image-width: 35px 55px; border-image-repeat: round; }
.gp.t-ember .half { border-image-slice: 62 60 fill; border-image-width: 57px 55px; }
.gp.t-eoe .half { border-image-slice: 40 60 fill; border-image-width: 37px 55px; }
.gp.t-tide .half, .gp.t-verdant .half, .gp.t-gloom .half, .gp.t-alch .half { border-image-slice: 46 70 fill; border-image-width: 42px 64px; }
/* player cards sit a little higher */
.arena .pl { position: relative; top: -10px; }

/* stage layout, one clean pass: the two player cards are exactly as tall as the two strips together, with the same gap on each side; the background card clears everything by an even margin */
.arena { grid-template-columns: 112px minmax(0, 1fr) 112px; width: 890px; column-gap: 10px; row-gap: 24px; margin-top: 46px; align-items: stretch; }
.arena .pl, .arena .pl.pl1, .arena .pl.pl2 { top: 0; margin: 0; align-self: stretch; }
.arena::before { top: -46px; bottom: -30px; left: -22px; right: -22px; }
.deck { height: calc(443px * var(--k)); }

/* no pointer triangle under the stage */
.deck::after { content: none; }

/* tighter top so everything sits snug; the stage scale itself is set from script to fit the window */
.stage { padding-top: clamp(10px, 1.6vw, 18px); }

/* the padlock: it arrives open (green) when the stake lands, snaps shut (red) before the stake moves to the middle, stays shut, then opens (green) on reaching the other side */
.arena[data-st="1"] .lk { display: block; animation: lockAppear .3s ease-out 1.05s both; }
.arena[data-st="1"] .lk .sh { transform: translate(1px, -3.5px) rotate(-36deg); animation: none; }
.arena[data-st="1"] .lk .bd { fill: #52d6b5; animation: none; }
.arena[data-st="2"] .lk { animation: lockSnap .4s ease-out .3s both; }
.arena[data-st="2"] .lk .sh { animation: shackleClose .3s ease-in .15s both; }
.arena[data-st="2"] .lk .bd { animation: lockRed .25s ease-out .3s both; }
@keyframes lockAppear { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
@keyframes lockSnap { 0% { opacity: 1; transform: scale(1); } 45% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes shackleClose { from { transform: translate(1px, -3.5px) rotate(-36deg); } to { transform: none; } }
@keyframes lockRed { from { fill: #52d6b5; } to { fill: #ff5560; } }

/* ---- the sky palette across the page: deep plum (right sky), deep navy (left sky) and the warm orange between them, over a pixel-noise texture ---- */
:root { --plum: #4d2145; --plum2: #5b2a53; --navy: #18304c; --navy2: #203f60; --warm: #f08a3c; --tex: url(/img/tex-noise.png) 0 0 / 64px 64px; }
.hudin { background: var(--tex), repeating-linear-gradient(0deg, #ffffff06 0 2px, transparent 2px 4px), linear-gradient(90deg, var(--plum) 0%, #2d1b44 42%, var(--navy) 100%); background-clip: padding-box; }
.state { background: var(--tex), linear-gradient(180deg, var(--plum2), #2c1230); background-clip: padding-box; }
[data-stage="4"] .state { background: var(--tex), linear-gradient(180deg, #14425a, #0c2a3a); background-clip: padding-box; }
.sub { background: var(--tex), linear-gradient(90deg, var(--plum), var(--navy)); background-clip: padding-box; }
.live .stat { background: var(--tex), linear-gradient(180deg, var(--navy2), var(--navy)); background-clip: padding-box; }
.stepw.s1 .step { background: var(--tex), linear-gradient(155deg, var(--plum2) 0%, #2d1741 52%, var(--navy) 100%); background-clip: padding-box; }
.stepw.s2 .step { background: var(--tex), linear-gradient(155deg, var(--navy2) 0%, var(--navy) 48%, #301a40 100%); background-clip: padding-box; }
.stepw.s3 .step { background: var(--tex), linear-gradient(155deg, #4f2430 0%, var(--plum) 45%, #3a1f45 100%); background-clip: padding-box; }
.stepw .stx small { color: #ff8f97; }
/* the three step cards sit a little higher */
.ground { padding-bottom: 16px; }

/* lock colours: locked is positive (green), unlocked is negative (red) */
.lk .bd { fill: #52d6b5; }
.arena[data-st="1"] .lk .bd { fill: #ff5560; animation: none; }
.arena[data-st="2"] .lk .bd { animation: lockToGreen .25s ease-out .3s both; }
.arena[data-st="4"] .lk .bd { animation: lockToRed .3s ease-out 1.35s both; }
@keyframes lockToGreen { from { fill: #ff5560; } to { fill: #52d6b5; } }
@keyframes lockToRed { from { fill: #52d6b5; } to { fill: #ff5560; } }

/* ---- palette taken from the hero art, used across the details (player cards excluded): night teal and navy, forest and moss from the left; plum, rose and ember from the right; sun orange between ---- */
:root { --pal-navy: #18304c; --pal-teal: #2d5a6c; --pal-forest: #1c443c; --pal-moss: #3b5a3e; --pal-plum: #4d2145; --pal-mauve: #6b2a4f; --pal-rose: #7a3446; --pal-ember: #8a4a2c; --scan: repeating-linear-gradient(0deg, #ffffff08 0 2px, transparent 2px 4px); }
.hudin { background: var(--scan), linear-gradient(90deg, var(--pal-forest), var(--pal-navy) 34%, var(--pal-plum) 68%, var(--pal-rose)); background-clip: padding-box; }
.state { background: var(--scan), linear-gradient(180deg, var(--pal-mauve), var(--pal-plum)); background-clip: padding-box; }
[data-stage="1"] .state { background: var(--scan), linear-gradient(180deg, var(--pal-teal), var(--pal-navy)); background-clip: padding-box; }
[data-stage="2"] .state { background: var(--scan), linear-gradient(180deg, var(--pal-rose), var(--pal-plum)); background-clip: padding-box; }
[data-stage="3"] .state { background: var(--scan), linear-gradient(180deg, var(--pal-ember), #5a2e1c); background-clip: padding-box; }
[data-stage="4"] .state { background: var(--scan), linear-gradient(180deg, var(--pal-moss), var(--pal-forest)); background-clip: padding-box; }
.sub { background: var(--scan), linear-gradient(90deg, var(--pal-navy), var(--pal-plum) 55%, var(--pal-rose)); background-clip: padding-box; }
.live .stat:nth-child(1) { background: var(--scan), linear-gradient(180deg, var(--pal-moss), var(--pal-forest)); background-clip: padding-box; }
.live .stat:nth-child(2) { background: var(--scan), linear-gradient(180deg, var(--pal-mauve), var(--pal-plum)); background-clip: padding-box; }
.stepw.s1 .step { background: var(--scan), linear-gradient(170deg, var(--pal-teal), var(--pal-navy) 60%, var(--pal-forest)); background-clip: padding-box; }
.stepw.s2 .step { background: var(--scan), linear-gradient(170deg, var(--pal-mauve), var(--pal-plum) 60%, var(--pal-navy)); background-clip: padding-box; }
.stepw.s3 .step { background: var(--scan), linear-gradient(170deg, var(--pal-ember), var(--pal-rose) 55%, var(--pal-plum)); background-clip: padding-box; }
.stepw.s1 .stx small { color: #9fe0c4; } .stepw.s2 .stx small { color: #f3a6c6; } .stepw.s3 .stx small { color: #ffd0a0; }
/* trade log label and stage button read in white */
.hud::before, .state, [data-stage="4"] .state { color: #fff; text-shadow: 0 2px 0 #000a; }

/* step cards: frame and fill are one drawn piece per card (tools/gen-cards.cjs), so nothing is pasted over a border */
.stepw .step { border: 12px solid transparent; border-image: none; padding: 0 6px; background: none; box-shadow: none; }
.stepw.s1 .step { border-image: url(/img/f-stepa-card.png?v=2) 12 fill / 12px stretch; }
.stepw.s2 .step { border-image: url(/img/f-stepb-card.png?v=2) 12 fill / 12px stretch; }
.stepw.s3 .step { border-image: url(/img/f-stepc-card.png?v=2) 12 fill / 12px stretch; }
.stepw { filter: drop-shadow(0 8px 12px #000b); }

/* trade log and stat chips: frame and fill drawn as one piece, like the step cards */
.hudin { border: 12px solid transparent; border-image: url(/img/f-log-card.png?v=2) 12 fill / 12px stretch; background: none; padding: 2px 6px 0; box-shadow: none; }
.hud { filter: drop-shadow(0 8px 12px #000b); }
.live .stat { border: 8px solid transparent; background: none; padding: 0 4px; box-shadow: none; }
.live .stat:nth-child(1) { border-image: url(/img/f-statg-card.png?v=2) 8 fill / 8px stretch; }
.live .stat:nth-child(2) { border-image: url(/img/f-statp-card.png?v=2) 8 fill / 8px stretch; }

/* trades arrive from the two worlds: the arena grows in at the castle door or the antenna dish and slides into place */
.arena.portal { animation: portalIn 1.4s cubic-bezier(.45,.05,.3,1) both; }
@keyframes portalIn { 0% { opacity: 0; translate: var(--dx) var(--dy); scale: .03; } 14% { opacity: 1; } 100% { opacity: 1; translate: 0 0; scale: 1; } }
.pfx { position: fixed; z-index: 50; width: 26px; height: 26px; margin: -13px; border: 3px solid #ffe2b8; box-shadow: 0 0 14px #ffb866, inset 0 0 8px #ffb866; pointer-events: none; animation: pfxOut 1s ease-out both; }
@keyframes pfxOut { 0% { opacity: .95; transform: scale(.3); } 100% { opacity: 0; transform: scale(3.2); } }

/* ---- padlock v3: pixel-art, one colour family (no red). It appears open, clicks shut and stays until the far side, then releases ---- */
.lk { width: 28px; height: 36px; overflow: visible; }
.tki .lk { right: -18px; top: 8px; }
.lk .lkd { fill: #0a1a18; } .lk .lkm { fill: #aeb9c8; } .lk .lkh { fill: #eef4fb; }
.lk .lkg { fill: #3fbf9a; } .lk .lkl { fill: #8ff0cf; } .lk .lks2 { fill: #24805f; }
.lk .lks { transform-box: fill-box; }
/* open: the shackle is lifted and swung aside */
.arena[data-st="1"] .lk .lks { transform: translate(2px, -3px); animation: none; }
.arena[data-st="1"] .lk .lkb { animation: none; }
.arena[data-st="1"] .lk .lkg, .arena[data-st="1"] .lk .lkl, .arena[data-st="1"] .lk .lks2 { animation: none; }
/* clicks shut at the start of the lock step, with a bright flash */
.arena[data-st="2"] .lk .lks { animation: lkDrop .24s steps(4) .12s both; }
.arena[data-st="2"] .lk .lkb { animation: lkClick .35s ease-out .3s both; }
.arena[data-st="3"] .lk .lks { animation: none; transform: none; }
/* released at the far side: the shackle pops open, then the lock lifts away */
.arena[data-st="4"] .lk .lks { animation: lkOpen .3s steps(4) 1.4s both; }
.arena[data-st="4"] .lk .lkb { animation: none; }
.arena[data-st="4"] .lk .lkg, .arena[data-st="4"] .lk .lkl, .arena[data-st="4"] .lk .lks2 { animation: none; }
@keyframes lkDrop { from { transform: translate(2px, -3px); } to { transform: translate(0, 0); } }
@keyframes lkOpen { from { transform: translate(0, 0); } to { transform: translate(2px, -3px); } }
@keyframes lkClick { 0% { filter: brightness(2.4); } 100% { filter: brightness(1); } }

/* padlock v3.1: the shackle is one piece hinged on its right leg. Open, it is swung away; it swings back and clicks into the body; at the far side it unclicks, swings away again and the lock disappears */
.lk .lks { transform-box: view-box; transform-origin: 10.5px 8px; }
.arena[data-st="1"] .lk .lks { transform: rotate(68deg); animation: none; }
.arena[data-st="2"] .lk .lks { animation: lkSwingIn .5s cubic-bezier(.4,0,.3,1) .1s both; }
.arena[data-st="2"] .lk .lkb { animation: lkClick .35s ease-out .55s both; }
.arena[data-st="3"] .lk .lks { transform: none; animation: none; }
.arena[data-st="4"] .lk .lks { animation: lkSwingOut .62s cubic-bezier(.3,0,.3,1) 1.35s both; }
@keyframes lkSwingIn { 0% { transform: rotate(68deg); } 78% { transform: rotate(-5deg); } 100% { transform: rotate(0); } }
@keyframes lkSwingOut { 0% { transform: translate(0, 0) rotate(0); } 20% { transform: translate(0, -1.2px) rotate(0); } 100% { transform: translate(0, -1.2px) rotate(68deg); } }
@keyframes lkClick { 0% { filter: brightness(2.2); transform: translateY(1px); } 100% { filter: brightness(1); transform: translateY(0); } }

/* the confirmation tick on the player cards is pixel art: stepped squares with a dark outline and a light edge */
.arena .pl::after { background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2015%2013%27%20shape-rendering%3D%27crispEdges%27%3E%3Cg%20fill%3D%27%2306281f%27%3E%3Crect%20x%3D%270%27%20y%3D%275%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%271%27%20y%3D%276%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%277%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%278%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%274%27%20y%3D%277%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%275%27%20y%3D%276%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%275%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%277%27%20y%3D%274%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%273%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%272%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%2710%27%20y%3D%271%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%27%237ff0c8%27%3E%3Crect%20x%3D%271%27%20y%3D%276%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%277%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%278%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%274%27%20y%3D%279%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%275%27%20y%3D%278%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%277%27%20y%3D%276%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%275%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%274%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%2710%27%20y%3D%273%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%2711%27%20y%3D%272%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%27%23eafff7%27%3E%3Crect%20x%3D%271%27%20y%3D%276%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%277%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%278%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%274%27%20y%3D%279%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%275%27%20y%3D%278%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%277%27%20y%3D%276%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%275%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%274%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%2710%27%20y%3D%273%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%2711%27%20y%3D%272%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / 90px auto no-repeat, linear-gradient(180deg, #2fae8fcc, #1f8f75aa); image-rendering: pixelated; box-shadow: inset 0 0 0 3px #7ff0c8aa, 0 0 14px #52d6b5; }

/* the small ticks over the stakes use the same pixel tick */
.ck { width: 30px; height: 26px; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2015%2013%27%20shape-rendering%3D%27crispEdges%27%3E%3Cg%20fill%3D%27%2306281f%27%3E%3Crect%20x%3D%270%27%20y%3D%275%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%271%27%20y%3D%276%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%277%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%278%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%274%27%20y%3D%277%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%275%27%20y%3D%276%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%275%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%277%27%20y%3D%274%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%273%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%272%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3Crect%20x%3D%2710%27%20y%3D%271%27%20width%3D%274%27%20height%3D%274%27%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%27%237ff0c8%27%3E%3Crect%20x%3D%271%27%20y%3D%276%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%277%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%278%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%274%27%20y%3D%279%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%275%27%20y%3D%278%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%277%27%20y%3D%276%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%275%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%274%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%2710%27%20y%3D%273%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3Crect%20x%3D%2711%27%20y%3D%272%27%20width%3D%272%27%20height%3D%272%27%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%27%23eafff7%27%3E%3Crect%20x%3D%271%27%20y%3D%276%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%272%27%20y%3D%277%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%273%27%20y%3D%278%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%274%27%20y%3D%279%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%275%27%20y%3D%278%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%276%27%20y%3D%277%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%277%27%20y%3D%276%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%278%27%20y%3D%275%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%279%27%20y%3D%274%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%2710%27%20y%3D%273%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3Crect%20x%3D%2711%27%20y%3D%272%27%20width%3D%271%27%20height%3D%271%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 2px 0 #0009); }
.ck svg { display: none; }

/* ---- padlock v4: larger, centred over the icon (the amount above and the name below stay readable); the shackle lifts and swings left to right on its hinge like a real padlock ---- */
.lk { width: 40px; height: 52px; }
.tki .lk { left: 50%; right: auto; top: -3px; margin-left: -20px; }
.lk .lks3 { fill: #6f7b8e; }
.lk .lks { transform-box: view-box; transform-origin: 14px 0; }
.arena[data-st="1"] .lk .lks { transform: translateY(-5px) scaleX(-1); animation: none; }
.arena[data-st="2"] .lk .lks { animation: lkClose .62s ease-in-out .1s both; }
.arena[data-st="2"] .lk .lkb { animation: lkClick .35s ease-out .62s both; }
.arena[data-st="3"] .lk .lks { transform: none; animation: none; }
.arena[data-st="4"] .lk .lks { animation: lkRelease .65s ease-in-out 1.35s both; }
@keyframes lkClose { 0% { transform: translateY(-5px) scaleX(-1); } 45% { transform: translateY(-5px) scaleX(1); } 62% { transform: translateY(-5px) scaleX(1); } 100% { transform: translateY(0) scaleX(1); } }
@keyframes lkRelease { 0% { transform: translateY(0) scaleX(1); } 22% { transform: translateY(-5px) scaleX(1); } 40% { transform: translateY(-5px) scaleX(1); } 100% { transform: translateY(-5px) scaleX(-1); } }

/* header: the brand and the connect button are matching framed buttons, 220 x 52, one in each sky's colour */
.top .brand, .top .btn { box-sizing: border-box; width: 220px; height: 52px; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 12px; border: 8px solid transparent; border-image-slice: 8 fill; border-image-width: 8px; border-image-repeat: stretch; background: none; box-shadow: none; text-shadow: 0 2px 0 #000a; }
.top .brand { border-image-source: url(/img/f-btnr-card.png?v=2); gap: 10px; font-size: 22px; color: #fff; }
.top .brand .mark, .top .brand img { width: 44px; height: 26px; filter: none; }
.top .btn { border-image-source: url(/img/f-btnl-card.png?v=2); justify-self: end; color: #fff; font-size: 13px; letter-spacing: .06em; }
.top .btn:hover { filter: brightness(1.15); } .top .btn:active { transform: translateY(2px); filter: brightness(.95); }
.top .btn, .nav nav a.btn { font-size: 16px; letter-spacing: .1em; }

/* ======== TEMPORARY: design variations switcher (remove when a direction is chosen) ======== */
html[data-v]:not([data-v="0"]) :is(.stepw .step, .hudin, .state, .live .stat, .sub, .top .brand, .top .btn) {
  border: 0 !important; border-image: none !important; box-shadow: inset 0 0 0 3px var(--fr), inset 0 0 0 5px var(--fr2) !important;
  background: var(--scan, none), linear-gradient(180deg, var(--f1), var(--f2)) !important; color: var(--tx, #fff);
  clip-path: polygon(0 6px, 3px 6px, 3px 3px, 6px 3px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 3px, calc(100% - 3px) 3px, calc(100% - 3px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 3px) calc(100% - 6px), calc(100% - 3px) calc(100% - 3px), calc(100% - 6px) calc(100% - 3px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 3px), 3px calc(100% - 3px), 3px calc(100% - 6px), 0 calc(100% - 6px)) !important;
}
html[data-v]:not([data-v="0"]) .step { padding: 8px 16px; } html[data-v]:not([data-v="0"]) .hudin { padding: 10px 18px 8px; }
html[data-v]:not([data-v="0"]) .state { padding: 8px 12px; } html[data-v]:not([data-v="0"]) .live .stat { padding: 6px 14px; } html[data-v]:not([data-v="0"]) .sub { padding: 8px 16px; }
html[data-v]:not([data-v="0"]) .hud::before { background: var(--f1); border: 0; box-shadow: inset 0 0 0 2px var(--fr); border-image: none; color: #fff; }
html[data-v]:not([data-v="0"]) .stepw .stx small { color: var(--fr); }
html[data-v]:not([data-v="0"]) .rail li { background: #ffffff14; }
/* bigger stage text in every variation */
html[data-v]:not([data-v="0"]) .wal .wn { font-size: 25px; } html[data-v]:not([data-v="0"]) .wal .wu { font-size: 12px; } html[data-v]:not([data-v="0"]) .tkg { font-size: 15px; height: 21px; }
html[data-v]:not([data-v="0"]) .arena .pl small { font-size: 12px; } html[data-v]:not([data-v="0"]) .arena .pl b { font-size: 18px; }
/* variations */
html[data-v]:not([data-v="0"]) :is(.stepw .step, .hudin, .state, .live .stat, .sub, .top .brand, .top .btn) { box-shadow: var(--bs, inset 0 0 0 3px var(--fr), inset 0 0 0 5px var(--fr2)) !important; background: var(--scan, none), var(--bgl, linear-gradient(180deg, var(--f1), var(--fm, color-mix(in srgb, var(--f1), var(--f2))), var(--f2))) !important; }
/* 1 quiet glass */
html[data-v="1"] { --fr: #ffffff55; --fr2: #ffffff14; --f1: #0a0c1ccc; --f2: #0a0c1caa; --scan: none; }
html[data-v="1"] .stage::before { background: linear-gradient(180deg, #0b1030aa 0%, #0b103033 30%, #0b103033 55%, #0b1030dd 100%); }
html[data-v="1"] .stepw .stx small { color: #ff8f97; }
/* 2 dithered: the current look, with every panel a dithered blend of the sky palette */
html[data-v="2"] { --fr: #ff5560; --fr2: #1a0f2c; --scan: none; }
html[data-v="2"] :is(.stepw .step, .hudin, .live .stat, .sub, .top .brand, .top .btn) { image-rendering: pixelated; }
html[data-v="2"] .stepw.s1 .step { --bgl: url(/img/dth-s1.png) 0 0 / 100% 100%; --fr: #8fd3c0; }
html[data-v="2"] .stepw.s2 .step { --bgl: url(/img/dth-s2.png) 0 0 / 100% 100%; --fr: #e49bc1; }
html[data-v="2"] .stepw.s3 .step { --bgl: url(/img/dth-s3.png) 0 0 / 100% 100%; --fr: #ffc98f; }
html[data-v="2"] .hudin { --bgl: url(/img/dth-log.png) 0 0 / 100% 100%; --fr: #d6b0e6; }
html[data-v="2"] .live .stat:nth-child(1) { --bgl: url(/img/dth-chipa.png) 0 0 / 100% 100%; --fr: #a8d28a; }
html[data-v="2"] .live .stat:nth-child(2) { --bgl: url(/img/dth-chipb.png) 0 0 / 100% 100%; --fr: #e49bc1; }
html[data-v="2"] .sub { --bgl: url(/img/dth-sub.png) 0 0 / 100% 100%; --fr: #ff8f97; }
html[data-v="2"] .top .brand { --bgl: url(/img/dth-brand.png) 0 0 / 100% 100%; --fr: #e49bc1; }
html[data-v="2"] .top .btn { --bgl: url(/img/dth-btn.png) 0 0 / 100% 100%; --fr: #8fd3e8; }
html[data-v="2"] .state { --f1: #4d2145; --f2: #2d1741; --fr: #ff8f97; }
html[data-v="2"] .stepw.s1 .stx small { color: #b9ecd8; } html[data-v="2"] .stepw.s2 .stx small { color: #f3b6d2; } html[data-v="2"] .stepw.s3 .stx small { color: #ffdcb4; }

/* golden padlock */
.lk .lkd { fill: #2e1b05; } .lk .lkm { fill: #e0a936; } .lk .lkh { fill: #fff2b8; } .lk .lks3 { fill: #a06c1a; }
.lk .lkg { fill: #f1b830; } .lk .lkl { fill: #ffe38e; } .lk .lkw { fill: #fffbe0; } .lk .lks2 { fill: #c4861a; } .lk .lkx { fill: #8a5410; }
.lk { filter: drop-shadow(0 2px 0 #0009) drop-shadow(0 0 6px #f1b83066); }
html[data-v]:not([data-v="0"]) .hud::before { top: -16px; height: 26px; line-height: 26px; padding: 0; }
html[data-v]:not([data-v="0"]) .hudin { padding-top: 14px; }
html[data-v]:not([data-v="0"]):not([data-v="4"]) .rail li { color: #d9d3f5; }

/* padlock v5: round-shouldered body; the shackle is hinged on its left leg (which stays in the body) and only the right leg has an opening, so it lifts and swings out to the left */
.lk .lks { transform-origin: 5.5px 0; }
.arena[data-st="1"] .lk .lks { transform: translateY(-5px) scaleX(-1); }
@keyframes lkClose { 0% { transform: translateY(-5px) scaleX(-1); } 45% { transform: translateY(-5px) scaleX(1); } 62% { transform: translateY(-5px) scaleX(1); } 100% { transform: translateY(0) scaleX(1); } }

/* the entrance is a slow, swooping flight: sideways drift and a looping rise-and-fall run on separate curves, while the card grows from a speck as it floats in from the castle door or the broken tower's window */
@property --ax { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --ay { syntax: "<length>"; inherits: false; initial-value: 0px; }
.arena.portal { translate: var(--ax) var(--ay); animation: portalX 2.8s cubic-bezier(.45,.05,.3,1) both, portalY 2.8s linear both, portalS 2.8s cubic-bezier(.3,.1,.25,1) both, portalA 2.8s linear both; }
@keyframes portalX { from { --ax: var(--dx); } to { --ax: 0px; } }
@keyframes portalY { 0% { --ay: var(--dy); animation-timing-function: cubic-bezier(.2,.7,.4,1); } 38% { --ay: calc(var(--dy) * .15 - 150px); animation-timing-function: cubic-bezier(.5,0,.6,1); } 78% { --ay: 14px; animation-timing-function: ease-out; } 100% { --ay: 0px; } }
@keyframes portalS { from { scale: .03; } to { scale: 1; } }
@keyframes portalA { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 1; } }

/* the hinge is the right leg; the opening is on the left, so the shackle swings out to the right */
.lk .lks { transform-origin: 14px 0; }

/* the castle's trade: down the winding path (small, drifting), then a wide swoop across into place */
.arena.portal.pl-left { animation: portalXL 4.6s linear both, portalYL 4.6s linear both, portalSL 4.6s linear both, portalAL 4.6s linear both; }
@keyframes portalXL { 0% { --ax: var(--dx); } 7% { --ax: var(--w1x); } 12% { --ax: var(--w2x); } 24% { --ax: var(--w3x); } 32% { --ax: var(--w4x); } 42% { --ax: var(--w5x); } 52% { --ax: var(--w6x); animation-timing-function: cubic-bezier(.5,0,.3,1); } 100% { --ax: 0px; } }
@keyframes portalYL { 0% { --ay: var(--dy); } 7% { --ay: var(--w1y); } 12% { --ay: var(--w2y); } 24% { --ay: var(--w3y); } 32% { --ay: var(--w4y); } 42% { --ay: var(--w5y); } 52% { --ay: var(--w6y); animation-timing-function: cubic-bezier(.2,.7,.4,1); } 76% { --ay: calc(var(--w6y) * .35 - 80px); animation-timing-function: cubic-bezier(.5,0,.6,1); } 92% { --ay: 12px; animation-timing-function: ease-out; } 100% { --ay: 0px; } }
@keyframes portalSL { 0% { scale: .03; } 52% { scale: .12; animation-timing-function: cubic-bezier(.3,.1,.25,1); } 100% { scale: 1; } }
@keyframes portalAL { 0% { opacity: 0; } 5% { opacity: 1; } 100% { opacity: 1; } }
html[data-v="2"] .hud::before { background: #3a1a3d; box-shadow: inset 0 0 0 2px #ff8f97; }

/* ---- padlock v6: a real 3D swing. The shackle is its own element in a perspective box: it lifts out of the body, then turns about the vertical axis of its right (hinge) leg, so the free leg swings out toward you and round to the far side, foreshortening as it goes; closing reverses it ---- */
span.lk { position: absolute; display: none; width: 40px; height: 52px; perspective: 150px; perspective-origin: 30% 30%; filter: drop-shadow(0 2px 0 #0009) drop-shadow(0 0 6px #f1b83066); overflow: visible; }
.tki span.lk { left: 50%; right: auto; top: -3px; margin-left: -20px; }
.arena[data-st="2"] span.lk, .arena[data-st="3"] span.lk, .arena[data-st="4"] span.lk, .arena[data-st="1"] span.lk { display: block; }
span.lk > svg { position: absolute; left: 0; top: 0; width: 40px; height: 52px; overflow: visible; }
span.lk .lks { transform-origin: 28px 0; backface-visibility: visible; }
.arena[data-st="1"] span.lk .lks { transform: translateY(-9px) rotateY(180deg); animation: none; }
.arena[data-st="2"] span.lk .lks { animation: lkClose3 .9s cubic-bezier(.4,0,.3,1) .1s both; }
.arena[data-st="3"] span.lk .lks { transform: none; animation: none; }
.arena[data-st="4"] span.lk .lks { animation: lkRelease3 .95s cubic-bezier(.4,0,.3,1) 1.35s both; }
.arena[data-st="2"] span.lk .lkb { animation: lkClick .35s ease-out .95s both; }
@keyframes lkClose3 { 0% { transform: translateY(-9px) rotateY(180deg); filter: brightness(1); } 50% { transform: translateY(-9px) rotateY(90deg); filter: brightness(.7); } 72% { transform: translateY(-9px) rotateY(0deg); filter: brightness(1); } 100% { transform: translateY(0) rotateY(0deg); filter: brightness(1); } }
@keyframes lkRelease3 { 0% { transform: translateY(0) rotateY(0deg); filter: brightness(1); } 24% { transform: translateY(-9px) rotateY(0deg); filter: brightness(1); } 62% { transform: translateY(-9px) rotateY(90deg); filter: brightness(.7); } 100% { transform: translateY(-9px) rotateY(180deg); filter: brightness(1); } }

/* padlock: one clean pixel lock, shackle swings on its long leg (no mirroring) */
.lk2 { position: absolute; right: -10px; bottom: -8px; z-index: 4; display: none; width: 24px; height: 30px; overflow: visible; filter: drop-shadow(1px 0 0 #2e1b05) drop-shadow(-1px 0 0 #2e1b05) drop-shadow(0 1px 0 #2e1b05) drop-shadow(0 -1px 0 #2e1b05) drop-shadow(0 3px 3px #0008); }
.lk2 svg { position: absolute; left: 0; top: 0; width: 24px; height: 30px; overflow: visible; }
.lk2 .a { fill: #e0a936; } .lk2 .h { fill: #ffe38e; } .lk2 .s { fill: #a06c1a; } .lk2 .m { fill: #f1b830; } .lk2 .k { fill: #2e1b05; }
.lk2 .m ~ .h { fill: #ffe38e; }
.lk2b .s { fill: #c4861a; }
.lk2s { transform-origin: 18px 16px; }
.arena[data-st="1"] .lk2, .arena[data-st="2"] .lk2, .arena[data-st="3"] .lk2, .arena[data-st="4"] .lk2 { display: block; }
.arena[data-st="1"] .lk2 { animation: lk2In .3s ease-out 1.05s both; }
.arena[data-st="1"] .lk2s { transform: translateY(-6px) rotate(32deg); }
.arena[data-st="2"] .lk2s { animation: lk2Close .6s ease-in-out .1s both; }
.arena[data-st="2"] .lk2b { animation: lkClick .35s ease-out .6s both; }
.arena[data-st="3"] .lk2s { transform: none; }
.arena[data-st="4"] .lk2s { animation: lk2Open .5s ease-in-out 1.2s both; }
.arena[data-st="4"] .lk2 { animation: lk2Out .5s ease-in 1.85s both; }
@keyframes lk2In { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
@keyframes lk2Close { 0% { transform: translateY(-6px) rotate(32deg); } 50% { transform: translateY(-6px) rotate(0); } 100% { transform: none; } }
@keyframes lk2Open { 0% { transform: none; } 50% { transform: translateY(-6px) rotate(0); } 100% { transform: translateY(-6px) rotate(32deg); } }
@keyframes lk2Out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-8px) scale(.6); } }

/* padlock v3: frames generated in Google Flow (true 3D turn), played as a sprite strip */
.lk2 { width: 40px; height: 44px; right: -24px; bottom: -10px; background: url(/img/f-lock3-strip.png?v=3) 0 0 / 280px 44px no-repeat; filter: drop-shadow(0 3px 3px #0008); }
.lk2 svg { display: none; }
.arena[data-st="1"] .lk2s, .arena[data-st="2"] .lk2s, .arena[data-st="4"] .lk2s { animation: none; transform: none; }
.arena[data-st="1"] .lk2 { background-position: 0 0; }
.arena[data-st="2"] .lk2 { animation: lk2Play 1.3s steps(6) .15s both; }
.arena[data-st="3"] .lk2 { background-position: -240px 0; animation: none; }
.arena[data-st="4"] .lk2 { background-position: -240px 0; animation: lk2Play .9s steps(6) 1s reverse both, lk2Out .35s ease-in 1.9s both; }
@keyframes lk2Play { from { background-position: 0 0; } to { background-position: -240px 0; } }

/* ======== walking-scene choreography: players come out of the two doors, meet on the bridge, the window folds open ======== */
.stage > .world { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; display: none; }
.stage.walk > .world { display: block; }
.wr { position: absolute; inset: 0; --u: 1; }
.wr .door { position: absolute; left: 74.2%; top: 62.6%; width: 5.4%; height: auto; transform: translate(-50%, -100%); image-rendering: pixelated; }
.wk { position: absolute; width: 0; height: 0; transform-origin: 0 0; transform: scale(calc(var(--s, 1) * var(--u, 1) * 1)) scaleX(var(--f, 1)); filter: drop-shadow(0 2px 0 #0009); }
.wk::after { content: ""; position: absolute; left: -15px; top: -3px; width: 30px; height: 7px; border-radius: 50%; background: radial-gradient(ellipse at center, #000a 0, #0000 70%); }
.wki { filter: saturate(1.2) brightness(1.12); position: absolute; left: 0; bottom: 0; display: block; background-repeat: no-repeat; image-rendering: pixelated; }
.wki.emerge { animation: emerge 1.4s linear both; }
.wki.leave { animation: emerge 1s ease-in reverse both; }
@keyframes emerge {
  0% { opacity: 0; filter: brightness(0) invert(1) sepia(1) saturate(3.5) brightness(1.3); }
  30% { opacity: 1; filter: brightness(0) invert(1) sepia(1) saturate(3.5) brightness(1.3); }
  62% { opacity: 1; filter: brightness(0) invert(0) sepia(0) saturate(1) brightness(1); }
  100% { opacity: 1; filter: brightness(1) invert(0) sepia(0) saturate(1) brightness(1); }
}
.wk.hop .wki { animation: wkhop .4s cubic-bezier(.3,.7,.4,1) 3; }
@keyframes wkhop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-16px); } }
.flare { position: absolute; width: 50px; height: 50px; margin: -34px 0 0 -25px; border-radius: 50%; scale: var(--u, 1); background: radial-gradient(circle, #fffbd0 0, #ffd23f 32%, #ffb02e66 58%, #0000 72%); animation: flareA 1.5s ease-out both; }
.flare.r { background: radial-gradient(circle, #fff0c8 0, #ff9a3c 34%, #ff5a2a55 60%, #0000 72%); }
@keyframes flareA { 0% { opacity: 0; transform: scale(.3); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.7); } }
/* the trade window folds open from its middle, left and right, and folds shut again */
.arena.folded { animation: none; scale: .05; opacity: 0; }
.arena.unfold { animation: unfold .95s cubic-bezier(.3, .8, .3, 1) both; }
.arena.foldout { animation: foldout .7s ease-in both; }
@keyframes unfold { 0% { scale: .05; opacity: 0; } 15% { opacity: 1; } 100% { scale: 1; opacity: 1; } }
@keyframes foldout { 0% { scale: 1; opacity: 1; } 75% { opacity: 1; } 100% { scale: .05; opacity: 0; } }
/* a gap under the window, where the players stand on the bridge */
.win .hud { margin-top: 78px; }
/* the player plates show a portrait cut from the character's own walk strip */
.arena .pl .badge { position: relative; display: block; width: 64px; height: 64px; padding: 0; margin: 4px 0 0; overflow: hidden; background: #120d26; border-radius: 3px; box-shadow: 0 0 0 3px #120d26, 0 0 0 5px var(--pc); }
.arena .pl .badge::after { content: none; }
.arena .pl .badge i { position: absolute; inset: 0; background: var(--pt) center / 100% 100% no-repeat; image-rendering: pixelated; }

/* one rule per character: its walk strip and portrait, and the size of one frame in sprite pixels (set here, not inline, because the CSP forbids style attributes) */
.c-kn { --sp: url(/img/f-kn-strip.png?v=11); --pt: url(/img/f-pkn-ico.png?v=2); --cw: 46; --ch: 56; }
.wki.c-kn { width: 46px; height: 56px; margin-left: -23px; background-image: var(--sp); }
.c-wz { --sp: url(/img/f-wz-strip.png?v=11); --pt: url(/img/f-pwz-ico.png?v=2); --cw: 40; --ch: 56; }
.wki.c-wz { width: 40px; height: 56px; margin-left: -20px; background-image: var(--sp); }
.c-rg { --sp: url(/img/f-rg-strip.png?v=11); --pt: url(/img/f-prg-ico.png?v=2); --cw: 38; --ch: 56; }
.wki.c-rg { width: 38px; height: 56px; margin-left: -19px; background-image: var(--sp); }
.c-cl { --sp: url(/img/f-cl-strip.png?v=11); --pt: url(/img/f-pcl-ico.png?v=2); --cw: 40; --ch: 56; }
.wki.c-cl { width: 40px; height: 56px; margin-left: -20px; background-image: var(--sp); }
.c-sc { --sp: url(/img/f-sc-strip.png?v=11); --pt: url(/img/f-psc-ico.png?v=2); --cw: 37; --ch: 56; }
.wki.c-sc { width: 37px; height: 56px; margin-left: -18.5px; background-image: var(--sp); }
.c-cy { --sp: url(/img/f-cy-strip.png?v=11); --pt: url(/img/f-pcy-ico.png?v=2); --cw: 37; --ch: 56; }
.wki.c-cy { width: 37px; height: 56px; margin-left: -18.5px; background-image: var(--sp); }
.c-rd { --sp: url(/img/f-rd-strip.png?v=11); --pt: url(/img/f-prd-ico.png?v=2); --cw: 34; --ch: 56; }
.wki.c-rd { width: 34px; height: 56px; margin-left: -17px; background-image: var(--sp); }
.c-en { --sp: url(/img/f-en-strip.png?v=11); --pt: url(/img/f-pen-ico.png?v=2); --cw: 35; --ch: 56; }
.wki.c-en { width: 35px; height: 56px; margin-left: -17.5px; background-image: var(--sp); }
/* the bridge's rope and front posts sit over the players; the rest of the bridge is the background art behind them */
.wr .flare { z-index: 3; }

/* ======== frames: every panel, plate and button wears a frame drawn in Gemini from the hero's own style (9-slice border-images) ======== */
html[data-v="2"][data-v][data-v][data-v] .stepw.s1 .step { border-style: solid !important; border-color: transparent !important; border-width: 12px !important; border-image: url(/img/f-s1-frame.png) 50 / 12px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .stepw.s2 .step { border-style: solid !important; border-color: transparent !important; border-width: 12px !important; border-image: url(/img/f-s2-frame.png) 50 / 12px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .stepw.s3 .step { border-style: solid !important; border-color: transparent !important; border-width: 12px !important; border-image: url(/img/f-s3-frame.png) 50 / 12px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .stepw .step { padding: 0 8px !important; }
html[data-v="2"][data-v][data-v][data-v] .stepw .slot { width: 78px !important; height: 64px !important; flex: none !important; background: none !important; border: 0 !important; box-shadow: none !important; clip-path: none !important; display: grid !important; place-items: center; }
html[data-v="2"][data-v][data-v][data-v] .stepw .tile { width: auto !important; height: 60px !important; max-width: 76px; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 2px 0 #0008); }
html[data-v="2"][data-v][data-v][data-v] .hudin { border-style: solid !important; border-color: transparent !important; border-width: 14px !important; border-image: url(/img/f-lcard-frame.png) 40 / 14px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .hudin { padding: 4px 10px 2px !important; }
html[data-v="2"][data-v][data-v][data-v] .sub { border-style: solid !important; border-color: transparent !important; border-width: 11px !important; border-image: url(/img/f-lcard-frame.png) 40 / 11px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .sub { padding: 2px 8px !important; }
html[data-v="2"][data-v][data-v][data-v] .state { border-style: solid !important; border-color: transparent !important; border-width: 9px !important; border-image: url(/img/f-ttab-frame.png) 45 / 9px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .state { padding: 3px 8px !important; }
html[data-v="2"][data-v][data-v][data-v] .live .stat:nth-child(1) { border-style: solid !important; border-color: transparent !important; border-width: 9px !important; border-image: url(/img/f-bt1-frame.png) 40 / 9px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .live .stat:nth-child(2) { border-style: solid !important; border-color: transparent !important; border-width: 9px !important; border-image: url(/img/f-bt2-frame.png) 40 / 9px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .live .stat { padding: 0 6px !important; }
html[data-v="2"][data-v][data-v][data-v] .top .brand { border-style: solid !important; border-color: transparent !important; border-width: 11px !important; border-image: url(/img/f-bt2-frame.png) 40 / 11px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v] .top .btn { border-style: solid !important; border-color: transparent !important; border-width: 11px !important; border-image: url(/img/f-bt1-frame.png) 40 / 11px stretch !important; clip-path: none !important; box-shadow: none !important; background-clip: padding-box !important; image-rendering: pixelated; }
/* the Trade log tab */
html[data-v="2"] .hud::before { background: none !important; border: solid transparent !important; border-width: 10px !important; border-image: url(/img/f-ttab-frame.png) 45 / 10px stretch !important; box-shadow: none !important; box-sizing: border-box; width: 158px; height: 44px; top: -28px; font-size: 13px; letter-spacing: .1em; image-rendering: pixelated; color: #fff; text-shadow: 0 2px 0 #000a; }
/* the trade window keeps the long dithered stage card; players sit on dithered plum / blue plates with their portrait */
html[data-v="2"] .arena::before { background: url(/img/f-seam-card.png?v=23) 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
html[data-v="2"] .arena .pl .badge { position: relative; width: 66px; height: 66px; margin: 4px 0 0; overflow: hidden; background: #120d26; box-shadow: 0 0 0 3px #120d26, 0 0 0 5px var(--pc); border-radius: 0; }
/* confirm: two checks at a time. Player 1 and the trade in game A tick together, then Player 2 and the trade in game B */
.arena[data-st="3"] .pl.pl1::after { animation: plIn .6s ease-out .1s both; }
.arena[data-st="3"] .gp.a .ck { animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) .1s both; }
.arena[data-st="3"] .gp.a .ckl { animation: ckLab .4s ease-out .3s both; }
.arena[data-st="3"] .pl.pl2::after { animation: plIn .6s ease-out 1.1s both; }
.arena[data-st="3"] .gp.b .ck { animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) 1.1s both; }
.arena[data-st="3"] .gp.b .ckl { animation: ckLab .4s ease-out 1.3s both; }
/* the confirm ticks use the drawn check from the same kit */
html[data-v="2"] .ck { width: 32px; height: 28px; background: url(/img/f-ck-ico.png) center / contain no-repeat; }
html[data-v="2"] .arena .pl::after { background: url(/img/f-ck-ico.png) center / 64px auto no-repeat, linear-gradient(180deg, #2fae8fcc, #1f8f75aa) !important; box-shadow: none; }
/* Player 2 stands on the right: turn the portrait toward the middle */
html[data-v="2"] .arena .pl.pl2 .badge i { transform: scaleX(-1); }

.wr .bback, .wr .bfront { position: absolute; left: 35.9%; top: 61.5%; width: 28.95%; height: auto; pointer-events: none; }
.wr .bback { z-index: 1; } .wr .bfront { z-index: 5; }
.wr .wk { z-index: 2; }
.wr .flare { z-index: 3; }
.stage { background: #0d0a1a; }
/* lift the trade window clear of the players on the bridge */
.arena { translate: 0 -34px; }
html[data-v="2"] .hud::before { display: grid; place-items: center; padding: 0 !important; line-height: 1 !important; height: 38px; top: -24px; }



/* ======== one recurring window frame (frame.js builds it from the trade card's own border at each window's real size) ======== */
html[data-v="2"][data-v][data-v][data-v][data-v] .fr.fr.fr { box-sizing: border-box; border: 12px solid transparent !important; border-image: none !important; background-color: transparent !important; background-repeat: no-repeat !important; background-size: 100% 100% !important; background-origin: border-box !important; background-clip: border-box !important; box-shadow: none !important; clip-path: none !important; image-rendering: pixelated; color: #fff3f0; text-shadow: 0 2px 0 #000a; }
html[data-v="2"][data-v][data-v][data-v][data-v] .hud::before { display: none !important; }
/* header: one font, one size, framed buttons, live numbers on the right */
.top { grid-template-columns: auto 1fr auto; gap: 20px; }
.topnav { font: 600 16px/1 var(--px); letter-spacing: .06em; gap: clamp(18px, 2.6vw, 38px); }
.topnav a { color: #fff3f0; padding: 8px 0; text-shadow: 0 2px 0 #000a; }
.topr { display: flex; align-items: center; gap: 12px; justify-self: end; }
.topr .live { display: flex; gap: 12px; margin: 0; }
html[data-v="2"][data-v][data-v][data-v][data-v] .top .brand, html[data-v="2"][data-v][data-v][data-v][data-v] .top .btn { width: auto; min-width: 150px; height: 52px; padding: 0 14px; font: 700 16px/1 var(--px); letter-spacing: .08em; text-transform: none; margin: 0; }
html[data-v="2"][data-v][data-v][data-v][data-v] .top .brand { font-size: 22px; letter-spacing: .02em; }
html[data-v="2"][data-v][data-v][data-v][data-v] .top .btn { text-transform: none; }
html[data-v="2"][data-v][data-v][data-v][data-v] .live .stat { height: 52px; padding: 0 12px; font: 600 13px/1 var(--px); letter-spacing: .06em; text-transform: none; display: inline-flex; align-items: center; gap: 8px; }
.live .stat img { height: 20px; width: auto; }
.live .stat b { font: 700 16px/1 var(--px); color: #ffd7a3; margin-right: 2px; }
/* tagline */
html[data-v="2"][data-v][data-v][data-v][data-v] .hero .sub { padding: 6px 14px; font: 500 clamp(13px, 1.3vw, 17px)/1.35 var(--px); }
/* steps */
html[data-v="2"][data-v][data-v][data-v][data-v] .stepw .step { padding: 8px 12px; }
/* trade log: a tab on the frame, the four stages as one connected line, then the state and the caption */
html[data-v="2"][data-v][data-v][data-v][data-v] .hudtab { position: absolute; left: 32px; top: -26px; z-index: 3; width: 150px; height: 44px; padding: 0; display: grid; place-items: center; font: 700 13px/1 var(--px); letter-spacing: .14em; text-transform: none; color: #ffd7a3; }
html[data-v="2"][data-v][data-v][data-v][data-v] .hudin { padding: 14px 18px 12px; }
html[data-v="2"][data-v][data-v][data-v][data-v] .rail { margin: 0 0 10px; padding: 0 0 10px; border-bottom: 3px dotted #ffffff30; gap: 0; }
html[data-v="2"][data-v][data-v][data-v][data-v] .rail li { position: relative; height: 24px; margin: 0; background: none; clip-path: none; display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 14px/1 var(--px); letter-spacing: .12em; color: #a99bc2; text-shadow: 0 2px 0 #000a; }
html[data-v="2"][data-v][data-v][data-v][data-v] .rail li:not(:last-child)::after { content: ""; position: absolute; left: 74%; width: 24%; top: 50%; border-top: 3px dotted #ffffff40; }
html[data-v="2"][data-v][data-v][data-v][data-v] :is([data-stage="1"] .s1, [data-stage="2"] :is(.s1, .s2), [data-stage="3"] :is(.s1, .s2, .s3), [data-stage="4"] .rail li) { color: #9ff3d9; background: none; }
html[data-v="2"][data-v][data-v][data-v][data-v] :is([data-stage="1"] .s1, [data-stage="2"] :is(.s1, .s2), [data-stage="3"] :is(.s1, .s2, .s3), [data-stage="4"] .rail li)::before { content: ""; width: 18px; height: 16px; background: url(/img/f-ck-ico.png) center / contain no-repeat; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v][data-v] :is([data-stage="2"] .s1, [data-stage="3"] :is(.s1, .s2), [data-stage="4"] .rail li:not(:last-child))::after { border-top-color: #9ff3d9aa; }
html[data-v="2"][data-v][data-v][data-v][data-v] .log { gap: 14px; }
html[data-v="2"][data-v][data-v][data-v][data-v] .state { border: 0 !important; border-image: none !important; background: #00000055 !important; box-shadow: inset 0 0 0 3px #ffffff2e !important; padding: 8px 14px 7px !important; min-width: 112px; font: 700 14px/1 var(--px); letter-spacing: .1em; text-transform: none; color: #ffd7a3; }
html[data-v="2"][data-v][data-v][data-v][data-v] [data-stage="4"] .state { color: #9ff3d9; }
html[data-v="2"][data-v][data-v][data-v][data-v] .cap { font: 500 15px/1.3 var(--body); color: #f4eefc; text-shadow: 0 2px 0 #000a; }
/* intro copy */

html[data-v="2"][data-v][data-v][data-v][data-v] .rail li { font-size: 15px; letter-spacing: .06em; }
html[data-v="2"][data-v][data-v][data-v][data-v] .live .stat, html[data-v="2"][data-v][data-v][data-v][data-v] .hudtab, html[data-v="2"][data-v][data-v][data-v][data-v] .state { text-transform: none; font-size: 15px; letter-spacing: .04em; }
/* small header and log text: the pixel face turns c into o at this size, so these use the body face */
html[data-v="2"][data-v][data-v][data-v][data-v] :is(.topnav a, .top .btn, .live .stat, .live .stat b, .rail li, .hudtab, .state) { font-family: var(--body); font-weight: 700; letter-spacing: .03em; text-transform: none; }
.topnav a { font-size: 16px; font-weight: 700; font-family: var(--body); letter-spacing: .03em; }
/* done: both locks unlatch and go before the stakes fly to the player cards */

/* doors: the player steps out of the dark doorway into the light (edge-lit by the door), and slips back into it on the way home */
.wki.emerge { animation: doorOut 1.5s ease-out both; }
.wki.leave { animation: doorOut .9s ease-in reverse both; }
@keyframes doorOut {
  0% { opacity: 0; filter: brightness(0) drop-shadow(0 0 5px var(--dl, #ffd060)); }
  18% { opacity: 1; filter: brightness(0) drop-shadow(0 0 6px var(--dl, #ffd060)); }
  60% { opacity: 1; filter: brightness(.35) saturate(1.2) drop-shadow(0 0 4px var(--dl, #ffd060)); }
  100% { opacity: 1; filter: saturate(1.2) brightness(1.12) drop-shadow(0 0 0 transparent); }
}
/* the page ships with a finished example trade for phones and no-script; on the walking scene it stays hidden until the scene takes over */
@media (min-width: 801px) and (prefers-reduced-motion: no-preference) { .stage:not(.ready) #ticket .deck, .stage:not(.ready) #ticket .hud { visibility: hidden; } }
/* confirm: each player checks the other player's side, and both check together */
.arena[data-st="3"] .pl.pl1::after, .arena[data-st="3"] .pl.pl2::after { animation: plIn .6s ease-out .1s both; }
.arena[data-st="3"] .gp.a .ck, .arena[data-st="3"] .gp.b .ck { animation: ckPop .55s cubic-bezier(.3,1.8,.5,1) .1s both; }
.arena[data-st="3"] .gp.a .ckl, .arena[data-st="3"] .gp.b .ckl { animation: ckLab .4s ease-out .3s both; }
/* confirm: the left player checks the bottom item, both together; then the right player and the top item, together */
.arena[data-st="3"] .pl.pl1::after, .arena[data-st="3"] .gp.b .ck { animation-delay: .1s; }
.arena[data-st="3"] .gp.b .ckl { animation-delay: .3s; }
.arena[data-st="3"] .pl.pl2::after, .arena[data-st="3"] .gp.a .ck { animation-delay: 1.1s; }
.arena[data-st="3"] .gp.a .ckl { animation-delay: 1.3s; }

/* the trade bubble over the two players: pops in with a pixel tail, then swells away as the window opens out of it */
.bub { position: fixed; z-index: 30; width: 88px; height: 76px; margin: -76px 0 0 -44px; display: grid; place-items: center; pointer-events: none; animation: bubIn .5s cubic-bezier(.3, 1.7, .5, 1) both; transform-origin: 50% 100%; }
.bub img { width: 38px; height: auto; image-rendering: pixelated; position: relative; z-index: 1; }
.bub::after { content: ""; position: absolute; left: 50%; top: 100%; margin: -3px 0 0 -9px; width: 18px; height: 9px; background: linear-gradient(#3c2552, #3c2552) 0 0 / 18px 3px no-repeat, linear-gradient(#3c2552, #3c2552) 3px 3px / 12px 3px no-repeat, linear-gradient(#3c2552, #3c2552) 6px 6px / 6px 3px no-repeat; }
.bub.pop { animation: bubPop .6s ease-in both; }
@keyframes bubIn { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bubPop { from { transform: scale(1); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* each player checks the bubble, then it opens into the window */
.pck { position: fixed; z-index: 31; width: 32px; height: 28px; margin: -28px 0 0 -16px; background: url(/img/f-ck-ico.png) center / contain no-repeat; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(0 2px 0 #0009); animation: ckPop .55s cubic-bezier(.3, 1.8, .5, 1) both; }
.pck.out { animation: none; opacity: 0; transition: opacity .4s ease; }

/* live numbers: two small bubbles under the Connect button */
.topr { flex-direction: column; align-items: flex-end; gap: 7px; }
.topr .btn { order: 1; } .topr .live { order: 2; gap: 8px; }
html[data-v="2"][data-v][data-v][data-v][data-v] .live .stat[data-fb] { height: 30px; padding: 0 8px; border-width: 8px !important; font-size: 12px; gap: 6px; }
html[data-v="2"][data-v][data-v][data-v][data-v] .live .stat[data-fb] b { font-size: 13px; }
.live .stat[data-fb] img { height: 14px; }
.top { align-items: start; }
.topnav { padding-top: 18px; }
/* the second game's row is not dimmed while the offer is open, so it has nothing to wake from */
.arena[data-st="0"] .gp.b { opacity: 1; filter: none; }
.arena[data-st="1"] .gp.b { animation: none; }

/* the middle of each lane is the xtrade server: always there, tokens pass into it and out of it, and it says what it is doing */
html[data-v="2"][data-v][data-v][data-v][data-v] .arena .esc.fr[data-fb] { opacity: 1 !important; animation: none !important; z-index: 6; width: 98px; height: 34px; margin: -17px 0 0 -49px; border-width: 8px !important; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 0; box-shadow: none !important; }
.arena .esc img { width: 16px; height: 16px; }
.arena .esc b { font: 700 12px/1 var(--body); letter-spacing: .04em; color: #fff3f0; text-shadow: 0 2px 0 #000a; }
.arena .esc::after { content: "standing by"; position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; font: 700 10px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: #ffe2a8; text-shadow: 0 1px 0 #000, 0 0 6px #000; }
.arena[data-st="1"] .esc::after { content: "relaying the offer"; }
.arena[data-st="2"] .esc::after { content: "holding both stakes"; }
.arena[data-st="3"] .esc::after { content: "confirming with both games"; }
.arena[data-st="4"] .esc::after { content: "settled"; color: #9ff3d9; }
.arena .tk, .arena .wal { z-index: 3; }
html[data-v="2"][data-v][data-v][data-v][data-v] .arena .esc.fr[data-fb] { width: 120px; height: 42px; margin: -21px 0 0 -60px; }
.arena .esc img { width: 20px; height: 20px; }
.arena .esc b { font-size: 15px; }
.arena .esc::after { font-size: 11px; top: calc(100% + 7px); }
/* confirm: the left player checks, then the right player, then xtrade in the middle, then the trade completes */
.arena[data-st="3"] .gp .ck, .arena[data-st="3"] .gp .ckl { display: none; }
.arena[data-st="3"] .pl.pl1::after { animation: plIn .6s ease-out .1s both; }
.arena[data-st="3"] .pl.pl2::after { animation: plIn .6s ease-out 1s both; }
.arena .esc::before { content: ""; position: absolute; right: -12px; top: -16px; width: 30px; height: 26px; z-index: 3; background: url(/img/f-ck-ico.png) center / contain no-repeat; image-rendering: pixelated; opacity: 0; transform: scale(0); pointer-events: none; filter: drop-shadow(0 2px 0 #0009); }
.arena[data-st="3"] .esc::before { animation: ckPop .55s cubic-bezier(.3, 1.8, .5, 1) 1.9s both; }
.arena[data-st="4"] .esc::before { opacity: 1; transform: none; }
/* Connect, games online and trades done stack in one column */
.topr .live { flex-direction: column; align-items: flex-end; gap: 6px; }
/* the frames now hold the hero's bright sky, so the small text on them needs more light */
html[data-v="2"][data-v][data-v][data-v][data-v] .rail li { color: #f3ead9; text-shadow: 0 2px 0 #000b, 0 0 6px #0008; }
html[data-v="2"][data-v][data-v][data-v][data-v] :is([data-stage="1"] .s1, [data-stage="2"] :is(.s1, .s2), [data-stage="3"] :is(.s1, .s2, .s3), [data-stage="4"] .rail li) { color: #fff6b8; }
html[data-v="2"][data-v][data-v][data-v][data-v] .state { color: #fff6b8; background: #0000004d !important; }
html[data-v="2"][data-v][data-v][data-v][data-v] [data-stage="4"] .state { color: #fff6b8; }
html[data-v="2"][data-v][data-v][data-v][data-v] .live .stat b { color: #fff6b8; }
.arena .esc::after { color: #fff3c4; }

/* the title: one element that loads zoomed in (hero.js) and zooms back. Hidden until it has been placed so the page never shows it small first. */
.hero { position: relative; z-index: 6; }
.hero h1 { white-space: nowrap; }
.zoom .hero { visibility: hidden; will-change: transform; animation: heroShow 0s 2.5s forwards; }
.zoom.zoom-ready .hero { visibility: visible; animation: none; }
@keyframes heroShow { to { visibility: visible; } }

/* trade log tab: centred on the log. The trade card sits a touch higher. */
html[data-v="2"][data-v][data-v][data-v][data-v] .hudtab { left: 50%; margin-left: -75px; }
.arena { translate: 0 -48px; }
/* the trade card's backdrop and the two player plates are drawn from the same panel as every other window (frame.js) */
html[data-v="2"][data-v][data-v][data-v][data-v] .arena::before { background: var(--cardbg, url(/img/f-seam-card.png?v=23)) 0 0 / 100% 100% no-repeat !important; image-rendering: pixelated; }
html[data-v="2"][data-v][data-v][data-v][data-v] .arena .pl.fr { padding: 10px 6px; gap: 6px; align-self: stretch; margin: 0; }
html[data-v="2"][data-v][data-v][data-v][data-v] .arena .pl.fr .badge { width: 66px; height: 66px; }
html[data-v="2"][data-v][data-v][data-v][data-v] .arena .pl.fr small { max-width: 80px; color: #fff3c4; text-shadow: 0 2px 0 #000b; }
html[data-v="2"][data-v][data-v][data-v][data-v] .arena .pl.fr b { color: #fff6e0; }

/* trade log: the label lives inside the window, as the first cell of the stage row, so nothing hangs out over the trade card */
html[data-v="2"][data-v][data-v][data-v][data-v] .hudin { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; }
html[data-v="2"][data-v][data-v][data-v][data-v] .hudtab { position: static; left: auto; top: auto; margin: 0; width: auto; height: auto; padding: 0 16px 0 4px; display: block; grid-column: 1; grid-row: 1; font: 800 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: #fff6b8; text-shadow: 0 2px 0 #000b; border-right: 3px dotted #ffffff40; background: none !important; }
html[data-v="2"][data-v][data-v][data-v][data-v] .hudin .rail { grid-column: 2; grid-row: 1; }
html[data-v="2"][data-v][data-v][data-v][data-v] .hudin .log { grid-column: 1 / -1; grid-row: 2; }

/* ======== phones (<= 800px): one column. The sky is the page's background, the title wraps, the two players sit side by side above the two games,
   then the trade log and the three steps. No walking scene here: the example trade just plays in its card. ======== */
@media (max-width: 800px) {
  html, body { overflow-x: hidden; }
  .stage { display: block; min-height: 100svh; padding: 12px 12px 24px; overflow: visible; }
  .stage > .scene { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 36% 80%; z-index: 0; left: 0 !important; top: 0 !important; }
  .stage > .world { display: none; }
  .stage::after { content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(180deg, #0b103099 0%, #0b103033 38%, #0b1030b3 100%); }
  .stage > :not(.scene):not(.world) { position: relative; z-index: 1; }

  /* header: brand and Connect on one row, the links under them, the two counts under those */
  .top { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; width: 100%; }
  .topr { display: contents; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .top .brand { grid-column: 1; grid-row: 1; width: auto; min-width: 0; justify-self: start; height: 46px; font-size: 20px; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .top .btn { grid-column: 2; grid-row: 1; width: auto; min-width: 104px; height: 46px; font-size: 15px; }
  .topnav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 18px; padding-top: 4px; font-size: 15px; flex-wrap: wrap; }
  .topr .live { grid-column: 1 / -1; grid-row: 3; display: flex; flex-direction: row; justify-content: center; gap: 8px; margin: 0; }

  /* title: wraps normally on a phone */
  .hero { margin: 20px 0 16px; width: 100%; }
  .hero h1 { white-space: normal !important; font-size: clamp(30px, 9.4vw, 44px); line-height: 1.12; text-align: center; padding: 0 4px; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .hero .sub { max-width: 100%; font-size: 13px; padding: 4px 6px; }

  /* the trade card: players side by side on top, the two games full width below */
  .win { margin: 22px 0 0; width: 100%; }
  .deck { height: auto; min-height: 0; --k: 1; }
  .arena { width: 100%; grid-template-columns: 1fr 1fr; grid-template-rows: auto; column-gap: 10px; row-gap: 12px; transform: none; translate: none; padding: 4px 0; }
  .arena::before, .arena::after { display: block; top: -18px; bottom: -18px; left: -16px; right: -16px; }
  .arena .gp { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .arena .pl.pl1 { grid-column: 1 !important; grid-row: 1 !important; } .arena .pl.pl2 { grid-column: 2 !important; grid-row: 1 !important; }
  .arena .esc::after { white-space: normal; text-align: center; width: 150px; line-height: 1.15; }
  .gp .half { padding: 40px 18px 16px; }

  /* the log: its label on its own line, then the four stages, then the state and caption */
  .hud { width: 100%; margin: 20px 0 0; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .hudin { grid-template-columns: 1fr; row-gap: 8px; padding: 12px 10px 10px; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .hudtab { grid-column: 1; grid-row: 1; border-right: 0; padding: 0 0 2px; text-align: center; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .hudin .rail { grid-column: 1; grid-row: 2; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .hudin .log { grid-column: 1; grid-row: 3; flex-direction: column; align-items: stretch; gap: 8px; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .rail li { font-size: 12px; letter-spacing: .02em; gap: 4px; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .rail li:not(:last-child)::after { display: none; }
  html[data-v="2"][data-v][data-v][data-v][data-v] .state { align-self: flex-start; }
  .cap { font-size: 14px; }

  /* the three steps stack */
  .ground { padding: 14px 0 0; }
  .quest { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 800px) {
  .gp .half { padding: 40px 30px 16px; }
  .wal .wu, .tk .tku { font-size: 9px; letter-spacing: 0; }
  .hud { margin-top: 14px; }
}

/* the log needs no label: it is plainly a log */
html[data-v="2"][data-v][data-v][data-v][data-v] .hudin { display: block; }
@media (max-width: 800px) { .arena .esc::after { display: none; } }

/* one title face: every heading-like label uses the pixel face at a size where it stays legible; running text keeps the body face */
html[data-v="2"][data-v][data-v][data-v][data-v][data-v] :is(.topnav a, .top .btn, .live .stat, .live .stat b, .rail li, .state, .arena .pl b) { font-family: var(--px); font-weight: 700; letter-spacing: .04em; }
html[data-v="2"][data-v][data-v][data-v][data-v][data-v] :is(.topnav a, .top .btn) { font-size: 18px; }
html[data-v="2"][data-v][data-v][data-v][data-v][data-v] :is(.rail li, .state) { font-size: 17px; }
html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .live .stat, html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .live .stat b { font-size: 14px; }
/* Connect matches the xtrade button on the other side */
@media (min-width: 801px) { html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .top .btn { min-width: 171px; font-size: 22px; } }
/* header on desktop: logo, games online, the four links, trades done, Connect, evenly spaced across the row */
@media (min-width: 801px) {
  .top { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
  .topr, .topr .live { display: contents; }
  .top .brand { order: 1; } .topr .live .stat:nth-child(1) { order: 2; } .topnav { order: 3; } .topr .live .stat:nth-child(2) { order: 4; } .topr .btn { order: 5; }
  html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .topr .live .stat[data-fb] { box-sizing: border-box; width: auto; min-width: 0; height: 44px; padding: 0 12px; font-size: 16px; gap: 8px; white-space: nowrap; justify-content: center; }
  html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .topr .live .stat[data-fb] b { font-size: 17px; }
  .topr .live .stat[data-fb] img { height: 24px; width: auto; image-rendering: pixelated; }
}
@media (max-width: 800px) {
  html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .topr .live .stat[data-fb] { white-space: nowrap; font-size: 14px; gap: 6px; padding: 0 8px; }
  html[data-v="2"][data-v][data-v][data-v][data-v][data-v] .topr .live .stat[data-fb] b { font-size: 15px; }
  .topr .live .stat[data-fb] img { height: 18px; width: auto; image-rendering: pixelated; }
}

/* what the service is: shown in the trade window's place while the players walk home */
.win { position: relative; }
.info { position: absolute; left: 50%; top: 0; width: min(560px, 90%); transform: translate(-50%, -50%); display: flex; flex-direction: column; text-align: center; gap: 8px; padding: 14px 22px; box-sizing: border-box; opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility 0s .7s; pointer-events: none; z-index: 4; color: #fff3f0; }
.info.on { opacity: 1; visibility: visible; transition: opacity .7s ease; }
.info b { font: 600 clamp(22px, 2.2vw, 30px)/1.1 var(--px); letter-spacing: .02em; }
.info p { margin: 0; font: 500 clamp(14px, 1.3vw, 17px)/1.4 var(--body); }
@media (max-width: 800px) { .info { display: none; } }

/* ---- the trade server: one tall unit in front of both lanes; the stakes slide in behind it to be confirmed ---- */
.srv { display: none; }
@media (min-width: 801px) {
  html[data-v][data-v][data-v][data-v][data-v][data-v] .arena .esc.esc.esc { display: none !important; }
  .arena .gp.b .gname { z-index: 6; }
  .arena .gp.b .srv { display: block; position: absolute; z-index: 4; left: 50%; top: var(--sv-top, -160px); height: var(--sv-h, 335px); aspect-ratio: 348 / 720; transform: translateX(-50%); background: url(/img/f-server-spr.png?v=2) 0 0 / 100% 100% no-repeat; pointer-events: none; }
  .sv-n { position: absolute; left: 38%; top: 3.6%; width: 25%; height: 4%; display: grid; place-items: center; font: 600 11px/1 var(--px); letter-spacing: .04em; color: #ffe2a8; text-shadow: 0 1px 0 #000a; font-style: normal; }
  .sv-t { position: absolute; left: 25.1%; width: 48.7%; top: 22.2%; height: 11.2%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
  .sv-t.b { top: 78.1%; height: 8.1%; gap: 1px; }
  .sv-t.b::before { font-size: 13px !important; } .sv-t.b::after { font-size: 9.5px !important; }
  .arena:is([data-st="3"], [data-st="4"]) .sv-t { padding-left: 13%; }
  .sv-t::before { content: "standing by"; font: 600 14px/1 var(--px); letter-spacing: .03em; text-transform: uppercase; color: #8ff0d6; text-shadow: 0 0 6px #35d0b0aa; }
  .sv-t::after { content: "ready"; font: 500 11px/1 var(--px); letter-spacing: .03em; color: #b6e9dc; }
  .arena[data-st="1"] .sv-t::before { content: "relaying"; } .arena[data-st="1"] .sv-t::after { content: "the offer"; }
  .arena[data-st="2"] .sv-t::before { content: "holding"; color: #ffd27a; text-shadow: 0 0 6px #ffb23caa; } .arena[data-st="2"] .sv-t::after { content: "both stakes"; color: #ffe9bd; }
  .arena[data-st="3"] .sv-t::before { content: "confirming"; color: #ffd27a; text-shadow: 0 0 6px #ffb23caa; } .arena[data-st="3"] .sv-t::after { content: "both games"; color: #ffe9bd; }
  .arena[data-st="4"] .sv-t::before { content: "settled"; } .arena[data-st="4"] .sv-t::after { content: "done"; }
  .sv-l { position: absolute; left: 26.7%; width: 7%; aspect-ratio: 1; margin: -3.5% 0 0 -3.5%; border-radius: 50%; background: #35d0b0; box-shadow: 0 0 8px 2px #35d0b0aa; opacity: 0; transition: opacity .3s, background .3s, box-shadow .3s; }
  .sv-l.a { top: 16.1%; } .sv-l.b { top: 71.7%; } .sv-l.r { left: 72.2%; }
  .arena:is([data-st="1"], [data-st="2"]) .sv-l { opacity: 1; background: #ffb23c; box-shadow: 0 0 8px 2px #ffb23caa; }
  .arena:is([data-st="3"], [data-st="4"]) .sv-l { opacity: 1; }
  .sv-c { position: absolute; left: 33%; width: 12%; height: auto; margin: -5.3% 0 0 -6%; opacity: 0; image-rendering: pixelated; filter: drop-shadow(0 2px 3px #000b) drop-shadow(0 0 6px #52d6b5aa); }
  .sv-c.a { top: 27.8%; } .sv-c.b { top: 82.1%; }
  .arena[data-st="3"] .sv-c.a { animation: ckPop .55s cubic-bezier(.3, 1.8, .5, 1) 1s both; }
  .arena[data-st="3"] .sv-c.b { animation: ckPop .55s cubic-bezier(.3, 1.8, .5, 1) 1.9s both; }
  .arena[data-st="4"] .sv-c { opacity: 1; }
  /* stakes wait beside the server while they are locked, then slide in behind it for the confirm */
  .lane2.ltr { --s2: calc(var(--m) - 140px); } .lane2.rtl { --s2: calc(var(--m) + 140px); }
  .arena[data-st="2"] .tk { transform: translate(var(--s2), 0); animation: toSide 1s cubic-bezier(.5, 0, .25, 1) 1.45s both; }
  .arena[data-st="3"] .tk { transform: translate(var(--m), 0); animation: intoSrv .9s cubic-bezier(.5, 0, .25, 1) both; }
  @keyframes toSide { from { opacity: 1; transform: translate(var(--o), 0); } to { opacity: 1; transform: translate(var(--s2), 0); } }
  @keyframes intoSrv { from { opacity: 1; transform: translate(var(--s2), 0); } to { opacity: 1; transform: translate(var(--m), 0); } }
}
@media (min-width: 801px) { .arena[data-st="3"] .sv-t.a::before { font-size: 12px; } .arena[data-st="3"] .sv-t.b::before { font-size: 11.5px !important; } }

/* ---- server v3: same width top to bottom, see-through openings at both sides, check replaces the screen text ---- */
@media (min-width: 801px) {
  .arena .gp.b .srv { top: var(--sv-top, -160px); height: var(--sv-h, 308px); aspect-ratio: 402 / 720; background-image: url(/img/f-server-spr.png?v=3); }
  .sv-n { left: 40%; top: 94.6%; width: 21%; height: 4.4%; font-size: 9px; }
  .sv-t { left: 27.9%; width: 44.2%; top: 9.4%; height: 18.4%; }
  .sv-t.b { top: 76.1%; height: 9.7%; }
  .sv-t.a, .sv-t.b { padding-left: 0 !important; }
  .sv-l { width: 6%; }
  .sv-l.a { left: 29.3%; top: 34.3%; } .sv-l.a.r { left: 70.9%; }
  .sv-l.b { left: 29.3%; top: 69.4%; } .sv-l.b.r { left: 70.9%; }
  .sv-c { left: 50%; width: 15%; margin: -6.6% 0 0 -7.5%; }
  .sv-c.a { top: 18.6%; } .sv-c.b { top: 80.9%; }
  .arena[data-st="3"] .sv-c.a { animation: ckPop .5s cubic-bezier(.3, 1.8, .5, 1) .35s both; }
  .arena[data-st="3"] .sv-c.b { animation: ckPop .5s cubic-bezier(.3, 1.8, .5, 1) .75s both; }
  .arena[data-st="3"] .sv-t.a::before, .arena[data-st="3"] .sv-t.a::after { animation: svOff .15s linear .35s both; }
  .arena[data-st="3"] .sv-t.b::before, .arena[data-st="3"] .sv-t.b::after { animation: svOff .15s linear .75s both; }
  .arena[data-st="4"] .sv-t::before, .arena[data-st="4"] .sv-t::after { opacity: 0; }
  @keyframes svOff { to { opacity: 0; } }
  /* stakes come in beside the server, run straight through its side opening without stopping, and leave by the other side */
  .lane2.ltr { --s2: calc(var(--m) - 148px); } .lane2.rtl { --s2: calc(var(--m) + 148px); }
  .arena[data-st="2"] .tk { animation: toSide .8s cubic-bezier(.5, 0, .25, 1) 1.45s both; }
  .arena[data-st="3"] .tk { animation: intoSrv .55s linear both; }
}

/* ---- server v4: mouths built into the cabinet at the height of each screen; the stake shrinks into one side and comes out of the other; game headers sit in the panel corners ---- */
@media (min-width: 801px) {
  .arena .gp .gname { left: 17%; }
  .arena .gp.b .srv { height: var(--sv-h, 365px); aspect-ratio: 376 / 720; background-image: url(/img/f-server-spr.png?v=4); }
  .sv-n { left: 38.6%; top: 91%; width: 21.2%; height: 4.8%; font-size: 10px; }
  .sv-t { left: 27.9%; width: 46%; top: 15.6%; height: 12.9%; }
  .sv-t.b { top: 65.6%; height: 14.3%; }
  .sv-l { display: none; }
  .sv-c { width: 14%; margin: -6.1% 0 0 -7%; }
  .sv-c.a { top: 22%; } .sv-c.b { top: 72.8%; }
  .lane2.ltr { --mi: calc(var(--m) - 64px); --mo: calc(var(--m) + 64px); }
  .lane2.rtl { --mi: calc(var(--m) + 64px); --mo: calc(var(--m) - 64px); }
  .tk { transform-origin: 50% 42px; }
  .arena[data-st="2"] .tk { opacity: 1; transform: translate(var(--mi), 0) scale(.3); animation: toMouth 1.8s linear 1.45s both; }
  .arena[data-st="3"] .tk { opacity: 0; transform: translate(var(--mi), 0) scale(.3); animation: none; }
  .arena[data-st="4"] .tk { animation: fromMouth 1.2s linear both, absorb .7s cubic-bezier(.5, 0, .8, .5) 2.4s forwards; }
    @keyframes toMouth { 0% { opacity: 1; transform: translate(calc(var(--o) + (var(--mi) - var(--o)) * 0), 0) scale(1); } 20% { opacity: 1; transform: translate(calc(var(--o) + (var(--mi) - var(--o)) * 0.12), 0) scale(0.82); } 40% { opacity: 1; transform: translate(calc(var(--o) + (var(--mi) - var(--o)) * 0.32), 0) scale(0.62); } 60% { opacity: 1; transform: translate(calc(var(--o) + (var(--mi) - var(--o)) * 0.58), 0) scale(0.45); } 80% { opacity: 1; transform: translate(calc(var(--o) + (var(--mi) - var(--o)) * 0.84), 0) scale(0.34); } 100% { opacity: 0; transform: translate(calc(var(--o) + (var(--mi) - var(--o)) * 1), 0) scale(0.3); } }
  @keyframes fromMouth { 0% { opacity: 0; transform: translate(calc(var(--mo) + (var(--e) - var(--mo)) * 0), 0) scale(0.3); } 20% { opacity: 1; transform: translate(calc(var(--mo) + (var(--e) - var(--mo)) * 0.16), 0) scale(0.34); } 40% { opacity: 1; transform: translate(calc(var(--mo) + (var(--e) - var(--mo)) * 0.42), 0) scale(0.45); } 60% { opacity: 1; transform: translate(calc(var(--mo) + (var(--e) - var(--mo)) * 0.68), 0) scale(0.62); } 80% { opacity: 1; transform: translate(calc(var(--mo) + (var(--e) - var(--mo)) * 0.88), 0) scale(0.82); } 100% { opacity: 1; transform: translate(calc(var(--mo) + (var(--e) - var(--mo)) * 1), 0) scale(1); } }
}

/* ---- server v5: two halves, one in each panel, joined in the gap; the stake runs onto the mouth on top of the server and shrinks into it ---- */
.sv, .sv-hi { display: none; }
@media (min-width: 801px) {
  .arena .gp .srv { display: none; }
  .sv { display: block; position: absolute; z-index: 2; left: 50%; width: calc(var(--sv-sh, 365px) * 376 / 720); transform: translateX(-50%); pointer-events: none; background: url(/img/f-server-spr.png?v=4) 0 0 / 100% var(--sv-sh, 365px) no-repeat; }
  .sv-top { top: var(--sv-ta, 5px); height: calc(var(--sv-ha, 175px) + 2px); }
  /* the lower panel's glow (its drop-shadow) is cut off above the lower panel in the server's column, so it no longer tints the upper half of the server and ends in a line */
  .arena .gp.b { --svhw: calc(var(--sv-sh, 365px) * 376 / 1440 + 8px); clip-path: polygon(-48px -48px, calc(50% - var(--svhw)) -48px, calc(50% - var(--svhw)) var(--sv-tb, -12px), calc(50% + var(--svhw)) var(--sv-tb, -12px), calc(50% + var(--svhw)) -48px, calc(100% + 48px) -48px, calc(100% + 48px) calc(100% + 48px), -48px calc(100% + 48px)); }
  .sv-bot { top: var(--sv-tb, -12px); height: var(--sv-hb, 190px); background-position: 0 calc(-1 * var(--sv-ha, 175px)); }
  .arena .tk { z-index: 5; }
  .sv .sv-t.a { top: calc(var(--sv-sh) * .156); height: calc(var(--sv-sh) * .129); }
  .sv .sv-t.b { top: calc(var(--sv-sh) * .656 - var(--sv-ha)); height: calc(var(--sv-sh) * .143); }
  .sv .sv-c.a { top: calc(var(--sv-sh) * .22); }
  .sv .sv-c.b { top: calc(var(--sv-sh) * .728 - var(--sv-ha)); }
  .sv .sv-n { top: calc(var(--sv-sh) * .91 - var(--sv-ha)); height: calc(var(--sv-sh) * .048); }
  /* the wall copies at each mouth sit above the stakes: the stake shows over the dark opening and goes behind the wall at its inside edge */
  .sv-hi { z-index: 6; }
  .sv-top.sv-hi.l { clip-path: inset(calc(var(--sv-sh) * .133) 79.3% calc(var(--sv-ha) - var(--sv-sh) * .283) 12.8%); }
  .sv-top.sv-hi.r { clip-path: inset(calc(var(--sv-sh) * .133) 12.8% calc(var(--sv-ha) - var(--sv-sh) * .283) 79.3%); }
  .sv-bot.sv-hi.l { clip-path: inset(calc(var(--sv-sh) * .664 - var(--sv-ha)) 79.3% calc(var(--sv-hb) + var(--sv-ha) - var(--sv-sh) * .808) 12.8%); }
  .sv-bot.sv-hi.r { clip-path: inset(calc(var(--sv-sh) * .664 - var(--sv-ha)) 12.8% calc(var(--sv-hb) + var(--sv-ha) - var(--sv-sh) * .808) 79.3%); }
}

/* the lane's line passes through the server instead of stopping behind it: it is drawn above the server body, in the dark opening of each side slot only; it ends at the slot's inside lip, as the stakes do, and runs on out the other side */
@media (min-width: 801px) {
  .arena .rl { --svh: calc(var(--sv-sh, 365px) * 376 / 720 * .41); z-index: 5; clip-path: polygon(0 -20px, calc(50% - var(--svh)) -20px, calc(50% - var(--svh)) 20px, 0 20px, 0 -20px, calc(50% + var(--svh)) -20px, 100% -20px, 100% 20px, calc(50% + var(--svh)) 20px, calc(50% + var(--svh)) -20px); }
}

/* ---- fit to the screen: the page never asks for more width than the window has ---- */
.stage { grid-template-columns: minmax(0, 1fr); }
/* between phone and wide desktop the header row (logo, two counters, four links, Connect) is wider than the window: the links drop to a second row */
@media (min-width: 801px) and (max-width: 1180px) {
  .top { flex-wrap: wrap; row-gap: 6px; }
  .topnav { order: 6; flex: 0 0 100%; justify-content: center; padding: 0; }
  .topr .live .stat:nth-child(2) { order: 3; } .topr .btn { order: 4; }
  html[data-v="2"][data-v][data-v][data-v][data-v][data-v][data-v] .top .btn { min-width: 130px; font-size: 18px; }
}
@media (min-width: 801px) and (max-width: 1100px) { .hero h1 { white-space: normal !important; font-size: clamp(26px, 5.2vw, 48px); line-height: 1.1; } }
