/* Stacker: "Faded Balcony". Dusk courtyard, desaturated: brick, door-red plaques, one porch-lamp amber. */
@font-face { font-family: "Big Shoulders Display"; src: url(/fonts/big-shoulders.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(/fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #16161c; --ink: #e9e1d3; --mute: #a39d9f; --amber: #dca457; --door: #6e3a30; --door-hi: #a0604f;
  --panel: rgba(18, 18, 24, .8); --line: rgba(255, 255, 255, .09); --field: rgba(0, 0, 0, .3); --field-line: rgba(255, 255, 255, .15);
  --ghost-line: rgba(233, 225, 211, .5); --focus: #dca457; --error: #e08a7a;
  --display: "Big Shoulders Display", Impact, "Arial Narrow", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { min-height: 100vh; padding-bottom: 16px; color: var(--ink); font: 15px/1.45 "Archivo", system-ui, sans-serif; -webkit-font-smoothing: antialiased; background-color: var(--bg); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--amber); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, .wordmark, .code, .winner { font-family: var(--display); font-weight: 900; text-transform: uppercase; letter-spacing: .02em; }
h2 { font-size: 2rem; margin: 0 0 .5rem; line-height: 1; } h3 { font-size: 1.25rem; margin: 1rem 0 .5rem; font-weight: 800; } h3:first-child { margin-top: 0; }
p { margin: 0 0 .6rem; }
.aside { font-size: .85rem; color: var(--mute); }
.kick { display: block; font: 800 .8rem var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin-bottom: .3rem; }
.narrow { max-width: 26rem; margin: 24px auto; }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: none; padding: 7px clamp(16px, 2.5vw, 40px); }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: inherit; }
.brand svg { width: 44px; height: 44px; }
.wordmark { font-size: 2.4rem; line-height: 1; color: var(--amber); }
#status { font-size: .85rem; color: var(--amber); }
#error { margin: 0 auto 10px; padding: .6rem 16px; border-left: 3px solid var(--error); color: var(--error); background: rgba(160, 60, 48, .12); }
.topmeta { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; font-size: .85rem; margin-bottom: 4px; }
.chip { padding: .25rem .6rem; border-radius: 999px; white-space: nowrap; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.15); }

/* panels, buttons, fields */
.panel { background: var(--panel); border-top: 3px solid var(--door); border-radius: 4px 4px 10px 10px; padding: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.btn { border: 0; border-radius: 4px; min-height: 44px; padding: .7rem 1.5rem; font: 800 1.05rem var(--display); text-transform: uppercase; letter-spacing: .08em;
  background: var(--amber); color: #24160a; transition: filter .15s, transform .1s; }
.btn:hover:not(:disabled) { filter: brightness(1.08); } .btn:active:not(:disabled) { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ghost-line); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.actions { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 6px 0 4px; }
.actions.start { justify-content: flex-start; margin-top: 12px; }
input, select { background: var(--field); border: 2px solid var(--field-line); border-radius: 4px; padding: .6rem .7rem; min-height: 44px; min-width: 0; }
input:focus, select:focus { border-color: var(--amber); }
select option { background: #1c1c24; }
.field { display: grid; gap: .3rem; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { color: var(--mute); text-transform: uppercase; letter-spacing: .12em; font-weight: 600; font-size: .7rem; padding: 0; margin-bottom: .3rem; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row .field { flex: 1 1 8rem; margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.seg { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: grid; place-items: center; min-height: 44px; background: var(--field); border: 2px solid var(--field-line); border-radius: 4px; font: 800 1.1rem var(--display); cursor: pointer; }
.seg input:checked + span { background: var(--door); border-color: var(--door-hi); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.link { width: 100%; margin-bottom: .6rem; }

/* home */
/* Home: the title runs across the top; the table and the tabbed panel share the row below it, tops level,
   so switching tabs only moves the panel's bottom edge. */
.home { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: clamp(40px, 5vw, 96px); align-items: center; padding: 24px 0; }
.home .demo { width: min(540px, calc(100svh - 345px)); margin: 14px auto 0; }
/* the panel is solid behind its content and fades out over 130px below it, so the fade follows each tab's length */
.home .panel.tabbed { display: flex; flex-direction: column; margin: 0; padding: 0 36px 130px; background: none; box-shadow: none; border-top: 0; position: relative; isolation: isolate; }
.home .panel.tabbed::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 4px 4px 10px 10px; border-top: 3px solid var(--door); background: var(--panel);
  -webkit-mask: linear-gradient(#000 calc(100% - 130px), transparent); mask: linear-gradient(#000 calc(100% - 130px), transparent); }
.home .tabs { margin: 0 -36px 32px; padding: 0 14px; } .home .tabs button { min-height: 72px; font-size: 1.3rem; }
.home .panel input, .home .panel .btn, .home .seg span { min-height: 60px; font-size: 1.15rem; } .home .seg span { font-size: 1.4rem; } .home .pane > .field { margin-bottom: 26px; }
.home .field > span, .home .field > legend { font-size: .82rem; } .home .learn { gap: 14px; } .home .learn a { padding: 24px 26px; gap: 6px; } .home .learn b { font-size: 1.6rem; } .home .learn span { font-size: 1.05rem; }
.home .panes { flex: 1; }
body:has(.home) #screen { max-width: min(100vw, 94rem); padding-left: clamp(16px, 3vw, 48px); padding-right: clamp(16px, 3vw, 48px); }
body:has(.home) .brand { visibility: hidden; } /* the big wordmark is right there */
@media (max-width: 860px) { .home { grid-template-columns: 1fr; padding: 0; } .home .demo { width: min(78vw, 320px); margin: 10px auto 0; }
  .home .panel.tabbed { margin-top: 20px; padding: 0 16px 90px; } .home .panel.tabbed::before { -webkit-mask: linear-gradient(#000 calc(100% - 90px), transparent); mask: linear-gradient(#000 calc(100% - 90px), transparent); }
  .home .tabs { margin: 0 -16px 20px; padding: 0 6px; } .home .tabs button { min-height: 56px; font-size: 1.1rem; } .home .panel input, .home .panel .btn, .home .seg span { min-height: 48px; font-size: 1rem; } }
.hero h1 { margin: 0; line-height: .92; font-size: clamp(4.5rem, 15vw, 10rem); color: var(--amber); text-shadow: 0 0 30px rgba(230,160,70,.22); }

/* round table */
.ring { position: relative; width: min(100%, 560px); aspect-ratio: 1; margin: 18px auto 0; }
@media (max-width: 600px) { .ring { margin-top: 34px; } }
.disc { position: absolute; inset: 15%; border-radius: 50%; background: radial-gradient(circle at 50% 46%, #2d2e35, #16171c 74%);
  border: 10px solid #24242b; box-shadow: 0 0 0 1px #393a44, 0 28px 60px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.06); }
.disc::after { content: ""; position: absolute; inset: 10%; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.05); }
/* the porch-lamp arc on the rim, pointing at whoever is to play */
.rimarc { position: absolute; inset: 15%; border-radius: 50%; z-index: 1; pointer-events: none;
  background: conic-gradient(from calc(var(--a) - 22deg), rgba(230,170,90,.95) 0 44deg, transparent 44deg 360deg);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 9px), #000 calc(100% - 8px), #000 100%, transparent 100%);
  mask: radial-gradient(closest-side, transparent calc(100% - 9px), #000 calc(100% - 8px), #000 100%, transparent 100%);
  filter: drop-shadow(0 0 6px rgba(230,160,70,.6)); animation: arcin .4s ease-out both; }
@keyframes arcin { from { opacity: 0; } }
.pod { position: absolute; width: 92px; transform: translate(-50%, -50%); text-align: center; z-index: 3; }
.pod .av { position: relative; width: 50px; margin: 0 auto 4px; padding: 5px 0 4px; border-radius: 3px; font: 800 .95rem var(--display);
  background: var(--door); color: #eadbc6; border: 2px solid #4a2620; transition: box-shadow .35s; }
.pod .av::before { content: ""; position: absolute; left: 50%; top: -11px; width: 14px; height: 7px; translate: -50% 0; border-radius: 7px 7px 2px 2px; background: #1e1f22; transition: background .35s, box-shadow .35s; }
.pod.bot .av { background: linear-gradient(#c3c6cb, #8f9399); color: #1b1c1f; border-color: #5d6066; } /* brushed aluminum, like the cans */
.pod.open .av { background: transparent; border-style: dashed; border-color: #5a5660; color: var(--mute); }
.pod.turn .av { box-shadow: 0 0 0 3px var(--amber); }
.pod.turn .av::before { background: var(--amber); box-shadow: 0 0 10px 3px rgba(230,160,70,.7), 0 16px 30px 10px rgba(230,160,70,.16); }
.pod .nm { display: block; font-size: .86rem; line-height: 1.15; overflow-wrap: anywhere; }
.pod.turn .nm { color: var(--amber); font-weight: 700; }
.pod .ct { display: block; font-size: .74rem; color: var(--mute); }
.pod .st { display: block; min-height: 1em; color: var(--amber); text-transform: uppercase; letter-spacing: .06em; font-size: .62rem; }
.pod.out, .pod.passed:not(.turn) { opacity: .5; }
.pod .dd { display: flex; min-width: 5.4rem; margin-top: 4px; }
.pod .dd-btn { min-height: 32px; font-size: .72rem; padding: .2rem .35rem .2rem .5rem; }
@media (max-width: 600px) { .pod { width: 70px; } .pod .nm { font-size: .74rem; } .pod .ct { font-size: .64rem; } }
@media (max-width: 600px) { .pod .dd { min-width: 0; } .pod .dd-btn { padding: .2rem .2rem .2rem .35rem; gap: .15rem; font-size: .68rem; } .pod .dd-chev { width: 10px; height: 10px; } }
.center { position: absolute; inset: 30%; display: grid; place-content: center; text-align: center; z-index: 2; color: var(--mute); }
.code { font-size: 3rem; line-height: 1; letter-spacing: .08em; margin-bottom: .3rem; color: var(--ink); }
@media (max-width: 600px) { .code { font-size: 2.1rem; } }

/* the pile: each play lands slightly off the last one */
.pile { position: absolute; left: 50%; top: 48%; width: 0; height: 0; z-index: 2; }
.play { position: absolute; left: 0; top: 0; display: flex; --cw: 54px; transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot)); }
.play .card { filter: drop-shadow(0 4px 5px rgba(0,0,0,.5)); }
.play .card + .card { margin-left: -30px; }
.play.old { filter: brightness(.68) saturate(.8); }
@media (max-width: 600px) { .play { --cw: 40px; } .play .card + .card { margin-left: -23px; } }
.caption { position: absolute; left: 50%; top: 71%; transform: translateX(-50%); font-size: .7rem; white-space: nowrap; z-index: 2; color: var(--mute); text-transform: uppercase; letter-spacing: .08em; }

/* table screen */
.tablegrid { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 24px; align-items: start; }
@media (max-width: 960px) { .tablegrid { grid-template-columns: minmax(0, 1fr); } }
.note { text-align: center; margin: 18px 0 0; font-size: .92rem; min-height: 1.4em; }

/* your hand: every card visible. One overlapping row; on narrow screens a big hand splits into two. */
.tablecol { container-type: inline-size; min-width: 0; }
.hand { --cw: 66px; display: flex; justify-content: center; padding: 28px 0 6px; min-height: 130px; }
@media (max-width: 600px) { .hand { --cw: 52px; min-height: 108px; } }
.handrow { display: contents; }
.cbtn { --step: clamp(17px, (100cqw - var(--cw)) / (var(--k) - 1), var(--cw) * .82);
  background: none; border: 0; padding: 0; flex: none; position: relative; transition: transform .16s cubic-bezier(.2,.8,.2,1), translate .16s; }
.hand .cbtn + .cbtn, .hand .handrow + .handrow > .cbtn:first-child { margin-left: calc(var(--step) - var(--cw)); }
.cbtn:focus-visible { outline: none; } .cbtn:focus-visible .card { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
@media (hover: hover) {
  .hand .cbtn:hover { transform: translateY(-12px); }
  .hand .cbtn:hover + .cbtn { translate: 6px 0; }
  .hand .cbtn:has(+ .cbtn:hover) { translate: -6px 0; }
}
.hand .cbtn[aria-pressed="true"] { transform: translateY(-22px); }
.cbtn[aria-pressed="true"] .card { filter: drop-shadow(0 0 10px rgba(220,164,87,.55)); }
@container (max-width: 480px) {
  .hand.split { flex-direction: column; align-items: center; }
  .hand.split .handrow { display: flex; justify-content: center; width: 100%; }
  .hand.split .cbtn { --step: clamp(24px, (100cqw - var(--cw)) / (var(--rk) - 1), var(--cw) * .82); }
  .hand.split .handrow + .handrow { margin-top: calc(var(--cw) * -.8); }
  .hand.split .handrow + .handrow > .cbtn:first-child { margin-left: 0; }
}

/* side panel */
.log { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow: auto; }
.log li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .4rem; align-items: center; padding: .38rem .2rem; font-size: .86rem; border-bottom: 1px solid rgba(255,255,255,.07); }
.log li::before { content: attr(value); color: var(--mute); font-size: .75rem; }
.log li.cur { background: rgba(220,164,87,.12); }
.log em { color: var(--mute); }
.log .mini { display: flex; --cws: 34px; } .log .mini .card + .card { margin-left: -14px; }
.bar { height: 8px; overflow: hidden; background: rgba(255,255,255,.1); border-radius: 2px; }
.bar > i { display: block; height: 100%; background: var(--door-hi); border-radius: 2px; }
.bar.me > i { background: var(--amber); }
.scores { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.scores li { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; font-size: .88rem; }
.scores li .bar { grid-column: 1 / -1; }

/* lobby, hand over */
.lobbygrid { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 28px; align-items: start; padding: 10px 0; }
.lobbygrid .ring { width: min(100%, 560px, max(320px, calc(100svh - 290px))); }
@media (max-width: 900px) { .lobbygrid { grid-template-columns: 1fr; } }
.overgrid { max-width: 46rem; margin: 0 auto; padding: 16px 0; display: grid; gap: 20px; }
.winner { font-size: 3rem; line-height: .95; margin: 0 0 .3rem; color: var(--amber); }
.standings { width: 100%; border-collapse: collapse; margin-top: 10px; }
.standings tr { border-bottom: 1px solid var(--line); }
.standings tr.me td { color: var(--amber); }
.standings td, .standings th { padding: .6rem .4rem; text-align: left; vertical-align: middle; }
.standings th { color: var(--mute); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.standings .num { text-align: right; font-variant-numeric: tabular-nums; }
.standings .barcell { width: 30%; } .standings small { color: var(--mute); }
@media (max-width: 600px) { .winner { font-size: 2.2rem; } .standings td, .standings th { padding: .5rem .25rem; } }

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

/* custom dropdown (dropdown.js): button + slide-down listbox */
.dd { position: relative; display: inline-flex; vertical-align: middle; min-width: 0; }
.dd-btn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; min-height: 44px; min-width: 0; padding: .5rem .6rem .5rem .75rem; text-align: left; font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--field); border: 2px solid var(--field-line); border-radius: 4px; transition: border-color .15s; }
.dd-btn:hover:not(:disabled) { border-color: var(--ghost-line); }
.dd[data-open] .dd-btn { border-color: var(--amber); }
.dd-btn:disabled { opacity: .45; cursor: not-allowed; }
.dd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: none; width: 12px; height: 12px; color: var(--mute); transition: transform .18s ease-out; }
.dd[data-open] .dd-chev { transform: rotate(180deg); color: var(--amber); }
.dd-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: max(100%, 9rem); max-height: 15rem; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: #1c1c24; border: 1px solid var(--field-line); border-radius: 6px; box-shadow: 0 12px 28px rgba(0, 0, 0, .5); outline: none;
  visibility: hidden; opacity: 0; clip-path: inset(0 0 100% 0 round 6px); transform: translateY(-4px);
  transition: clip-path .12s ease-in, opacity .12s ease-in, transform .12s ease-in, visibility 0s .12s; }
.dd-right .dd-list { left: auto; right: 0; }
.dd[data-open] .dd-list { visibility: visible; opacity: 1; clip-path: inset(0 0 0 0 round 6px); transform: none;
  transition: clip-path .18s ease-out, opacity .18s ease-out, transform .18s ease-out, visibility 0s; }
.dd-list li { display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .7rem 0 .5rem; border-radius: 4px; font-size: .9rem; white-space: nowrap; cursor: pointer; }
.dd-list li.on { background: rgba(220, 164, 87, .14); }
.dd-list:focus-visible li.on { box-shadow: 0 0 0 1px var(--amber) inset; }
.dd-list li[aria-selected="true"] { color: var(--amber); }
.dd-list li[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.dd-check { flex: none; width: 12px; height: 12px; visibility: hidden; }
.dd-list li[aria-selected="true"] .dd-check { visibility: visible; }
.pod:has(.dd[data-open]) { z-index: 20; }

/* ---- motion: sliding turn marker, deal from the deck ---- */
@property --a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.rimarc.slide { animation: none; transition: --a .5s cubic-bezier(.3, .7, .2, 1); }
.ring { container-type: inline-size; }
.deck { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 4; pointer-events: none; }
.deck > .card { position: absolute; width: 44px; left: -22px; top: -31px; animation: deckgo .3s ease-in calc(1500ms - var(--el)) forwards; }
.deck > .card:nth-child(2) { translate: 1px -2px; } .deck > .card:nth-child(3) { translate: 2px -4px; }
.fly { position: absolute; left: -15px; top: -21px; opacity: 0; animation: fly .55s cubic-bezier(.2, .7, .2, 1) calc(var(--d) - var(--el)) both; }
.fly .card { width: 30px; }
@keyframes fly { 0% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) rotate(200deg) scale(.8); } }
@keyframes deckgo { to { opacity: 0; transform: scale(.7); } }
.hand.dealing .cbtn { animation: dealin .5s cubic-bezier(.2, .8, .25, 1) calc(700ms + var(--i) * 45ms - var(--el)) backwards; }
@keyframes dealin { from { transform: translateY(-46vh) rotate(-10deg) scale(.5); opacity: 0; } 40% { opacity: 1; } }
.pod.away { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .deck { display: none; } }

a.btn { display: inline-flex; align-items: center; text-decoration: none; }

/* ---- round 3: errors, seat banner, share link, fit, end of hand ---- */
/* errors float over the page (never push it down); form errors sit in a reserved line under their field */
#error { position: fixed; z-index: 50; left: 50%; bottom: 20px; translate: -50% 0; width: min(32rem, calc(100% - 32px)); margin: 0; border-radius: 4px;
  background: #2a1d1d; box-shadow: 0 12px 30px rgba(0,0,0,.5); animation: toastin .2s ease-out; }
@keyframes toastin { from { opacity: 0; translate: -50% 8px; } }
.ferr { display: block; min-height: 1.3em; margin-top: 2px; font-size: .8rem; line-height: 1.3; color: var(--error); text-transform: none; letter-spacing: 0; }
.row + .ferr { margin: 4px 0 0; }
input[aria-invalid="true"] { border-color: var(--error); }
.seatbanner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 14px;
  border: 1px solid rgba(220,164,87,.35); border-radius: 4px; background: rgba(220,164,87,.08); }
.seatbanner .aside { display: inline-block; margin-top: 2px; }
.narrow > .seatbanner, #screen > .seatbanner { max-width: 72rem; }
.linkrow { display: flex; gap: 8px; margin-bottom: .6rem; } .linkrow .link { margin: 0; flex: 1; } .linkrow .btn { padding: .5rem 1rem; }
.log li.newround { border-bottom: 2px solid rgba(220,164,87,.35); }

/* the table fits a laptop screen (1280×800) without scrolling: the ring shrinks with the viewport height */
.tablecol .ring { width: min(100%, 560px, max(320px, calc(100vh - 380px))); margin-top: 6px; }
.tablecol .note { margin-top: 16px; }
.tablecol .hand { padding-top: 26px; min-height: 120px; }

/* end of hand: the last play lands and holds, the table dims, then the results rise in */
.tablegrid.ending { animation: tableout .35s ease-in calc(1250ms - var(--el)) forwards; }
@keyframes tableout { to { opacity: 0; transform: translateY(-10px) scale(.985); } }
.overgrid.reveal > .panel { animation: risein .45s cubic-bezier(.2,.8,.2,1) calc(0ms - var(--el)) backwards; }
@keyframes risein { from { opacity: 0; transform: translateY(18px); } }
.overgrid.reveal .standings tbody tr { animation: rowin .4s ease-out calc(var(--d) - var(--el)) backwards; }
@keyframes rowin { from { opacity: 0; transform: translateX(-10px); } }
.overgrid.reveal .bar > i { animation: barup .7s cubic-bezier(.3,.7,.2,1) calc(var(--d) + 200ms - var(--el)) backwards; }
@keyframes barup { from { width: var(--from); } }
.scoring { margin-top: -.2rem; }

/* ---- round 4 ---- */
/* a play slides from the seat that made it onto the pile */
.play.land { animation: slidein .55s cubic-bezier(.2,.8,.25,1) both; animation-delay: calc(-1 * var(--el, 0ms)); }
@keyframes slidein { from { translate: var(--fx) var(--fy); scale: .6; opacity: .4; } }

/* side panel: scores on top, recent plays (newest first) fill the rest, no scrolling */
.tablegrid aside { display: flex; flex-direction: column; height: calc(100svh - 122px); min-height: 22rem; overflow: hidden; }
.tablegrid aside .log { flex: 1 1 0; min-height: 0; max-height: none; overflow: hidden; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.log li.fresh { animation: login .4s ease-out both; animation-delay: calc(-1 * var(--el, 0ms)); }
@keyframes login { from { opacity: 0; transform: translateY(-12px); } }
@media (max-width: 960px) { .tablegrid aside { height: auto; } .tablegrid aside .log { max-height: 16rem; } }

/* Leave sits in the top bar with the table chips */
.topmeta { align-items: center; }
.btn.chipbtn { padding: .3rem .8rem; font-size: .8rem; border-radius: 999px; }

/* auto-pass toggle next to Play / Pass */
/* Auto-pass: a toggle in the same language as the player-count picker (field fill, door red when on) */
.autopass { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; margin-left: .4rem; cursor: pointer;
  font: 800 .9rem var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--mute); transition: color .15s; }
.autopass input { appearance: none; margin: 0; padding: 0; flex: none; align-self: center; width: 22px; height: 22px; min-height: 0; min-width: 0; border-radius: 4px; cursor: pointer;
  background: var(--field); border: 2px solid var(--field-line); transition: background-color .15s, border-color .15s; }
.autopass input:checked { background: var(--door) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--door-hi); }
.autopass:has(input:checked) { color: var(--ink); }
.autopass:hover input:not(:checked) { border-color: var(--ghost-line); }
.autopass input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* drag across cards to select */
.hand .cbtn { touch-action: none; user-select: none; -webkit-user-select: none; }

/* landing demo: one trick played round a small table, looping */
.demo { position: relative; width: min(100%, 540px, calc(100svh - 290px)); aspect-ratio: 1; margin: 18px auto 0; container-type: inline-size; }
.demo .disc { position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 50% 45%, #2a2b31, #17181c 70%); box-shadow: inset 0 0 0 10px #232429, inset 0 0 0 11px rgba(255,255,255,.05), 0 20px 50px rgba(0,0,0,.45); }
.dseat { position: absolute; transform: translate(-50%, -50%); width: 2.1rem; height: 1.6rem; display: grid; place-items: center; font: 800 .95rem var(--display); background: linear-gradient(#c3c6cb, #8f9399); color: #1b1c1f; border: 1px solid #5d6066; border-radius: 3px; }
.dseat:first-of-type { background: #6e3a30; color: #eadbc6; border-color: #4a2620; }
.dpile { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dplay { position: absolute; display: flex; --cw: 46px; transform: translate(-50%, -50%) translateX(var(--dx)) rotate(var(--rot)); animation: 8s cubic-bezier(.2,.8,.25,1) infinite both; }
.dplay .card { filter: drop-shadow(0 4px 5px rgba(0,0,0,.5)); } .dplay .card + .card { margin-left: -26px; }
.dpass { position: absolute; transform: translate(-50%, -50%); font: 800 .8rem var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); animation: 8s ease-out infinite both; }
@media (prefers-reduced-motion: reduce) { .dplay, .dpass { animation: none; } .dpass { display: none; } }

/* how to play */
.howtopage .howstep { animation: stepin .35s ease-out both; }
@keyframes stepin { from { opacity: 0; transform: translateX(16px); } }
.howtopage p { color: #d8d0c6; }
.hshow { margin: 12px 0 16px; }
.hcards { display: flex; gap: 6px; --cw: 52px; }
.hshow figcaption { margin-top: 6px; font-size: .8rem; color: var(--mute); }
.hdots { display: flex; gap: 6px; margin: 18px 0 4px; }
.hdots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.18); }
.hdots span.on { background: var(--amber); }

/* screen changes and review steps cross-fade / slide instead of cutting */
::view-transition-group(*) { animation-duration: .35s; animation-timing-function: cubic-bezier(.2,.8,.25,1); }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }

/* Leaderboard */
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board + .actions, .narrow > .panel + .panel { margin-top: 16px; }

/* Home panel: tabs. All panes share one grid cell, so the panel keeps the tallest pane's height. */
.panel.tabbed { padding-top: 0; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 -18px 20px; padding: 0 6px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; min-height: 52px; padding: .4rem .1rem 0; cursor: pointer;
  color: var(--mute); font: 800 1rem var(--display); text-transform: uppercase; letter-spacing: .08em; transition: color .15s, border-color .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--amber); border-bottom-color: var(--amber); }
.tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.panes { display: grid; }
.pane { grid-area: 1 / 1; display: flex; flex-direction: column; min-width: 0; }
.pane[inert] { visibility: hidden; } /* still sized, so the panel and hero never shift between tabs */
.pane > .actions:last-child { padding-top: 18px; }
.pane .aside { margin: 12px 0 0; }
.pane.enter { animation: panein .2s ease-out; }
@keyframes panein { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .pane.enter { animation: none; } }
@media (max-width: 420px) { .tabs button { font-size: .9rem; letter-spacing: .05em; } }

.board.mini { margin-top: 0; }
.board.mini tr.gap { border-top: 1px dashed var(--ghost-line); }
.empty { font: 800 1.4rem var(--display); text-transform: uppercase; letter-spacing: .04em; margin: .2rem 0 0; }
.pname { font: 800 1.6rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; margin: 0 0 14px; display: flex; align-items: center; gap: .3rem; }
.pname .tag, .board .tag { font: 600 .65rem "Archivo", sans-serif; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; margin-left: .35rem; }
.board tr.me .tag { color: var(--amber); border-color: var(--amber); }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.pstats div { background: var(--bg); padding: 10px 12px; display: grid; gap: 2px; }
.pstats b { font: 800 1.5rem/1 var(--display); color: var(--amber); font-variant-numeric: tabular-nums; }
.pstats span { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--mute); }
.recent { list-style: none; margin: 12px 0 0; padding: 0; }
.panel > .recent { margin-top: 0; }
.recent li { display: grid; grid-template-columns: 2.6rem 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.recent b { grid-row: span 2; font: 800 1.3rem var(--display); text-transform: uppercase; }
.recent .of { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--mute); font-weight: 600; }
.recent .vs { grid-column: 2; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent em { grid-column: 3; grid-row: 1 / span 2; align-self: center; font: 800 1.05rem var(--display); font-style: normal; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; }
.recent em.up { color: #8fc28a; } .recent em.down { color: var(--error); }
.panel h3.kick { margin: 18px 0 6px; }
.learn { display: grid; gap: 10px; }
.learn a { display: grid; gap: 3px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--field); color: var(--ink); text-decoration: none; transition: border-color .15s, background-color .15s; }
.learn a:hover { border-color: var(--ghost-line); background: rgba(0,0,0,.4); }
.learn a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.learn b { font: 800 1.25rem var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--amber); }
.learn span { color: var(--mute); font-size: .9rem; }
.pstats + .aside { margin-top: 12px; }
.ferr:empty { display: none; }
.panel.tabbed > .seatbanner { margin-top: 18px; }
/* Ranked / casual status: a small label-style chip, not a sentence */
.rankchip { display: inline-block; margin-left: .5rem; padding: .12rem .5rem; border: 1px solid var(--line); border-radius: 999px; vertical-align: 1px;
  font: 600 .62rem "Archivo", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
.rankchip[hidden] { display: none; }
.rankchip.ranked { color: var(--amber); border-color: var(--amber); }
.panel > .rankchip { margin: 14px 0 0; }

/* patio table: black hammered metal (game table and the home demo) */
.disc, .demo .disc { background: radial-gradient(ellipse at 38% 28%, rgba(255,255,255,.10), transparent 45%),
    radial-gradient(circle at 35% 35%, rgba(255,255,255,.10) 0 16%, transparent 44%) 0 0/15px 15px, radial-gradient(circle at 65% 65%, rgba(0,0,0,.5) 0 18%, transparent 48%) 0 0/15px 15px,
    radial-gradient(circle at 35% 35%, rgba(255,255,255,.08) 0 16%, transparent 44%) 7.5px 7.5px/15px 15px, radial-gradient(circle at 65% 65%, rgba(0,0,0,.45) 0 18%, transparent 48%) 7.5px 7.5px/15px 15px,
    radial-gradient(circle at 50% 45%, #2a2d32, #121316 78%);
  border: 9px solid #0d0e10; box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), inset 0 -30px 60px rgba(0,0,0,.55), 0 0 0 1px #2c2e33, 0 34px 70px rgba(0,0,0,.65); }
.disc::after { display: none; }
/* clutter on the table: bottle caps and stray card backs */
.mess { position: absolute; inset: 0; pointer-events: none; }
.mess i, .floor i { position: absolute; translate: -50% -50%; }
.mess .cap { width: 3.4cqw; height: 3.4cqw; }
.mess .stain { width: 13cqw; height: 13cqw; border-radius: 50%; border: 2px solid rgba(190,140,90,.13); box-shadow: inset 0 0 0 4px rgba(120,80,40,.06); }
.mess .stray { width: 7cqw; height: 10cqw; border-radius: .8cqw; }
.cap { border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.6);
  background: radial-gradient(circle, var(--c1) 0 52%, var(--c2) 54% 66%, transparent 68%), repeating-conic-gradient(var(--c2) 0 7.5deg, var(--c3) 7.5deg 15deg); }
.cap.gold { --c1: #b8913f; --c2: #8a6a2a; --c3: #d9b866; } .cap.silver { --c1: #a9adb3; --c2: #6f737a; --c3: #cfd2d6; } .cap.red { --c1: #9b2b25; --c2: #6c1c18; --c3: #c24038; }
.mess .stray, .floor .back { border: 1.5px solid #f2ede4; box-shadow: 0 2px 6px rgba(0,0,0,.5);
  background: linear-gradient(45deg, transparent 46%, rgba(255,255,255,.25) 46% 54%, transparent 54%) 0 0/6px 6px, linear-gradient(-45deg, transparent 46%, rgba(255,255,255,.25) 46% 54%, transparent 54%) 0 0/6px 6px, #2a4a9c; }

/* page background: the patio floor round the table, concrete pavers under the porch light, with the night's mess */
body { background: radial-gradient(70% 55% at 30% 45%, rgba(255,214,160,.07), transparent 70%), radial-gradient(ellipse at 40% 45%, transparent 35%, rgba(0,0,0,.6) 100%),
    repeating-linear-gradient(90deg, transparent 0 178px, rgba(0,0,0,.5) 178px 181px, rgba(255,255,255,.04) 181px 182px), repeating-linear-gradient(0deg, transparent 0 178px, rgba(0,0,0,.5) 178px 181px, rgba(255,255,255,.04) 181px 182px),
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.035) 0 20%, transparent 50%) 0 0/37px 37px, radial-gradient(circle at 70% 60%, rgba(0,0,0,.18) 0 25%, transparent 55%) 0 0/23px 23px,
    linear-gradient(160deg, #2b2927, #201f1e); background-attachment: fixed; } /* the floor stays put when a page scrolls */
.floor { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.floor .cup { width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, #4e1010 0 46%, #8a201c 47% 70%, #b52d27 71% 84%, #e9e3da 85%); box-shadow: 0 10px 20px rgba(0,0,0,.6); }
.floor .can { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 50% 62%, #444 0 14%, transparent 15%), radial-gradient(circle, #b9bcc1 0 62%, #7b7f86 63% 75%, #d4d6da 76%); box-shadow: 0 6px 12px rgba(0,0,0,.55); }
.floor .canside { width: 110px; height: 56px; border-radius: 10px; background: linear-gradient(90deg, #8b8f95 0 4%, transparent 4% 96%, #8b8f95 96%), linear-gradient(#d6d8dc, #8e9298 45%, #5d6066); box-shadow: 0 8px 14px rgba(0,0,0,.55); }
.floor .bottle { width: 150px; height: 40px; border-radius: 20px 8px 8px 20px; background: linear-gradient(90deg, #2c160a 0 66%, transparent 66%), linear-gradient(#7a4520, #3d1f0c); clip-path: polygon(0 0, 66% 0, 76% 32%, 100% 36%, 100% 64%, 76% 68%, 66% 100%, 0 100%); opacity: .9; }
.floor .back { width: 62px; height: 88px; border-radius: 6px; }
.floor .face { width: 64px; } .floor .face .card { width: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,.5)); }
.floor .cap { width: 34px; height: 34px; }
.floor .lighter { width: 70px; height: 26px; border-radius: 5px; background: linear-gradient(90deg, #b9bcc1 0 22%, #3a6fa6 22%); box-shadow: 0 4px 8px rgba(0,0,0,.5); }
@media (max-width: 860px) { .floor i { scale: .6; } }
