/* The two typefaces are served from here (fonts/, SIL Open Font License), never from a font
   service: opening the game makes no request to anyone but this site. */
@font-face { font-family: 'Fraunces'; src: url('../fonts/fraunces.woff') format('woff'); font-weight: 500 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Nunito'; src: url('../fonts/nunito.woff') format('woff'); font-weight: 200 1000; font-style: normal; font-display: swap; }
/* CribBaker — UI design system
   Warm wood, brass and cream over a living 3D table. Landscape only. */

:root {
  --ink: #1d140d;
  --ink-2: #3a2a1d;
  --cream: #f7edd9;
  --paper: #fdf8ec;
  --paper-2: #efe1c4;
  --wood: #6b4429;
  --wood-2: #4a2d1a;
  --wood-3: #2c1a0f;
  --brass: #d6a94a;
  --brass-hi: #f6dc92;
  --brass-lo: #9c7224;
  --felt: #1e4b36;
  --crib: #e0362c;
  --crib-glow: rgba(255, 58, 40, 0.75);
  --good: #5fbf6a;
  --sky: #69b7ff;
  --glass: rgba(24, 16, 10, 0.72);
  --glass-2: rgba(24, 16, 10, 0.5);
  --line: rgba(255, 236, 200, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Times New Roman', serif;
  --ui: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --pad: clamp(10px, 2.2vh, 22px);
  --tb: max(3.6em, 56px); /* room under a menu's top bar (title + back pill) */
  --fs: clamp(13px, calc(1.55vh + 0.55vw), 20px);
  --card-h: clamp(88px, 31vh, 224px);
  --ease-out: cubic-bezier(0.2, 0.9, 0.25, 1.15);
  --ease: cubic-bezier(0.4, 0.1, 0.2, 1);
}
html.bigtext { --fs: clamp(15px, calc(1.85vh + 0.65vw), 23px); --card-h: clamp(98px, 34vh, 240px); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.tile svg.tile-ic { width: 100%; height: 100%; }
.peg-ic svg, svg.peg-ic { width: 100%; height: 100%; }
.crown svg, svg.crown { width: 100%; height: 100%; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #0b0907; color: var(--cream);
  font-family: var(--ui); font-size: var(--fs); font-weight: 700; line-height: 1.25;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; /* iOS would otherwise inflate text in landscape */
}
button { font: inherit; color: inherit; }
input { font: inherit; }
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#app { position: fixed; inset: 0; pointer-events: none; transition: opacity 1.2s var(--ease); }
#app.ambient { opacity: 0; }
#app.ambient #screens > *, #app.ambient #hud > * { pointer-events: none; }
.ambient-hint { position: fixed; left: 50%; bottom: calc(18px + var(--sb)); transform: translate(-50%, 8px); opacity: 0; pointer-events: none; z-index: 40; padding: .45em 1.1em; border-radius: 99px; background: rgba(20,12,6,.55); color: var(--cream); font-size: .85em; letter-spacing: .04em; transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.ambient-hint.in { opacity: .85; transform: translate(-50%, 0); }
#screens, #hud, #overlays, #toasts { position: absolute; inset: 0; }
/* each layer is its own stacking context, so nothing on the table (hand, played cards,
   The Show) can ever paint over a dialog, and dialogs never cover toasts */
#screens { z-index: 1; }
#hud { z-index: 2; }
#overlays { z-index: 3; }
#toasts { z-index: 4; }
#screens > *, #hud > *, #overlays > *, #toasts > * { pointer-events: auto; }
#hud[hidden] { display: none; }
.display { font-family: var(--display); font-weight: 800; letter-spacing: 0.01em; }
.muted { opacity: 0.72; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- logo */
.logo { font-family: var(--display); font-weight: 900; line-height: 0.9; letter-spacing: -0.02em; display: inline-flex; align-items: baseline; filter: drop-shadow(0 6px 14px rgba(0,0,0,.55)); }
.logo-crib { color: var(--paper); }
.logo-baker {
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 48%, var(--brass-lo) 52%, #e4bd66 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; position: relative;
}
.logo.big { font-size: clamp(48px, 15vh, 128px); }
.logo.mid { font-size: clamp(30px, 8vh, 64px); }
.logo.small { font-size: clamp(20px, 4.6vh, 34px); }
.logo-row { display: flex; gap: 0.6em; justify-content: center; margin-top: 0.5em; }
.logo-row i { width: 0.55em; height: 0.55em; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2a1a10, #0a0604 70%); box-shadow: inset 0 1px 2px rgba(0,0,0,.8), 0 1px 0 rgba(255,230,180,.25); display: block; }

/* ---------------------------------------------------------------- loading + rotate */
#loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 40%, #2a1b10 0%, #0b0705 70%); transition: opacity .6s var(--ease), visibility .6s; }
#loading.done { opacity: 0; visibility: hidden; }
.load-inner { text-align: center; }
.load-track { position: relative; width: min(64vw, 520px); height: 22px; margin: 4vh auto 1.6vh; border-radius: 12px; background: linear-gradient(#5a3820, #3b2414); box-shadow: inset 0 2px 4px rgba(0,0,0,.6), 0 1px 0 rgba(255,220,160,.2); }
.load-holes { position: absolute; inset: 0 10px; background: radial-gradient(circle, #0b0705 2.6px, transparent 3.4px) 0 50% / calc(100% / 24) 100% repeat-x; opacity: .9; }
.load-peg { position: absolute; top: -12px; left: 10px; width: 10px; height: 26px; border-radius: 5px 5px 3px 3px; background: linear-gradient(90deg, #8f1f19, #e0493e 45%, #a3271f); box-shadow: 0 4px 6px rgba(0,0,0,.5); transition: left .35s var(--ease-out); }
.load-msg { font-size: 0.95em; opacity: 0.7; letter-spacing: 0.04em; }
.load-tip { margin-top: 2.4vh; min-height: 1.3em; font-family: var(--display); font-style: italic; font-weight: 500; opacity: 0; transition: opacity .35s var(--ease); max-width: 80vw; }
.load-tip.in { opacity: .6; }

#rotate { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; text-align: center; padding: 24px; background: radial-gradient(ellipse at 50% 40%, #2a1b10 0%, #0b0705 75%); }
@media (orientation: portrait) and (max-width: 1100px) { #rotate { display: grid; } }
.rotate-phone { width: 70px; height: 124px; border: 4px solid var(--cream); border-radius: 16px; margin: 0 auto 28px; position: relative; animation: rot 2.6s var(--ease) infinite; }
.rotate-screen { position: absolute; inset: 8px 5px; border-radius: 6px; background: linear-gradient(135deg, var(--brass), var(--wood)); }
.rotate-inner .display { font-size: 26px; margin: 0 0 8px; }
.rotate-sub { opacity: .75; max-width: 280px; margin: 0 auto; }
@keyframes rot { 0%, 20% { transform: rotate(0); } 50%, 75% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* ---------------------------------------------------------------- screens */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--pad) + var(--st)) calc(var(--pad) + var(--sr)) calc(var(--pad) + var(--sb)) calc(var(--pad) + var(--sl));
  opacity: 0; transform: scale(1.03); transition: opacity .38s var(--ease), transform .45s var(--ease-out); will-change: opacity, transform;
}
.screen.in { opacity: 1; transform: none; }
.screen.out { opacity: 0; transform: scale(0.97); pointer-events: none; }
.screen.back.out { transform: scale(1.03); }
.scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 50% 55%, rgba(10,6,4,.35) 0%, rgba(10,6,4,.78) 100%); }
.scrim.light { background: radial-gradient(ellipse at 50% 60%, rgba(10,6,4,.05) 0%, rgba(10,6,4,.55) 100%); }
.scrim.left { background: linear-gradient(90deg, rgba(10,6,4,.86) 0%, rgba(10,6,4,.55) 45%, rgba(10,6,4,.12) 75%); }

.topbar { position: absolute; top: calc(var(--pad) + var(--st)); left: calc(var(--pad) + var(--sl)); right: calc(var(--pad) + var(--sr)); display: flex; align-items: center; gap: 0.7em; z-index: 3; }
.topbar .spacer { flex: 1; }
.topbar h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.55em; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.crumb { opacity: .65; font-size: .85em; letter-spacing: .06em; text-transform: uppercase; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --b1: #fbf2df; --b2: #e8d4ad; --lip: #a7845a; --tx: var(--ink);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 2.75em; padding: .6em 1.25em; border: 0; border-radius: 14px; cursor: pointer; overflow: hidden;
  color: var(--tx); font-weight: 900; letter-spacing: .02em; white-space: nowrap;
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: 0 5px 0 var(--lip), 0 9px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.7);
  transform: translateY(0); transition: transform .14s var(--ease-out), box-shadow .14s var(--ease), filter .2s;
}
.btn::after { /* glimmer sweep */
  content: ''; position: absolute; top: -50%; bottom: -50%; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-120%) skewX(-18deg); pointer-events: none;
}
.btn:hover:not(:disabled), .btn.hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--lip), 0 14px 26px rgba(0,0,0,.45), 0 0 0 3px rgba(255,220,140,.25), inset 0 1px 0 rgba(255,255,255,.8); }
.btn:hover:not(:disabled)::after { animation: glimmer .8s var(--ease); }
.btn:active:not(:disabled), .btn.pressed { transform: translateY(4px); box-shadow: 0 1px 0 var(--lip), 0 3px 8px rgba(0,0,0,.4), inset 0 2px 6px rgba(0,0,0,.18); transition-duration: .05s; }
.btn:disabled { filter: grayscale(.7) brightness(.7); cursor: default; }
.btn:focus-visible { outline: 3px solid var(--brass-hi); outline-offset: 3px; }
.btn .ic { width: 1.25em; height: 1.25em; flex: none; }
.btn-primary { --b1: #ffe7a6; --b2: #d9a645; --lip: #8a6020; --tx: #2a1806; }
.btn-primary.idle::after { animation: glimmer 1.1s var(--ease) 1.2s infinite; animation-delay: 2.2s; }
.btn-wood { --b1: #8a5a37; --b2: #5e3a22; --lip: #2e1a0d; --tx: var(--paper); box-shadow: 0 5px 0 var(--lip), 0 9px 18px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,220,180,.35); }
.btn-dark { --b1: rgba(52,36,24,.92); --b2: rgba(32,22,14,.92); --lip: #120a05; --tx: var(--cream); box-shadow: 0 4px 0 var(--lip), 0 8px 16px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,220,180,.18); }
.btn-red { --b1: #ff7a62; --b2: #d7362a; --lip: #7c1b13; --tx: #fff; }
.btn-green { --b1: #9be3a2; --b2: #3fa653; --lip: #1d5a29; --tx: #062b0d; }
.btn-big { font-size: 1.3em; min-height: 2.6em; padding: .55em 1.9em; border-radius: 18px; }
.btn-huge { font-size: clamp(22px, 5.4vh, 40px); padding: .45em 2.2em; border-radius: 22px; min-height: 2.2em; }
.btn-icon { min-height: 0; width: 2.7em; height: 2.7em; padding: 0; border-radius: 50%; }
.btn-icon .ic { width: 1.35em; height: 1.35em; }
.btn-sm { min-height: 2.1em; padding: .35em .9em; font-size: .9em; border-radius: 11px; box-shadow: 0 3px 0 var(--lip), 0 6px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-sm:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
.btn.shake, .tile.shake, .shake { animation: shake .42s var(--ease); }
.btn.jiggle, .jiggle { animation: jiggle .6s var(--ease); }
/* a soft ring that swells out of the button — transform + opacity only, so it never repaints */
.pulse { overflow: visible; }
.pulse::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: 0 0 0 3px rgba(255,214,120,.75), 0 0 18px rgba(255,200,90,.45); animation: ring 1.6s var(--ease) infinite; }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18, 1.35); } }
.btn.pulse::after { display: none; }
@keyframes glimmer { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(520%) skewX(-18deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-7px) rotate(-1deg); } 35% { transform: translateX(6px) rotate(1deg); } 55% { transform: translateX(-4px); } 75% { transform: translateX(3px); } }
@keyframes jiggle { 0%, 100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-5deg) scale(1.06); } 40% { transform: rotate(4deg) scale(1.06); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 5px 0 var(--lip), 0 9px 18px rgba(0,0,0,.4), 0 0 0 0 rgba(255,214,120,.55); } 50% { box-shadow: 0 5px 0 var(--lip), 0 9px 18px rgba(0,0,0,.4), 0 0 0 12px rgba(255,214,120,0); } }

/* ---------------------------------------------------------------- tiles (big choices) */
.tiles { display: flex; gap: clamp(10px, 2.4vw, 28px); justify-content: center; align-items: stretch; flex-wrap: nowrap; }
.tile {
  --c1: #3c2717; --c2: #24160c; --acc: var(--brass);
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45em; text-align: center;
  width: clamp(150px, 25vw, 300px); min-height: clamp(150px, 42vh, 320px); padding: 1.1em 1em; border: 0; border-radius: 22px; cursor: pointer; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,220,160,.16), transparent 60%), linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: 0 8px 0 #120a05, 0 16px 34px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,220,170,.22), inset 0 0 0 1px rgba(255,220,170,.1);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease), filter .2s; color: var(--paper);
}
.tile::after { content: ''; position: absolute; top: -60%; bottom: -60%; width: 35%; left: -50%; background: linear-gradient(100deg, transparent, rgba(255,235,190,.22), transparent); transform: translateX(-100%) skewX(-16deg); pointer-events: none; }
.tile:hover:not(.locked) { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 12px 0 #120a05, 0 24px 44px rgba(0,0,0,.6), 0 0 0 3px rgba(255,214,120,.35), inset 0 1px 0 rgba(255,220,170,.3); }
.tile:hover:not(.locked)::after { animation: glimmer 1s var(--ease); }
.tile:active:not(.locked) { transform: translateY(5px) scale(.985); box-shadow: 0 2px 0 #120a05, 0 6px 16px rgba(0,0,0,.5), inset 0 2px 10px rgba(0,0,0,.35); transition-duration: .06s; }
.tile .tile-ic { width: clamp(46px, 13vh, 92px); height: clamp(46px, 13vh, 92px); color: var(--acc); filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.tile .tile-t { font-family: var(--display); font-weight: 800; font-size: 1.45em; }
.tile .tile-s { font-size: .86em; opacity: .75; max-width: 16em; text-wrap: balance; }
.tile.sel { box-shadow: 0 8px 0 #120a05, 0 16px 34px rgba(0,0,0,.55), 0 0 0 3px var(--brass), 0 0 30px rgba(255,200,90,.35); }
.tile.locked { filter: grayscale(1) brightness(.55); cursor: not-allowed; }
.tile.locked .tile-ic { opacity: .35; }
.lockbadge { position: absolute; top: .6em; right: .6em; width: 1.6em; height: 1.6em; opacity: .9; color: var(--cream); }
.newbadge { position: absolute; top: .55em; left: .55em; background: var(--crib); color: #fff; font-size: .7em; font-weight: 900; padding: .15em .55em; border-radius: 99px; letter-spacing: .06em; box-shadow: 0 2px 8px rgba(0,0,0,.4); animation: jiggle 1.2s var(--ease) infinite; }

.tile.mini { width: clamp(78px, 11vw, 132px); min-height: clamp(84px, 22vh, 150px); border-radius: 16px; padding: .6em .5em; gap: .3em; }
.tile.mini .tile-t { font-size: .92em; }
.tile.mini .tile-ic { width: clamp(30px, 8vh, 56px); height: clamp(30px, 8vh, 56px); }

/* ---------------------------------------------------------------- menu layout */
.menu-center { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 3vh, 26px); }
.menu-row { display: flex; gap: .8em; flex-wrap: wrap; justify-content: center; }
.title-wrap { display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 5vh, 44px); text-align: center; }
.tagline { font-family: var(--display); font-style: italic; font-weight: 500; font-size: 1.15em; opacity: .85; margin-top: -.4em; text-shadow: 0 2px 10px rgba(0,0,0,.7); }
.foot { position: absolute; bottom: calc(var(--pad) + var(--sb)); left: calc(var(--pad) + var(--sl)); right: calc(var(--pad) + var(--sr)); display: flex; justify-content: space-between; align-items: center; gap: .6em; font-size: .8em; opacity: .75; pointer-events: none; }
.foot > * { pointer-events: auto; }
.chip { display: inline-flex; align-items: center; gap: .45em; padding: .35em .8em; border-radius: 99px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; }
.chip .ic { width: 1.1em; height: 1.1em; }
.chip.dev { background: #6a1d8a; color: #fff; }
.pegdot { width: .95em; height: .95em; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -2px 3px rgba(0,0,0,.4), inset 0 1px 2px rgba(255,255,255,.45); flex: none; }
.chip button { all: unset; cursor: pointer; }

/* main menu */
.main-grid { display: grid; grid-template-columns: auto auto auto; gap: clamp(10px, 2.2vw, 30px); align-items: stretch; margin-top: 2.2em; }
.main-side { display: flex; flex-direction: column; gap: .7em; min-width: clamp(150px, 19vw, 250px); justify-content: space-between; }
.side-btn { justify-content: flex-start !important; padding-left: 1em !important; }
.tiles.col { flex-direction: column; gap: clamp(10px, 2.2vh, 20px); }
.tile.half { width: clamp(150px, 21vw, 270px); min-height: 0; flex: 1; flex-direction: row; justify-content: flex-start; text-align: left; gap: .8em; padding: .8em 1em; border-radius: 20px; }
.tile.half .tile-ic { width: clamp(34px, 8vh, 60px); height: clamp(34px, 8vh, 60px); flex: none; }
.tile.half .tile-t { font-size: 1.22em; }
.tile.half .tile-s { font-size: .78em; text-wrap: pretty; }
.hero-col { display: flex; flex-direction: column; align-items: stretch; gap: .5em; }
.hero {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: .25em; text-align: left;
  width: clamp(230px, 33vw, 420px); min-height: clamp(170px, 50vh, 360px); padding: 1.1em 1.25em 1.15em; border: 0; border-radius: 26px; cursor: pointer; overflow: hidden; color: var(--paper);
  background: radial-gradient(ellipse at 80% 0%, rgba(255,226,170,.22), transparent 55%), linear-gradient(180deg, rgba(20,12,6,.32) 0%, rgba(20,12,6,.62) 50%, rgba(14,8,4,.94) 100%), var(--hbg, #3c2717);
  box-shadow: 0 8px 0 #120a05, 0 18px 40px rgba(0,0,0,.6), inset 0 0 0 2px rgba(255,214,120,.55), inset 0 1px 0 rgba(255,236,190,.5);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease);
}
.hero::before { /* slow breathing glow, compositor-only */
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 3px rgba(255,220,140,.9), inset 0 0 40px rgba(255,200,90,.35); opacity: 0; animation: breathe 2.8s var(--ease) infinite;
}
.hero::after { content: ''; position: absolute; top: -60%; bottom: -60%; width: 30%; left: -45%; background: linear-gradient(100deg, transparent, rgba(255,240,200,.28), transparent); transform: translateX(-100%) skewX(-16deg); pointer-events: none; animation: glimmer 1.6s var(--ease) 1.5s infinite; animation-delay: 1.2s; }
.hero:hover { transform: translateY(-5px); box-shadow: 0 13px 0 #120a05, 0 26px 50px rgba(0,0,0,.65), inset 0 0 0 2px rgba(255,214,120,.8), inset 0 1px 0 rgba(255,236,190,.6); }
.hero:active { transform: translateY(6px) scale(.99); box-shadow: 0 2px 0 #120a05, 0 6px 18px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,214,120,.8); transition-duration: .06s; }
.hero-art { position: absolute; right: 5%; top: 9%; width: 52%; height: 46%; display: grid; place-items: center; transform: rotate(-9deg); pointer-events: none; filter: drop-shadow(0 10px 14px rgba(0,0,0,.55)); opacity: .92; }
.hero-art svg { width: 100%; height: 100%; }
.hero-room { position: absolute; left: 1.1em; top: 1em; width: 2.2em; height: 2.2em; padding: .45em; border-radius: 50%; background: rgba(255,240,210,.12); color: var(--brass-hi); box-shadow: inset 0 0 0 1px rgba(255,220,160,.25); }
.hero-room svg { width: 100%; height: 100%; }
.hero > :not(.hero-art):not(.hero-room) { position: relative; z-index: 1; }
.hero-room { z-index: 1; }
.main-side .side-btn { min-height: 3.1em; }
.hero-kicker { font-size: .74em; letter-spacing: .14em; text-transform: uppercase; opacity: .8; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.hero-title { display: inline-flex; align-items: center; gap: .3em; font-family: var(--display); font-weight: 900; font-size: clamp(34px, 9.5vh, 64px); line-height: 1; color: var(--brass-hi); text-shadow: 0 4px 18px rgba(0,0,0,.6); }
.hero-title .ic { width: .8em; height: .8em; }
.hero-sub { font-weight: 900; font-size: 1.05em; }
.hero-meta { font-size: .8em; opacity: .72; }
.hero-scores { display: flex; gap: .8em; flex-wrap: wrap; font-size: .95em; }
.hero-scores span { display: inline-flex; align-items: center; gap: .35em; }
.hero-scores i { width: .8em; height: .8em; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -2px 3px rgba(0,0,0,.4); }
.hero-scores b { font-family: var(--display); font-size: 1.15em; }
.linkbtn { border: 0; background: none; color: var(--cream); opacity: .7; font-weight: 800; font-size: .82em; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: .2em; }
.linkbtn:hover { opacity: 1; }
@keyframes breathe { 0%, 100% { opacity: 0; } 50% { opacity: .75; } }

/* setup screen */
.setup { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(10px, 2.2vw, 28px); width: min(100%, 1180px); max-height: calc(100% - var(--tb)); align-items: start; margin-top: var(--tb); }
.panel { background: rgba(24, 16, 10, 0.8); border-radius: 20px; padding: clamp(10px, 1.8vh, 18px); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
@media (hover: hover) and (pointer: fine) { .panel { background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } }
.panel h3 { margin: 0 0 .55em; font-family: var(--display); font-weight: 800; font-size: 1.05em; letter-spacing: .02em; display: flex; align-items: center; gap: .5em; opacity: .95; }
.panel h3 small { font-family: var(--ui); font-weight: 700; opacity: .6; font-size: .8em; }
.picker-row { display: flex; gap: .55em; overflow-x: auto; padding: .2em .1em .5em; scrollbar-width: none; touch-action: pan-x; }
.picker-row::-webkit-scrollbar { display: none; }
.opt {
  flex: none; position: relative; display: flex; flex-direction: column; align-items: center; gap: .3em; padding: .45em; width: clamp(84px, 10.5vw, 128px);
  border: 0; border-radius: 14px; cursor: pointer; background: rgba(255,240,210,.06); box-shadow: inset 0 0 0 1px var(--line); color: var(--cream); transition: transform .16s var(--ease-out), box-shadow .16s;
}
.opt:hover:not(.locked) { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(255,220,150,.4), 0 6px 14px rgba(0,0,0,.35); }
.opt:active:not(.locked) { transform: translateY(2px) scale(.97); }
.opt.sel { box-shadow: inset 0 0 0 2px var(--brass), 0 0 18px rgba(255,200,90,.35); background: rgba(255,214,120,.12); }
.opt.locked { cursor: not-allowed; }
.opt .thumb { width: 100%; aspect-ratio: 1.45; border-radius: 10px; display: grid; place-items: center; overflow: hidden; position: relative; }
.opt .thumb svg { width: 92%; height: 92%; }
.opt .lbl { font-size: .74em; font-weight: 800; text-align: center; line-height: 1.1; min-height: 2.2em; display: flex; align-items: center; }
.opt.locked .thumb { background: repeating-linear-gradient(135deg, #1a120c 0 8px, #140d08 8px 16px) !important; }
.opt.locked .thumb > * { opacity: 0 !important; }
.opt.locked .thumb::after { content: '?'; position: absolute; font-family: var(--display); font-weight: 900; font-size: 2.2em; color: rgba(255,240,210,.22); }
.opt.locked .lbl { opacity: .45; }
.swatches { display: flex; flex-wrap: wrap; gap: .45em; }
.sw { width: 2.3em; height: 2.3em; border-radius: 50%; border: 0; cursor: pointer; position: relative; box-shadow: inset 0 -3px 6px rgba(0,0,0,.35), inset 0 2px 3px rgba(255,255,255,.35), 0 2px 6px rgba(0,0,0,.4); transition: transform .14s var(--ease-out); }
.sw:hover:not(.locked) { transform: scale(1.12); }
.sw.sel { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--brass), 0 2px 6px rgba(0,0,0,.4); }
.sw.locked { background: #241a12 !important; cursor: not-allowed; }
.sw.locked::after { content: '?'; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,240,210,.3); font-weight: 900; }
.row { display: flex; align-items: center; gap: .7em; justify-content: space-between; padding: .45em 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .lab { display: flex; flex-direction: column; }
.row .lab small { opacity: .62; font-weight: 700; font-size: .78em; }

/* toggle + segmented + slider */
.toggle { position: relative; width: 3.3em; height: 1.85em; border-radius: 99px; border: 0; cursor: pointer; background: #3a2a1e; box-shadow: inset 0 2px 5px rgba(0,0,0,.6); transition: background .2s; flex: none; }
.toggle::after { content: ''; position: absolute; top: .2em; left: .2em; width: 1.45em; height: 1.45em; border-radius: 50%; background: linear-gradient(#fff6e4, #d9c39c); box-shadow: 0 2px 5px rgba(0,0,0,.5); transition: transform .22s var(--ease-out); }
.toggle.on { background: linear-gradient(90deg, #c9952f, #e8b84f); }
.toggle.on::after { transform: translateX(1.45em); }
.seg { display: inline-flex; background: rgba(0,0,0,.35); border-radius: 12px; padding: 3px; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.seg button { border: 0; background: none; padding: .45em .9em; border-radius: 9px; cursor: pointer; font-weight: 900; color: rgba(255,240,215,.7); transition: background .15s, color .15s, transform .1s; }
.seg button:active { transform: scale(.95); }
.seg button.on { background: linear-gradient(180deg, #ffe7a6, #d9a645); color: #2a1806; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.slider { -webkit-appearance: none; appearance: none; width: clamp(120px, 18vw, 220px); height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--brass) var(--v, 50%), #3a2a1e var(--v, 50%)); outline: none; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); touch-action: pan-x; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(#fff6e4, #d9c39c); box-shadow: 0 2px 6px rgba(0,0,0,.5); cursor: pointer; }
.slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; border: 0; background: linear-gradient(#fff6e4, #d9c39c); }

.scroll { overflow-y: auto; touch-action: pan-y; scrollbar-width: thin; scrollbar-color: rgba(255,220,160,.3) transparent; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------- collection / achievements */
.split { display: grid; grid-template-columns: minmax(150px, 22%) 1fr; gap: clamp(10px, 2vw, 22px); width: min(100%, 1240px); height: calc(100% - var(--tb)); margin-top: var(--tb); }
.tabs { display: flex; flex-direction: column; gap: .4em; }
.tab { border: 0; text-align: left; padding: .65em .9em; border-radius: 12px; background: rgba(255,240,210,.05); color: var(--cream); cursor: pointer; font-weight: 900; display: flex; align-items: center; gap: .55em; box-shadow: inset 0 0 0 1px var(--line); transition: transform .14s var(--ease-out), background .15s; }
.tab:hover { transform: translateX(3px); background: rgba(255,240,210,.1); }
.tab.on { background: linear-gradient(90deg, rgba(214,169,74,.45), rgba(214,169,74,.12)); box-shadow: inset 3px 0 0 var(--brass), inset 0 0 0 1px rgba(255,214,120,.35); }
.tab .ic { width: 1.2em; height: 1.2em; opacity: .9; }
.tab .count { margin-left: auto; opacity: .55; font-size: .78em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(88px, 11vw, 132px), 1fr)); gap: .6em; align-content: start; padding: .2em; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(210px, 26vw, 300px), 1fr)); gap: .6em; padding: .2em; }
.ach { display: flex; gap: .75em; align-items: center; padding: .65em .8em; border-radius: 16px; background: rgba(255,240,210,.05); box-shadow: inset 0 0 0 1px var(--line); }
.ach .medal { flex: none; }
.ach b { display: block; font-family: var(--display); font-size: 1.02em; }
.ach small { opacity: .7; display: block; line-height: 1.2; }
.ach .rw { margin-top: .3em; display: flex; gap: .3em; flex-wrap: wrap; }
.ach .rw span { font-size: .68em; padding: .15em .5em; border-radius: 99px; background: rgba(255,214,120,.15); color: var(--brass-hi); }
.ach.locked { opacity: .55; }
.ach.locked .medal { filter: grayscale(1) brightness(.6); }
.medal { width: 3.1em; height: 3.1em; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff1c2, #e3b04f 45%, #9b6c1d 100%); box-shadow: 0 3px 0 #5e3e0e, 0 6px 14px rgba(0,0,0,.45), inset 0 0 0 3px rgba(255,240,200,.45); color: #3c2405; }
.medal .ic { width: 55%; height: 55%; }
.medal.big { width: 5em; height: 5em; }

/* ---------------------------------------------------------------- modal / sheets / toasts */
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6,3,2,.55); opacity: 0; transition: opacity .25s var(--ease); padding: calc(var(--pad) + var(--st)) calc(var(--pad) + var(--sr)) calc(var(--pad) + var(--sb)) calc(var(--pad) + var(--sl)); }
.modal-wrap.in { opacity: 1; }
.modal { max-width: min(92vw, 720px); max-height: 100%; overflow: auto; background: linear-gradient(180deg, #3b2717, #24160c); border-radius: 22px; padding: clamp(14px, 3vh, 26px); box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,170,.25), inset 0 0 0 1px rgba(255,220,170,.12);
  transform: translateY(16px) scale(.96); transition: transform .32s var(--ease-out); text-align: center; }
.modal-wrap.in .modal { transform: none; }
.modal h2 { font-family: var(--display); margin: 0 0 .35em; font-size: 1.6em; }
.modal p { margin: .3em 0 .9em; opacity: .85; }
.modal .menu-row { margin-top: .6em; }
.modal { position: relative; }
.modal-menu, .curtain .modal-menu { position: absolute; top: .55em; right: .55em; width: 2.3em; height: 2.3em; z-index: 2; }
.curtain .modal-menu, .cutspread .modal-menu { top: calc(var(--pad) + var(--st)); right: calc(var(--pad) + var(--sr)); width: 2.7em; height: 2.7em; }
.modal.paper { background: linear-gradient(180deg, #fffaf0, #f0e2c5); color: var(--ink); }

.toast { position: absolute; left: 50%; top: calc(var(--pad) + var(--st) + 3.6em); transform: translate(-50%, -30px); opacity: 0; display: flex; align-items: center; gap: .8em; padding: .65em 1.2em .65em .7em; border-radius: 18px;
  background: linear-gradient(180deg, rgba(60,40,22,.96), rgba(30,20,12,.96)); box-shadow: 0 12px 34px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,214,120,.35); transition: transform .45s var(--ease-out), opacity .35s; pointer-events: none; max-width: 90vw; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast b { font-family: var(--display); font-size: 1.1em; display: block; }
.toast small { opacity: .75; }
.toast.plain { padding: .55em 1.1em; }
.toast .medal { animation: medalIn 1s var(--ease-out); }
@keyframes medalIn { 0% { transform: scale(0) rotate(-180deg); } 70% { transform: scale(1.15) rotate(10deg); } 100% { transform: none; } }

/* ---------------------------------------------------------------- HUD */
.hud-top { position: absolute; top: calc(6px + var(--st)); left: calc(var(--pad) + var(--sl)); right: calc(var(--pad) + var(--sr)); display: flex; align-items: flex-start; gap: .6em; pointer-events: none; z-index: 4; }
.hud-top > * { pointer-events: auto; }
.scores { flex: 1; display: flex; justify-content: center; gap: .45em; flex-wrap: wrap; pointer-events: none; }
.spill { position: relative; display: flex; align-items: center; gap: .5em; padding: .3em .85em .3em .45em; border-radius: 99px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), 0 4px 14px rgba(0,0,0,.35); min-width: 7.2em; transition: transform .25s var(--ease-out), box-shadow .25s; }
.spill .dot { width: 1.25em; height: 1.25em; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -2px 4px rgba(0,0,0,.4), inset 0 1px 2px rgba(255,255,255,.5); flex: none; }
.spill .nm { font-weight: 900; max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88em; }
.spill .sc { margin-left: auto; font-family: var(--display); font-weight: 900; font-size: 1.32em; min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.spill.turn { box-shadow: inset 0 0 0 2px var(--pc), 0 0 18px color-mix(in srgb, var(--pc) 60%, transparent), 0 4px 14px rgba(0,0,0,.35); transform: translateY(2px) scale(1.04); }
.spill .tags { position: absolute; bottom: -.95em; left: 50%; transform: translateX(-50%); display: flex; gap: .25em; white-space: nowrap; }
.tag { font-size: .62em; font-weight: 900; letter-spacing: .06em; padding: .12em .5em; border-radius: 99px; background: var(--paper); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.4); text-transform: uppercase; }
.tag.dealer { background: var(--brass); }
.tag.go { background: #fff; color: #b3261e; animation: jiggle .6s var(--ease); }
.tag.think { background: rgba(255,255,255,.85); }
.tag.off { background: #555; color: #eee; }
.spill .bump { position: absolute; right: -.3em; top: -1.1em; font-family: var(--display); font-weight: 900; color: var(--brass-hi); text-shadow: 0 2px 8px rgba(0,0,0,.7); pointer-events: none; animation: bump 1.4s var(--ease-out) forwards; white-space: nowrap; font-size: 1.05em; }
@keyframes bump { 0% { opacity: 0; transform: translateY(8px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 80% { opacity: 1; transform: translateY(-6px); } 100% { opacity: 0; transform: translateY(-14px); } }
.progress121 { position: absolute; left: .7em; right: .7em; bottom: .15em; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress121 i { display: block; height: 100%; width: var(--p, 0%); background: var(--pc); transition: width .6s var(--ease); }

.hud-left { position: absolute; left: calc(var(--pad) + var(--sl)); top: 50%; transform: translateY(-62%); display: flex; flex-direction: column; gap: .5em; align-items: flex-start; z-index: 3; }
.hud-right { position: absolute; right: calc(var(--pad) + var(--sr)); bottom: calc(var(--card-h) * 0.62 + var(--sb) + 14px); display: flex; flex-direction: column; gap: .55em; align-items: flex-end; z-index: 5; }
.countbadge { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.6em; height: 4.6em; border-radius: 50%; background: radial-gradient(circle at 40% 30%, #fff9ea, #e6d1a6); color: var(--ink); box-shadow: 0 6px 0 #9f7c4f, 0 10px 24px rgba(0,0,0,.5); transition: transform .25s var(--ease-out); }
.countbadge b { font-family: var(--display); font-size: 1.85em; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.countbadge small { font-size: .62em; letter-spacing: .14em; font-weight: 900; opacity: .7; }
.countbadge.pop { animation: jiggle .5s var(--ease); }
.countbadge.hot { background: radial-gradient(circle at 40% 30%, #fff0c8, #f2b74b); }
.countbadge[hidden] { display: none; }
.minicard-label { font-size: .7em; letter-spacing: .12em; text-transform: uppercase; opacity: .7; text-align: center; margin-top: .25em; }
.starter-slot { display: flex; flex-direction: column; align-items: center; }

.prompt { position: absolute; left: 50%; bottom: calc(var(--card-h) * 0.86 + var(--sb) + 8px); transform: translateX(-50%); padding: .45em 1.15em; border-radius: 99px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), 0 6px 16px rgba(0,0,0,.4); font-weight: 900; white-space: nowrap; z-index: 5; transition: opacity .25s, transform .3s var(--ease-out); max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }
.prompt.hide { opacity: 0; transform: translate(-50%, 10px); }
/* a picked card rises into the prompt's place: the prompt steps up out of its way (and off the CRIB tags) */
.hud-root:has(.hand .card.sel) .prompt:not(.hide) { transform: translate(-50%, calc(var(--card-h) * -0.4)); }
.hud-root.showing .prompt { opacity: 0; }
.prompt.wait { font-size: .82em; padding: .32em .95em; opacity: .85; font-weight: 800; }
.prompt.crib { background: rgba(120, 18, 12, .82); box-shadow: inset 0 0 0 1px rgba(255,120,100,.5), 0 0 22px rgba(255,60,40,.35); }

.hand { position: absolute; left: 50%; bottom: calc(-0.16 * var(--card-h) + var(--sb)); transform: translateX(-50%); height: var(--card-h); display: flex; justify-content: center; z-index: 4; pointer-events: none; }
.hand.dim .card { filter: brightness(.75) saturate(.8); }
.card {
  --w: calc(var(--card-h) * 0.714); position: relative; width: var(--w); height: var(--card-h); margin: 0 calc(var(--w) * -0.17); border-radius: calc(var(--w) * 0.075);
  pointer-events: auto; cursor: pointer; transform-origin: 50% 120%; transition: transform .28s var(--ease-out), filter .2s, margin .3s var(--ease); box-shadow: 0 6px 14px rgba(0,0,0,.42), 0 1px 3px rgba(0,0,0,.3);
}
.card > svg, .card > .face, .card > .cimg { width: 100%; height: 100%; display: block; border-radius: inherit; }
.cimg { width: 100%; height: 100%; display: block; -webkit-user-drag: none; pointer-events: none; }
.hand .card { transform: translateY(var(--y, 0px)) rotate(var(--r, 0deg)); }
.hand .card:hover { transform: translateY(calc(var(--y, 0px) - 10%)) rotate(var(--r, 0deg)); z-index: 2; }
.hand .card.sel { transform: translateY(calc(var(--y, 0px) - 24%)) rotate(var(--r, 0deg)); z-index: 3; }
.hand .card.lift { transform: translateY(calc(var(--y, 0px) + var(--dy, 0px))) rotate(0deg) scale(1.04); transition: none; z-index: 5; }
.hand .card.sel.lift { transform: translateY(calc(var(--y, 0px) - 24% + var(--dy, 0px))) rotate(0deg) scale(1.04); }
.card.sel::before { content: ''; position: absolute; inset: -4px; border-radius: calc(var(--w) * 0.09); box-shadow: 0 0 0 3px var(--brass-hi), 0 0 24px rgba(255,214,120,.7); pointer-events: none; }
.card.crib.sel::before { box-shadow: 0 0 0 3px #ff5a48, 0 0 28px var(--crib-glow), 0 0 60px rgba(255,40,20,.35); animation: cribGlow 1.4s var(--ease) infinite; }
.card.crib.sel::after { content: ''; position: absolute; inset: -6px; border-radius: calc(var(--w) * 0.1); box-shadow: 0 0 22px 6px rgba(255,60,40,.55); pointer-events: none; animation: breathe 1.4s var(--ease) infinite; }
.card .cribtag { position: absolute; left: 50%; top: -0.9em; transform: translateX(-50%) scale(.6); opacity: 0; padding: .12em .65em; border-radius: 99px; background: linear-gradient(180deg, #ff6b57, #c9271d); color: #fff; font-weight: 900; letter-spacing: .14em; font-size: .78em; box-shadow: 0 3px 10px rgba(0,0,0,.45); transition: transform .25s var(--ease-out), opacity .2s; pointer-events: none; z-index: 4; }
.card.crib.sel .cribtag { opacity: 1; transform: translateX(-50%) scale(1); }
/* cards picked for the crib step apart from their neighbours, so neither glow nor tag is hidden */
.hand .card.crib.sel { margin: 0 calc(var(--w) * 0.03); }
.card.illegal { filter: brightness(.55) saturate(.6); cursor: not-allowed; }
.hand .card.nudge:not(.sel) { animation: nudge .6s var(--ease); }
@keyframes nudge { 0%, 100% { transform: translateY(var(--y, 0px)) rotate(var(--r, 0deg)); } 40% { transform: translateY(calc(var(--y, 0px) - 9%)) rotate(var(--r, 0deg)); } }
.hand .card.illegal:hover { transform: translateY(calc(var(--y, 0px) - 3%)) rotate(var(--r, 0deg)); }
.card.deal { animation: dealIn .5s var(--ease-out) backwards; }
@keyframes dealIn { from { transform: translate(var(--dx, 30vw), var(--dy, -40vh)) rotate(25deg) scale(.6); opacity: 0; } }
@keyframes cribGlow { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
.card .jbadge { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); background: var(--paper); color: var(--ink); border-radius: 10px; padding: .1em .45em; font-weight: 900; box-shadow: 0 2px 8px rgba(0,0,0,.4); font-size: .9em; }

/* the cards counted in pegging: big enough to read at a glance; each overlaps the last a little,
   always leaving its corner (rank and suit) in view */
.pile { --ph: calc(var(--card-h) * 0.6); position: absolute; left: 50%; bottom: calc(var(--card-h) * 0.86 + var(--sb) + 3.3em); transform: translateX(-50%); display: flex; align-items: flex-end; z-index: 3; pointer-events: none; height: var(--ph); padding: 0 calc(var(--ph) * 0.09); }
.pile .card { height: 100%; width: auto; aspect-ratio: .714; border-radius: 7.5% / 5.4%; margin: 0 calc(var(--ph) * -0.064); cursor: default; pointer-events: none; animation: pileIn .35s var(--ease-out) backwards; transform: rotate(var(--r, 0deg)); box-shadow: 0 5px 12px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.3); }
.pile .card .owner { position: absolute; left: 50%; bottom: -.55em; transform: translateX(-50%); width: .9em; height: .9em; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0,0,0,.5); }
.pile.clear .card { transition: transform .45s var(--ease), opacity .45s; transform: translateY(-30px) scale(.8); opacity: 0; }
@keyframes pileIn { from { transform: translate(var(--fx, 0), var(--fy, 40vh)) scale(1.3) rotate(10deg); opacity: 0; } }

.actions { display: flex; flex-direction: column; gap: .55em; align-items: flex-end; }
/* auto-deal: a brass bar fills along the bottom of Next Hand */
.btn.auto::before { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: rgba(120,70,10,.55); transform-origin: 0 50%; transform: scaleX(0); animation: autofill var(--auto, 5s) linear forwards; }
@keyframes autofill { to { transform: scaleX(1); } }
.opp { position: absolute; display: flex; flex-direction: column; align-items: center; gap: .25em; z-index: 3; }
.fan { display: flex; height: 2.6em; }
.fan i { display: block; width: 1.7em; height: 2.4em; margin: 0 -0.55em; border-radius: 4px; background: var(--back, linear-gradient(135deg, #8d1d1a, #4a0c0a)); box-shadow: 0 2px 5px rgba(0,0,0,.5), inset 0 0 0 2px #f4ead6; transform: rotate(calc((var(--i) - var(--n) / 2) * 6deg)); transform-origin: 50% 140%; }
.bubble { position: absolute; padding: .4em .9em; border-radius: 16px; background: var(--paper); color: var(--ink); font-weight: 900; box-shadow: 0 6px 16px rgba(0,0,0,.45); white-space: nowrap; animation: bubble 1.6s var(--ease-out) forwards; z-index: 8; pointer-events: none; }
.bubble.long { animation-duration: 2.9s; font-style: italic; }
.bubble::before { content: ''; position: absolute; left: 50%; top: -6px; width: 12px; height: 12px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 80% { opacity: 1; transform: translate(-50%, -4px); } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.floater { position: absolute; transform: translate(-50%, -50%); font-family: var(--display); font-weight: 900; font-size: 1.6em; color: var(--brass-hi); text-shadow: 0 3px 12px rgba(0,0,0,.8), 0 0 18px rgba(255,200,90,.5); pointer-events: none; z-index: 9; animation: floatUp 1.7s var(--ease-out) forwards; white-space: nowrap; }
.floater small { display: block; font-family: var(--ui); font-size: .48em; text-align: center; color: var(--paper); letter-spacing: .04em; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(.5); } 18% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 75% { opacity: 1; transform: translate(-50%, -110%); } 100% { opacity: 0; transform: translate(-50%, -150%); } }

/* The Show */
.show { position: absolute; right: calc(var(--pad) + var(--sr)); top: 50%; width: min(58vw, 780px); transform: translate(110%, -50%); transition: transform .5s var(--ease-out); z-index: 6;
  background: linear-gradient(180deg, rgba(40,27,16,.94), rgba(22,14,8,.94)); border-radius: 22px; padding: clamp(10px, 2vh, 18px); box-shadow: 0 18px 50px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,214,120,.25); }
.show.in { transform: translate(0, -50%); }
.show h3 { margin: 0; font-family: var(--display); font-size: 1.32em; display: flex; align-items: center; gap: .5em; }
.show h3 .dot { width: .9em; height: .9em; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); }
/* the whole panel wears the colour of whoever is counting */
.show { --pc: #d6a94a; border: 3px solid var(--pc); box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 26px -2px var(--pc), inset 0 0 40px -10px var(--pc); transition: transform .5s var(--ease-out), border-color .4s, box-shadow .4s; }
.show h3 { padding: .15em .2em .35em; border-bottom: 2px solid color-mix(in srgb, var(--pc) 55%, transparent); }
/* the running count: a big number in a pill, labelled, that pops as it climbs */
.show .total { position: relative; margin-left: auto; display: flex; flex-direction: column; align-items: center; min-width: 2.6em; padding: .1em .45em .15em; border-radius: 14px;
  background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 2px var(--pc); font-variant-numeric: tabular-nums; line-height: 1; }
.show .total small { font-family: var(--ui); font-size: .42em; font-weight: 900; letter-spacing: .18em; opacity: .7; margin-bottom: .15em; }
.show .total b { font-size: 1.9em; color: var(--paper); text-shadow: 0 0 14px var(--pc); }
.show .total b.bump { animation: countBump .45s var(--ease-out); }
@keyframes countBump { 0% { transform: scale(1); } 35% { transform: scale(1.45); color: #fff; } 100% { transform: scale(1); } }
.show .total .add { position: absolute; right: 105%; top: 38%; font-style: normal; font-size: 1.05em; font-weight: 900; color: var(--brass-hi); opacity: 0; white-space: nowrap; pointer-events: none; }
.show .total .add.go { animation: countAdd 1s var(--ease-out); }
@keyframes countAdd { 0% { opacity: 0; transform: translate(.4em, .2em) scale(.7); } 20% { opacity: 1; transform: translate(0, 0) scale(1.15); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-.2em, -.8em) scale(1); } }
.show .cards { display: flex; gap: 2%; margin: 1.5em 0 .55em; align-items: flex-end; }
.show .cards .c { position: relative; flex: 1; aspect-ratio: .714; border-radius: 7%/5%; transition: transform .3s var(--ease-out), filter .3s, opacity .3s, box-shadow .3s; box-shadow: 0 5px 12px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4); }
.show .cards .c svg, .show .cards .c img { width: 100%; height: 100%; display: block; }
.show .cards .c.starter { margin-left: 4.5%; }
/* the starter stands a little apart, under its own label, with a hairline between */
.show .cards .c.starter::after { content: 'STARTER'; position: absolute; top: -1.45em; left: 0; right: 0; text-align: center; font-size: .6em; font-weight: 900; letter-spacing: .16em; color: var(--brass-hi); opacity: .8; }
.show .cards .c.starter::before { content: ''; position: absolute; left: -15%; top: 8%; bottom: 8%; width: 2px; border-radius: 2px; background: linear-gradient(transparent, color-mix(in srgb, var(--pc) 70%, transparent), transparent); }
/* the cards not in this score step back, but stay easy to read */
.show .cards.lit .c:not(.on) { opacity: .66; filter: brightness(.74) saturate(.85); transform: translateY(3%) scale(.97); }
.show .cards .c.on { transform: translateY(-8%) scale(1.05); box-shadow: 0 0 0 2.5px rgba(255,232,160,.95), 0 0 22px 5px rgba(255,214,120,.65), 0 12px 18px rgba(0,0,0,.5); z-index: 1; }
.show .phrase { min-height: 1.6em; font-family: var(--display); font-weight: 900; font-size: 1.6em; line-height: 1.15; text-align: center; color: var(--paper); text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.show .phrase.pop { animation: jiggle .45s var(--ease); }
.show .log { display: flex; flex-wrap: wrap; gap: .35em; justify-content: center; margin-top: .4em; min-height: 1.7em; }
.show .log span { font-size: .82em; padding: .2em .7em; border-radius: 99px; background: rgba(255,214,120,.16); box-shadow: inset 0 0 0 1px rgba(255,214,120,.22); color: var(--brass-hi); font-variant-numeric: tabular-nums; animation: pileIn .3s var(--ease-out); --fy: 10px; }
.show .log span b { color: var(--paper); margin-left: .25em; }
/* phones: the cards are what matter, so the panel takes more of the width */
@media (max-height: 520px) {
  .show { width: min(68vw, 640px); padding: 8px 12px 10px; border-radius: 18px; }
  .show h3 { font-size: 1.15em; padding-bottom: .25em; }
  .show .cards { margin: 1.35em 0 .35em; }
  .show .phrase { font-size: 1.35em; }
  .show .log { margin-top: .2em; }
  .show .log span { font-size: .76em; }
}
.show .zero { text-align: center; font-family: var(--display); font-size: 1.3em; opacity: .85; }

/* curtain for pass & play */
.curtain { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, rgba(40,26,16,.97), rgba(10,6,3,.99)); opacity: 0; transition: opacity .3s var(--ease); text-align: center; }
.curtain.in { opacity: 1; }
.curtain h2 { font-family: var(--display); font-size: 2em; margin: .2em 0; }
.curtain .peg-ic { width: 3.4em; height: 3.4em; margin: 0 auto; }

/* joker picker */
.jpick .ranks, .jpick .suits { display: flex; flex-wrap: wrap; gap: .35em; justify-content: center; margin: .5em 0; }
.jpick .ranks button, .jpick .suits button { min-width: 2.5em; height: 2.5em; border-radius: 10px; border: 0; cursor: pointer; font-weight: 900; font-size: 1.05em; background: #fff8e9; color: var(--ink); box-shadow: 0 3px 0 #a88c5c; transition: transform .1s; }
.jpick .suits button { min-width: 3.2em; height: 3.2em; font-size: 1.5em; }
.jpick button.on { background: linear-gradient(180deg, #ffe7a6, #d9a645); box-shadow: 0 3px 0 #8a6020, 0 0 0 3px rgba(255,214,120,.6); }
.jpick button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a88c5c; }
.jpick .red { color: #c3261d; }
.jpick .preview { width: 5.5em; margin: .3em auto; aspect-ratio: .714; }
.jpick .preview img, .jpick .preview svg { width: 100%; height: 100%; display: block; }
.timer { width: 3.2em; height: 3.2em; margin: 0 auto .4em; position: relative; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 1.2em; }

/* cut */
.cutrow { display: flex; justify-content: center; margin: 1em 0 .4em; height: 7em; cursor: pointer; touch-action: none; }
.cutrow i { display: block; width: 3.4em; height: 5em; margin: 0 -1.35em; border-radius: 6px; background: var(--back, linear-gradient(135deg, #8d1d1a, #4a0c0a)); background-size: cover; box-shadow: 0 3px 8px rgba(0,0,0,.45), inset 0 0 0 2px #f4ead6; transition: transform .15s var(--ease-out); }
.cutrow i.hl { transform: translateY(-1.1em); }

/* game over */
.winner { text-align: center; }
.winner .crown { display: block; margin: 0 auto .1em; width: 3.4em; height: 3.4em; color: var(--brass-hi); filter: drop-shadow(0 6px 20px rgba(255,200,90,.6)); animation: medalIn 1s var(--ease-out); }
.final-scores { display: flex; gap: .6em; justify-content: center; margin: .8em 0; flex-wrap: wrap; }
.final-scores .spill { min-width: 9em; }
.skunk-badge { display: inline-block; margin-top: .4em; padding: .3em .9em; border-radius: 99px; background: #111; color: #fff; font-weight: 900; letter-spacing: .08em; box-shadow: inset 0 0 0 2px #fff; animation: jiggle 1s var(--ease) infinite; }
.earned { display: flex; gap: .5em; justify-content: center; flex-wrap: wrap; margin: .6em 0; }

/* online: players loading in */
.loadscreen { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; text-align: center; opacity: 0; transition: opacity .5s var(--ease);
  background: radial-gradient(ellipse at 50% 40%, rgba(46,30,18,.97) 0%, rgba(11,7,5,.99) 75%); padding: calc(var(--pad) + var(--st)) calc(var(--pad) + var(--sr)) calc(var(--pad) + var(--sb)) calc(var(--pad) + var(--sl)); }
.loadscreen.in { opacity: 1; }
.ls-inner { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.6vh, 14px); }
.ls-inner h2 { font-family: var(--display); margin: 0; font-size: 1.5em; }
.ls-inner p { margin: 0; }
.ls-players { display: flex; gap: clamp(10px, 2vw, 22px); flex-wrap: wrap; justify-content: center; margin: .6em 0; }
.ls-p { width: clamp(110px, 16vw, 170px); padding: .8em .6em; border-radius: 18px; background: rgba(255,240,210,.05); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; align-items: center; gap: .35em; transition: background .4s, box-shadow .4s; }
.ls-p .peg-ic { width: 2em; height: 2.8em; transition: transform .5s var(--ease-out); }
.ls-p b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ls-p small { height: 1.3em; display: flex; align-items: center; opacity: .8; }
.ls-p .ls-ok { display: none; align-items: center; gap: .3em; color: var(--good); }
.ls-p .ls-ok .ic { width: 1.1em; height: 1.1em; }
.ls-p.ready { background: rgba(95,191,106,.1); box-shadow: inset 0 0 0 1px rgba(95,191,106,.5); }
.ls-p.ready .ls-ok { display: inline-flex; }
.ls-p.ready .ls-wait { display: none; }
.ls-p.ready .peg-ic { transform: translateY(-4px); }
.ls-wait { display: inline-flex; gap: .3em; }
.ls-wait i { width: .45em; height: .45em; border-radius: 50%; background: var(--brass); animation: lsdot 1.1s var(--ease) infinite; }
.ls-wait i:nth-child(2) { animation-delay: .15s; }
.ls-wait i:nth-child(3) { animation-delay: .3s; }
@keyframes lsdot { 0%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.ls-tip { font-family: var(--display); font-style: italic; font-weight: 500; opacity: .6; }

/* lobby */
.code { display: flex; gap: .3em; justify-content: center; margin: .2em 0 .3em; }
.code span { width: 1.4em; height: 1.55em; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: clamp(30px, 10vh, 76px); background: linear-gradient(180deg, #fffaf0, #eadbbb); color: var(--ink); border-radius: 14px; box-shadow: 0 6px 0 #a48a5c, 0 10px 24px rgba(0,0,0,.45); }
.code.input span { cursor: text; }
.code.input span.cur { box-shadow: 0 6px 0 #a48a5c, 0 0 0 3px var(--brass-hi), 0 10px 24px rgba(0,0,0,.45); animation: curblink 1.2s infinite; }
@keyframes curblink { 50% { transform: translateY(-3px); } }
.join-center { margin-top: 2.4em; }
.codebox { position: relative; display: block; cursor: text; }
.codefield { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; font-size: 16px; color: transparent; background: transparent; caret-color: transparent; -webkit-user-select: text; user-select: text; touch-action: manipulation; }
.join-hint { margin: .2em 0 .4em; min-height: 1.3em; }
/* when the phone's keyboard takes half the screen, keep the code and button up top */
@media (max-height: 300px) { .join-center { margin-top: 2em; gap: 4px; } .join-screen .code span { font-size: clamp(26px, 14vh, 60px); } .join-hint { display: none; } }
.keys { display: grid; grid-template-columns: repeat(10, 1fr); gap: .35em; max-width: 620px; margin: .6em auto; }
.keys button { height: 2.5em; border: 0; border-radius: 10px; font-weight: 900; font-size: 1.05em; background: #fff8e9; color: var(--ink); box-shadow: 0 3px 0 #a88c5c; cursor: pointer; }
.keys button:active { transform: translateY(2px); box-shadow: 0 1px 0 #a88c5c; }
.keys .wide { grid-column: span 2; background: #e8d4ad; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6em; width: min(100%, 720px); }
.slot { display: flex; flex-direction: column; align-items: center; gap: .3em; padding: .8em .5em; border-radius: 16px; background: rgba(255,240,210,.05); box-shadow: inset 0 0 0 1px var(--line); min-height: 6.5em; justify-content: center; }
.slot .peg-ic { width: 2.1em; height: 3em; }
.slot.empty { opacity: .45; border: 2px dashed rgba(255,240,210,.18); box-shadow: none; }
.slot b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; z-index: 30; pointer-events: none; }
.countdown b { font-family: var(--display); font-weight: 900; font-size: clamp(90px, 38vh, 300px); color: var(--paper); text-shadow: 0 10px 40px rgba(0,0,0,.7), 0 0 60px rgba(255,200,90,.5); animation: cd 1s var(--ease-out) forwards; }
@keyframes cd { 0% { opacity: 0; transform: scale(2.2); } 25% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(.7); } }
.spinner { width: 3.4em; height: 3.4em; border-radius: 50%; border: 5px solid rgba(255,240,210,.15); border-top-color: var(--brass); animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.namefield { padding: .65em .9em; border-radius: 12px; border: 0; background: #fff8e9; color: var(--ink); font-weight: 800; min-width: 12em; box-shadow: inset 0 2px 4px rgba(0,0,0,.2); text-align: center; -webkit-user-select: text; user-select: text; touch-action: auto; }
.namefield:focus { outline: 3px solid var(--brass-hi); }

/* settings */
.settings { width: min(100%, 760px); height: calc(100% - var(--tb)); margin-top: var(--tb); }
.settings .panel { margin-bottom: .8em; }
/* wide screens: two columns, so most of the settings fit without scrolling */
@media (min-width: 1100px) {
  .settings { width: min(100%, 1180px); display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9em; align-content: start; }
}

/* help */
/* How to Play: chapters on the left, one illustrated page at a time */
.rules .tabs .count { font-family: var(--display); }
.rules-page { display: flex; flex-direction: column; min-height: 0; max-width: 62vw; padding: 0; overflow: hidden; }
.rules-body { flex: 1; min-height: 0; padding: clamp(14px, 2.6vh, 26px) clamp(14px, 2.4vw, 30px) .6em; }
.rule { max-width: 46em; animation: ruleIn .42s var(--ease-out) both; }
.rule.fwd { animation-name: ruleFwd; }
.rule.bwd { animation-name: ruleBwd; }
@keyframes ruleIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes ruleFwd { from { opacity: 0; transform: translateX(26px); } }
@keyframes ruleBwd { from { opacity: 0; transform: translateX(-26px); } }
.rule-head { display: flex; align-items: flex-start; gap: .85em; margin-bottom: .9em; }
.rule-n { flex: none; width: 2.1em; height: 2.1em; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.15em; color: #2a1806; background: radial-gradient(circle at 35% 30%, var(--brass-hi), var(--brass) 60%, var(--brass-lo)); box-shadow: 0 3px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.6); }
.rule-head h3 { margin: .05em 0 .2em; font-family: var(--display); font-weight: 800; font-size: 1.5em; color: var(--paper); letter-spacing: .01em; }
.rule .lede { margin: 0; font-size: 1.04em; line-height: 1.4; opacity: .92; font-weight: 700; }
.rule p { line-height: 1.5; font-weight: 600; opacity: .86; margin: .75em 0; }
.rule p.muted { opacity: .6; font-size: .9em; }
.rule b { color: var(--brass-hi); }
.crib-word { color: #ff7b6b; text-shadow: 0 0 10px var(--crib-glow); }
/* example rows: printed cards, what they make, the points */
.ex { display: flex; align-items: center; gap: .9em; padding: .5em .7em; margin: .45em 0; border-radius: 14px; background: rgba(255,240,210,.05); box-shadow: inset 0 0 0 1px var(--line); }
.ex-cards { display: flex; align-items: center; gap: .28em; flex: none; min-width: 8.1em; }
.ex-what { flex: 1; line-height: 1.3; font-weight: 700; opacity: .9; }
.ex-pts { flex: none; font-family: var(--display); font-weight: 800; font-size: 1.2em; color: var(--brass-hi); min-width: 2.2em; text-align: right; }
.mc { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 1.75em; height: 2.4em; border-radius: .28em; background: linear-gradient(180deg, #fffdf6, #efe6d2); color: #1d140d; box-shadow: 0 2px 4px rgba(0,0,0,.35), inset 0 0 0 1px rgba(0,0,0,.12); line-height: 1; }
.mc b { font-family: var(--display); font-weight: 800; font-size: .95em; color: inherit !important; }
.mc i { font-style: normal; font-size: .85em; margin-top: .05em; }
.mc.red { color: #c8202a; }
.mc.crib { box-shadow: 0 0 0 2px var(--crib), 0 0 14px var(--crib-glow); transform: translateY(-.25em); }
.mc.starter { box-shadow: 0 0 0 2px var(--brass), 0 0 12px rgba(246,220,146,.55); }
.mc.go { width: auto; padding: 0 .6em; font-family: var(--display); font-weight: 800; background: linear-gradient(180deg, var(--brass-hi), var(--brass)); color: #2a1806; }
.mc-plus { opacity: .6; font-weight: 900; margin: 0 .1em; }
.perfect { display: flex; align-items: center; gap: .28em; margin: .9em 0 .4em; padding: .7em .9em; border-radius: 16px; background: linear-gradient(90deg, rgba(214,169,74,.22), rgba(214,169,74,.04)); box-shadow: inset 0 0 0 1px rgba(255,214,120,.3); }
.perfect > div { margin-left: .8em; display: flex; flex-direction: column; line-height: 1.1; }
.perfect > div b { font-family: var(--display); font-size: 2em; color: var(--brass-hi); }
.perfect > div span { opacity: .75; font-size: .85em; }
/* the goal: a strip of track with two pegs */
.rule-track { display: flex; align-items: center; gap: .55em; padding: .9em 1.1em; margin: .3em 0 .6em; border-radius: 14px; width: max-content; max-width: 100%; background: linear-gradient(180deg, #d8b98a, #b8935e); box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 4px 12px rgba(0,0,0,.35); }
.rt-hole { width: .62em; height: .62em; border-radius: 50%; background: #2a1a0f; box-shadow: inset 0 1px 2px #000; position: relative; }
.rt-gap { width: .4em; }
.rt-hole.peg::after { content: ''; position: absolute; left: 50%; bottom: 40%; width: .5em; height: 1.5em; transform: translateX(-50%); border-radius: .25em .25em .1em .1em; background: linear-gradient(90deg, #8f1f17, #e0483a 45%, #9b2219); box-shadow: 0 2px 3px rgba(0,0,0,.45); }
.rt-hole.peg.back::after { animation: leap 2.8s var(--ease) infinite; }
@keyframes leap { 0%, 30% { transform: translateX(-50%); } 55% { transform: translate(calc(-50% + 3.3em), -1.1em); } 75%, 100% { transform: translate(calc(-50% + 6.6em), 0); } }
/* skunk lines */
.skunkbar { position: relative; height: .7em; margin: 2.4em .6em 3em; border-radius: 99px; background: rgba(255,240,210,.1); box-shadow: inset 0 0 0 1px var(--line); }
.sb-fill { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #6d3a8f, #c0392b 50%, var(--brass) 75%, var(--good)); opacity: .55; }
.sb-mark { position: absolute; top: -2.05em; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: .8em; white-space: nowrap; }
.sb-mark b { font-family: var(--display); font-size: 1.3em; line-height: 1; color: var(--paper); }
.sb-mark i { width: 2px; height: 2.4em; margin: .2em 0; background: var(--cream); opacity: .7; border-radius: 1px; }
.sb-mark em { font-style: normal; opacity: .75; }
.sb-end { position: absolute; right: -.4em; top: 1.2em; font-family: var(--display); font-weight: 800; color: var(--good); }
/* controls */
.ctl { display: flex; gap: .8em; align-items: flex-start; margin: .7em 0; }
.ctl > span { flex: none; width: 2.2em; height: 2.2em; border-radius: 12px; display: grid; place-items: center; background: rgba(255,240,210,.07); box-shadow: inset 0 0 0 1px var(--line); color: var(--brass-hi); }
.ctl > span svg { width: 1.2em; height: 1.2em; }
.ctl p { margin: .15em 0 0 !important; }
kbd { display: inline-block; min-width: 1.5em; padding: .05em .4em; border-radius: 6px; text-align: center; font: 800 .85em var(--ui); color: var(--paper); background: rgba(255,240,210,.12); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35), inset 0 0 0 1px var(--line); }
.rules-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .8em; padding: .7em clamp(14px, 2.4vw, 30px) calc(.8em + 5px); border-top: 1px solid var(--line); background: rgba(10,6,3,.25); }
.rules-dots { display: flex; gap: .4em; }
.rules-dots i { width: .45em; height: .45em; border-radius: 50%; background: rgba(255,240,210,.25); transition: background .2s, transform .2s; }
.rules-dots i.on { background: var(--brass-hi); transform: scale(1.35); }
@media (max-height: 430px) { .rule-head h3 { font-size: 1.25em; } .ex { padding: .35em .6em; margin: .3em 0; } .rules-body { padding-top: 10px; } }
.help { width: min(100%, 900px); height: calc(100% - var(--tb)); margin-top: var(--tb); }
.help h4 { font-family: var(--display); margin: .9em 0 .3em; font-size: 1.1em; color: var(--brass-hi); }
.help p, .help li { opacity: .9; line-height: 1.45; font-weight: 600; }
.help ul { margin: .2em 0; padding-left: 1.2em; }

/* small phones (≤ 430 px tall landscape) */
@media (max-height: 430px) {
  :root { --pad: 8px; }
  .main-grid { margin-top: 2.6em; }
  .tile.half { padding: .6em .75em; gap: .6em; }
  .tile.half .tile-t { font-size: 1.08em; }
  .tile.half .tile-s { font-size: .7em; }
  .hero { min-height: 0; padding: .9em 1em 1em; }
  .hero-art { width: 40%; height: 40%; top: 6%; right: 4%; }
  .hero-title { font-size: clamp(30px, 11vh, 52px); }
  .pile { --ph: calc(var(--card-h) * 0.62); }
  .tile { min-height: 46vh; }
  .btn-big { font-size: 1.12em; }
  .topbar h2 { font-size: 1.25em; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
html.reduce * { animation-duration: .01ms !important; transition-duration: .01ms !important; }

/* while a game is on its way in, the menus underneath take no more taps */
.start-blocker { position: fixed; inset: 0; z-index: 45; cursor: progress; background: transparent; }

/* the cut: the whole deck spread face down, pick any card */
.cutspread { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 2.4vh, 18px);
  padding: calc(var(--pad) + var(--st)) calc(var(--pad) + var(--sr)) calc(var(--pad) + var(--sb)) calc(var(--pad) + var(--sl));
  background: radial-gradient(ellipse at 50% 55%, rgba(14,8,4,.42), rgba(6,3,2,.78)); opacity: 0; transition: opacity .3s var(--ease); }
.cutspread.in { opacity: 1; }
.cutspread.out { opacity: 0; transition-duration: .35s; pointer-events: none; }
.cs-head { text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.cs-head h2 { margin: 0; font-family: var(--display); font-size: 1.5em; }
.cs-head p { margin: .15em 0 0; opacity: .8; font-size: .9em; }
.cs-deck { position: relative; flex: none; }
.cutspread .sc { position: absolute; left: 0; top: 0; height: var(--ch); padding: 0; margin: 0; border: 0; background: none; cursor: pointer; perspective: 900px; -webkit-tap-highlight-color: transparent;
  transform: translate(var(--cx), var(--cy)); transition: transform .55s var(--ease-out) var(--d, 0s); }
.cutspread.in .sc { transform: translate(var(--x), var(--y)); }
.cutspread .sc .cf { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); pointer-events: none; transform-style: preserve-3d; border-radius: 7%/5%;
  box-shadow: -2px 3px 8px rgba(0,0,0,.45); transition: transform .18s var(--ease-out), box-shadow .18s, opacity .25s, filter .25s; }
.cutspread .sc .b, .cutspread .sc .f { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cutspread .sc .f { transform: rotateY(180deg); background: var(--paper); }
.cutspread .sc img, .cutspread .sc svg { width: 100%; height: 100%; display: block; }
@media (hover: hover) {
  .cutspread:not(.picked) .sc:hover .cf { transform: translateY(-11%); box-shadow: 0 0 0 2px var(--brass-hi), 0 0 18px 2px rgba(246,220,146,.55), -2px 8px 14px rgba(0,0,0,.5); }
}
.cutspread .sc:focus-visible { outline: none; }
.cutspread .sc:focus-visible .cf { transform: translateY(-11%); box-shadow: 0 0 0 3px var(--brass-hi); }
.cutspread.picked .sc:not(.chosen) .cf { opacity: .9; filter: brightness(.42) saturate(.6); }
.cutspread .sc.chosen { z-index: 5; }
.cutspread .sc.chosen .cf { transform: translateY(-20%) scale(1.14); box-shadow: 0 0 0 2px var(--brass-hi), 0 0 26px 6px rgba(246,220,146,.6), 0 14px 24px rgba(0,0,0,.55); transition: transform .3s var(--ease-out), box-shadow .3s; }
.cutspread .sc.chosen.flip .cf { transform: translateY(-20%) scale(1.22) rotateY(180deg); transition: transform .55s var(--ease); }
.cutspread .cs-auto { font-size: .85em; padding: .45em 1.1em; }
.cutspread.picked .cs-auto { opacity: 0; pointer-events: none; transition: opacity .2s; }

/* ---------------------------------------------------------------- the spinning-peg loader (js/ui/loader.js) */
.cb-loader { --lpc: #c8352b; position: fixed; left: 50%; top: 50%; z-index: 60; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: .35em; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .28s var(--ease), visibility 0s linear .28s; }
.cb-loader.in { opacity: 1; visibility: visible; transition: opacity .22s var(--ease), visibility 0s; }
.cb-loader .lp-art { position: relative; width: clamp(58px, 12vh, 84px); aspect-ratio: 1; }
/* a dark glass disc behind the peg, so it reads over sand, snow or a bright window */
.cb-loader .lp-art::before { content: ''; position: absolute; inset: -16%; border-radius: 50%; background: radial-gradient(closest-side, rgba(14,9,5,.72), rgba(14,9,5,.5) 70%, rgba(14,9,5,.35));
  box-shadow: inset 0 0 0 1px rgba(255,220,150,.2), 0 6px 18px rgba(0,0,0,.35); }
.cb-loader .lp-art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cb-loader .lp-jolt, .cb-loader .lp-spin { position: absolute; inset: 0; }
.cb-loader .lp-spin { will-change: transform; filter: drop-shadow(0 3px 5px rgba(0,0,0,.45)); }
.cb-loader .lp-body { fill: var(--lpc); transition: fill .18s var(--ease); }
.cb-loader .lp-halo { transform-box: fill-box; transform-origin: center; opacity: .6; }
.cb-loader .lp-text { position: relative; display: grid; place-items: center; min-height: 1.6em; margin-top: .55em; padding: .28em .95em; border-radius: 99px; background: rgba(12,7,4,.66); box-shadow: inset 0 0 0 1px rgba(255,220,150,.14); }
.cb-loader .lp-msg, .cb-loader .lp-go { grid-area: 1 / 1; white-space: nowrap; text-shadow: 0 2px 8px rgba(0,0,0,.8); transition: opacity .25s var(--ease), transform .3s var(--ease-out); }
.cb-loader .lp-msg { font-size: .9em; font-weight: 800; letter-spacing: .03em; color: var(--cream); opacity: .85; }
.cb-loader .lp-go { font-family: var(--display); font-weight: 900; font-size: 1.35em; color: var(--brass-hi); opacity: 0; transform: scale(.85); }
.cb-loader.going .lp-msg { opacity: 0; }
.cb-loader.going .lp-go { opacity: 1; transform: none; }

/* the top-left way out of every menu: a labelled pill, never smaller than a fingertip */
.backbtn { min-height: max(48px, 2.95em); padding: 0 1.15em 0 .85em; gap: .4em; border-radius: 999px; font-size: 1em; flex: none; }
.backbtn .ic { width: 1.45em; height: 1.45em; }
@media (pointer: coarse) { .btn-icon { width: max(44px, 2.7em); height: max(44px, 2.7em); } }

/* ---------------------------------------------------------------- collection: tabs | items | a window onto the 3D preview */
.coll-scrim { background: linear-gradient(90deg, rgba(10,6,4,.86) 0%, rgba(10,6,4,.6) 42%, rgba(10,6,4,.3) 58%, rgba(10,6,4,0) 66%); }
.split.coll3 { grid-template-columns: minmax(148px, 19%) minmax(0, 1fr) minmax(210px, 35%); width: min(100%, 1720px); }
.coll3 > [data-items] { min-width: 0; }
.peek { position: relative; min-height: 0; border-radius: 20px; cursor: grab; overflow: hidden; -webkit-user-select: none; user-select: none; }
.peek:active { cursor: grabbing; }
.peek-frame { position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,220,150,.26), inset 0 0 60px rgba(0,0,0,.2), 0 0 0 1px rgba(0,0,0,.22);
  background:
    linear-gradient(var(--brass-hi), var(--brass-hi)) left 11px top 11px / 16px 2px no-repeat,
    linear-gradient(var(--brass-hi), var(--brass-hi)) left 11px top 11px / 2px 16px no-repeat,
    linear-gradient(var(--brass-hi), var(--brass-hi)) right 11px top 11px / 16px 2px no-repeat,
    linear-gradient(var(--brass-hi), var(--brass-hi)) right 11px top 11px / 2px 16px no-repeat;
  opacity: .8; }
.peek-hint { position: absolute; top: .8em; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .4em; max-width: calc(100% - 4em);
  font-size: .72em; font-weight: 800; padding: .35em .85em; border-radius: 99px; background: rgba(10,6,4,.55); color: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; transition: opacity .6s var(--ease); }
.peek-hint .ic { width: 1.2em; height: 1.2em; flex: none; }
.peek.touched .peek-hint { opacity: 0; }
.peek-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5em .7em; padding: 2.4em .8em .8em; background: linear-gradient(rgba(10,6,4,0), rgba(10,6,4,.8)); pointer-events: none; }
.peek-cap { flex: 1 1 9.5em; min-width: 0; display: grid; gap: .12em; text-shadow: 0 2px 8px rgba(0,0,0,.75); }
.peek-cap b { font-family: var(--display); font-size: 1.2em; font-weight: 800; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peek-cap small { font-size: .78em; font-weight: 700; opacity: .82; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.peek-act { flex: none; margin-left: auto; pointer-events: auto; }
.peek-btn { min-height: max(44px, 2.75em); padding: .5em 1.05em; border-radius: 14px; }

/* ---------------------------------------------------------------- hang out: just the room and its music */
#screens > .hangout { pointer-events: none; }
.hangout .topbar button { pointer-events: auto; }
.hangout .topbar, .hangout .hang-now { transition: opacity .8s var(--ease); }
.hangout.quiet .topbar { opacity: .4; }
.hangout.quiet .hang-now { opacity: .25; }
.hang-hint, .co-hint { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: .45em; font-size: .8em; font-weight: 800; padding: .45em 1em; border-radius: 99px;
  background: rgba(10,6,4,.6); color: var(--cream); white-space: nowrap; pointer-events: none; animation: hintOut 6s var(--ease) forwards; }
.hang-hint { bottom: calc(var(--pad) + var(--sb) + 3.4em); }
.hang-hint .ic { width: 1.25em; height: 1.25em; }
@keyframes hintOut { 0% { opacity: 0; } 8%, 75% { opacity: 1; } 100% { opacity: 0; } }
.hang-now { position: absolute; right: calc(var(--pad) + var(--sr)); bottom: calc(var(--pad) + var(--sb)); display: flex; align-items: center; gap: .45em; font-size: .78em; font-weight: 800; padding: .45em .95em; border-radius: 99px; background: rgba(10,6,4,.5); opacity: .85; pointer-events: none; }
.hang-now .ic { width: 1.15em; height: 1.15em; color: var(--brass-hi); }

/* ---------------------------------------------------------------- check out: a board up close */
#screens > .checkout { pointer-events: none; }
.checkout .co-pad { position: absolute; inset: 0; pointer-events: auto; cursor: grab; }
.checkout .co-pad:active { cursor: grabbing; }
.checkout .topbar button, .checkout .co-info, .checkout .co-bar { pointer-events: auto; }
.co-info { position: absolute; left: calc(var(--pad) + var(--sl)); bottom: calc(var(--pad) + var(--sb)); width: clamp(180px, calc(100vw - 2 * var(--pad) - var(--sl) - var(--sr) - max(384px, 21.5em)), 430px);
  padding: .7em .9em .75em; border-radius: 16px; background: rgba(20,13,8,.74); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
@media (hover: hover) and (pointer: fine) { .co-info, .co-bar { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); } }
.co-info p { margin: 0 0 .5em; font-size: .84em; font-weight: 700; opacity: .9; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.co-fin-name { font-size: .82em; margin-bottom: .4em; }
.co-fin-name .muted { opacity: .65; }
.co-sw { flex-wrap: nowrap; overflow-x: auto; gap: .45em; padding: 6px 6px 7px; margin: -6px -6px -7px; scrollbar-width: none; }
.co-sw::-webkit-scrollbar { display: none; }
.co-sw .sw { width: 2em; height: 2em; flex: none; }
.co-bar { position: absolute; right: calc(var(--pad) + var(--sr)); bottom: calc(var(--pad) + var(--sb)); display: flex; gap: .4em; padding: .45em; border-radius: 999px; background: rgba(20,13,8,.62); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.co-bar .btn-icon.on { --b1: #ffe7a6; --b2: #d9a645; --lip: #8a6020; --tx: #2a1806; }
.co-hint { top: calc(var(--pad) + var(--st) + var(--tb) + .2em); }

/* phones: a slimmer tab column, so the items and the window keep their room */
@media (max-height: 430px) {
  .split.coll3 { grid-template-columns: minmax(132px, 17%) minmax(0, 1fr) minmax(190px, 35%); gap: 8px; }
  .coll3 .tab { padding: .5em .65em; gap: .45em; font-size: .92em; }
  .peek-foot { padding: 2em .6em .6em; }
  .peek-cap b { font-size: 1.05em; }
}
@media (max-height: 430px) {
  .co-info { padding: .55em .75em .6em; }
  .co-info p { display: none; }
  .co-hint { font-size: .72em; }
}

/* card backs in the Collection's window: three of the chosen back, fanned on green baize */
.peek-stage { position: absolute; inset: 0; border-radius: inherit; display: none; place-items: center; overflow: hidden;
  background: radial-gradient(ellipse at 50% 42%, #2f6a4b 0%, #1d4a33 55%, #10291c 100%); }
.peek-stage.on { display: grid; }
.peek-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.12) 0 1px, transparent 1px 3px); }
.pc-fan { position: relative; width: min(46%, 9.5em); aspect-ratio: .714; margin-bottom: 14%; }
.pc-fan .pc { position: absolute; inset: 0; border-radius: 7%/5%; overflow: hidden; box-shadow: 0 10px 22px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.3); transform-origin: 50% 120%; transition: transform .45s var(--ease-out); }
.pc-fan .pc svg, .pc-fan .pc img { width: 100%; height: 100%; display: block; }
.pc-fan .pc0 { transform: rotate(-14deg) translateX(-8%); }
.pc-fan .pc1 { transform: rotate(0deg) translateY(-3%); }
.pc-fan .pc2 { transform: rotate(14deg) translateX(8%); }

/* rendered thumbnails of peg options (the peg studio) */
.opt .thumb.shot { background: radial-gradient(ellipse at 50% 45%, #3a2a1e, #120c08 75%); }
.opt .thumb.shot img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.opt .thumb.shot.fresh img { animation: thumbIn .45s var(--ease) both; }
@keyframes thumbIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.opt .thumb.shot.loading::before { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,230,190,.08) 50%, transparent 70%) 0 0 / 250% 100%; animation: thumbWait 1.4s linear infinite; }
.opt .thumb.shot.loading > span { opacity: .35; }
@keyframes thumbWait { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---------------------------------------------------------------- controller (js/ui/pad.js) */
/* the focus ring: one brass ring that glides from button to button */
.pad-ring { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 48; pointer-events: none; opacity: 0; transition: opacity .16s var(--ease);
  box-shadow: 0 0 0 2.5px var(--brass-hi), 0 0 0 5px rgba(36,22,8,.6), 0 0 22px 5px rgba(255,214,120,.38); }
.pad-ring.on { opacity: 1; }
.pad-ring::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 14px 3px rgba(255,236,190,.55); animation: breathe 1.9s var(--ease) infinite; }
html.pad, html.pad * { cursor: none !important; }

/* what a focused thing looks like (the same lift as a mouse hover) */
html.pad .btn.pad-on:not(:disabled) { transform: translateY(-2px); box-shadow: 0 7px 0 var(--lip), 0 14px 26px rgba(0,0,0,.45), 0 0 0 3px rgba(255,220,140,.25), inset 0 1px 0 rgba(255,255,255,.8); }
html.pad .btn.pad-on:not(:disabled)::after { animation: glimmer .8s var(--ease); }
html.pad .tile.pad-on:not(.locked) { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 12px 0 #120a05, 0 24px 44px rgba(0,0,0,.6), 0 0 0 3px rgba(255,214,120,.35), inset 0 1px 0 rgba(255,220,170,.3); }
html.pad .tile.pad-on:not(.locked)::after { animation: glimmer 1s var(--ease); }
html.pad .hero.pad-on { transform: translateY(-5px); box-shadow: 0 13px 0 #120a05, 0 26px 50px rgba(0,0,0,.65), inset 0 0 0 2px rgba(255,214,120,.8), inset 0 1px 0 rgba(255,236,190,.6); }
html.pad .opt.pad-on:not(.locked) { transform: translateY(-3px); }
html.pad .sw.pad-on:not(.locked) { transform: scale(1.12); }
html.pad .tab.pad-on { transform: translateX(3px); background: rgba(255,240,210,.1); }
html.pad .linkbtn.pad-on { opacity: 1; }
html.pad .ach.pad-on { background: rgba(255,240,210,.1); }
.tile.pressed:not(.locked) { transform: translateY(5px) scale(.985) !important; transition-duration: .06s; }
.hero.pressed { transform: translateY(6px) scale(.99) !important; transition-duration: .06s; }
.opt.pressed:not(.locked) { transform: translateY(2px) scale(.97) !important; }
.sw.pressed:not(.locked) { transform: scale(.94) !important; }
.tab.pressed, .seg button.pressed, .jpick button.pressed { transform: translateY(2px) scale(.97); }
/* cards show focus themselves: lifted, with a pale outline that follows the card */
html.pad .hand .card.pad-on { transform: translateY(calc(var(--y, 0px) - 10%)) rotate(var(--r, 0deg)); z-index: 2; outline: 3px solid rgba(255,248,230,.95); outline-offset: 3px; }
html.pad .hand .card.sel.pad-on { transform: translateY(calc(var(--y, 0px) - 24%)) rotate(var(--r, 0deg)); z-index: 3; }
html.pad .hand .card.illegal.pad-on { transform: translateY(calc(var(--y, 0px) - 3%)) rotate(var(--r, 0deg)); outline-color: rgba(255,248,230,.5); }
html.pad .cutspread:not(.picked) .sc.pad-on { z-index: 4; }
html.pad .cutspread:not(.picked) .sc.pad-on .cf { transform: translateY(-14%); box-shadow: 0 0 0 3px var(--brass-hi), 0 0 22px 4px rgba(246,220,146,.6), -2px 10px 16px rgba(0,0,0,.5); }

/* Xbox button caps */
.pg { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 1.45em; height: 1.45em; padding: 0 .1em; border-radius: 50%; vertical-align: -.32em;
  font: 900 .78em/1 var(--ui); letter-spacing: 0; color: #f2f2f2; background: radial-gradient(circle at 38% 30%, #4a4a52, #1b1b20 70%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.55); }
.pg-a { color: #7bd84a; } .pg-b { color: #ff5e52; } .pg-x { color: #4ea6ff; } .pg-y { color: #ffd23e; }
.pg-lb, .pg-rb, .pg-lt, .pg-rt { border-radius: .42em; min-width: 2.05em; font-size: .68em; height: 1.6em; padding: 0 .3em; }
.pg-lt, .pg-rt { border-radius: .42em .42em .7em .7em; }
.pg-ls, .pg-rs, .pg-l3, .pg-r3 { background: radial-gradient(circle at 50% 50%, #1b1b20 0 46%, #3b3b42 50% 62%, #1b1b20 66%); color: #ddd; }
.pg-l3, .pg-r3 { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 0 0 2px rgba(255,255,255,.18), 0 1px 2px rgba(0,0,0,.55); }
.pg-dpad { font-size: .9em; color: #ddd; }
.pg .pgi { width: .95em; height: .95em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.pg + .pg { margin-left: .18em; }
.pg-badge { display: none; }
html.pad .pg-badge { display: inline-flex; }
html.pad .no-pad { display: none !important; }
html:not(.pad) .pad-only { display: none !important; }
.btn .pg-badge .pg { font-size: .74em; }
.btn-icon .pg-badge { position: absolute; right: 2px; bottom: 2px; font-size: .62em; }
.btn-icon .pg-badge .pg { font-size: .8em; }

/* the button legend along the bottom of menus */
.pad-legend { position: fixed; z-index: 47; left: 50%; bottom: calc(6px + var(--sb)); transform: translate(-50%, 6px); display: flex; gap: 1.05em; align-items: center; padding: .38em 1em; border-radius: 99px;
  background: rgba(14,9,5,.72); box-shadow: inset 0 0 0 1px rgba(255,220,150,.16), 0 6px 18px rgba(0,0,0,.35); font-size: .74em; font-weight: 800; color: var(--cream); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .25s var(--ease), transform .3s var(--ease-out); }
.pad-legend.on { opacity: .92; transform: translate(-50%, 0); }
.pad-legend .pl-i { display: inline-flex; align-items: center; gap: .38em; }
.pad-legend .pg { font-size: .95em; }
.pad-legend[data-at=hud] { display: none; }
.pad-legend[data-at=right] { left: auto; right: calc(var(--pad) + var(--sr)); transform: translateY(6px); }
.pad-legend[data-at=right].on { transform: none; }
.pad-legend[data-at=top] { bottom: auto; top: calc(var(--pad) + var(--st) + 3.5em); }
@media (max-height: 430px) { .pad-legend { font-size: .66em; padding: .3em .85em; gap: .8em; } }

/* the room pointer (L3): a soft reticle that brightens over things you can touch */
.pad-ptr { position: fixed; left: 0; top: 0; z-index: 47; pointer-events: none; opacity: 0; transition: opacity .2s var(--ease); }
.pad-ptr.on { opacity: 1; }
.pad-ptr i { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,248,230,.9), 0 0 0 4px rgba(20,12,6,.45), 0 0 14px rgba(255,236,190,.45);
  transition: transform .18s var(--ease-out), box-shadow .18s; }
.pad-ptr i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: #fff8e6; box-shadow: 0 0 6px rgba(255,236,190,.9); }
.pad-ptr.hot i { transform: scale(1.3); box-shadow: 0 0 0 2.5px var(--brass-hi), 0 0 0 5px rgba(20,12,6,.45), 0 0 22px 4px rgba(255,214,120,.65); }
.pad-ptr.down i { transform: scale(.82); }
.pad-ptr span { position: absolute; left: 22px; top: 12px; padding: .3em .75em; border-radius: 99px; background: rgba(14,9,5,.78); color: var(--cream); font-size: .74em; font-weight: 800; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.pad-ptr.hot span:not(:empty) { opacity: 1; }

/* the on-screen keyboard */
.pad-osk { position: fixed; inset: 0; z-index: 46; display: flex; align-items: flex-end; justify-content: center; padding: 0 calc(var(--pad) + var(--sr)) calc(var(--pad) + var(--sb)) calc(var(--pad) + var(--sl));
  background: linear-gradient(rgba(6,3,2,0) 30%, rgba(6,3,2,.62)); opacity: 0; transition: opacity .2s var(--ease); }
.pad-osk.in { opacity: 1; }
.osk-panel { width: min(100%, 660px); padding: .7em .8em .8em; border-radius: 22px; background: linear-gradient(180deg, #3b2717, #24160c); box-shadow: 0 20px 60px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,220,170,.25), inset 0 0 0 1px rgba(255,220,170,.12);
  transform: translateY(24px); transition: transform .28s var(--ease-out); }
.pad-osk.in .osk-panel { transform: none; }
.osk-head { display: flex; align-items: center; gap: .7em; margin-bottom: .55em; }
.osk-label { font-size: .72em; letter-spacing: .1em; text-transform: uppercase; opacity: .65; flex: none; }
.osk-text { flex: 1; min-width: 0; display: flex; align-items: center; min-height: 2.1em; padding: .25em .8em; border-radius: 12px; background: #fff8e9; color: var(--ink); font-weight: 900; font-size: 1.1em; box-shadow: inset 0 2px 4px rgba(0,0,0,.2); overflow: hidden; white-space: pre; }
.osk-caret { width: 2px; height: 1.15em; margin-left: 1px; background: var(--ink); animation: oskBlink 1s steps(1) infinite; }
@keyframes oskBlink { 50% { opacity: 0; } }
.osk-n { flex: none; font-size: .72em; opacity: .6; font-variant-numeric: tabular-nums; }
.osk-keys { display: flex; flex-direction: column; gap: .32em; }
.osk-row { display: flex; gap: .32em; justify-content: center; }
.osk-k { flex: 1 1 0; max-width: 3.3em; height: 2.35em; border: 0; border-radius: 10px; font-weight: 900; font-size: 1em; background: #fff8e9; color: var(--ink); box-shadow: 0 3px 0 #a88c5c; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .35em; transition: transform .1s, background .1s; }
.osk-k.pressed, .osk-k:active { transform: translateY(2px); box-shadow: 0 1px 0 #a88c5c; }
html.pad .osk-k.pad-on { background: #fff; }
.osk-fn .osk-k { max-width: none; background: #e8d4ad; font-size: .88em; }
.osk-fn .osk-k.wide { flex: 1.6 1 0; }
.osk-fn .osk-k.space { flex: 3 1 0; }
.osk-fn .osk-k.done { background: linear-gradient(180deg, #ffe7a6, #d9a645); }
.osk-fn .osk-k.on { background: linear-gradient(180deg, #ffe7a6, #d9a645); }
.osk-k .pg { font-size: .8em; }
@media (max-height: 430px) { .osk-k { height: 2.05em; } .osk-panel { padding: .5em .6em .6em; } .osk-head { margin-bottom: .4em; } }
.pg-l3, .pg-r3 { font-size: .64em; min-width: 1.75em; height: 1.75em; }
.pad-legend[data-at=bar] { left: auto; bottom: auto; transform: translate(0, -50%) translateX(6px); }
.pad-legend[data-at=bar].on { transform: translate(0, -50%); }
.btn-icon .pg-badge { font-size: .72em; right: 1px; bottom: 1px; }
.osk-k:disabled { opacity: .28; box-shadow: none; cursor: default; }
/* round icon buttons wear their button as a corner tag, outside the button */
html.pad .btn-icon:has(.pg-badge) { overflow: visible; }
html.pad .btn-icon:has(.pg-badge)::after { display: none; }
html.pad .btn-icon .pg-badge { right: -7px; bottom: -7px; font-size: .78em; }
html.pad .btn-icon .pg-badge .pg { font-size: .82em; box-shadow: 0 0 0 2px rgba(20,12,6,.85), 0 2px 5px rgba(0,0,0,.5); }
html.pad-ptr .hand .card.pad-on { outline-color: transparent; }
.pg .pgi.pgf { fill: currentColor; stroke: none; width: 1.05em; height: 1.05em; }

/* ---------------------------------------------------------------- arrivals: a screen's parts settle in one after another */
@keyframes riseIn { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.screen.in .main-grid > *, .screen.in .tiles > .tile, .screen.in .setup > .panel, .screen.in .split > *, .screen.in .settings .panel,
.screen.in .ach-grid > .ach, .grid.fresh > * { animation: riseIn .5s var(--ease-out) backwards; }
.screen.in .main-grid > :nth-child(2), .screen.in .tiles > :nth-child(2), .screen.in .setup > :nth-child(2), .screen.in .split > :nth-child(2), .screen.in .settings .panel:nth-child(2) { animation-delay: .06s; }
.screen.in .main-grid > :nth-child(3), .screen.in .tiles > :nth-child(3), .screen.in .split > :nth-child(3), .screen.in .settings .panel:nth-child(3) { animation-delay: .12s; }
.screen.in .tiles > :nth-child(4) { animation-delay: .18s; }
.screen.in .settings .set-col + .set-col .panel { animation-delay: .08s; }
.screen.in .settings .set-col + .set-col .panel:nth-child(2) { animation-delay: .14s; }
.screen.in .settings .set-col + .set-col .panel:nth-child(3) { animation-delay: .2s; }
.screen.in .ach-grid > :nth-child(3n+2), .grid.fresh > :nth-child(4n+2) { animation-delay: .04s; }
.screen.in .ach-grid > :nth-child(3n), .grid.fresh > :nth-child(4n+3) { animation-delay: .08s; }
.grid.fresh > :nth-child(4n) { animation-delay: .12s; }
/* a screen on its way out doesn't replay anything */
.screen.out * { animation-play-state: paused; }

/* lists that scroll sideways or down fade at the edge that has more, so it's clear there is more
   (classes from scrollFade() in js/ui/ui.js) */
.xfade { --fl: #000; --fr: transparent; -webkit-mask-image: linear-gradient(90deg, var(--fl), #000 2.2em, #000 calc(100% - 2.2em), var(--fr)); mask-image: linear-gradient(90deg, var(--fl), #000 2.2em, #000 calc(100% - 2.2em), var(--fr)); }
.xfade.mid { --fl: transparent; }
.xfade.at-end { --fr: #000; }
.xfade.fits { -webkit-mask-image: none; mask-image: none; }
.yfade { --ft: #000; --fb: transparent; -webkit-mask-image: linear-gradient(var(--ft), #000 1.6em, #000 calc(100% - 2.4em), var(--fb)); mask-image: linear-gradient(var(--ft), #000 1.6em, #000 calc(100% - 2.4em), var(--fb)); }
.yfade.vmid { --ft: transparent; }
.yfade.vend { --fb: #000; }
.yfade.vfits { -webkit-mask-image: none; mask-image: none; }

/* the table's HUD arrives: scores drop in, the count and starter slide in from the left */
@keyframes hudDrop { from { opacity: 0; transform: translateY(-110%); } }
@keyframes hudFromLeft { from { opacity: 0; transform: translate(-36px, -62%); } }
.hud-root .hud-top { animation: hudDrop .65s var(--ease-out) .15s backwards; }
.hud-root .hud-left { animation: hudFromLeft .65s var(--ease-out) .3s backwards; }
/* a dialog is open: toasts come up from the bottom instead of covering its title */
#overlays:has(.modal-wrap.in) ~ #toasts .toast { top: auto; bottom: calc(var(--pad) + var(--sb)); transform: translate(-50%, 30px); }
#overlays:has(.modal-wrap.in) ~ #toasts .toast.in { transform: translate(-50%, 0); }
@media (hover: hover) and (pointer: fine) { .modal-wrap { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); } }
/* a button that can't be pressed yet keeps its colour, just quieter and flat */
.btn:disabled { filter: saturate(.45) brightness(.82); opacity: .78; box-shadow: 0 2px 0 var(--lip), 0 4px 10px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.35); transform: translateY(3px); }
.prompt.wait { background: rgba(20,13,8,.78); opacity: .95; }

/* small controls answer the pointer too */
button.chip { border: 0; color: inherit; font: inherit; font-weight: 800; cursor: pointer; transition: background .15s, box-shadow .15s, transform .12s var(--ease-out); }
button.chip:hover { background: rgba(48,33,20,.88); box-shadow: inset 0 0 0 1px rgba(255,220,150,.38); }
button.chip:active, button.chip.pressed { transform: scale(.95); }
html.pad button.chip.pad-on { background: rgba(48,33,20,.88); }
.seg button:not(.on):hover { color: var(--paper); background: rgba(255,240,210,.07); }
.toggle:hover { filter: brightness(1.12); }
.toggle:active, .toggle.pressed { transform: scale(.95); }

/* pause: Resume across the top, the rest in a tidy two-by-two */
.modal.pause { width: min(92vw, 27em); }
.modal.pause .menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65em; }
.modal.pause .menu-row .btn { width: 100%; }
.modal.pause .menu-row .btn-primary { grid-column: 1 / -1; min-height: 3em; font-size: 1.1em; }
.modal.pause p { margin-bottom: .6em; font-size: .9em; }
/* game over: the winner's score stands out */
.final-scores .spill.win { box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 22px rgba(255,214,120,.35), 0 4px 14px rgba(0,0,0,.35); transform: scale(1.06); }
.final-scores .spill.win .sc { color: var(--brass-hi); }

/* game over: a bigger headline, Play Again first and full width, the ways out beneath it */
.modal.over { width: min(92vw, 31em); }
.modal.over h2 { font-size: 2em; }
.modal.over .menu-row { flex-wrap: wrap; }
.modal.over .menu-row .btn { flex: 1 1 0; }
.modal.over .menu-row .btn-primary { order: -1; flex: 1 1 100%; }
.modal p { text-wrap: pretty; }
.modal.pause p { text-wrap: balance; }
.modal.over .winner .crown { width: 2.7em; height: 2.7em; }

/* ------------------------------------------------------------------ reading the game at a glance
   The four things you look for in play: the score, whose turn and whose crib, what has been
   played, and what was just scored. Each is large, sits on its own solid backing (never bare
   text over the room), and no label drops under 11px, even on a small phone. */
.hud-top .spill { gap: .55em; padding: .22em 1em .34em .5em; min-width: 9.2em; background: rgba(20, 13, 8, .86); box-shadow: inset 0 0 0 1.5px rgba(255, 236, 200, .22), 0 4px 14px rgba(0,0,0,.45); }
.hud-top .spill .dot { width: 1.5em; height: 1.5em; box-shadow: inset 0 -2px 4px rgba(0,0,0,.4), inset 0 1px 2px rgba(255,255,255,.5), 0 0 0 2px rgba(255,255,255,.75); }
.hud-top .spill .nm { font-size: 1em; max-width: 8em; color: #fff; }
.hud-top .spill .sc { font-size: 1.95em; line-height: 1; min-width: 1.45em; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.hud-top .progress121 { height: 4px; bottom: .2em; background: rgba(255,255,255,.14); }
/* whose turn: the whole pill lights in the player's colour, and says so underneath */
.hud-top .spill.turn { background: color-mix(in srgb, var(--pc) 26%, rgba(20, 13, 8, .92)); box-shadow: inset 0 0 0 3px var(--pc), 0 0 0 2px rgba(255,255,255,.85), 0 0 24px color-mix(in srgb, var(--pc) 70%, transparent), 0 4px 14px rgba(0,0,0,.45); transform: translateY(2px) scale(1.06); z-index: 1; }
.hud-top .spill .tags { bottom: auto; top: calc(100% + .3em); gap: .3em; }
.hud-top .tag { font-size: max(.68em, 11px); letter-spacing: .07em; padding: .16em .6em; box-shadow: 0 2px 6px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.25); }
.hud-top .tag.dealer { background: var(--brass-hi); color: #2a1a08; }
.hud-top .tag.turn { background: #fff; color: #14100c; box-shadow: 0 0 0 2px var(--pc), 0 2px 8px rgba(0,0,0,.5); animation: turnTag 1.6s ease-in-out infinite; }
@keyframes turnTag { 50% { box-shadow: 0 0 0 2px var(--pc), 0 0 12px 2px color-mix(in srgb, var(--pc) 75%, transparent), 0 2px 8px rgba(0,0,0,.5); } }
.hud-top .spill .bump { font-size: 1.45em; top: calc(100% + 1.7em); bottom: auto; right: .2em; padding: 0 .35em; border-radius: 99px; background: rgba(20, 13, 8, .9); box-shadow: inset 0 0 0 1.5px var(--pc); z-index: 2; }
/* the count and the starter */
.countbadge { width: 5.2em; height: 5.2em; box-shadow: 0 6px 0 #9f7c4f, 0 10px 24px rgba(0,0,0,.5), 0 0 0 2px rgba(20,13,8,.55); }
.countbadge b { font-size: 2.3em; }
.countbadge small { font-size: max(.64em, 11px); letter-spacing: .1em; opacity: .8; }
.minicard-label { font-size: max(.72em, 11px); font-weight: 900; opacity: 1; padding: .1em .55em; border-radius: 99px; background: rgba(20, 13, 8, .8); margin-top: .35em; }
/* what has been played: who played each card (a ring in their colour), and the cards from
   before the count restarted kept in view, smaller and dimmed, set apart from the live ones */
.pile .card { transition: height .4s var(--ease-out), margin .4s var(--ease-out), filter .4s; }
.pile .card .owner { width: 1.05em; height: 1.05em; bottom: -.62em; box-shadow: 0 0 0 2.5px #fff, 0 2px 6px rgba(0,0,0,.6); }
.pile .card.old { height: 68%; margin: 0 calc(var(--ph) * -0.105); filter: brightness(.78) saturate(.8); transform: none; }
.pile .card.old.gap { margin-right: calc(var(--ph) * 0.12); }
.pile .card.old .owner { width: .8em; height: .8em; bottom: -.5em; }
/* what was just scored */
.floater { display: flex; flex-direction: column; align-items: center; gap: .05em; padding: .18em .7em .3em; border-radius: .7em; font-size: 1em; background: rgba(20, 13, 8, .9); box-shadow: inset 0 0 0 2.5px var(--pc, var(--brass-hi)), 0 8px 22px rgba(0,0,0,.55); text-shadow: none; animation-duration: 2.2s; }
.floater b { font-size: 2.5em; line-height: 1.05; color: var(--brass-hi); text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.floater small { font-size: max(.86em, 12px); font-weight: 800; color: #fff; letter-spacing: .03em; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.5); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } 22% { transform: translate(-50%, -50%) scale(1); } 82% { opacity: 1; transform: translate(-50%, calc(-50% - 8px)); } 100% { opacity: 0; transform: translate(-50%, calc(-50% - 14px)); } }
.prompt { background: rgba(20, 13, 8, .86); }
.prompt b { color: var(--brass-hi); font-size: 1.15em; }
.bubble { font-size: max(1em, 13px); }
/* a picked card rises and takes the prompt up with it: the played cards move up too, so the
   prompt never sits across them */
.pile { transition: transform .3s var(--ease-out); }
.hud-root:has(.hand .card.sel) .pile { transform: translate(-50%, calc(var(--card-h) * -0.4)); }
/* no reading text under 11px, on any screen (small phones scale everything from a 13px base,
   which took the fine print down to 8-10px); dev/autotest/menus.mjs checks every screen */
small { font-size: max(.83em, 11px); }
.tile .tile-s { font-size: max(.86em, 11px); }
.tile.half .tile-s { font-size: max(.78em, 11px); }
.hero-kicker { font-size: max(.74em, 11px); letter-spacing: .12em; }
.hero-meta { font-size: max(.8em, 11px); }
.panel h3 small { font-size: max(.8em, 11px); }
.opt .lbl { font-size: max(.74em, 11px); }
.row .lab small { font-size: max(.78em, 11px); }
.tab .count { font-size: max(.78em, 11px); }
.ach .rw span { font-size: max(.68em, 11px); }
.sb-mark { font-size: max(.8em, 11px); }
.peek-cap small { font-size: max(.78em, 11px); }
.foot, .foot .chip, .peek-hint, .hang-hint, .co-hint { font-size: max(.8em, 11px); }
.foot .chip { font-size: 1em; }
.show .log span { font-size: max(.82em, 11px); }
.card .cribtag { font-size: max(.78em, 11px); }
.prompt.wait { font-size: max(.82em, 11px); }
.show .total small { font-size: max(.42em, 11px); letter-spacing: .12em; opacity: .85; }
.show .cards .c.starter::after { font-size: max(.6em, 11px); top: -1.5em; }
/* two pills (two players, or two teams) have room for longer names */
.scores:has(.spill:first-child:nth-last-child(2)) .spill .nm { max-width: 13em; }
/* on short screens The Show sits just under the score bar's markers instead of across them */
@media (max-height: 520px) { .show { top: calc(50% + 1.5em); } }

/* ------------------------------------------------------------------ rarity, earning, trying on
   Every unlockable has a rarity (js/game/rewards.js): a gem-like pip in its tile's corner and a
   glow along its foot. Locked things show what they are (dimmed, behind a lock), and a tap tries
   one on in the Collection's window, with how it's earned underneath. */
:root { --r-common: #cdbf9f; --r-rare: #5fb0ff; --r-epic: #c27dff; --r-legendary: #ffb43a; }
.r-common { --rc: var(--r-common); } .r-rare { --rc: var(--r-rare); } .r-epic { --rc: var(--r-epic); } .r-legendary { --rc: var(--r-legendary); }
.rpip { position: absolute; top: .55em; right: .55em; width: .72em; height: .72em; transform: rotate(45deg); border-radius: .16em; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--rc) 40%, #fff), var(--rc) 45%, color-mix(in srgb, var(--rc) 55%, #000));
  box-shadow: 0 0 0 1.5px rgba(10,6,3,.7), 0 0 8px color-mix(in srgb, var(--rc) 70%, transparent); }
.opt.r-legendary .rpip { animation: rpipGlow 2.4s ease-in-out infinite; }
@keyframes rpipGlow { 50% { box-shadow: 0 0 0 1.5px rgba(10,6,3,.7), 0 0 14px 2px color-mix(in srgb, var(--rc) 85%, transparent); } }
.opt[class*=" r-"]::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 0; height: 2px; border-radius: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--rc), transparent); opacity: .85; }
.opt.r-epic .thumb.shot, .opt.r-legendary .thumb.shot { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 45%, transparent), inset 0 -18px 24px -14px color-mix(in srgb, var(--rc) 40%, transparent); }
/* locked: what it is, dimmed behind a lock; a tap tries it on */
.opt.locked { cursor: pointer; }
.opt.locked .thumb { background: radial-gradient(ellipse at 50% 45%, #2a1f17, #100b07 75%) !important; }
.opt.locked .thumb > * { opacity: .72 !important; filter: grayscale(.35) brightness(.86); }
.opt.locked .thumb::after { content: none; }
.opt.locked .lbl { opacity: .78; }
.opt .lbl { gap: .3em; justify-content: center; }
.opt .lbl .lk { display: inline-flex; flex: none; width: 1em; height: 1em; color: var(--brass-hi); opacity: .9; }
.opt .lbl .lk svg.ic { width: 100%; height: 100%; vertical-align: 0; }
.opt.locked:hover { transform: translateY(-2px); }
.opt.locked:hover .thumb > * { opacity: .92 !important; filter: grayscale(.1); }
.opt.trying { box-shadow: inset 0 0 0 2px var(--rc, var(--brass)), 0 0 18px color-mix(in srgb, var(--rc, var(--brass)) 45%, transparent); background: color-mix(in srgb, var(--rc, var(--brass)) 12%, transparent); }
.opt.trying .thumb > * { opacity: 1 !important; filter: none; }
/* the window: its caption takes the rarity's colour; a locked pick says how it's earned */
.peek[data-rarity=rare] .peek-cap small, .peek[data-rarity=epic] .peek-cap small, .peek[data-rarity=legendary] .peek-cap small { color: color-mix(in srgb, var(--rc) 70%, #fff); opacity: 1; }
.peek[data-rarity=common] { --rc: var(--r-common); } .peek[data-rarity=rare] { --rc: var(--r-rare); } .peek[data-rarity=epic] { --rc: var(--r-epic); } .peek[data-rarity=legendary] { --rc: var(--r-legendary); }
.peek.trying .peek-frame { box-shadow: inset 0 0 0 2px var(--rc), inset 0 0 40px color-mix(in srgb, var(--rc) 25%, transparent); }
.peek.trying .peek-hint { opacity: 0; }
.peek-earn:empty { display: none; }
.earn { display: grid; gap: .25em; margin-top: .35em; padding: .45em .6em; border-radius: 10px; background: rgba(12, 8, 5, .78); box-shadow: inset 0 0 0 1px rgba(255,236,200,.14); text-shadow: none; }
.earn-t { display: flex; gap: .4em; align-items: flex-start; font-size: max(.82em, 11px); font-weight: 800; line-height: 1.25; }
.earn-t svg.ic { flex: none; width: 1.05em; height: 1.05em; color: var(--brass-hi); margin-top: .05em; }
.earn small, .earn-n { font-size: max(.74em, 11px); opacity: .8; font-weight: 700; }
.earn-bar { height: 5px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.earn-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi)); }
.earn-or { opacity: .65 !important; }

/* ------------------------------------------------------------------ the end of a game: Baker Level and rewards
   The bar fills from where it was by what the game earned (every level crossed flashes), then
   what the game unlocked comes in as cards, rarest first; a tap puts one on for the next game. */
.xpbox { position: relative; margin: .75em auto .2em; max-width: 27em; padding: .55em .8em .6em; border-radius: 14px; background: rgba(12, 8, 5, .55); box-shadow: inset 0 0 0 1px rgba(255,236,200,.14); text-align: left; }
.xp-row { display: flex; align-items: center; justify-content: space-between; gap: .6em; }
.xp-lv { display: flex; align-items: center; gap: .4em; font-weight: 800; }
.xp-lv svg.ic { color: var(--brass-hi); }
.xp-lv b { font-family: var(--display); font-size: 1.3em; color: var(--brass-hi); line-height: 1; }
.xp-gain { font-weight: 900; color: #fff; padding: .14em .65em; border-radius: 99px; background: linear-gradient(180deg, #6a4a20, #3b2a12); box-shadow: inset 0 0 0 1px rgba(246,220,146,.5); font-size: .92em; white-space: nowrap; }
.xp-bar { position: relative; height: 10px; margin: .5em 0 .4em; border-radius: 99px; background: rgba(255,255,255,.1); box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.xp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brass-lo), var(--brass-hi) 70%, #fff6d6); box-shadow: 0 0 12px rgba(246,220,146,.55); }
.xp-flash { position: absolute; right: 0; bottom: calc(100% + .35em); font-family: var(--display); font-weight: 900; font-size: 1.15em; color: var(--brass-hi); text-shadow: 0 2px 10px rgba(0,0,0,.6), 0 0 18px rgba(246,220,146,.6); opacity: 0; pointer-events: none; }
.xpbox.lvup .xp-flash { animation: lvFlash 1.5s var(--ease-out) both; }
.xpbox.lvup { animation: lvBox 1s var(--ease-out); }
@keyframes lvFlash { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 18% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes lvBox { 30% { box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 30px rgba(246,220,146,.55); } }
.xp-parts { display: flex; flex-wrap: wrap; gap: .1em .8em; font-size: max(.74em, 11px); font-weight: 700; opacity: .8; }
.xp-parts b { color: var(--brass-hi); }
.rewards { margin: .7em 0 .1em; min-width: 0; }
.rw-title { display: flex; align-items: center; justify-content: center; gap: .4em; font-weight: 900; font-size: .9em; letter-spacing: .04em; color: var(--brass-hi); }
.rw-row { display: flex; gap: .55em; overflow-x: auto; padding: .55em .35em .45em; justify-content: safe center; scroll-snap-type: x proximity; touch-action: pan-x; scrollbar-width: none; }
.rw-row::-webkit-scrollbar { display: none; }
.rcard { --rc: var(--r-common); flex: none; position: relative; width: 7.4em; display: grid; justify-items: center; align-content: start; gap: .1em; padding: .42em .42em .55em; border: 0; border-radius: 14px; overflow: hidden; color: var(--cream); cursor: pointer; scroll-snap-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 16%, #2a1c12), #170f09); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 62%, transparent), 0 6px 16px rgba(0,0,0,.4);
  animation: rcardIn .65s var(--ease-out) backwards; transition: transform .16s var(--ease-out); }
.rcard[data-noequip] { cursor: default; }
.rcard:not([data-noequip]):hover { transform: translateY(-3px); }
.rcard:not([data-noequip]):active { transform: translateY(1px) scale(.97); }
.rcard.r-common { --rc: var(--r-common); } .rcard.r-rare { --rc: var(--r-rare); } .rcard.r-epic { --rc: var(--r-epic); } .rcard.r-legendary { --rc: var(--r-legendary); }
.rcard::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%) -150% 0 / 250% 100% no-repeat; animation: rcardShine 1.1s var(--ease) .5s backwards; }
.rw-row > :nth-child(2) { animation-delay: .12s; } .rw-row > :nth-child(2)::after { animation-delay: .62s; }
.rw-row > :nth-child(3) { animation-delay: .24s; } .rw-row > :nth-child(3)::after { animation-delay: .74s; }
.rw-row > :nth-child(4) { animation-delay: .36s; } .rw-row > :nth-child(4)::after { animation-delay: .86s; }
.rw-row > :nth-child(n+5) { animation-delay: .48s; } .rw-row > :nth-child(n+5)::after { animation-delay: .98s; }
.rcard.r-legendary { box-shadow: inset 0 0 0 1.5px var(--rc), 0 0 22px color-mix(in srgb, var(--rc) 45%, transparent), 0 6px 16px rgba(0,0,0,.4); }
.rcard.r-epic { box-shadow: inset 0 0 0 1.5px var(--rc), 0 0 16px color-mix(in srgb, var(--rc) 30%, transparent), 0 6px 16px rgba(0,0,0,.4); }
@keyframes rcardIn { 0% { opacity: 0; transform: translateY(14px) scale(.85); } 60% { opacity: 1; transform: translateY(-2px) scale(1.03); } 100% { transform: none; } }
@keyframes rcardShine { from { background-position: -150% 0; } to { background-position: 150% 0; } }
.rc-img { width: 100%; aspect-ratio: 1.45; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 45%, #3a2a1e, #120c08 75%); }
.rc-img.loading { background: radial-gradient(ellipse at 50% 45%, #3a2a1e, #120c08 75%), linear-gradient(100deg, transparent 30%, rgba(255,230,190,.08) 50%, transparent 70%); }
.rc-img img { width: 100%; height: 100%; object-fit: cover; display: block; animation: thumbIn .45s var(--ease) both; }
.rc-img .art { width: 100%; height: 100%; display: grid; place-items: center; }
.rc-img .art-ic { width: 42%; color: #fff8e6; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.rc-img .art-ic svg.ic { width: 100%; height: 100%; }
.rc-img .art-board svg { width: 88%; height: 88%; }
.rc-img .art-back { padding: 6%; }
.rc-img .art-back img, .rc-img .art-back svg { height: 100%; width: auto; border-radius: 4px; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
.rc-r { margin-top: .3em; font-size: max(.62em, 11px); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--rc); }
.rcard b { font-size: .86em; line-height: 1.15; text-align: center; }
.rcard small { font-size: max(.7em, 11px); opacity: .7; }
.rc-eq { margin-top: .32em; display: inline-flex; align-items: center; gap: .25em; padding: .16em .7em; border-radius: 99px; font-size: max(.72em, 11px); font-weight: 900; background: rgba(255,236,200,.12); }
.rc-eq svg.ic { width: 1em; height: 1em; }
.rcard.worn .rc-eq { background: var(--brass-hi); color: #2a1a08; }
.modal.over.has-rewards { width: min(94vw, 40em); }
.modal.over .earned { margin: .5em 0 .2em; }
/* landscape phones: the game's result on the left, what it earned on the right */
@media (max-height: 520px) {
  .modal.over .winner .crown { width: 2em; height: 2em; }
  .modal.over h2 { font-size: 1.55em; margin-bottom: .15em; }
  .modal.over .final-scores { margin: .45em 0; }
  .xpbox { margin-top: .45em; }
}
/* landscape screens with rewards to show: the game's result on the left, what it earned on the right */
@media (min-aspect-ratio: 4/3) {
  .modal.over.has-rewards { width: min(96vw, 58em); max-width: min(96vw, 58em); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-rows: auto auto auto; column-gap: 1.2em; align-items: start; }
  .modal.over.has-rewards .modal-body { display: contents; }
  .modal.over.has-rewards > h2 { grid-column: 1; grid-row: 1; }
  .modal.over.has-rewards .over-l { grid-column: 1; grid-row: 2; display: grid; justify-items: center; }
  .modal.over.has-rewards .over-r { grid-column: 2; grid-row: 1 / span 2; align-self: start; min-width: 0; }
  .modal.over.has-rewards .menu-row { grid-column: 1 / -1; grid-row: 3; }
  .modal.over.has-rewards .xpbox { width: 100%; }
  .modal.over.has-rewards .rewards { margin: 0; }
  .modal.over.has-rewards .rw-row { flex-wrap: wrap; justify-content: center; overflow: visible; }
  .modal.over.has-rewards .rcard { width: 6.5em; }
}
@media (max-height: 520px) {
  .modal.over .menu-row { flex-wrap: nowrap; }
  .modal.over .menu-row .btn-primary { order: -1; flex: 1.5 1 0; }
  .modal.over .menu-row .btn { min-height: 2.6em; padding-top: .35em; padding-bottom: .35em; }
  .rcard { width: 6.2em !important; padding: .32em .32em .4em; }
  .rcard small { display: none; }
  .rc-img { aspect-ratio: 1.7; }
  .rc-eq { margin-top: .2em; }
  .modal.over .earned { margin: .35em 0 0; gap: .35em; }
  .modal.over .earned .chip { font-size: .85em; }
}
.rcard.rmore { cursor: default; align-content: center; min-height: 7em; background: rgba(255,240,210,.05); box-shadow: inset 0 0 0 1.5px rgba(255,236,200,.18); }
.rcard.rmore b { font-family: var(--display); font-size: 1.6em; color: var(--brass-hi); }
.rcard.rmore::after { content: none; }
/* the Baker Level on the main menu: a ring of progress round your peg colour, and the level */
.lvring { --p: 0; position: relative; display: grid; place-items: center; width: 1.45em; height: 1.45em; border-radius: 50%; flex: none;
  background: conic-gradient(var(--brass-hi) calc(var(--p) * 360deg), rgba(255,236,200,.18) 0); }
.lvring::before { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: #1b120b; }
.lvring .pegdot { position: relative; width: .82em; height: .82em; }
.lvtag { font-size: max(.72em, 11px); font-weight: 900; padding: .08em .5em; border-radius: 99px; background: rgba(246,220,146,.16); color: var(--brass-hi); letter-spacing: .03em; }
/* the track on the Achievements screen */
.lvtrack { margin: .2em .2em 1em; padding: .8em .9em .7em; border-radius: 18px; background: linear-gradient(180deg, rgba(60,40,22,.7), rgba(24,16,10,.7)); box-shadow: inset 0 0 0 1px rgba(255,236,200,.16); }
.lvhead { display: flex; align-items: center; gap: 1em; }
.lvbig { display: grid; justify-items: center; line-height: 1; flex: none; }
.lvbig span { font-size: max(.7em, 11px); letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.lvbig b { font-family: var(--display); font-size: 2.6em; color: var(--brass-hi); text-shadow: 0 0 18px rgba(246,220,146,.35); }
.lvmeta { flex: 1; min-width: 0; display: grid; gap: .25em; }
.lvmeta .xp-bar { margin: 0; }
.lvmeta small b { font-weight: 900; color: var(--rc, var(--brass-hi)); }
.lvhow { opacity: .62 !important; }
.lvnodes { display: flex; gap: .45em; overflow-x: auto; padding: .7em .1em .2em; scrollbar-width: none; touch-action: pan-x; }
.lvnodes::-webkit-scrollbar { display: none; }
.lvnode { --rc: var(--r-common); flex: none; width: 6.6em; position: relative; display: grid; justify-items: center; gap: .1em; padding: .45em .35em .5em; border-radius: 12px; text-align: center;
  background: rgba(255,240,210,.04); box-shadow: inset 0 0 0 1px rgba(255,236,200,.1); opacity: .72; }
.lvnode.r-rare { --rc: var(--r-rare); } .lvnode.r-epic { --rc: var(--r-epic); } .lvnode.r-legendary { --rc: var(--r-legendary); }
.lvnode.got { opacity: 1; background: color-mix(in srgb, var(--rc) 12%, rgba(255,240,210,.04)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--rc) 55%, transparent); }
.lvnode.next { opacity: 1; box-shadow: inset 0 0 0 2px var(--brass-hi), 0 0 16px rgba(246,220,146,.3); }
.lvnode .lvn { font-family: var(--display); font-weight: 900; font-size: 1.2em; color: var(--rc); }
.lvnode .lvi { width: 1em; height: 1em; opacity: .75; }
.lvnode .lvi svg.ic { width: 100%; height: 100%; vertical-align: 0; }
.lvnode b { font-size: max(.74em, 11px); line-height: 1.15; }
.lvnode small { font-size: max(.66em, 11px); opacity: .7; }
.ach .rw span.r-rare { background: color-mix(in srgb, var(--r-rare) 20%, transparent); color: color-mix(in srgb, var(--r-rare) 70%, #fff); }
.ach .rw span.r-epic { background: color-mix(in srgb, var(--r-epic) 22%, transparent); color: color-mix(in srgb, var(--r-epic) 65%, #fff); }
.ach .rw span.r-legendary { background: color-mix(in srgb, var(--r-legendary) 22%, transparent); color: color-mix(in srgb, var(--r-legendary) 70%, #fff); }
.ach-pr { display: flex; align-items: center; gap: .5em; margin-top: .3em; font-size: max(.7em, 11px); font-weight: 800; opacity: .85; }
.ach-pr .earn-bar { flex: 1; max-width: 9em; }
/* a place's own picture on its button, its emblem small in the corner */
.opt .thumb.pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.opt .thumb.pic .pic-ic { position: absolute; left: .35em; bottom: .3em; width: 1.35em; height: 1.35em; padding: .22em; border-radius: 50%; color: #fff8e6; background: rgba(12,8,5,.6); box-shadow: 0 0 0 1px rgba(255,236,200,.25); }
.opt .thumb.pic .pic-ic svg.ic { width: 100%; height: 100%; vertical-align: 0; }
