:root {
  --ink: #09090b;
  --panel: #151518;
  --panel-2: #202024;
  --paper: #ece8df;
  --yellow: #ffd21c;
  --pink: #ff2ca8;
  --cyan: #16dcff;
  --acid: #a9ff29;
  --red: #ff3c27;
  --muted: #a7a3a0;
  --line: rgba(255,255,255,.16);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* the whole page is black, so iPhone notch/side areas, overscroll and any gap around the game show black, not white (owner, 2026-11-05) */
html { background: #09090b; color-scheme: dark; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: white; background: var(--ink); overflow-x: hidden; }
#gameScreen { background-color: #12101a; background-image: linear-gradient(rgba(7,7,10,.42),rgba(7,7,10,.58)),var(--match-background,none),url("assets/backgrounds/neon-alley.jpg"); background-size: cover; background-position: center; background-attachment: scroll; }
.background-dialog { width: min(560px,90vw); }
.online-hub { border: 1px solid #664052; padding: 16px; margin: 22px 0; background: #141118; }
.online-hub-heading,.online-hub-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.online-hub h3 { margin: 0; }
.game-name-field { grid-column: 1 / -1; margin: 8px 0 22px; }
.login-entry-bar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; text-align: left; }
/* Deck Builder sits across from Log in / Sign in, on the same row. */
.account-entry-row { display: flex; gap: 12px; align-items: stretch; }
.account-entry-row .login-entry-bar { flex: 1 1 auto; width: auto; min-width: 0; }
.account-entry-row #deckBuilderButton { flex: 0 0 auto; }
.online-hub-links #shopButton { margin-left: auto; }   /* stays on the right, where it was beside Deck Builder */
.game-name-field label,.game-name-field small { display: block; margin: 6px 0; }
.game-name-login { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.practice-return { margin-top: 20px; }
.game-name-field input { width: 100%; padding: 12px; border: 1px solid #666; background: #15151b; color: white; font: 16px system-ui,sans-serif; }
.game-name-field small { color: #aaa; font: 12px/1.5 system-ui,sans-serif; }
#matchYourArtistName,#matchOpponentArtistName { overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; padding: 4px; background: #09090bb3; }
.online-hub p,.collection-dialog p { font: 14px/1.5 system-ui,sans-serif; color: #d0ccd3; }
.online-hub small { display: block; margin-top: 12px; color: #aaa; font: 12px/1.5 system-ui,sans-serif; }
.locked-tag { display: inline-block; color: #ffb2bd; font: 800 10px/1.5 system-ui,sans-serif; letter-spacing: .08em; }
.collection-dialog { padding: 28px; max-height: 85vh; overflow-y: auto; }
.collection-dialog h2 { font-size: clamp(26px,4vw,44px); margin: 16px 0; }
.collection-card-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(85px,1fr)); gap: 10px; max-height: 300px; overflow-y: auto; padding: 8px; background: #09090c; }
.collection-card-grid img { width: 100%; aspect-ratio: 2/3; object-fit: contain; }
.collection-lock-note { padding: 14px; border-left: 3px solid #bf657d; background: #21141a; margin: 18px 0; font: 13px/1.5 system-ui,sans-serif; }
.pack-rewards { padding: 16px; border: 1px solid #534549; }
.pack-rewards ol { padding-left: 20px; font: 14px/1.8 system-ui,sans-serif; }
.shop-products { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; margin-top: 18px; }
.shop-products article { border: 1px solid #49414c; padding: 18px; }
.pack-product { display: flex; flex-direction: column; background: #0b0b10; }
.pack-art { display: block; width: 100%; height: 260px; object-fit: contain; }
.pack-product h3 { margin: 16px 0 0; }
.pack-product .pack-price { font: 800 26px/1.2 system-ui,sans-serif; color: white; margin: 10px 0; }
.pack-product button { margin-top: auto; }
.shop-products .pack-silver { border-color: #9b9fa8; }
.shop-products .pack-gold { border-color: #c7a544; }
/* Phones and touch screens: the Re-Up packs sit in one row you swipe left and right, at the same card size as on
   desktop, instead of wrapping into a tall column. Vertical swipes still scroll the shop itself. */
@media (max-width: 900px), (pointer: coarse) {
  .shop-products { display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 4px; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch;
    padding-bottom: 10px; scrollbar-width: thin; }
  .shop-products article { flex: 0 0 240px; scroll-snap-align: start; }
}
.pack-gold .pack-price { color: #edcf72; }
.collection-dialog button:disabled { opacity: .55; cursor: not-allowed; }
.background-dialog label { display: block; margin: 20px 0 8px; }
.background-dialog input { max-width: 100%; }
.background-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; gap: 12px; max-height: 45vh; overflow-y: auto; padding: 4px; }
.background-options button { padding: 12px; }
.background-options img { display: block; width: 150px; max-width: 100%; height: 86px; object-fit: cover; margin-bottom: 8px; }
@media(max-width:650px) { .topbar { height: auto; min-height: 76px; flex-wrap: wrap; gap: 12px; padding-block: 12px; } .top-actions { flex-wrap: wrap; } }
button { font: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.grain { position: fixed; inset: 0; opacity: .14; pointer-events: none; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.36'/%3E%3C/svg%3E"); mix-blend-mode: overlay; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4vw, 56px); border-bottom: 1px solid var(--line); background: rgba(9,9,11,.9); backdrop-filter: blur(18px); position: relative; z-index: 30; }
.brand-button { display: flex; gap: 12px; align-items: center; color: white; background: none; border: 0; cursor: pointer; text-align: left; }
.brand-button strong { display: block; font-size: 1.08rem; letter-spacing: .06em; transform: skew(-5deg); }
.brand-button small { display: block; color: var(--yellow); font-family: system-ui, sans-serif; font-size: .62rem; font-weight: 800; letter-spacing: .18em; }
.can-mark { display: grid; place-items: center; width: 40px; height: 45px; color: var(--ink); background: var(--yellow); border: 3px solid white; box-shadow: 4px 4px 0 var(--pink); transform: rotate(-3deg); }
.top-actions { display: flex; gap: 10px; }
.match-clock { display: grid; gap: 2px; text-align: center; margin-inline: 12px; }
.match-clock[hidden] { display: none; }
.match-clock span { color: #aaa; font: 800 10px system-ui; letter-spacing: .12em; }
.match-clock strong { color: var(--yellow); font: 800 20px/1.1 system-ui; font-variant-numeric: tabular-nums; }
@media(max-width: 600px) { .topbar:has(.match-clock:not([hidden])) { height: auto; min-height: 76px; flex-wrap: wrap; gap: 8px; padding-block: 8px; } .match-clock { order: 3; flex-basis: 100%; } }
.icon-button { min-height: 42px; padding: 0 16px; color: white; border: 1px solid var(--line); border-radius: 4px; background: #18181c; cursor: pointer; font-family: system-ui, sans-serif; font-weight: 800; }
.icon-button:hover, .icon-button[aria-pressed="true"] { color: var(--ink); border-color: var(--yellow); background: var(--yellow); }

.setup-screen { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(330px, .82fr) minmax(560px, 1.18fr); }
.setup-visual { position: sticky; top: 76px; height: calc(100vh - 76px); overflow: hidden; border-right: 1px solid var(--line); }
.setup-reel { position: absolute; inset: 0; overflow: hidden; background: #050507 url("assets/backgrounds/neon-alley.jpg") center / cover no-repeat; }
#setupVideo { opacity: 0; }
#setupVideo.is-playing { opacity: 1; }
.reel-item { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 1; }
.reel-item:nth-child(2) { animation-delay: 6s; }.reel-item:nth-child(3) { animation-delay: 12s; }.reel-item:nth-child(4) { animation-delay: 18s; }.reel-item:nth-child(5) { animation-delay: 24s; }.reel-item:nth-child(6) { animation-delay: 30s; }
@keyframes setup-reel { 0% { opacity: 1; transform: scale(1.02) translateX(-1%); } 15% { opacity: 1; } 17% { opacity: 0; transform: scale(1.1) translateX(1%); } 100% { opacity: 0; transform: scale(1.1); } }
.visual-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.35) 42%, rgba(0,0,0,.96)); }
.visual-copy { position: absolute; inset: auto clamp(24px, 5vw, 62px) 48px; }
.eyebrow, .step-tag { color: var(--yellow); font-family: system-ui, sans-serif; font-size: .72rem; font-weight: 900; letter-spacing: .2em; }
.visual-copy h1 { margin: 14px 0; max-width: 650px; font-size: clamp(3.3rem, 6vw, 6.6rem); line-height: .8; letter-spacing: -.045em; transform: skew(-4deg); text-shadow: 7px 7px 0 #000; }
.visual-copy h1 em { color: var(--yellow); font-style: normal; }
.visual-copy p { max-width: 500px; margin: 22px 0 0; color: #ddd; font-family: system-ui, sans-serif; font-size: 1rem; font-weight: 700; line-height: 1.55; }
.setup-panel { padding: clamp(32px, 5vw, 70px); background: radial-gradient(circle at 85% 10%, rgba(255,44,168,.14), transparent 30%), linear-gradient(145deg,#16161a,#0b0b0d 70%); }
.setup-heading h2 { margin: 8px 0 4px; font-size: clamp(2.2rem, 4vw, 4.5rem); line-height: 1; text-transform: uppercase; transform: skew(-3deg); }
.setup-heading p, .setup-note { color: var(--muted); font-family: system-ui, sans-serif; font-weight: 650; }
.player-pickers { display: grid; gap: 34px; margin: 42px 0 32px; }
.picker-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.picker-title span { display: grid; place-items: center; width: 34px; height: 34px; color: var(--ink); background: var(--yellow); clip-path: polygon(8% 0,100% 0,92% 100%,0 100%); }
.picker-title h3 { margin: 0; font-size: 1.55rem; letter-spacing: .03em; text-transform: uppercase; }
.deck-picker { display: grid; grid-template-columns: repeat(5, minmax(88px, 1fr)); gap: 10px; }
.deck-choice { position: relative; min-width: 0; height: 118px; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: #202024; cursor: pointer; overflow: hidden; isolation: isolate; }
.deck-choice::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.95)); z-index: -1; }
.deck-choice img { width: 100%; height: 73px; object-fit: contain; filter: saturate(.65); transition: .2s ease; }
.deck-choice span { display: block; overflow: hidden; text-align: center; text-overflow: ellipsis; color: #ddd; font-size: .84rem; letter-spacing: .04em; text-transform: uppercase; }
.deck-choice:hover, .deck-choice.selected { border-color: var(--deck-color); box-shadow: 0 0 0 2px var(--deck-color), 0 0 24px color-mix(in srgb, var(--deck-color) 35%, transparent); transform: translateY(-2px); }
.deck-choice:hover img, .deck-choice.selected img { filter: none; transform: scale(1.04); }
.deck-choice.selected span { color: white; }
.versus-stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; height: clamp(290px,36vw,430px); margin: -8px 0 30px; overflow: hidden; background: #070709; isolation: isolate; }
.versus-fighter { position: relative; overflow: hidden; min-width: 0; background: #070709; }
.versus-character { position: absolute; inset: 0; width: 100%; height: calc(100% - 72px); object-fit: cover; object-position: center; border: 0; transform: none; animation: none; }
.versus-logo { position: absolute; left: 50%; bottom: 5px; width: min(72%,190px); height: 62px; object-fit: contain; transform: translateX(-50%); }
.versus-mark { position: absolute; left: 50%; top: calc(50% - 36px); z-index: 8; display: grid; place-content: center; margin: 0; pointer-events: none; color: white; font-size: clamp(3.8rem,8vw,7.2rem); line-height: .55; text-align: center; transform: translate(-50%,-50%) skew(-8deg) rotate(-5deg); text-shadow: 5px 5px 0 var(--pink),-3px -3px 0 var(--yellow),0 0 28px #000; }
.versus-mark span:last-child { margin-left: 22px; }
@keyframes fighter-breathe { from { transform: translateY(8px) scale(.98); } to { transform: translateY(-5px) scale(1.04); } }
@keyframes fighter-breathe-flip { from { transform: translateY(8px) scaleX(-1) scale(.98); } to { transform: translateY(-5px) scaleX(-1) scale(1.04); } }
.primary-button { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; min-height: 60px; padding: 0 24px; color: var(--ink); border: 0; background: var(--yellow); box-shadow: 7px 7px 0 var(--pink); cursor: pointer; font-size: 1.1rem; letter-spacing: .06em; transform: skew(-2deg); }
.primary-button:hover { background: white; transform: translate(-2px,-2px) skew(-2deg); box-shadow: 10px 10px 0 var(--pink); }
.setup-note { margin: 20px 0 0; text-align: center; font-size: .8rem; }

.game-screen { min-height: calc(100vh - 76px); padding: 14px clamp(12px, 2.6vw, 42px) 30px; background: radial-gradient(circle at 50% 45%, rgba(22,220,255,.1), transparent 32%), repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 42px), linear-gradient(#0c0c0e,#121216); }
.match-strip { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.match-player { display: flex; align-items: center; gap: 10px; font-size: 1rem; letter-spacing: .05em; text-transform: uppercase; }
.current-name { justify-content: flex-end; color: var(--yellow); }
.match-player img { width: 74px; height: 24px; object-fit: contain; }
.round-badge { display: flex; align-items: baseline; gap: 7px; padding: 5px 15px; color: var(--muted); border-inline: 1px solid var(--line); font-family: system-ui, sans-serif; font-size: .68rem; font-weight: 800; letter-spacing: .15em; }
.round-badge strong { color: white; font-size: 1.1rem; }
.board { max-width: 1160px; margin: 0 auto; }
.board-heading, .hand-heading { display: flex; justify-content: space-between; align-items: end; padding: 13px 0 8px; }
.board-heading > div:first-child, .hand-heading > div:first-child { display: flex; align-items: baseline; gap: 12px; }
.zone-label { color: var(--muted); font-family: system-ui, sans-serif; font-size: .67rem; font-weight: 900; letter-spacing: .18em; }
.board-heading strong, .hand-heading strong { color: var(--yellow); font-size: 1.1rem; }
.supply-line { display: flex; gap: 8px; font-family: system-ui, sans-serif; font-size: .73rem; font-weight: 800; }
.supply-pill { padding: 4px 8px; border: 1px solid var(--line); background: #1c1c20; }
.supply-pill.can { color: var(--cyan); }.supply-pill.cap { color: var(--acid); }
.arena-surface { --arena-image: none; position: relative; aspect-ratio: 17 / 11; background-color: #17171b; background-image: linear-gradient(rgba(0,0,0,.06),rgba(0,0,0,.06)),var(--arena-image); background-size: cover; background-position: center; border: 1px solid transparent; border-radius: 8px; box-shadow: 0 18px 55px rgba(0,0,0,.7); overflow: hidden; isolation: isolate; }
.arena-surface::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 55px rgba(0,0,0,.42); z-index: 3; }
.arena-surface.mirror-deck-mat { background-image: linear-gradient(rgba(255, 231, 204, .18),rgba(255, 231, 204, .18)),var(--arena-image); background-blend-mode: screen; }
.arena-crew { position: absolute; left: 2%; top: 2%; z-index: 5; padding: 5px 9px; color: white; background: rgba(0,0,0,.76); border-left: 4px solid var(--yellow); font-family: system-ui,sans-serif; font-size: .62rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.arena-surface .ups-row { position: absolute; inset: 0; z-index: 4; display: block; width: 100%; height: 100%; min-height: 0; pointer-events: none; }
.ups-slot { position: relative; display: grid; place-items: center; min-height: 138px; border: 1px dashed rgba(255,255,255,.34); background: linear-gradient(135deg,rgba(0,0,0,.1),rgba(255,255,255,.04)); overflow: hidden; }
.arena-surface .ups-slot { position: absolute; top: 30.5%; width: 11.5%; height: 27%; min-height: 0; border: 1px dashed rgba(255,255,255,.48); border-radius: 4px; background: rgba(0,0,0,.16); box-shadow: inset 0 0 18px rgba(0,0,0,.26); pointer-events: auto; }
.arena-surface .ups-slot:nth-child(1) { left: 59%; }.arena-surface .ups-slot:nth-child(2) { left: 45%; }.arena-surface .ups-slot:nth-child(3) { left: 31%; }.arena-surface .ups-slot:nth-child(4) { left: 17%; }.arena-surface .ups-slot:nth-child(5) { left: 3.2%; }
.ups-slot.empty::after { content: attr(data-number); color: rgba(255,255,255,.12); font-size: 2.1rem; }
.arena-surface .ups-slot.empty::after { color: rgba(255,255,255,.54); text-shadow: 0 2px 5px #000; font-size: clamp(.8rem,2vw,1.8rem); }
.arena-pile { position: absolute; z-index: 7; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 64px; min-height: 42px; padding: 5px 7px; color: rgba(255,255,255,.78); border: 1px dashed rgba(255,255,255,.34); border-radius: 4px; background: rgba(0,0,0,.2); font-family: system-ui,sans-serif; font-size: clamp(.48rem,.78vw,.7rem); font-weight: 950; letter-spacing: .09em; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; overflow: hidden; }
.arena-pile b { display: grid; place-items: center; min-width: 21px; height: 21px; color: #09090b; border-radius: 50%; background: white; font-size: .67rem; }
.arena-pile.occupied { color: white; border-style: solid; border-color: color-mix(in srgb,var(--yellow) 65%,white); background: rgba(9,9,11,.72); box-shadow: 0 3px 12px rgba(0,0,0,.65); }
.arena-pile.occupied::before { content: ""; position: absolute; left: 9%; top: 14%; width: 23%; height: 64%; border: 1px solid rgba(255,255,255,.72); border-radius: 2px; background: linear-gradient(135deg,var(--yellow),#17171b 72%); box-shadow: 4px 3px 0 rgba(255,255,255,.28),8px 6px 0 rgba(0,0,0,.48); transform: rotate(-5deg); opacity: .8; }
.arena-pile.has-card-art.occupied::before { display: none; }
.arena-pile.occupied span,.arena-pile.occupied b { position: relative; z-index: 1; }
.deck-pile.occupied::before { left: 12%; top: 8%; width: 44%; height: 78%; background: #09090b url('assets/logos/can-control.webp') center / 88% auto no-repeat; box-shadow: 4px 3px 0 var(--yellow),8px 6px 0 rgba(255,255,255,.45),12px 9px 0 rgba(0,0,0,.6); opacity: 1; }
.trash-pile::before { display: none; }
.trash-pile .pile-preview { position: absolute; inset: 5%; z-index: 0; width: 52%; height: 90%; min-height: 0; opacity: .94; transform: rotate(-4deg); box-shadow: 4px 4px 0 rgba(255,255,255,.35); pointer-events: none; }
.arena-pile .supply-preview { position: absolute; top: 5%; width: 27%; height: 88%; min-height: 0; opacity: 1; border: 1px solid white; box-shadow: 2px 3px 0 rgba(0,0,0,.75); pointer-events: auto; cursor: zoom-in; transform-origin: center bottom; }
.arena-pile .supply-preview .real-card-image { object-fit: contain; background: #08080a; }
.arena-pile .supply-strip { display: contents; }
.can-pile > span,.can-pile > b,.cap-pile > span,.cap-pile > b,.beast-pile > span,.beast-pile > b { position: relative; z-index: 30; text-shadow: 0 2px 4px #000; }
.trash-pile .pile-preview .card-art { height: 48%; }.trash-pile .pile-preview .card-body { padding: 3px; }.trash-pile .pile-preview .card-kicker,.trash-pile .pile-preview .card-effect,.trash-pile .pile-preview .card-cost { display: none; }.trash-pile .pile-preview .card-name { min-height: 0; font-size: clamp(.34rem,.55vw,.5rem); }.trash-pile .pile-preview .card-stats { left: 2px; right: 2px; bottom: 2px; font-size: .4rem; }
.trash-pile { right: 3%; top: 13%; width: 13%; height: 14%; }.deck-pile { right: 3%; top: 50%; width: 14%; height: 17%; }.can-pile { left: 7%; bottom: 8%; width: 29%; height: 19%; }.beast-pile { left: 36.5%; bottom: 8%; width: 7%; height: 19%; padding-inline: 2px; }.beast-pile span { writing-mode: vertical-rl; }.cap-pile { left: 44%; bottom: 8%; width: 34%; height: 19%; }
.arena-pile.snap-hit,.ups-slot.snap-hit { animation: zone-snap .4s ease-out; }
.ups-slot.targetable { z-index: 9; cursor: crosshair; border: 3px solid white; box-shadow: 0 0 0 4px var(--yellow),0 0 30px var(--yellow); animation: target-pulse .8s ease-in-out infinite alternate; }
.ups-slot.target-picked { z-index: 10; border: 3px solid var(--acid); box-shadow: 0 0 0 5px white,0 0 34px var(--acid); }
@keyframes target-pulse { from { filter: brightness(1); transform: scale(1); } to { filter: brightness(1.22); transform: scale(1.035); } }
@keyframes zone-snap { 0% { transform: scale(1); } 38% { transform: scale(1.08); box-shadow: 0 0 0 4px white,0 0 28px var(--yellow); } 100% { transform: scale(1); } }
.snap-ghost { position: fixed !important; z-index: 200; pointer-events: none; margin: 0 !important; box-shadow: 0 22px 60px rgba(0,0,0,.85),0 0 0 3px var(--yellow) !important; transform-origin: center; }
.arena-guide { position: absolute; inset: 0; z-index: 6; pointer-events: none; font-family: system-ui,sans-serif; font-size: clamp(.42rem,.75vw,.68rem); font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.arena-guide span { position: absolute; padding: 4px 7px; color: #fff; background: rgba(0,0,0,.72); border: 1px solid rgba(255,255,255,.35); border-radius: 999px; box-shadow: 0 2px 9px #000; }
.arena-guide span:nth-child(1) { left: 4.2%; top: 46%; }.arena-guide span:nth-child(2) { left: 42%; top: 58.5%; }.arena-guide span:nth-child(3) { right: 3%; top: 17%; }.arena-guide span:nth-child(4) { right: 3%; top: 55%; }.arena-guide span:nth-child(5) { left: 15%; bottom: 5%; }.arena-guide span:nth-child(6) { left: 55%; bottom: 5%; }
.opponent-board { max-width: 760px; opacity: .82; transform-origin: top center; }
.opponent-board .arena-surface { aspect-ratio: 17 / 5.4; background-size: cover; background-position: center 38%; }
.opponent-board .arena-surface .ups-slot { top: 22%; height: 60%; }
.opponent-board .arena-crew { display: none; }

@media (min-width: 901px) {
  .game-screen { display: block; }
  .board { width: 100%; max-width: 1160px; }
  .opponent-board { max-width: 1160px; opacity: .94; }
  .opponent-board .arena-surface,.player-board .arena-surface { aspect-ratio: 17 / 5.4; background-position: center 38%; }
  .opponent-board .arena-surface .ups-slot,.player-board .arena-surface .ups-slot { top: 22%; height: 60%; }
  .board-heading { padding-block: 5px 4px; }
  .hand-heading { padding-block: 8px 5px; }
  .hand-row { min-height: 158px; padding-bottom: 8px; }
  .hand-row .game-card { flex-basis: 106px; min-height: 148px; }
  .street-control { margin-top: 8px; }
}
.street-control { max-width: 1160px; min-height: 76px; margin: 16px auto 0; padding: 10px 12px 16px; display: grid; grid-template-columns: minmax(220px,.8fr) minmax(280px,1.2fr); gap: 10px 24px; align-items: center; border-block: 1px solid var(--line); background: rgba(0,0,0,.3); }
.phase-track { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.phase-step { height: 7px; background: #303036; transform: skew(-18deg); }
.phase-step.done { background: white; }.phase-step.active { background: var(--yellow); box-shadow: 0 0 14px rgba(255,210,28,.6); }
.street-message { display: flex; align-items: center; gap: 14px; min-width: 0; }
.phase-number { color: var(--yellow); font-size: 2rem; transform: skew(-5deg); }
.street-message strong { display: block; font-size: 1.14rem; letter-spacing: .08em; }
.street-message p { margin: 3px 0 0; color: var(--muted); font-family: system-ui, sans-serif; font-size: .75rem; line-height: 1.35; }
.phase-button, .selection-bar button { min-height: 44px; padding: 0 18px; color: var(--ink); border: 0; background: var(--yellow); cursor: pointer; letter-spacing: .04em; }
.phase-button:disabled { color: #777; background: #303036; cursor: not-allowed; }
.street-actions { grid-column: 1 / -1; display: flex; justify-content: center; gap: 10px; }.street-actions .phase-button { min-width: min(360px,45vw); }.paid-buff-button { color: white; border: 1px solid var(--pink); background: #281221; }.paid-buff-button:hover:not(:disabled) { color: #09090b; background: var(--pink); }
.hand-zone { max-width: 1280px; margin: 4px auto 0; }
.pile-stats { display: flex; gap: 16px; color: var(--muted); font-family: system-ui, sans-serif; font-size: .72rem; font-weight: 800; }
.pile-stats b { margin-left: 4px; color: white; }
.hand-row { display: flex; gap: 10px; min-height: 188px; padding: 4px 2px 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-color: var(--yellow) #222; }
.game-card { --card-accent: var(--yellow); position: relative; flex: 0 0 126px; min-height: 176px; padding: 0; color: white; border: 2px solid #37373e; border-radius: 6px; background: #151518; overflow: hidden; cursor: pointer; scroll-snap-align: start; text-align: left; touch-action: pan-x; user-select: none; -webkit-user-select: none; transition: .16s ease; }
.game-card:hover, .game-card.selected { border-color: var(--card-accent); transform: translateY(-8px) rotate(-1deg); box-shadow: 0 10px 28px rgba(0,0,0,.6), 0 0 0 2px color-mix(in srgb, var(--card-accent) 35%, transparent); }
.game-card.inspectable:focus-visible { outline: 3px solid white; outline-offset: 3px; }
.real-face-card { aspect-ratio: 2 / 3; min-height: 0; background: #08080a; }
.real-card-image { display: block; width: 100%; height: 100%; object-fit: contain; background: #08080a; }
#hand [draggable="true"] { cursor: grab; }
#hand .game-card { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
#hand .game-card img { -webkit-user-drag: none; }
.hand-drag-ghost { position: fixed; pointer-events: none; z-index: 9999; opacity: .9; border: 2px solid #64ffcf; border-radius: 4px; box-shadow: 0 10px 30px #0009; }
#hand [draggable="true"]:active { cursor: grabbing; }
/* drop areas while dragging a card: thick and drawn inside the edge, so the mat never clips them */
.ups-slot.card-drop-ready,.arena-pile.card-drop-ready { outline: 5px dashed #64ffcf; outline-offset: -5px; }
.ups-slot.card-drop-over,.arena-pile.card-drop-over { outline: 6px solid #64ffcf; outline-offset: -6px; box-shadow: inset 0 0 48px #64ffcf88; }
.arena-pile.card-drop-ready { z-index: 9; outline-offset: 3px; }
.arena-pile.card-drop-over { outline-offset: 3px; box-shadow: inset 0 0 30px #64ffcf99, 0 0 34px #64ffcf; }
.ups-slot.card-drop-ready { z-index: 8; outline: 5px dashed #64ffcf; outline-offset: 2px; box-shadow: 0 0 22px #64ffcf99; }
.ups-slot.card-drop-over { z-index: 9; outline: 5px solid #64ffcf; outline-offset: 2px; box-shadow: inset 0 0 30px #64ffcf99, 0 0 30px #64ffcf; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.card-art { height: 83px; background-color: #29292e; background-image: var(--card-image); background-position: center 18%; background-size: cover; border-bottom: 1px solid var(--line); }
.stack-shield { position: absolute; top: 5px; right: 5px; z-index: 2; padding: 3px 5px; color: #09090b; border: 1px solid white; border-radius: 3px; background: var(--acid); box-shadow: 2px 2px 0 #000; font-family: system-ui,sans-serif; font-size: .44rem; font-weight: 950; letter-spacing: .04em; }
.card-body { padding: 8px; }
.card-kicker { color: var(--card-accent); font-family: system-ui, sans-serif; font-size: .55rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.card-name { display: block; min-height: 32px; margin-top: 4px; font-size: .92rem; line-height: .9; text-transform: uppercase; }
.card-effect { display: block; margin-top: 6px; color: #bbb; font-family: system-ui, sans-serif; font-size: .57rem; line-height: 1.25; }
.card-stats { position: absolute; left: 7px; right: 7px; bottom: 6px; display: flex; justify-content: space-between; gap: 3px; font-family: system-ui, sans-serif; font-size: .57rem; font-weight: 900; }
.card-cost { display: flex; gap: 4px; }.card-cost i { font-style: normal; }
.card-points { color: var(--yellow); }
.ups-slot .game-card { width: 100%; height: 100%; min-height: 0; flex-basis: auto; border: 0; border-radius: 3px; background: rgba(21,21,24,.96); }
.attachment-peeks { position: absolute; inset: 0 4% auto; z-index: 5; height: 42%; pointer-events: none; }
.attachment-peek { position: absolute; left: calc(var(--peek-index) * 9%); top: calc(var(--peek-index) * 10px); width: calc(92% - var(--peek-index) * 9%); height: 26px; padding: 0; overflow: hidden; pointer-events: auto; border: 2px solid white; border-radius: 3px; background: #08080a; box-shadow: 0 3px 7px #000; cursor: zoom-in; }
.attachment-peek img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.attachment-peek span { position: absolute; inset: auto 2px 1px; overflow: hidden; color: white; background: rgba(0,0,0,.74); font: 900 clamp(.28rem,.42vw,.42rem)/1 system-ui,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.ups-slot .real-card-image { object-fit: cover; }
.ups-slot .game-card:hover { transform: none; }
.arena-surface .ups-slot .card-art { height: 42%; }
.arena-surface .ups-slot .card-body { padding: clamp(3px,.55vw,7px); }
.arena-surface .ups-slot .card-name { min-height: 0; font-size: clamp(.5rem,1vw,.86rem); }
.arena-surface .ups-slot .card-effect { display: none; }
.arena-surface .ups-slot .stack-shield { top: 2px; right: 2px; padding: 2px 3px; font-size: clamp(.3rem,.5vw,.42rem); }
.arena-surface .ups-slot .card-stats { left: 4px; right: 4px; bottom: 4px; font-size: clamp(.38rem,.65vw,.55rem); }
.opponent-board .card-effect, .opponent-board .card-cost { display: none; }
.selection-bar { position: sticky; bottom: 12px; z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 10px 12px 10px 18px; border: 1px solid var(--yellow); background: rgba(14,14,16,.96); box-shadow: 0 8px 38px rgba(0,0,0,.7); backdrop-filter: blur(14px); }
.selection-bar > div { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; }
.selection-bar span { color: var(--yellow); font-family: system-ui, sans-serif; font-size: .64rem; font-weight: 900; letter-spacing: .12em; }
.selection-bar strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selection-bar small { grid-column: 1 / -1; color: var(--muted); font-family: system-ui, sans-serif; font-size: .67rem; }
.selection-actions { display: flex; gap: 8px; }
.selection-bar .discard-card-button { color: white; border: 1px solid #ff4b4b; background: #7d1010; }
.targeting-screen { position: fixed; inset: 0; z-index: 60; pointer-events: none; border: 5px solid var(--yellow); box-shadow: inset 0 0 90px rgba(0,0,0,.72); }
.targeting-banner { position: fixed; left: 50%; top: 82px; width: min(620px,calc(100% - 150px)); padding: 12px 18px; text-align: center; transform: translateX(-50%); color: white; border: 2px solid white; background: rgba(5,5,7,.94); box-shadow: 0 0 0 5px var(--yellow),0 12px 40px #000; }
.targeting-screen span { display: block; color: var(--yellow); font: 900 .7rem/1 system-ui,sans-serif; letter-spacing: .16em; }
.targeting-screen strong { display: block; margin-top: 6px; }
#cancelTargetingButton { position: fixed; right: 18px; top: 18px; pointer-events: auto; padding: 10px 16px; color: white; border: 1px solid white; background: #7d1010; cursor: pointer; }
#confirmTargetButton { position: fixed; left: 50%; top: min(610px,72vh); z-index: 2; pointer-events: auto; padding: 14px 24px; transform: translateX(-50%); color: #050507; border: 3px solid white; background: var(--yellow); box-shadow: 0 8px 30px #000; cursor: pointer; font-weight: 950; }
#confirmTargetButton[hidden] { display: none; }
.target-card-chooser { position: fixed; left: 50%; top: 162px; display: flex; justify-content: center; gap: 14px; width: min(920px,calc(100% - 28px)); max-height: min(48vh,420px); padding: 18px; overflow-x: auto; pointer-events: auto; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.5); background: rgba(4,4,6,.94); box-shadow: 0 18px 60px #000; }
.target-card-choice { position: relative; flex: 0 0 150px; padding: 0 0 8px; color: white; border: 3px solid var(--yellow); background: #111116; cursor: pointer; box-shadow: 0 0 0 2px #000,0 0 24px color-mix(in srgb,var(--yellow) 42%,transparent); }
.target-card-choice:hover,.target-card-choice:focus-visible { transform: translateY(-7px) scale(1.03); outline: 3px solid white; }
.target-card-choice.target-picked { transform: translateY(-7px) scale(1.04); outline: 4px solid white; box-shadow: 0 0 0 6px var(--acid),0 0 38px var(--acid); }
.target-card-choice img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: contain; background: #050507; }
.target-card-choice span { padding: 8px 6px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-card-choice small { color: #bbb; font: 800 .63rem/1 system-ui,sans-serif; }
.trash-gallery { display: grid; grid-template-columns: repeat(auto-fill,minmax(120px,1fr)); gap: 14px; max-height: 65vh; overflow-y: auto; padding: 8px 2px; }
.trash-gallery .dumpster-choice { width: 100%; }

.pass-screen { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle, rgba(255,44,168,.18), transparent 36%), rgba(4,4,5,.98); }
.pass-card { width: min(520px,100%); padding: 50px; text-align: center; border: 1px solid var(--line); background: #151518; box-shadow: 12px 12px 0 var(--yellow); }
.spray-icon { display: inline-grid; place-items: center; width: 80px; height: 80px; color: var(--ink); border-radius: 50%; background: var(--yellow); font-size: 2rem; transform: rotate(-8deg); }
.pass-card p { margin: 26px 0 4px; color: var(--muted); font-family: system-ui, sans-serif; font-size: .75rem; font-weight: 900; letter-spacing: .2em; }
.pass-card h2 { margin: 0; font-size: clamp(2.5rem,8vw,5rem); line-height: .9; transform: skew(-4deg); }
.pass-card > span:not(.spray-icon) { display: block; margin: 12px 0 30px; color: var(--yellow); letter-spacing: .08em; }
.rules-dialog, .result-dialog { width: min(840px, calc(100% - 28px)); color: white; border: 1px solid var(--line); border-radius: 0; background: #111114; box-shadow: 16px 16px 0 var(--pink); }
.card-viewer { width: min(920px,calc(100% - 24px)); max-height: calc(100vh - 24px); padding: 16px; color: white; border: 2px solid var(--yellow); background: #0c0c0f; box-shadow: 14px 14px 0 var(--pink); }
.rules-dialog::backdrop, .result-dialog::backdrop, .card-viewer::backdrop { background: rgba(0,0,0,.9); backdrop-filter: blur(9px); }
.card-viewer-layout { display: grid; grid-template-columns: minmax(260px,420px) 1fr; gap: clamp(18px,4vw,48px); align-items: center; clear: both; }
.card-viewer-layout img { display: block; width: 100%; max-height: calc(100vh - 64px); object-fit: contain; border: 2px solid white; box-shadow: 0 0 0 5px var(--yellow),12px 14px 0 rgba(0,0,0,.7); }
.card-viewer-copy span { color: var(--yellow); font-family: system-ui,sans-serif; font-size: .72rem; font-weight: 950; letter-spacing: .18em; text-transform: uppercase; }
.card-viewer-copy h2 { margin: 8px 0 16px; font-size: clamp(2rem,6vw,4.5rem); line-height: .88; text-transform: uppercase; }
.card-viewer-copy strong { display: block; color: var(--acid); font-family: system-ui,sans-serif; font-size: 1rem; }
.card-viewer-copy p { color: #d2d2d7; font-family: system-ui,sans-serif; font-size: 1rem; line-height: 1.55; }
.instant-card-button { margin-top: 22px; color: #09090b; }
.dumpster-dialog { width: min(760px,calc(100% - 24px)); }
.dumpster-choices { display: flex; gap: 12px; padding: 8px 2px 4px; overflow-x: auto; }
.dumpster-choice { flex: 0 0 138px; padding: 0; color: white; border: 2px solid transparent; background: transparent; cursor: pointer; }
.dumpster-choice:hover,.dumpster-choice:focus-visible { border-color: var(--yellow); }
.dumpster-choice img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.dumpster-choice span { display: block; padding: 7px 4px; font-family: system-ui,sans-serif; font-size: .7rem; font-weight: 900; }
.payment-dialog { width: min(920px,calc(100% - 24px)); }
.payment-dialog > p { margin: 0 34px 16px; color: #ddd; font: 800 .86rem/1.45 system-ui,sans-serif; }
.payment-choices { display: flex; gap: 14px; min-height: 230px; padding: 12px 34px 24px; overflow-x: auto; }
.payment-choice { flex: 0 0 145px; padding: 0 0 9px; color: white; border: 3px solid #444; background: #101014; cursor: pointer; }
.payment-choice.selected { border-color: white; outline: 5px solid var(--yellow); transform: translateY(-5px); }
.payment-choice img { display: block; width: 100%; aspect-ratio: 2/3; object-fit: contain; background: #050507; }
.payment-choice strong,.payment-choice span { display: block; padding: 5px 7px 0; overflow: hidden; font: 900 .68rem/1.15 system-ui,sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.payment-choice span { color: var(--acid); font-size: .6rem; }
.payment-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 0 34px 28px; }
.payment-actions button { min-width: 180px; padding: 13px 18px; border: 1px solid white; cursor: pointer; font-weight: 950; }
.payment-actions button:disabled { opacity: .35; cursor: not-allowed; }
.dialog-close { float: right; width: 42px; height: 42px; color: white; border: 1px solid var(--line); background: #222; cursor: pointer; font-size: 1.6rem; }
.rules-head { padding: 34px 34px 12px; }.rules-head span, .result-dialog > span { color: var(--yellow); font-family: system-ui, sans-serif; font-size: .7rem; font-weight: 900; letter-spacing: .2em; }.rules-head h2 { margin: 5px 0; font-size: 3rem; text-transform: uppercase; }
.rules-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.rules-grid article { padding: 20px; background: #19191d; }.rules-grid b { color: var(--pink); }.rules-grid h3 { margin: 8px 0; text-transform: uppercase; }.rules-grid p, .rule-notes p { color: #bbb; font-family: system-ui, sans-serif; font-size: .82rem; line-height: 1.5; }
.rule-notes { padding: 18px 34px 30px; }.rule-notes strong { color: var(--yellow); }
.result-dialog { padding: 46px; text-align: center; }.result-burst { display: grid; place-items: center; width: 108px; aspect-ratio: 1; margin: -10px auto 18px; position: relative; isolation: isolate; color: white; background: #fff; clip-path: polygon(29.3% 0,70.7% 0,100% 29.3%,100% 70.7%,70.7% 100%,29.3% 100%,0 70.7%,0 29.3%); font-size: 1.9rem; letter-spacing: .04em; transform: rotate(-7deg); }
.result-burst::before { content: ""; position: absolute; inset: var(--stop-rim, 5px); z-index: -1; background: var(--red); clip-path: polygon(29.3% 0,70.7% 0,100% 29.3%,100% 70.7%,70.7% 100%,29.3% 100%,0 70.7%,0 29.3%); }.result-dialog h2 { margin: 12px auto 26px; max-width: 620px; font-size: clamp(2.2rem,6vw,4.4rem); line-height: .92; transform: skew(-4deg); }.final-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px; }.score-card { padding: 18px; border: 1px solid var(--line); background: #202024; }.score-card strong { display: block; margin-top: 6px; color: var(--yellow); font-size: 2rem; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 120; max-width: calc(100% - 30px); padding: 12px 18px; color: var(--ink); background: white; box-shadow: 6px 6px 0 var(--pink); font-family: system-ui, sans-serif; font-weight: 850; transform: translate(-50%,150%); transition: .22s ease; }.toast.show { transform: translate(-50%,0); }
/* Hidden toasts slide below the screen edge, but an empty one is short enough to peek out: hide it fully once it has slid away. */
.toast:not(.show) { visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }

@media (max-width: 900px) {
  .setup-screen { grid-template-columns: 1fr; }
  .setup-visual { position: relative; top: 0; height: 56vh; min-height: 460px; border-right: 0; }
  .setup-panel { padding: 34px 18px 50px; }
  .street-control { grid-template-columns: 1fr; }.phase-track { grid-column: 1 / -1; }.street-message { justify-content: center; }.street-message p { max-width: 360px; }.street-actions { flex-wrap: wrap; }.street-actions .phase-button { min-width: min(340px,86vw); }
  .rules-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .topbar { height: 66px; padding-inline: 12px; }.brand-button small { display: none; }.icon-button { padding-inline: 11px; }.icon-button span { display: none; }
  .setup-visual { height: 52vh; min-height: 410px; }.visual-copy { inset-inline: 22px; bottom: 28px; }.visual-copy h1 { font-size: 3.5rem; }.visual-copy p { font-size: .86rem; }
  .deck-picker { grid-template-columns: repeat(3,1fr); }.deck-choice { height: 104px; }.deck-choice img { height: 62px; }.versus-stage { height: 280px; }.versus-logo { height: 54px; }
  .game-screen { padding-inline: 8px; }.match-player span { display: none; }.match-player img { width: 54px; }
  .opponent-board { transform: none; }.opponent-board .arena-surface { aspect-ratio: 17 / 6.4; }
  .arena-surface { border-radius: 4px; }.arena-surface .ups-slot { width: 12.5%; }.arena-surface .ups-slot:nth-child(1) { left: 58%; }.arena-surface .ups-slot:nth-child(2) { left: 44%; }.arena-surface .ups-slot:nth-child(3) { left: 30%; }.arena-surface .ups-slot:nth-child(4) { left: 16%; }.arena-surface .ups-slot:nth-child(5) { left: 2.5%; }.arena-guide span { padding: 2px 4px; }.arena-surface .ups-slot .card-kicker { display: none; }.arena-surface .ups-slot .card-points { font-size: .43rem; }.arena-surface .ups-slot .card-cost { display: none; }
  .arena-pile { min-width: 0; min-height: 24px; padding: 2px 3px; gap: 3px; font-size: .42rem; }.arena-pile b { min-width: 16px; width: 16px; height: 16px; font-size: .5rem; }
  .ups-row { gap: 4px; min-height: 112px; }.ups-slot { min-height: 112px; }.ups-slot .card-body { padding: 5px; }.ups-slot .card-effect { display: none; }.ups-slot .card-name { font-size: .58rem; }.ups-slot .card-art { height: 52%; }
  .street-control { gap: 9px; }.street-message p { display: none; }.phase-number { font-size: 1.5rem; }.phase-button { padding-inline: 10px; font-size: .72rem; }.street-actions { width: 100%; max-width: none; margin-inline: auto; }
  .game-card { flex-basis: 114px; }.selection-bar { align-items: stretch; }.selection-bar small { display: none; }.selection-bar button { max-width: 130px; }
  .rules-grid { grid-template-columns: 1fr; }.rules-dialog { padding: 0; }.rules-head { padding-inline: 20px; }.rule-notes { padding-inline: 20px; }.result-dialog { padding: 38px 18px; }
  .pass-card { padding: 40px 20px; }
  .card-viewer { padding: 10px; }.card-viewer-layout { grid-template-columns: 1fr; gap: 12px; }.card-viewer-layout img { width: min(62vw,330px); max-height: 62vh; margin: 0 auto; }.card-viewer-copy { text-align: center; }.card-viewer-copy h2 { margin-block: 5px 9px; }.card-viewer-copy p { margin-bottom: 4px; font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) { .reel-item { display: none; animation: none; }.reel-item:first-child { display: block; opacity: 1; }.versus-character { animation: none; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

/* Keep both complete mats on the tabletop; reserve more room for the player. */
.game-screen { --mat-space: max(240px, calc(100dvh - 210px)); display: block; padding-top: 6px; }
.game-screen .board { width: 100%; max-width: 1160px; margin-inline: auto; }
.game-screen .player-board { max-width: 1240px; }
.game-screen .opponent-board { opacity: .94; }
.arena-stage { position: relative; width: 100%; overflow: hidden; }
.opponent-board .arena-stage { height: calc(var(--mat-space) * .35); }
.player-board .arena-stage { height: calc(var(--mat-space) * .65); }
.game-screen .board .arena-surface { position: absolute; left: 50%; top: 50%; width: 100%; height: auto; aspect-ratio: 17 / 11; background-size: cover; background-position: center; transform-origin: center; transform: translate(-50%,-50%); box-shadow: 0 24px 28px #000; }
.subway-feed { position: absolute; bottom: 0; left: 0; right: 0; z-index: 20; border: 1px solid #fff; background: #8b1818; color: white; font: bold 11px system-ui; padding: 5px 2px; cursor: pointer; }
.subway-feed:disabled { background: #242428; color: #bbb; cursor: default; }
.game-screen .board .ups-slot .real-card-image { object-fit: contain; }
.game-screen .board .arena-surface .ups-slot { top: 29.5%; height: 25.5%; width: 14%; }
/* Anchor each card to its painted tunnel, from UPS 01 back to STOP. */
.game-screen .board .arena-surface .ups-slot:nth-child(1) { left: 66%; }
.game-screen .board .arena-surface .ups-slot:nth-child(2) { left: 50%; }
.game-screen .board .arena-surface .ups-slot:nth-child(3) { left: 33.5%; }
.game-screen .board .arena-surface .ups-slot:nth-child(4) { left: 17%; }
.game-screen .board .arena-surface .ups-slot:nth-child(5) { left: 2.5%; }
/* Fill the painted supply sections including their CANS! / RE-UP / CAPS names, so they are big drop targets. */
.game-screen .board .arena-surface .can-pile { left: 2.7%; width: 33%; bottom: 8%; height: 35%; }
.game-screen .board .arena-surface .beast-pile { top: 55%; bottom: auto; height: 39%; }
.revealed-in-hand { position: relative; }
.revealed-in-hand::after { content: ""; position: absolute; inset: 1px; border: 3px solid #ff3030; border-radius: 45%; pointer-events: none; z-index: 50; box-shadow: 0 0 8px #ff3030; }
.game-screen .board .arena-surface .cap-pile { left: 44%; width: 34%; bottom: 8%; height: 35%; }
.game-screen .board-heading { padding: 4px 0; min-height: 24px; align-items: center; gap: 5px; }
.game-screen .board-heading .zone-label { font-size: .6rem; letter-spacing: .04em; }
.game-screen .board-heading > div:first-child { gap: 5px; }
.game-screen .board-heading .supply-line { gap: 3px; font-size: .6rem; }
.game-screen .board-heading .supply-pill { padding: 3px; }
.game-screen .board .arena-pile { min-width: 0; min-height: 0; }
.target-card-chooser { flex-wrap: wrap; justify-content: center; overflow: auto; max-height: calc(100dvh - 285px); }
.target-card-choice { flex-basis: clamp(105px,14vw,150px); }
#confirmTargetButton { top: auto; bottom: 32px; }

/* Ownership remains visible while targets are hovered or selected. */
.owner-current { --owner-color: #269cff; }
.owner-opponent { --owner-color: #ff424d; }
.target-card-choice[class*="owner-"],.dumpster-choice[class*="owner-"],.ups-slot.targetable[class*="owner-"] {
  border: 3px solid var(--owner-color);
  box-shadow: 0 0 0 2px #08080a,0 0 18px color-mix(in srgb,var(--owner-color) 45%,transparent);
}
.target-card-choice[class*="owner-"] small { color: var(--owner-color); display: block; padding: 6px; line-height: 1.35; }
.dumpster-choice[class*="owner-"] span { color: var(--owner-color); }
.target-card-choice.target-picked[class*="owner-"],.ups-slot.target-picked[class*="owner-"] { outline: 4px solid white; box-shadow: 0 0 0 6px var(--owner-color),0 0 24px var(--owner-color); }
#revealedLegendaries .target-card-choice { width: 120px; display: inline-flex; margin: 8px; vertical-align: top; }
#revealedLegendaries h3 { font-size: 12px; letter-spacing: .08em; }
#matchModeHelp { font-size: .85rem; color: #ccc; margin: 10px 0 20px; }
.match-mode-picker { border: 1px solid #555; padding: 14px; margin: 16px 0 0; display: grid; gap: 10px; }
.match-mode-picker legend { padding: 0 8px; font-weight: 800; }
.match-mode-picker label { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #555; cursor: pointer; }
.match-mode-picker label:has(input:checked) { border-color: var(--yellow); background: #292511; }
.match-mode-picker input { accent-color: var(--yellow); width: 18px; height: 18px; }
.match-mode-picker small { display: block; margin-top: 4px; color: #bbb; font-size: .75rem; }
#gameScreen { padding-left: clamp(90px, 13vw, 190px); }
.game-screen .board { position: relative; }
.match-artists { position: absolute; right: calc(100% + 12px); top: 24px; bottom: 8px; width: clamp(72px, 11vw, 170px); display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
.match-artists figure { margin: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; align-items: center; }
.match-artists img { width: 100%; min-height: 0; height: calc(100% - 32px); object-fit: contain; object-position: center bottom; }
.match-artists figcaption { color: #eee; text-align: center; font-size: 10px; font-weight: 800; padding: 6px 0; }
@media (max-width: 650px) { #gameScreen { padding-left: 62px; } .match-artists { width: 48px; right: calc(100% + 6px); } .match-artists figcaption { font-size: 8px; } }
.player-board .board-heading { position: relative; }
/* Cops patrol (owner, 2026-11-12): walks slowly across the whole board and back, a blue line out, a red line back. */
#policePatrol { position: fixed; left: 0; top: calc(50% - 40px); width: clamp(64px, 8vw, 100px); z-index: 1200; pointer-events: none; }
#policePatrol::before { content: ""; position: absolute; right: 55%; bottom: 6px; width: 100vw; height: 6px; border-radius: 3px; background: linear-gradient(to right, transparent, var(--patrol-line, #1e6bff)); box-shadow: 0 0 14px var(--patrol-line, #1e6bff); }
#policePatrol.patrol-blue { --patrol-line: #1e6bff; }
#policePatrol.patrol-red { --patrol-line: #ff2330; }
.caught-up-banner { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3em; padding: 16px; background: rgb(0 0 0 / .55); pointer-events: none; text-align: center; }
.caught-up-banner[hidden] { display: none; }
.caught-up-banner strong { color: var(--yellow, #ffd21c); font: 900 clamp(2.2rem, 9vw, 6.5rem)/1 var(--display-font, Impact, system-ui, sans-serif); letter-spacing: .02em; text-shadow: 4px 4px 0 #ff2ca8, 0 0 24px #000; -webkit-text-stroke: 2px #000; paint-order: stroke fill; }
.caught-up-banner span { color: #fff; font: 900 clamp(1.3rem, 4.5vw, 3rem)/1.1 system-ui, sans-serif; text-shadow: 3px 3px 0 #000; }
.caught-up-banner.rival strong { text-shadow: 4px 4px 0 #1e6bff, 0 0 24px #000; }
#policePatrol[hidden] { display: none; }
#policePatrol img { display: block; width: 100%; filter: drop-shadow(0 4px 3px #0006); }
/* Actual video frames, pre-keyed into a transparent animated PNG. */
#policePatrol .patrol-character { animation: none; }
#gameScreen { padding-right: clamp(190px, 22vw, 280px); }
.match-history { position: fixed; right: 10px; top: var(--match-history-top, 240px); bottom: 16px; width: clamp(170px, 20vw, 250px); overflow-y: auto; background: rgba(16,16,20,.55); border: 1px solid #444; padding: 12px; z-index: 6; }
.match-history h3 { margin: 0 0 6px; font-size: 16px; color: var(--yellow); }
.match-history p { font: 11px system-ui; color: #aaa; }
.match-history ol { list-style: none; margin: 0; padding: 0; font: 12px/1.5 system-ui; }
.match-history li { padding: 10px 0; border-bottom: 1px solid #34343c; overflow-wrap: anywhere; }
.match-history strong { display: block; color: #aaa; font-size: 10px; margin-bottom: 4px; }
@media(max-width: 700px) { #gameScreen { padding-right: 12px; } .match-history { position: relative; right: auto; top: auto; bottom: auto; width: 100%; max-height: 200px; margin-bottom: 12px; } }
.computer-play-preview { position: fixed; width: 130px; max-height: 195px; object-fit: contain; pointer-events: none; z-index: 80; border: 2px solid #ffb400; border-radius: 6px; box-shadow: 0 8px 30px #000b; }
.forced-discard-dialog { width: min(920px,94vw); max-height: 88vh; overflow: auto; background: #121216; color: #fff; border: 2px solid var(--yellow); padding: 24px; }
.forced-discard-dialog::backdrop { background: #000e; }
.forced-discard-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.forced-discard-choices > button { cursor: pointer; padding: 10px; color: white; background: #24242b; border: 1px solid #777; }
.game-screen .player-hand-zone { position: relative; margin-top: calc(-1 * var(--hand-lift, 48px)); z-index: 5; }
.player-hand-zone .hand-heading { position: absolute; top: 24px; right: 0; flex-direction: column; align-items: flex-end; gap: 3px; padding: 0 0 3px; }
.player-hand-zone .pile-stats { order: -1; }
.player-hand-zone .hand-count-label { display: flex; align-items: baseline; gap: 8px; }
.player-hand-zone .hand-count-label .zone-label { font-size: .6rem; }
.player-hand-zone .hand-count-label strong { font-size: .95rem; }
.player-hand-zone .hand-phase-button { width: 170px; min-width: 0; min-height: 40px; margin-top: 10px; padding: 8px; font-size: 12px; white-space: normal; }
.player-hand-zone .hand-row { width: calc(100% - 180px); padding-top: 8px; padding-bottom: 8px; align-items: flex-start; }
@media(max-width: 650px) { .player-hand-zone .hand-heading { position: static; padding-top: 18px; } .player-hand-zone .hand-row { width: 100%; } }
.hand-row .real-face-card { aspect-ratio: auto; }
.hand-row .real-card-image { height: auto; aspect-ratio: 2 / 3; }
.hand-card-cost { display: block; height: 22px; text-align: center; font: 800 13px/22px system-ui,sans-serif; color: var(--yellow); background: #0b0b0eef; }
.hand-row .game-card.coach-suggested { outline: 2px dashed #70f5d0; outline-offset: 2px; }
.coach-hint { display: block; width: 100%; padding: 3px 1px; background: #153e34; color: #b9ffeb; font: 800 9px/1.2 system-ui,sans-serif; text-align: center; pointer-events: none; }
.coach-control { outline: 3px dashed #70f5d0 !important; outline-offset: 3px; box-shadow: 0 0 14px #70f5d055; }
.target-card-choice.coach-control img,.dumpster-choice.coach-control img,.payment-choice.coach-control img,.game-card.coach-suggested img { outline: 4px solid #70f5d0; outline-offset: -4px; filter: drop-shadow(0 0 7px #70f5d0); }
.target-card-choice .coach-choice-label,.dumpster-choice .coach-choice-label { display: block; background: #70f5d0; color: #06251c !important; padding: 7px 4px; font: 900 10px/1.3 system-ui,sans-serif; }
.player-board .street-control { position: absolute; right: calc(100% + 12px); top: 18px; width: clamp(140px,11vw,170px); max-width: none; min-height: 0; margin: 0; padding: 10px; grid-template-columns: minmax(0,1fr); gap: 9px; border: 1px solid #555; border-radius: 6px; background: #111117; z-index: 7; }
.player-board .street-message { gap: 7px; align-items: flex-start; }
.player-board .street-message strong { font-size: 15px; overflow-wrap: anywhere; }
.player-board .street-message p { display: block; font-size: 11px; }
.player-board .phase-number { font-size: 24px; }
.player-board .street-actions { display: flex; flex-direction: column; grid-column: 1; width: 100%; gap: 8px; }
.player-board .street-actions .phase-button { width: 100%; min-width: 0; min-height: 42px; height: auto; padding: 9px 5px; font-size: 12px; white-space: normal; }
@media(min-width: 901px) { #gameScreen { padding-left: max(160px,13vw); } .player-board .match-artists { top: 245px; } }
@media(max-width: 900px) { .player-board .street-control { position: relative; right: auto; top: auto; width: 100%; margin: 8px 0; } .player-board .street-actions { flex-direction: row; } }
.player-board > .selection-bar { position: absolute; top: 0; bottom: auto; left: 0; right: 0; min-height: 56px; padding: 8px 12px; gap: 12px; z-index: 12; }
@media(max-width: 650px) { .player-board > .selection-bar { top: 0; flex-wrap: wrap; } }
.opponent-hand-display { display: flex; justify-content: center; align-items: flex-end; gap: 14px; min-height: 0; padding: 0; }
.game-screen .opponent-board .board-heading { padding-block: 0; margin: 0; }
#soundButton[hidden] { display: none; }
#gameScreen .player-board .player-presenter { top: auto; bottom: 8px; gap: 24px; width: clamp(140px,11vw,170px); justify-content: flex-end; }
#gameScreen .player-presenter .street-control { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: 100%; margin: 0; flex: none; }
#gameScreen .player-presenter .street-control { z-index: 2; }
#gameScreen .player-presenter .street-control::before,
#gameScreen .player-presenter .street-control::after { content: ""; position: absolute; left: calc(50% - 6px); right: auto; bottom: -35px; width: 36px; height: 36px; border: 0; transform: none; pointer-events: none; }
#gameScreen .player-presenter .street-control::before { background: #eee; clip-path: polygon(0 0,100% 0,0 100%); }
#gameScreen .player-presenter .street-control::after { background: #111117; clip-path: polygon(8% 0,90% 0,8% 82%); }
@media(max-width: 900px) {
  #gameScreen .player-presenter .street-control::before,#gameScreen .player-presenter .street-control::after { left: auto; right: -30px; bottom: auto; top: 50%; width: 30px; height: 30px; }
  #gameScreen .player-presenter .street-control::before { clip-path: polygon(0 0,100% 70%,0 100%); }
  #gameScreen .player-presenter .street-control::after { clip-path: polygon(0 10%,82% 68%,0 90%); }
}
@media(max-width: 900px) { #gameScreen .player-board .player-presenter { position: relative; left: auto; right: auto; bottom: auto; width: 100%; display: grid; grid-template-columns: minmax(0,1fr) 80px; margin-bottom: 12px; } }
#opponentHandCount { color: #ddd; font: 800 11px system-ui,sans-serif; }
#opponentHandBacks { display: flex; align-items: center; padding-left: 12px; }
.opponent-card-back { display: flex; align-items: center; justify-content: center; width: 34px; height: 49px; margin-left: -10px; border: 1px solid #aaa; border-radius: 3px; background: #09090b; box-shadow: 2px 2px 4px #0009; }
.opponent-card-back img { width: 90%; height: 90%; object-fit: contain; }
@media(max-width: 650px) { .opponent-hand-display { gap: 8px; flex-wrap: wrap; } .opponent-card-back { width: 28px; height: 40px; } }

/* History on the left; arena-anchored crew portraits and controls on the right. */
.music-dialog { width: min(520px,92vw); }
.music-dialog > label { display: block; margin: 18px 0 8px; font-weight: bold; }
.music-dialog input,.music-dialog select,.music-dialog audio { width: 100%; }
.music-dialog select { padding: 10px; background: #19191f; color: white; border: 1px solid #666; }
.music-dialog input::file-selector-button { padding: 10px; margin-right: 10px; border: 0; background: var(--yellow); color: #000; cursor: pointer; }
.music-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
#musicStatus { overflow-wrap: anywhere; }
.music-buy { margin-top: 18px; padding-top: 14px; border-top: 1px solid #333; }
.music-buy-title { display: inline !important; }
.music-price { margin-left: 6px; padding: 2px 8px; border-radius: 3px; background: #000; color: var(--yellow); font-size: .85em; }
.icon-button:hover .music-price { color: #fff; }
.music-price.owned { color: #7dff9a; }
.music-buy.own-file #musicDownload { display: none; }
.music-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.music-confirm[hidden] { display: none; }
.music-confirm p { flex-basis: 100%; margin: 0; }
#musicBuyStatus { min-height: 1.2em; overflow-wrap: anywhere; }
/* Locked online (owner, 2026-10-26): grey, with hazard tape across reading FINISH 5 LESSONS TO PLAY. */
.match-mode-picker label.online-locked { position: relative; overflow: hidden; padding-bottom: 92px; border: 2px solid #5b5963; background: #26252b; color: #8d8a96; cursor: not-allowed; }
.match-mode-picker label.online-locked small { color: #8d8a96; }
.hazard-tape { display: none; }
.online-locked .hazard-tape { display: flex; align-items: center; justify-content: center; position: absolute; left: -8%; right: -8%; bottom: 16px; height: 58px;
  transform: rotate(-3deg); background: repeating-linear-gradient(-45deg,#ffd21f 0 22px,#111 22px 44px); border-block: 4px solid #111; box-shadow: 0 6px 14px rgba(0,0,0,.55); pointer-events: none; }
/* 1 VS CPU start button: same caution tape while the 5 lessons are unfinished (all screen sizes). */
#startButton.cpu-locked { position: relative; overflow: hidden; cursor: not-allowed; }
#startButton.cpu-locked > span:not(.hazard-tape) { opacity: .35; }
#startButton.cpu-locked .hazard-tape { display: flex; align-items: center; justify-content: center; position: absolute; left: -12%; right: -12%; top: 50%; bottom: auto; height: clamp(30px,38%,44px);
  transform: translateY(-50%) rotate(-5deg); background: repeating-linear-gradient(-45deg,#ffd21f 0 18px,#111 18px 36px); border-block: 3px solid #111; pointer-events: none; }
#startButton.cpu-locked .hazard-tape b { font-family: system-ui, "Arial Black", Helvetica, sans-serif; font-style: normal; font-size: clamp(11px,2.6vw,17px); padding: 3px 10px; text-shadow: none; transform: none; }
.lessons-nudge { animation: lessons-nudge .5s ease-in-out 2; }
@keyframes lessons-nudge { 0%,100% { translate: 0 0; } 25% { translate: -5px 0; } 75% { translate: 5px 0; } }
@media (prefers-reduced-motion: reduce) { .lessons-nudge { animation: none; outline: 3px solid #16dcff; } }
.hazard-tape b { padding: 6px 14px; background: #ffd21f; color: #111; border: 3px solid #111; font-weight: 900; font-size: clamp(16px,4.6vw,24px); letter-spacing: 1px; white-space: nowrap; }
.opponent-board .match-artists.has-easy-coach { top: 8px; bottom: auto; gap: 24px; justify-content: flex-start; }
.has-easy-coach figure { height: auto; flex: none; }
.has-easy-coach img { height: auto; max-height: 170px; }
.easy-coach { position: relative; z-index: 2; padding: 12px; border: 3px solid #eee; border-radius: 0; box-shadow: 4px 4px 0 #000; background: #111117; color: #fff; pointer-events: auto; }
.easy-coach::before,.easy-coach::after { content: ""; position: absolute; left: calc(50% - 6px); bottom: -35px; width: 36px; height: 36px; pointer-events: none; }
.easy-coach::before { background: #eee; clip-path: polygon(0 0,100% 0,0 100%); }
.easy-coach::after { background: #111117; clip-path: polygon(8% 0,90% 0,8% 82%); }
@media(max-width: 900px) {
  .easy-coach::before,.easy-coach::after { left: auto; right: -30px; bottom: auto; top: 50%; width: 30px; height: 30px; }
  .easy-coach::before { clip-path: polygon(0 0,100% 70%,0 100%); }
  .easy-coach::after { clip-path: polygon(0 10%,82% 68%,0 90%); }
}
.easy-coach strong { font-size: 13px; color: var(--yellow); }
.easy-coach p { font: 12px/1.45 system-ui,sans-serif; margin: 7px 0 0; }
@media(max-width: 900px) { .opponent-board .match-artists.has-easy-coach { position: relative; left: auto; right: auto; top: auto; width: 100%; display: grid; grid-template-columns: minmax(0,1fr) 80px; margin-bottom: 12px; } }
.opponent-board .opponent-presenter { top: 12px; bottom: auto; justify-content: flex-start; gap: 24px; width: clamp(140px,11vw,170px); }
.opponent-presenter .street-control { position: relative; display: grid; grid-template-columns: minmax(0,1fr); width: 100%; min-height: 0; margin: 0; padding: 12px; gap: 9px; border: 3px solid #eee; border-radius: 0; background: #111117; box-shadow: 4px 4px 0 #000; pointer-events: auto; }
.opponent-presenter .street-control::after { content: ""; position: absolute; right: 22px; bottom: -17px; width: 24px; height: 24px; background: #111117; border-right: 3px solid #eee; border-bottom: 3px solid #eee; transform: skewY(35deg); }
.opponent-presenter .street-message { align-items: flex-start; gap: 7px; }
.opponent-presenter .phase-number { font-size: 24px; }
.opponent-presenter .street-message strong { font-size: 15px; }
.opponent-presenter .street-message p { display: block; font-size: 11px; line-height: 1.5; }
.opponent-presenter .selection-bar { position: static; display: block; min-height: 0; margin: 0; padding: 10px 0 0; border: 0; border-top: 1px solid #555; background: none; }
.opponent-presenter .selection-bar > div { display: block; }
.opponent-presenter .selection-bar strong,.opponent-presenter .selection-bar small { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.opponent-presenter .selection-bar small { font-size: 11px; line-height: 1.5; }
.opponent-presenter figure { height: auto; flex: none; }
.opponent-presenter img { height: auto; max-height: 170px; }
@media(max-width: 900px) { .opponent-board .opponent-presenter { position: relative; left: auto; right: auto; top: auto; width: 100%; display: grid; grid-template-columns: minmax(0,1fr) 80px; margin-bottom: 12px; } }
.game-screen .player-board { margin-top: calc(-1 * var(--opponent-gap,0px)); }
.opponent-board .match-artists { bottom: calc(8px + var(--opponent-gap,0px)); }
.player-board .street-control { top: 34px; border: 3px solid #eee; border-radius: 0; box-shadow: 4px 4px 0 #000; padding: 12px; overflow: visible; }
.player-board .street-control::after { content: ""; position: absolute; right: 22px; bottom: -17px; width: 24px; height: 24px; background: #111117; border-right: 3px solid #eee; border-bottom: 3px solid #eee; transform: skewY(35deg); }
.player-board .street-control .selection-bar { position: static; display: block; min-height: 0; margin: 0; padding: 10px 0 0; border: 0; border-top: 1px solid #555; background: none; }
.player-board .street-control .selection-bar > div { display: block; }
.player-board .street-control .selection-bar strong,.player-board .street-control .selection-bar small { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.player-board .street-control .selection-bar small { font-size: 11px; line-height: 1.5; }
.player-board .street-message p { line-height: 1.5; }
.player-hand-zone .hand-heading { width: 170px; }
.player-hand-zone .hand-action-controls { order: -3; display: flex; flex-direction: column; gap: 7px; width: 100%; }
.player-hand-zone .pile-stats { order: -2; margin-top: 6px; }
.player-hand-zone .hand-action-controls button { width: 100%; min-width: 0; max-width: none; min-height: 38px; margin: 0; padding: 8px; white-space: normal; font-size: 12px; background: var(--yellow); color: #090909; border: 1px solid #555; cursor: pointer; }
.player-hand-zone .hand-action-controls button:disabled { opacity: .45; cursor: not-allowed; }
.hand-action-controls .selection-actions { display: flex; flex-direction: column; gap: 7px; }
@media(min-width: 901px) { .player-board .match-artists { top: 320px; } }
@media(max-width: 900px) { .player-board .street-control { top: auto; margin-bottom: 24px; } }
@media(max-width: 650px) { .player-hand-zone .hand-heading { width: 100%; } .player-hand-zone .hand-action-controls { max-width: 220px; } }
#gameScreen { padding-left: clamp(190px,22vw,280px); padding-right: clamp(90px,13vw,190px); }
.match-history { left: 10px; right: auto; }
.match-artists { left: calc(100% + 12px); right: auto; }
@media(min-width: 901px) {
  #gameScreen { padding-right: max(160px,13vw); }
  .player-board .street-control { left: calc(100% + 12px); right: auto; }
}
@media(max-width: 700px) {
  #gameScreen { padding-left: 12px; }
  .match-history { left: auto; }
}
@media(max-width: 650px) {
  #gameScreen { padding-right: 62px; }
  .match-artists { left: calc(100% + 6px); right: auto; }
}
.result-dialog .block-button { margin-bottom: 14px; background: var(--pink); color: white; box-shadow: 7px 7px 0 var(--yellow); text-decoration: none; }


.rotate-phone { display: none; }
.quick-music-toggle { display: none; }
@media (pointer: coarse) and (orientation: landscape) {
  .quick-music-toggle { display: inline-block; }
  body:has(#gameScreen:not([hidden])) .topbar { padding-inline: max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right)); }
  body:has(#gameScreen:not([hidden])) .top-actions { gap: 4px; }
  body:has(#gameScreen:not([hidden])) .top-actions .icon-button { padding: 0 8px; font-size: 12px; min-height: 40px; }
}
.return-to-mat { display: none; }
@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen .return-to-mat { display: block; position: static; width: 100%; min-height: 48px; background: var(--yellow); color: #111; border: 2px solid white; border-radius: 5px; font: bold 13px system-ui; }
}
/* The card inspection sheet fits the viewport; its details scroll below the art. */
#cardViewer { box-sizing: border-box; max-height: calc(100dvh - 16px); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
@media (pointer: coarse), (max-width: 650px) {
  #cardViewer { width: calc(100vw - 16px); height: calc(100dvh - 16px); margin: auto; padding: 12px; box-shadow: none; touch-action: pan-y; }
  #cardViewer .card-viewer-layout { grid-template-columns: minmax(0,1fr); gap: 20px; }
  #cardViewer .card-viewer-layout img { width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 90px); margin: 0 auto; }
  #cardViewer .card-viewer-copy { text-align: left; padding: 8px 6px 24px; overflow-wrap: anywhere; }
  #cardViewer .card-viewer-copy h2 { font-size: clamp(24px,4vw,40px); line-height: 1.1; }
  #cardViewer .card-viewer-copy p { font-size: 16px; }
  #cardViewer .dialog-close { position: sticky; top: 0; float: right; min-width: 44px; min-height: 44px; z-index: 2; background: #16121e; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #cardViewer { overflow: hidden; padding: 12px 58px 12px 12px; }
  #cardViewer .dialog-close { position: absolute; top: 4px; right: 4px; }
  #cardViewer .card-viewer-layout { height: 100%; grid-template-columns: minmax(0,38%) minmax(0,1fr); gap: 16px; align-items: center; }
  #cardViewer .card-viewer-layout img { max-height: calc(100dvh - 48px); max-width: 100%; box-shadow: none; }
  #cardViewer .card-viewer-copy { padding: 0; }
  #cardViewer .card-viewer-copy h2 { font-size: clamp(18px,3vw,30px); margin: 5px 0 8px; }
  #cardViewer .card-viewer-copy p { font-size: clamp(12px,2.8dvh,16px); line-height: 1.3; margin: 8px 0 0; }
  #cardViewer .card-viewer-copy strong { font-size: 13px; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #musicDialog, #backgroundDialog { width: min(640px,96vw); max-height: 94dvh; margin: auto; padding: 16px; overflow-y: auto; }
  #musicDialog button, #backgroundDialog button, #backgroundFile { min-height: 44px; }
  #backgroundFile { width: 100%; font-size: 16px; }
  #backgroundFile::file-selector-button { min-height: 44px; padding: 8px 12px; background: var(--yellow); border: 0; margin-right: 8px; }
  #musicDialog .dialog-close, #backgroundDialog .dialog-close { position: sticky; top: 0; float: right; z-index: 2; }
}

/* Landscape match composition: two opposing lanes, hand and thumb actions. */
@media (pointer: coarse) and (orientation: landscape) {
  body:has(#gameScreen:not([hidden])) { overflow: hidden; }
  #gameScreen:not([hidden]) { position: fixed; inset: var(--match-content-top,44px) 0 0; height: calc(100dvh - var(--match-content-top,44px)); display: grid; grid-template-columns: minmax(0,1fr) 140px; grid-template-rows: minmax(0,1fr) minmax(0,1fr) 100px; gap: 2px 8px; padding: 2px max(8px,env(safe-area-inset-right)) 2px max(8px,env(safe-area-inset-left)); overflow: hidden; }
  #gameScreen .opponent-board { grid-area: 1 / 1; }
  #gameScreen .player-board { grid-area: 2 / 1; }
  #gameScreen .board { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; margin: 0; }
  #gameScreen .board-heading { flex: 0 0 20px; min-height: 20px; padding: 0; }
  #gameScreen .board .arena-stage { flex: 1; height: auto; min-height: 0; width: 100%; aspect-ratio: auto; overflow: visible; }
  #gameScreen .board .arena-surface { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; transform: none !important; border-radius: 4px; background-size: 100% 100%; box-shadow: none; }
  #gameScreen .board .arena-surface .ups-slot { top: 4%; height: 90%; width: 11%; min-height: 0; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(1) { left: 49%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(2) { left: 37%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(3) { left: 25%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(4) { left: 13%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(5) { left: 1%; }
  #gameScreen .board .arena-pile { font-size: 9px; }
  #gameScreen .board .arena-surface .can-pile { left: 62%; top: 5%; width: 16%; height: 42%; bottom: auto; }
  #gameScreen .board .arena-surface .cap-pile { left: 62%; top: 52%; width: 16%; height: 42%; bottom: auto; }
  #gameScreen .board .arena-surface .beast-pile { left: 80%; top: 52%; width: 8%; height: 42%; bottom: auto; }
  #gameScreen .board .arena-surface .trash-pile { left: 80%; top: 5%; width: 8%; height: 42%; bottom: auto; }
  #gameScreen .board .arena-surface .deck-pile { left: 90%; top: 5%; width: 8%; height: 89%; bottom: auto; }
  #gameScreen .arena-guide, #gameScreen .arena-crew { display: none; }
  #gameScreen .player-hand-zone { display: contents; }
  #gameScreen .player-hand-zone .hand-row { grid-area: 3 / 1; height: 100%; min-height: 0; padding: 3px; margin: 0; }
  #gameScreen #hand .game-card { flex-basis: 56px; min-height: 0; }
  #gameScreen .hand-card-cost { height: 15px; font-size: 10px; line-height: 15px; }
  #gameScreen .coach-hint { display: none; }
  #gameScreen .player-hand-zone .hand-heading { grid-area: 1 / 2 / 4 / 3; width: 100%; height: 100%; overflow-y: auto; padding: 4px; justify-content: flex-end; }
  #gameScreen .player-hand-zone .hand-action-controls button { min-height: 44px; font-size: 12px; }
  #gameScreen .match-history { display: none; }
}

@media (pointer: coarse) and (orientation: landscape) {
  body:has(#gameScreen:not([hidden])) > .topbar { height: 44px; min-height: 44px; padding: 2px 10px; }
  body:has(#gameScreen:not([hidden])) .brand-button img { display: none; }
  body:has(#gameScreen:not([hidden])) .match-clock { display: none; }
  body:has(#gameScreen:not([hidden])) > .account-banner { display: none; }
  #gameScreen:not([hidden]) { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 4px 10px; padding: 4px 10px; }
  #gameScreen .match-history { grid-column: 1 / -1; grid-row: 3; }
  #gameScreen .opponent-board { grid-column: 1; grid-row: 1; }
  #gameScreen .player-board { grid-column: 2; grid-row: 1; }
  #gameScreen .board .arena-stage { height: 46dvh; aspect-ratio: auto; }
  #gameScreen .board .arena-surface { width: min(100%,70dvh); }
  #gameScreen .board .match-artists { display: none; }
  #gameScreen .opponent-hand-display { display: none; }
  #gameScreen .board .ups-slot { min-height: 0; }
  #gameScreen .player-hand-zone { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  #gameScreen #hand .game-card { flex-basis: 72px; min-height: 0; }
  #gameScreen .hand-row { min-height: 0; }
  #gameScreen .player-hand-zone { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 8px; margin-top: -12px; align-items: start; }
  #gameScreen .player-hand-zone .hand-row { grid-column: 1; grid-row: 1; width: 100%; padding-top: 8px; }
  #gameScreen .player-hand-zone .hand-heading { grid-column: 2; grid-row: 1; position: static; width: 100%; padding: 8px 0; }
  #gameScreen .player-hand-zone .hand-action-controls { flex-direction: column; }
  #gameScreen .player-hand-zone .hand-action-controls > button,
  #gameScreen .player-hand-zone .hand-action-controls > .selection-actions { flex: none; width: 100%; }
  #gameScreen .player-board { margin-bottom: 0; }
}

@media (pointer: coarse) {
  #hand .game-card { touch-action: pan-x; }
}
/* Phone/tablet play: full-width mats, swipeable hand, and reachable tap actions. */
@media(max-width: 900px) {
  #gameScreen { padding: 12px max(10px,env(safe-area-inset-right)) 28px max(10px,env(safe-area-inset-left)); }
  .game-screen .board { min-width: 0; }
  .game-screen .board .arena-stage { height: auto; aspect-ratio: 17 / 11; }
  .game-screen .board .arena-surface { box-shadow: none; }
  .game-screen .player-hand-zone { margin-top: 16px; }
  .player-hand-zone .hand-heading { position: static; width: 100%; align-items: stretch; padding: 8px 0; }
  .player-hand-zone .hand-action-controls { max-width: none; display: flex; flex-flow: row wrap; }
  .player-hand-zone .hand-action-controls > button,
  .player-hand-zone .hand-action-controls > .selection-actions { flex: 1 1 140px; width: auto; }
  .player-hand-zone .hand-action-controls button { min-height: 48px; font-size: 14px; }
  .player-hand-zone .hand-row { width: 100%; padding: 8px 6px 18px; touch-action: pan-x pan-y; }
  #hand .game-card { flex: 0 0 110px; scroll-snap-align: start; touch-action: pan-x; cursor: pointer; }
  .match-history { position: relative; inset: auto; width: 100%; max-height: 150px; margin-bottom: 12px; }
  .game-screen .match-artists { position: relative; inset: auto; width: 100%; }
  dialog { max-width: calc(100vw - 20px); max-height: calc(100dvh - 24px); overflow: auto; }
  .payment-actions { flex-wrap: wrap; }
  .payment-actions button { min-width: 0; flex: 1 1 120px; }
}
@media(max-width: 650px) {
  .topbar { height: auto; min-height: 66px; flex-wrap: wrap; gap: 8px; padding: 10px; }
  .top-actions { flex-wrap: wrap; gap: 6px; }
  button, select, input:not([type=radio]):not([type=checkbox]) { min-height: 44px; }
  input, select, textarea { font-size: 16px; }
  .setup-panel { min-width: 0; padding-inline: 12px; }
  .setup-visual { min-height: 330px; height: 45svh; }
  .account-banner { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .account-banner > div { min-width: 0; overflow-wrap: anywhere; }
  .game-screen .board .ups-slot { min-height: 0; }
  .game-screen .board-heading { flex-wrap: wrap; }
  .target-card-chooser { top: 110px; max-height: calc(100dvh - 200px); }
  .game-screen .board { margin-bottom: 10px; }
  .game-screen .match-history { max-height: 80px; padding: 6px; font-size: 12px; }
  .game-screen .player-hand-zone { margin-top: 6px; }
  .player-hand-zone .hand-action-controls { gap: 6px; }
  .player-hand-zone .hand-action-controls > button { flex-basis: 120px; }
  .player-hand-zone .hand-row { min-height: 0; padding-bottom: 10px; }
  #hand .game-card { min-height: 0; }
  #hand .game-card:hover, #hand .game-card.selected { transform: none; }
  .game-screen .street-control { padding: 8px; margin-bottom: 10px; }
}
/* Final mobile placement overrides the older responsive desktop layout. */
@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen:not([hidden]) { grid-template-columns: minmax(0,1fr) 140px; grid-template-rows: minmax(0,1fr) minmax(0,1fr) 100px; padding: 2px 8px; gap: 2px 8px; }
  #gameScreen .opponent-board { grid-area: 1 / 1; }
  #gameScreen .player-board { grid-area: 2 / 1; }
  #gameScreen .board .arena-stage { height: auto; }
  #gameScreen .board .arena-surface { width: 100%; top: 0 !important; left: 0 !important; }
  #gameScreen .match-strip { position: absolute; right: 8px; top: 4px; width: 132px; display: flex; flex-direction: column; gap: 2px; padding: 2px; font-size: 10px; pointer-events: none; }
  #gameScreen .match-strip .match-player img { display: none; }
  #gameScreen .match-strip .round-badge { padding: 0; }
  #gameScreen .player-hand-zone { display: contents; }
  #gameScreen .player-hand-zone .hand-row { grid-area: 3 / 1; padding: 3px; }
  #gameScreen .player-hand-zone .hand-heading { grid-area: 1 / 2 / 4 / 3; height: 100%; justify-content: flex-end; }
  #gameScreen #hand .game-card { flex-basis: 56px; }
}
/* Preserve printed mat geometry; perspective fitting handles the smaller rival lane. */
@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen:not([hidden]) { grid-template-rows: minmax(0,.65fr) minmax(0,1.35fr) 92px; }
  #gameScreen .board .arena-surface { left: 50% !important; top: var(--fitted-top,50%) !important; right: auto; bottom: auto; height: auto; aspect-ratio: 17 / 11; background-size: cover; transform: var(--fitted-transform) !important; }
  #gameScreen .board .arena-surface .ups-slot { top: 29.5%; height: 25.5%; width: 14%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(1) { left: 66%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(2) { left: 50%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(3) { left: 33.5%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(4) { left: 17%; }
  #gameScreen .board .arena-surface .ups-slot:nth-child(5) { left: 2.5%; }
  #gameScreen .board .arena-surface .can-pile { left: 2.7%; top: auto; bottom: 8%; width: 33%; height: 35%; }
  #gameScreen .board .arena-surface .cap-pile { left: 44%; top: auto; bottom: 8%; width: 34%; height: 35%; }
  #gameScreen .board .arena-surface .beast-pile { left: 36.5%; top: 55%; bottom: auto; width: 7%; height: 39%; }
  #gameScreen .board .arena-surface .trash-pile { left: auto; right: 3%; top: 13%; width: 13%; height: 14%; }
  #gameScreen .board .arena-surface .deck-pile { left: auto; right: 3%; top: 50%; width: 14%; height: 17%; }
}

@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen:not([hidden]) { grid-template-rows: minmax(0,.16fr) minmax(0,1.84fr) 0px; gap: 0 8px; transition: grid-template-rows .3s ease; }
  #gameScreen.opponent-focus:not([hidden]) { grid-template-rows: minmax(0,1.84fr) minmax(0,.16fr) 0px; }
  #gameScreen .player-board { margin-top: 0; margin-bottom: 0; padding-bottom: 0; }
  #gameScreen .board { position: relative; touch-action: pan-x; }
  #gameScreen .board-heading { position: absolute; inset: 0 0 auto; z-index: 8; pointer-events: none; text-shadow: 0 1px 3px #000; }
  #gameScreen .board .arena-stage { height: 100%; flex: 1; }
  #gameScreen #opponentHandCount { display: block; font: bold 10px system-ui; color: white; }
  #gameScreen .opponent-board .board-heading > div:first-child { flex-wrap: wrap; }
  #gameScreen .player-hand-zone .hand-row { position: fixed; left: max(20px,env(safe-area-inset-left)); right: max(156px,env(safe-area-inset-right)); bottom: 0; width: auto; height: 86px; margin: 0; overflow-y: hidden; padding: 4px 2px 0; z-index: 18; background: linear-gradient(transparent,#09090b99); }
  #gameScreen #hand .game-card { flex: 0 0 96px; align-self: flex-start; min-height: 0; }
  .forced-discard-choices, .target-card-chooser, .payment-choices, .dumpster-choices { display: flex; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; gap: 12px; }
  .forced-discard-choices > button, .target-card-chooser > button, .payment-choices > button, .dumpster-choices > button { flex-shrink: 0; touch-action: pan-x; }
  .forced-discard-choices img, .target-card-chooser img, .payment-choices img, .dumpster-choices img { max-height: 48dvh; width: auto; object-fit: contain; }
}
@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen > .return-to-mat, dialog > .return-to-mat { display: block; position: fixed; top: calc(var(--match-content-top,44px) + 2px); right: max(12px,env(safe-area-inset-right)); width: 140px; min-height: 44px; z-index: 1000; background: var(--yellow); color: #111; border: 2px solid white; font: bold 12px system-ui; }
  .resume-mat-choice { position: fixed; top: calc(var(--match-content-top,44px) + 54px); right: max(12px,env(safe-area-inset-right)); width: 140px; min-height: 44px; z-index: 1000; background: #111; color: white; border: 2px solid var(--yellow); }
  body.mat-inspection .targeting-screen { visibility: hidden; }
  body.mat-inspection dialog[open] { background: transparent !important; border-color: transparent !important; box-shadow: none !important; pointer-events: none; }
  body.mat-inspection dialog[open]::backdrop { background: transparent; }
  body.mat-inspection dialog[open] > :not(.return-to-mat):not(.resume-mat-choice) { visibility: hidden; }
  dialog > .return-to-mat, dialog > .resume-mat-choice { pointer-events: auto; }
  #gameScreen .hand-heading { padding-top: 100px !important; }
}
@media (pointer: coarse) and (orientation: landscape) {
  body:has(#gameScreen:not([hidden])) #homeButton { min-height: 40px; padding: 6px 10px; border: 1px solid #ff6262; background: #551919; flex-shrink: 0; }
  body:has(#gameScreen:not([hidden])) #homeButton > * { display: none; }
  body:has(#gameScreen:not([hidden])) #homeButton::after { content: "QUIT GAME"; font: bold 12px system-ui; color: white; }
}
/* Phone choices keep their confirmation controls in a dedicated right rail. */
@media (pointer: coarse) and (orientation: landscape) {
  /* The pay screen too: CANCEL and CONFIRM stay on screen in the right rail, under VIEW OPPONENT; the cards and
     the instructions use the rest, and the instructions scroll if they're long (short phones, the Claude app). */
  #supplyPaymentDialog[open] { display: grid; grid-template-columns: minmax(0,1fr) 152px; grid-template-rows: auto auto minmax(0,1fr); column-gap: 10px; width: calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)); max-width: none; height: calc(100dvh - 16px); max-height: none; margin: auto; padding: 8px max(4px,env(safe-area-inset-right)) 8px 12px; overflow: hidden; box-sizing: border-box; }
  #supplyPaymentDialog .rules-head { grid-column: 1; grid-row: 1; padding: 0; }
  #supplyPaymentDialog .rules-head h2 { font-size: 1rem; margin: 2px 0 0; }
  #supplyPaymentDialog > p { grid-column: 1; grid-row: 2; margin: 4px 0; max-height: 4.4em; overflow-y: auto; font-size: .72rem; line-height: 1.4; }
  #supplyPaymentDialog .payment-choices { grid-column: 1; grid-row: 3; min-height: 0; padding: 4px 2px; align-items: stretch; }
  #supplyPaymentDialog .payment-choices img { max-height: calc(100dvh - 210px); }
  #supplyPaymentDialog .payment-actions { grid-column: 2; grid-row: 1 / -1; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 96px 0 0; }
  #supplyPaymentDialog .payment-actions button { flex: 0 0 auto; width: 100%; min-width: 0; min-height: 48px; padding: 10px 8px; font-size: .78rem; }
  #confirmTargetButton { left: auto; right: max(12px,env(safe-area-inset-right)); top: 50%; bottom: auto; transform: translateY(-50%); width: 140px; min-height: 52px; padding: 12px 8px; }
  #cancelTargetingButton { right: max(12px,env(safe-area-inset-right)); top: 12px; width: 140px; min-height: 44px; }
  .target-card-chooser { left: max(12px,env(safe-area-inset-left)); right: calc(164px + env(safe-area-inset-right)); top: 90px; bottom: 12px; width: auto; max-height: none; transform: none; padding: 10px; align-items: center; }
  .targeting-banner { left: 12px; right: calc(164px + env(safe-area-inset-right)); top: 12px; width: auto; transform: none; }
  .target-card-chooser { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .target-card-chooser > button { flex: 0 0 auto; }
  #gameScreen .hand-action-controls #handSelectionActions { order: -5; }
  #gameScreen .hand-action-controls #handPhaseButton { order: -4; }
  #gameScreen .player-hand-zone .hand-heading { justify-content: flex-start; padding-top: 54px; }
}
 

/* Phones: Cans, Caps and Beast are rows you swipe sideways, each card full size and in its own box, with an
   arrow while more cards sit off to one side. The 72px hand gets a 48px row, leaving more height for the focused mat. */
@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen:not([hidden]) { grid-template-rows: minmax(44px,.16fr) minmax(0,1.84fr) 48px; }
  #gameScreen.opponent-focus:not([hidden]) { grid-template-rows: minmax(0,1.84fr) minmax(44px,.16fr) 48px; }
  #gameScreen .player-hand-zone .hand-row { height: 72px; }
  #gameScreen .arena-pile .supply-strip { position: absolute; inset: 3px; z-index: 10; display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity; touch-action: pan-x; -webkit-overflow-scrolling: touch; scrollbar-width: none; will-change: scroll-position; }
  #gameScreen .arena-pile .supply-strip::-webkit-scrollbar { display: none; } /* will-change above: on its own layer the row stays swipeable inside the tilted mat after a redraw (Chrome lost it otherwise) */
  #gameScreen .arena-pile .supply-strip > .supply-preview { position: relative; top: auto; left: auto !important; flex: 0 0 auto; width: auto; height: 100%; aspect-ratio: 2 / 3; transform: none !important; scroll-snap-align: start; touch-action: pan-x; }
  #gameScreen .beast-pile .supply-strip > .supply-preview { width: 100%; height: auto; max-height: 100%; align-self: center; }
  #gameScreen .arena-pile > span, #gameScreen .arena-pile > b { pointer-events: none; }
  #gameScreen .player-hand-zone .hand-row { padding-top: 0; }
  .reup-p-mark { position: absolute; left: 40%; top: 90.5%; width: 1px; height: 0; pointer-events: none; }   /* where the hand's edge meets the mat */   /* the cards themselves tuck over the mat's edge */
  #gameScreen .arena-pile.has-card-art > span { display: none; }
  #gameScreen .arena-pile.has-card-art > b { position: absolute; top: 2px; right: 2px; z-index: 32; }
  #gameScreen .arena-pile.more-right::after, #gameScreen .arena-pile.has-card-art.more-left::before { content: "\203A"; position: absolute; top: 0; bottom: 0; right: 0; left: auto; z-index: 31; display: grid; place-items: center; width: 16px; height: auto; border: 0; border-radius: 0; background: linear-gradient(90deg,transparent,rgba(0,0,0,.85)); box-shadow: none; color: var(--yellow); font: 900 18px/1 system-ui,sans-serif; opacity: 1; transform: none; pointer-events: none; }
  #gameScreen .arena-pile.has-card-art.more-left::before { content: "\2039"; left: 0; right: auto; background: linear-gradient(270deg,transparent,rgba(0,0,0,.85)); }
}
/* Trash: the zone covers the mat's whole printed TRASH box (card-shaped on every mat), and the top card stands
   upright in its middle at 88% of the box's height, in its own 2:3 shape, with the count in the corner.
   Both mats, phone and desktop. Tap/click and hold work as before. */
.arena-surface .trash-pile, #gameScreen .board .arena-surface .trash-pile { left: auto; right: 3.2%; top: 4.5%; bottom: auto; width: 16%; height: 36.5%; }
.trash-pile .pile-preview { inset: auto; left: 50%; top: 50%; width: auto; height: 88%; max-width: 92%; aspect-ratio: 2 / 3; opacity: 1; transform: translate(-50%,-50%); box-shadow: 3px 4px 0 rgba(0,0,0,.65); }
.trash-pile .pile-preview .real-card-image { width: 100%; height: 100%; object-fit: contain; }
.trash-pile.occupied > span { display: none; }
.trash-pile.occupied > b { position: absolute; top: 3px; right: 3px; z-index: 2; box-shadow: 0 1px 4px #000; }

/* "Place in Re-Up, use next turn" supplies placed this turn: dimmed under caution tape until usable. */
.next-turn-lock { position: relative; overflow: hidden; outline: 3px solid #ffd21c; outline-offset: -3px; }
.next-turn-lock img { filter: brightness(.4) grayscale(.5); }
.next-turn-lock::after, .next-turn-lock.spray-painted-card::after {
  content: "NEXT TURN";
  position: absolute; left: -20%; right: -20%; top: 50%;
  padding: 4px 0; transform: translateY(-50%) rotate(-24deg);
  background: repeating-linear-gradient(45deg, #ffd21c 0 12px, #111 12px 24px);
  color: #111; text-align: center; font: 900 clamp(9px, 1.4vw, 15px)/1 system-ui, sans-serif; letter-spacing: .12em;
  text-shadow: 0 0 3px #ffd21c, 0 0 3px #ffd21c, 0 0 3px #ffd21c;
  box-shadow: 0 2px 6px #000a; pointer-events: none; z-index: 31;
  display: block; opacity: 1; width: auto; height: auto; bottom: auto; animation: none; border-radius: 0; filter: none;
}
.payment-choice.next-turn-lock { cursor: not-allowed; opacity: 1; }
.payment-choice.next-turn-lock span { color: #ffd21c; }
/* On the mat only the top of a supply card shows, so its tape sits high and level. */
.supply-preview.next-turn-lock::after, .supply-preview.next-turn-lock.spray-painted-card::after { top: 22%; transform: translateY(-50%) rotate(-8deg); font-size: 9px; padding: 3px 0; }

/* Card viewer: step through a stack (bottom card first). */
.card-viewer-stack { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-family: system-ui, sans-serif; }
.card-viewer-stack[hidden] { display: none; }
.card-viewer-stack b { min-width: 0; color: white; font-size: .78rem; font-weight: 900; letter-spacing: .14em; }
.card-viewer-stack button { flex: none; width: 48px; height: 44px; color: #09090b; background: var(--yellow); border: 2px solid #000; box-shadow: 3px 3px 0 #000; font-size: 1.2rem; font-weight: 900; cursor: pointer; }
.card-viewer-stack button:focus-visible { outline: 3px solid white; outline-offset: 2px; }
@media (max-width: 700px), (max-height: 620px) { .card-viewer-stack { justify-content: center; margin-bottom: 6px; } .card-viewer-stack button { width: 40px; height: 36px; } }

/* Standings sit under the start button; the setup reel keeps the left column. */
.home-leaderboard { display:flex; flex-direction:column; margin-top:28px; background:#09090b; border:1px solid var(--line); min-width:0; }
.home-leaderboard iframe { display:block; width:100%; height:640px; border:0; }
.standings-full-link { display:block; padding:16px; color:#16dcff; text-align:center; font-weight:800; border-top:1px solid #ff2ca8; }
@media(max-width:850px) { .home-leaderboard iframe { height:70svh; min-height:420px; } }

/* Use the spare strip below the rival heading; never participate in mat sizing.
   Keep it clear of UPS, piles, the next heading and the right action rail. */
@media (pointer: coarse) and (orientation: landscape) {
  #gameScreen .opponent-board { z-index: 1; }
  #gameScreen .opponent-hand-display {
    display: block;
    position: absolute;
    top: 44px;
    left: 150px;
    width: clamp(100px, calc(100% - 340px), 180px);
    height: 34px;
    z-index: 9;
    pointer-events: none;
  }
  #gameScreen #opponentHandBacks {
    display: grid;
    grid-template-columns: repeat(var(--opponent-hand-size, 1), minmax(0, 1fr));
    width: min(100%, calc(24px + var(--opponent-hand-size, 1) * 12px));
    height: 34px;
    padding: 0 24px 0 0;
    pointer-events: none;
  }
  #gameScreen .opponent-card-back {
    box-sizing: border-box;
    width: 24px;
    height: 34px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 2px;
    pointer-events: none;
    user-select: none;
    box-shadow: 1px 1px 2px #0009;
  }
  #gameScreen.opponent-focus .opponent-hand-display { left: 2px; top: 24px; }
  #gameScreen .opponent-card-back.revealed-in-hand { pointer-events: auto; cursor: pointer; }
  #gameScreen .opponent-card-back.revealed-in-hand img { width: 100%; height: 100%; object-fit: contain; }
}
@media (pointer: coarse) and (orientation: landscape) and (max-height: 350px) {
  #gameScreen.opponent-focus .opponent-hand-display,
  #gameScreen.opponent-focus #opponentHandBacks { height: 28px; }
  #gameScreen.opponent-focus .opponent-card-back { width: 21px; height: 28px; }
}

/* Desktop: the rival's face-down hand straddles the near (bottom) edge of their mat, instead of above the heading
   where the top bar hid it (owner request, 2026-10-25); app.js measures --opponent-hand-top. Phones and tablets keep
   their own placement. */
@media (min-width: 901px) and (pointer: fine) {
  #gameScreen .opponent-board { position: relative; }
  #gameScreen .opponent-hand-display { position: absolute; z-index: 6; top: var(--opponent-hand-top, 30px); left: 50%; transform: translateX(-50%); gap: 10px; pointer-events: none; filter: drop-shadow(0 4px 6px #000c); }
  #gameScreen .opponent-hand-display #opponentHandCount { padding: 3px 7px; border-radius: 3px; background: #0b0a0ecc; }
  #gameScreen .opponent-hand-display .revealed-in-hand { pointer-events: auto; } /* revealed cards stay inspectable */
}

/* bigger cards in your hand on desktop (the phone and tablet layouts keep their own sizes) */
@media (min-width: 901px) and (pointer: fine) {
  .hand-row { min-height: 222px; }
  .hand-row .game-card, #hand .game-card { flex-basis: 150px; min-height: 208px; }
  .hand-row .game-card .card-art { height: 104px; }
}

/* Result screen fits the screen (owner, 2026-11-05): the STOP sign sits inside the box, and on short screens
   everything shrinks so the sign, result, scores and buttons show without scrolling. */
@media (max-height: 640px) {
  .result-dialog { padding: 22px 26px; max-height: calc(100dvh - 16px); }
  .result-burst { width: 76px; margin: 0 auto 8px; font-size: 1.3rem; --stop-rim: 4px; }
  .result-dialog h2 { margin: 6px auto 14px; font-size: clamp(1.6rem, 5vw, 2.6rem); }
  .final-scores { margin-bottom: 14px; }
  .score-card { padding: 10px; }
  .score-card strong { font-size: 1.5rem; }
}
@media (max-height: 430px) {
  .result-dialog { padding: 12px 18px; }
  .result-burst { width: 54px; margin-bottom: 4px; font-size: .95rem; --stop-rim: 3px; }
  .result-dialog > span { font-size: .6rem; }
  .result-dialog h2 { margin: 4px auto 8px; font-size: clamp(1.2rem, 4vw, 1.8rem); }
  .final-scores { gap: 8px; margin-bottom: 10px; }
  .score-card { padding: 6px 8px; }
  .score-card strong { margin-top: 2px; font-size: 1.2rem; }
  .result-dialog .primary-button { min-height: 42px; }
}

/* Placement guidance fills existing legal sections without adding a layer over cards. */
.place-hint { display:block; width:100%; padding:3px 2px; background:rgb(255 210 28 / var(--place-guide,1)); color:#fff; text-shadow:0 1px 2px #000; font:800 9px/1.2 system-ui,sans-serif; text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; pointer-events:none; }
.lesson-place-target { background-color:rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide-fill,.24)) !important; outline:3px solid rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide,1)) !important; outline-offset:-3px; box-shadow:inset 0 0 20px rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide,1)),0 0 10px rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide,1)) !important; transition:outline-color .2s,box-shadow .2s,background-color .2s; }
@media (max-width: 960px) and (orientation: landscape) {
  #placeGuideButton { min-width:40px; min-height:40px; padding-inline:7px; flex-shrink:0; white-space:nowrap; }
}
@media (prefers-reduced-motion: reduce) { .lesson-place-target { transition:none; } }
/* Artwork fills a UPS slot, so paint its border on the card as well. */
.lesson-place-target > .game-card { outline:3px solid rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide,1)) !important; outline-offset:-3px; }
@media (pointer:coarse) and (orientation:landscape) and (max-height:430px) {
  /* The existing scroll hint otherwise sits on top of the action buttons. */
  body:has(#gameScreen:not([hidden])) > .fs-scroll-hint { display:none; }
}

/* Re-Up destinations use the same cyan guidance as the UPS tunnels. */
.arena-pile.lesson-place-target { outline-offset:-2px; border-color:rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide,1)); }

/* Stack targets tint the host card without blocking taps or covering shield labels. */
.placement-card-fill { position:absolute; inset:0; z-index:1; border-radius:inherit; background:rgb(var(--place-guide-rgb,61 252 255) / var(--place-guide-fill,.24)); pointer-events:none; }

/* Violet means stack on an existing card; cyan means place in a mat section. */
.lesson-stack-target { --place-guide-rgb:190 125 255; }

/* Mic Drop Legendary stack (owner, 2026-11-12): drawn like the placement highlight (.lesson-place-target) but
   yellow: the slot gets the same outline, fill and glow, and an outlined three-point crown sits on the card. */
.game-card.micdrop-legend { outline: 3px solid rgb(255 210 28); outline-offset: -3px; }
.micdrop-legend-slot { background-color: rgb(255 210 28 / .24) !important; outline: 3px solid rgb(255 210 28) !important; outline-offset: -3px; box-shadow: inset 0 0 20px rgb(255 210 28), 0 0 10px rgb(255 210 28) !important; }
.legend-crown { position: absolute; left: 50%; top: 34%; z-index: 6; display: flex; flex-direction: column; align-items: center; transform: translateX(-50%); pointer-events: none; }
.legend-crown svg { display: block; width: 3.4rem; height: auto; overflow: visible; filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 1.5px #000) drop-shadow(0 0 6px rgb(255 210 28)) drop-shadow(0 0 12px rgb(255 210 28)); }
.legend-crown path { fill: rgb(255 210 28 / .24); stroke: rgb(255 210 28); stroke-width: 4; stroke-linejoin: round; }
.legend-crown > b { margin-top: 2px; padding: 1px 4px; color: #09090b; border-radius: 3px; background: rgb(255 210 28); box-shadow: 0 0 8px rgb(255 210 28); font: 950 .5rem/1.2 system-ui,sans-serif; letter-spacing: .04em; white-space: nowrap; }
.arena-surface .ups-slot .legend-crown svg { width: clamp(2.6rem,5.6vw,4.6rem); }
.arena-surface .ups-slot .legend-crown > b { font-size: clamp(.38rem,.7vw,.6rem); }

/* Above the starter decks (owner, 2026-11-12): where a chosen lesson sends the player. */
.starter-deck-instructions { margin: 34px 0 -18px; padding: 12px 16px; color: #09090b; background: var(--yellow, #ffd21c); border-left: 8px solid var(--pink, #ff2ca8); font: 900 clamp(.95rem, 2.2vw, 1.2rem)/1.3 system-ui, sans-serif; letter-spacing: .02em; scroll-margin-top: 90px; }
.starter-deck-instructions[hidden] { display: none; }

/* Beast is one supply card shown in both Can and Cap rows, with readable middle artwork. */
.arena-pile.beast-pile .supply-preview{width:90%}
.beast-art-loading{position:absolute;inset:0;z-index:1;display:grid;place-items:center;padding:4px;background:#18111f;color:#ffd21c;font:900 11px/1.2 system-ui;text-align:center;writing-mode:horizontal-tb!important;pointer-events:none}
/* A sideways finger move that runs past the edge of the game must not become the browser's "swipe back": on Android
   tablets that left the match in the middle of placing a card. Up/down behaviour (tucking the browser bars) is unchanged. */
html, body { overscroll-behavior-x: none; }

/* Help remains clickable while OFF, with a neutral grey state even on hover. */
#placeGuideButton[aria-pressed="false"],
#placeGuideButton[aria-pressed="false"]:hover { background:#58585f; border-color:#929299; color:#f3f3f5; }

/* Pharaoh previews whole stacks; keep its review and cancel controls above My People. */
.targeting-screen.pharaoh-targeting { z-index: 950; }
.pharaoh-targeting .targeting-banner { max-height: 140px; overflow: auto; pointer-events: auto; }
.pharaoh-targeting .target-card-chooser { top: 245px; max-height: calc(100dvh - 340px); }
.pharaoh-targeting .target-card-choice { overflow-y: auto; }
@media (max-width: 900px) {
  .pharaoh-targeting .targeting-banner { max-height: 95px; padding: 8px; font-size: 12px; }
  .pharaoh-targeting .target-card-chooser { top: 130px; max-height: none; align-items: stretch; }
  .pharaoh-targeting .target-card-choice img { height: 100px; width: 100%; }
}

/* Final UPS are public board cards. Keep stack supports visible beside their host. */
.result-dialog .return-to-match { margin-bottom: 20px; }
.result-dialog .final-scores { grid-template-columns: minmax(0,1fr); gap: 18px; text-align: left; }
.match-result-player { min-width: 0; }
.match-result-player h3 { margin: 0 0 14px; font: 800 clamp(1rem,2.5vw,1.35rem)/1.3 system-ui,sans-serif; overflow-wrap: anywhere; }
.match-result-equation { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.match-result-ups { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; flex: 1 1 320px; min-width: 0; }
.match-result-stack { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; max-width: 100%; border: 1px solid #ffffff24; background: #111114; }
.match-result-card { display: grid; gap: 5px; align-content: start; width: clamp(64px,9vw,100px); padding: 0; border: 0; color: white; background: transparent; cursor: zoom-in; }
.match-result-card img { display: block; width: 100%; aspect-ratio: 2.5/3.5; object-fit: contain; }
.match-result-card span { font: 600 11px/1.3 system-ui,sans-serif; overflow-wrap: anywhere; }
.result-dialog .match-result-total { margin: 0; white-space: nowrap; font: 900 clamp(1.3rem,3vw,1.8rem)/1.2 system-ui,sans-serif; }
.match-result-card:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.view-match-results { position: fixed; bottom: 12px; right: 12px; z-index: 60; min-height: 44px; padding: 10px 16px; border: 2px solid var(--yellow); background: #111114; color: var(--yellow); font-weight: 900; }
.view-match-results[hidden] { display: none; }
@media (max-width: 600px) {
  .result-dialog .match-result-player { padding: 12px; }
  .match-result-ups { flex-basis: 100%; gap: 8px; }
  .match-result-equation { gap: 12px; }
}

.result-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; }

/* A broad results panel keeps each player's UPS flowing across a long row. */
.result-dialog { width: min(1240px, calc(100% - 28px)); }
@media (min-width: 901px) {
  .result-dialog { padding: 24px 28px; }
  .result-dialog .result-burst { width: 58px; margin: 0 auto 8px; font-size: 1.1rem; }
  .result-dialog h2 { max-width: none; margin: 8px auto 16px; font-size: clamp(1.8rem,3vw,2.7rem); }
  .result-dialog .return-to-match { margin-bottom: 14px; }
  .result-dialog .final-scores { gap: 12px; margin-bottom: 16px; }
  .result-dialog .match-result-player { padding: 12px 16px; }
  .match-result-player h3 { margin-bottom: 10px; }
  .match-result-card { width: clamp(64px,6vw,92px); }
  .match-result-ups { flex-basis: 650px; gap: 10px; }
  .match-result-total { flex: 0 0 auto; }
}

/* Passive mouse preview stays above the mat without capturing taps or drags. */
/* In-match artwork lift: the actual card stays in place for selection/dragging. */
.card-hover-preview { position: fixed; z-index: 9998; pointer-events: none; padding: 0; border: 0; border-radius: 8px; background: transparent; box-shadow: none; animation: card-preview-rise .12s ease-out; }
.card-hover-preview img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; filter: drop-shadow(0 12px 20px #000c); }
[data-card-inspection], [data-card-inspection] img, .card-hover-preview, .card-hover-preview *, #cardViewerImage, .hand-drag-ghost, .snap-ghost, .computer-play-preview { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
[data-card-inspection] img, .card-hover-preview img, #cardViewerImage, .hand-drag-ghost, .snap-ghost, .computer-play-preview { -webkit-user-drag: none; }
@keyframes card-preview-rise { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card-hover-preview { animation: none; } }

/* Supply totals include Beast, but only real Can/Cap cards belong in these areas. */
#gameScreen .arena-pile:is(.can-pile,.cap-pile).occupied::before { display: none; }
#gameScreen .arena-pile:is(.can-pile,.cap-pile) > span { display: none; }
#gameScreen .arena-pile:is(.can-pile,.cap-pile) > b { position: absolute; top: 2px; right: 2px; z-index: 32; pointer-events: none; }

/* Short sideways phones: both players' results sit side by side so the bottom buttons
   (LESSON N+1, BACK TO MAIN) stay on screen without scrolling. */
@media (max-height: 500px) and (min-width: 560px) {
  .result-dialog .final-scores { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 8px; }
  .result-dialog .match-result-player { padding: 6px 10px; }
  .result-dialog .match-result-player h3 { margin: 0 0 4px; font-size: .95rem; }
  .result-dialog .match-result-equation { gap: 8px; flex-wrap: nowrap; }
  .result-dialog .match-result-ups { flex-basis: 0; flex-grow: 1; flex-wrap: nowrap; gap: 4px; font-size: .85rem; overflow: hidden; }
  .result-dialog .match-result-stack { flex-wrap: nowrap; gap: 2px; padding: 2px; }
  .result-dialog .match-result-card { width: 32px; flex: 0 1 32px; min-width: 20px; }
  .result-dialog .match-result-card span { display: none; }
  .result-dialog .match-result-total { font-size: 1.15rem; }
  .result-dialog .return-to-match { min-height: 36px; margin-bottom: 8px; }
}

/* Sideways phones and small tablets (651-1000px): the top buttons wrap instead of pushing Full Screen off the edge. */
@media (max-width: 1000px) {
  body:has(#setupScreen:not([hidden])) .topbar { height: auto; min-height: 66px; flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  body:has(#setupScreen:not([hidden])) .top-actions { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
}

/* CHOOSE YOUR CREW graffiti (owner art, 2026-11-24): right next to the Choose your crews heading, tilted like a sticker. */
.setup-heading { display: flow-root; }
.crew-art { float: right; width: clamp(140px, 19vw, 280px); height: auto; margin: -18px -8px 8px 18px; transform: rotate(4deg);
  filter: drop-shadow(6px 6px 0 #000) drop-shadow(0 0 14px rgba(0,0,0,.5)); pointer-events: none; }
@media (max-width: 620px) { .crew-art { width: 132px; margin: -6px -4px 6px 10px; } }
