/* D-Games — pub-table felt, amber lager, beer-mat buttons */
:root {
  --felt: #0d3326; --felt-2: #134836; --felt-3: #0a2a1f;
  --stout: #22160e; --amber: #f5a524; --amber-2: #ffc94a; --amber-d: #b8730a;
  --foam: #fff4dc; --cherry: #e2463a; --wood: #c98a3c; --wood-d: #7a4b1c;
  --ink: #fff4dc; --mute: rgba(255, 244, 220, .6);
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body); font-weight: 800; color: var(--ink);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 220, 140, .10), transparent 60%),
    radial-gradient(140% 100% at 50% 120%, rgba(0, 0, 0, .55), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--felt);
  background-attachment: fixed;
  overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation;
}
#app { min-height: 100%; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 14px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; align-items: center; gap: 14px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--amber-2); outline-offset: 3px; }

/* ---------- buttons: beer mats ---------- */
.btn {
  min-height: 52px; padding: 0 22px; border-radius: 999px; font-family: var(--display); font-size: 22px; letter-spacing: .5px;
  background: rgba(255, 244, 220, .1); box-shadow: inset 0 0 0 2px rgba(255, 244, 220, .22);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: transform .12s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; }
.btn.big { width: 100%; min-height: 66px; font-size: 28px; }
.btn.sm { min-height: 40px; font-size: 18px; padding: 0 14px; }
.btn.amber {
  color: var(--stout);
  background: radial-gradient(circle at 50% 30%, var(--amber-2), var(--amber) 55%, var(--amber-d));
  box-shadow: 0 6px 0 #7c4b05, 0 10px 24px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .25), inset 0 0 0 7px rgba(122, 75, 5, .25);
}
.btn.amber:active { transform: translateY(4px); box-shadow: 0 2px 0 #7c4b05, 0 4px 10px rgba(0, 0, 0, .3), inset 0 0 0 3px rgba(255, 255, 255, .25); }
.btn.round { width: 64px; height: 64px; padding: 0; font-size: 30px; color: var(--stout); background: var(--foam); box-shadow: 0 5px 0 #b9ab8a; }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--cherry); box-shadow: 0 5px 0 #8c231a; }
.ico { width: 42px; height: 42px; border-radius: 50%; font-size: 22px; background: rgba(0, 0, 0, .22); display: grid; place-items: center; }

/* ---------- token (player piece) ---------- */
.tok {
  --s: 54px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none; position: relative;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .75) 0 8%, rgba(255, 255, 255, 0) 30%), radial-gradient(circle at 50% 60%, var(--c), color-mix(in srgb, var(--c) 60%, #000) 100%);
  background-color: var(--c);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25), inset 0 0 0 3px rgba(255, 255, 255, .28), 0 3px 0 rgba(0, 0, 0, .35), 0 6px 12px rgba(0, 0, 0, .25);
}
.tok i { font-style: normal; font-size: calc(var(--s) * .52); line-height: 1; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.tok.xs { --s: 28px; } .tok.sm { --s: 40px; } .tok.lg { --s: 92px; } .tok.xl { --s: 132px; }
.tok.ghost { background: transparent; box-shadow: inset 0 0 0 3px rgba(255, 244, 220, .2); }
.tok.ghost i { color: rgba(255, 244, 220, .3); font-family: var(--display); }
.tok.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.7); } }

/* ---------- beer glass ---------- */
.glass { display: block; overflow: visible; }
.glass .liquid { transition: transform .5s cubic-bezier(.3, .9, .4, 1); }
.glass .foam { fill: var(--foam); }
.glass .bub { fill: rgba(255, 255, 255, .7); animation: rise 2.2s linear infinite; }
.glass .b2 { animation-delay: .7s; } .glass .b3 { animation-delay: 1.4s; }
@keyframes rise { from { transform: translateY(20px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(-45px); opacity: 0; } }
.glass.mini { width: 26px; height: 42px; }
.glass.micro { width: 12px; height: 19px; }

/* ---------- top bar ---------- */
.bar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 12px 8px; width: 100%; max-width: 520px; margin: 0 auto; }
body:has(.lobby) .bar .code { visibility: hidden; }
.bar .code { font-family: var(--display); font-size: 20px; letter-spacing: 3px; opacity: .55; margin-right: auto; }
.bar .clock { font-family: var(--display); font-size: 20px; background: rgba(0, 0, 0, .25); padding: 6px 12px; border-radius: 999px; }
.bar .clock + .code { margin-left: 4px; }
.bar .final { font-family: var(--display); font-size: 20px; color: var(--stout); background: var(--amber); padding: 4px 12px; border-radius: 999px; animation: throb 1s infinite; }
@keyframes throb { 50% { transform: scale(1.08); } }

/* ---------- home ---------- */
.home { justify-content: center; text-align: center; gap: 18px; min-height: 100vh; }
.hero { width: 120px; height: 190px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.hero .glass { width: 100%; height: 100%; }
.logo { font-family: var(--display); font-weight: 400; font-size: 64px; line-height: .9; margin: 0; color: var(--foam);
  text-shadow: 0 4px 0 var(--amber-d), 0 8px 0 rgba(0, 0, 0, .35); transform: rotate(-3deg); }
.tag { margin: 0 0 8px; font-size: 26px; letter-spacing: 4px; }
.join-row { display: flex; gap: 10px; width: 100%; }
.code-in { flex: 1; min-width: 0; height: 64px; border-radius: 999px; border: 0; text-align: center; font-family: var(--display); font-size: 34px; letter-spacing: 10px;
  background: rgba(0, 0, 0, .3); color: var(--foam); box-shadow: inset 0 0 0 2px rgba(255, 244, 220, .2); text-transform: uppercase; }
.code-in::placeholder { color: rgba(255, 244, 220, .2); }
.small { opacity: .5; margin: 0; font-size: 18px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* ---------- profile ---------- */
.profile { position: relative; padding-top: calc(16px + var(--safe-t)); }
.back { position: absolute; left: 12px; top: calc(12px + var(--safe-t)); width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .25); font-size: 24px; }
.preview { height: 150px; display: grid; place-items: center; }
.colors { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; width: 100%; }
.sw { aspect-ratio: 1; border-radius: 50%; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 2px 0 rgba(0, 0, 0, .3); transition: transform .15s; }
.sw.on { transform: scale(1.12); box-shadow: 0 0 0 3px var(--felt), 0 0 0 6px var(--foam); }
.sw:disabled { opacity: .18; }
.emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; background: rgba(0, 0, 0, .18); border-radius: 22px; padding: 10px; }
.em { aspect-ratio: 1; font-size: 30px; border-radius: 14px; }
.em.on { background: rgba(255, 244, 220, .16); box-shadow: inset 0 0 0 2px var(--amber); }
.name-in { width: 100%; height: 52px; border: 0; border-radius: 999px; text-align: center; font: 800 20px var(--body); background: rgba(0, 0, 0, .25); color: var(--foam); }

/* ---------- lobby ---------- */
.invite { display: flex; gap: 16px; align-items: center; width: 100%; background: rgba(0, 0, 0, .2); border-radius: 26px; padding: 14px; }
.qr { width: 128px; height: 128px; background: #fff; border-radius: 16px; padding: 6px; flex: none; transition: transform .25s; }
.qr svg { width: 100%; height: 100%; display: block; }
.qr.zoom { position: fixed; inset: 0; margin: auto; width: min(86vw, 420px); height: min(86vw, 420px); z-index: 90; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .7); }
.invite-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.big-code { font-family: var(--display); font-size: 52px; letter-spacing: 6px; line-height: 1; color: var(--amber-2); text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 6px; width: 100%; }
.seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 76px; }
.seat em { font-style: normal; font-size: 13px; opacity: .8; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.me .tok { box-shadow: 0 0 0 3px var(--felt), 0 0 0 6px var(--amber), 0 6px 12px rgba(0, 0, 0, .3); }
.seat.off { opacity: .4; }
.seat .crown { position: absolute; top: -12px; left: 50%; transform: translateX(8px) rotate(18deg); font-size: 20px; }
.seat .kick { position: absolute; top: -6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--stout); font-size: 12px; }
.settings { width: 100%; display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, .2); border-radius: 26px; padding: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.ri { width: 58px; font-size: 26px; display: flex; align-items: center; gap: 2px; justify-content: center; }
.seg { flex: 1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 4px; }
.seg button { height: 44px; border-radius: 999px; font-family: var(--display); font-size: 20px; }
.seg button.on { background: var(--foam); color: var(--stout); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.seg button:disabled { cursor: default; }
.seg button:disabled:not(.on) { opacity: .5; }
.est { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 4px; }
.est b { font-family: var(--display); font-size: 30px; color: var(--amber-2); font-weight: 400; }
.est span { opacity: .65; font-size: 18px; }
.go { width: 100%; margin-top: auto; }
.waiting { display: flex; justify-content: center; align-items: center; gap: 12px; font-size: 30px; padding: 12px; }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--foam); animation: bounce 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 40% { transform: translateY(-10px); opacity: .5; } }

/* ---------- round ---------- */
.round { padding: 0 12px calc(12px + var(--safe-b)); gap: 10px; justify-content: center; }
.intro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.g-icon { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; font-size: 96px;
  background: radial-gradient(circle at 50% 35%, #fff9ea, #f0e1bd 70%, #d8c290); box-shadow: 0 0 0 10px rgba(255, 244, 220, .12), 0 14px 0 rgba(0, 0, 0, .3); animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.demo { display: flex; gap: 12px; align-items: center; background: rgba(0, 0, 0, .25); padding: 12px 18px; border-radius: 999px; }
.demo span { font-size: 36px; animation: demo 2.4s calc(var(--i) * .45s) infinite both; }
@keyframes demo { 0%, 100% { transform: scale(1); opacity: .45; } 12%, 30% { transform: scale(1.3); opacity: 1; } }
.cd { font-family: var(--display); font-size: 96px; height: 100px; color: var(--amber-2); text-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.cd.pulse { animation: cd .9s ease-out; }
@keyframes cd { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } }
.stage { flex: 1; width: 100%; display: flex; touch-action: none; }
.stage[hidden], .intro[hidden], .result[hidden] { display: none; }
.result { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 50; min-width: 220px; padding: 22px 30px; border-radius: 34px; text-align: center; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 4px; animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.result b { font-family: var(--display); font-size: 64px; font-weight: 400; line-height: 1; }
.result span { font-family: var(--display); font-size: 34px; }
.result.good { background: var(--foam); color: var(--stout); }
.result.bad { background: var(--cherry); color: #fff; }
.others { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 34px; opacity: 0; transition: opacity .3s; }
.others.on { opacity: 1; }
.others .o { opacity: .35; transition: opacity .3s, transform .3s; }
.others .o.done { opacity: 1; transform: translateY(-3px); }

/* game pad base */
.g-pad { flex: 1; width: 100%; border-radius: 30px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; overflow: hidden;
  background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 2px rgba(255, 244, 220, .08); touch-action: none; }
.g-hint { font-size: 64px; }
/* green light */
.tl-stage { transition: background .08s; }
.tl-stage[data-s=red] { background: radial-gradient(circle at 50% 30%, rgba(226, 70, 58, .35), rgba(0, 0, 0, .3)); }
.tl-stage[data-s=green] { background: radial-gradient(circle at 50% 70%, rgba(46, 204, 113, .55), rgba(0, 0, 0, .2)); }
.tl-stage[data-s=fail] { background: rgba(226, 70, 58, .6); }
.tlight { height: min(48vh, 340px); filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .5)); }
.tlight circle { fill: #3a3d3b; transition: fill .05s; }
[data-s=red] .l-red, [data-s=fail] .l-red { fill: #ff3b30; filter: drop-shadow(0 0 12px #ff3b30); }
[data-s=green] .l-grn { fill: #2bff7a; filter: drop-shadow(0 0 14px #2bff7a); }
/* odd one out */
.odd-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; width: 100%; padding: 10px; opacity: 0; transform: scale(.94); transition: opacity .12s, transform .2s; }
.odd-grid.on { opacity: 1; transform: none; }
.odd-cell { aspect-ratio: 1; font-size: min(9vw, 40px); border-radius: 50%; background: var(--foam); box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .06), 0 3px 0 rgba(0, 0, 0, .3); }
.odd-cell.miss { background: var(--cherry); animation: shake .3s; }
.odd-cell.hit { background: #2ecc71; transform: scale(1.15); }
.g-pen { position: absolute; top: 14px; right: 18px; font-family: var(--display); font-size: 28px; color: var(--cherry); opacity: 0; }
.g-pen.pop { animation: penp 1s; }
@keyframes penp { 0% { opacity: 1; transform: scale(1.5); } 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
/* snap */
.snap-stage { flex-direction: row; gap: 16px; }
.card { width: 40%; aspect-ratio: 5/7; border-radius: 20px; background: var(--foam); display: grid; place-items: center; box-shadow: 0 8px 0 rgba(0, 0, 0, .3), inset 0 0 0 6px #fff, inset 0 0 0 8px rgba(34, 22, 14, .12); }
.card span { font-size: min(18vw, 84px); }
.card.prev { width: 32%; opacity: .55; transform: rotate(-6deg); }
.card.prev span { font-size: min(13vw, 60px); }
.card.cur { transform: rotate(3deg); }
.card.flip { animation: flip .22s ease-out; }
@keyframes flip { from { transform: rotateY(90deg) rotate(3deg); } }
.snap-stage.good .card.cur { box-shadow: 0 0 0 6px #2ecc71, 0 8px 0 rgba(0, 0, 0, .3); }
.snap-stage.bad { background: rgba(226, 70, 58, .5); }
/* let go */
.lg-btn { width: min(70vw, 290px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; transition: transform .12s, background .1s;
  background: radial-gradient(circle at 50% 35%, #fff9ea, #e6d4a8); box-shadow: 0 12px 0 #8a7a55, 0 20px 30px rgba(0, 0, 0, .4); touch-action: none; }
.lg-btn span { font-size: min(26vw, 110px); pointer-events: none; }
.lg-btn[data-s=hold] { transform: translateY(8px) scale(.97); box-shadow: 0 4px 0 #8a7a55, 0 8px 14px rgba(0, 0, 0, .4); background: radial-gradient(circle at 50% 35%, #ffe08a, var(--amber)); }
.lg-btn[data-s=skull] { transform: translateY(8px); background: radial-gradient(circle at 50% 35%, #ff7a6e, var(--cherry)); animation: shake .25s infinite; }
.lg-btn[data-s=good] { background: radial-gradient(circle, #6ef0a5, #2ecc71); }
.lg-btn[data-s=fail] { background: #555; box-shadow: 0 6px 0 #222; }
/* frenzy */
.fz-time { font-family: var(--display); font-size: 56px; color: var(--amber-2); }
.fz-glass { width: 120px; height: 190px; }
.fz-glass .glass { width: 100%; height: 100%; }
.fz-glass .liquid { transition-duration: .15s; }
.fz-count { font-family: var(--display); font-size: 72px; line-height: 1; }
.fz-count.pop { animation: pop .15s; }
/* clock */
.ck-target { font-family: var(--display); font-size: 40px; background: var(--foam); color: var(--stout); padding: 6px 20px; border-radius: 999px; }
.ck-face { width: min(56vw, 220px); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .45)); }
.ck-read { font-family: var(--display); font-size: 54px; min-height: 60px; }
.ck-stage.blind .ck-hand { opacity: 0; }
.ck-btn { font-size: 54px; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: var(--cherry); box-shadow: 0 8px 0 #8c231a; }
/* count */
.ct-stage { justify-content: flex-start; padding: 12px; }
.ct-field { position: relative; width: 100%; flex: 1; min-height: 46vh; opacity: 0; }
.ct-field.on { opacity: 1; }
.ct-field.gone { opacity: 0; }
.ct-field.reveal { opacity: .5; }
.ct-field span { position: absolute; font-size: min(12vw, 52px); }
.ct-keys { position: absolute; inset: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-content: center; opacity: 0; pointer-events: none; }
.ct-keys.on { opacity: 1; pointer-events: auto; }
.ct-key { aspect-ratio: 1; border-radius: 50%; font-family: var(--display); font-size: min(12vw, 52px); color: var(--stout);
  background: radial-gradient(circle at 50% 35%, #fff9ea, #e9d8ad); box-shadow: 0 6px 0 #8a7a55; }
.ct-key.hit { background: #2ecc71; color: #fff; }
.ct-key.miss { background: var(--cherry); color: #fff; }

/* picture match */
.mt-stage { justify-content: flex-start; padding: 16px 12px; gap: 16px; }
.mt-target { width: min(40vw, 160px); aspect-ratio: 1; border-radius: 28px; display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 35%, #fff9ea, #ecdcb3); box-shadow: 0 0 0 6px var(--amber), 0 10px 0 rgba(0, 0, 0, .35);
  transition: transform .2s; }
.mt-target span { font-size: min(22vw, 96px); line-height: 1; grid-area: 1 / 1; }
.mt-target .mt-pic { opacity: 0; transform: scale(.4); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), opacity .08s; }
.mt-target.on .mt-pic { opacity: 1; transform: none; }
.mt-target .mt-cd { font-family: var(--display); color: var(--amber-d); font-size: min(20vw, 84px); }
.mt-target .mt-cd.pulse { animation: cd .9s ease-out; }
.mt-target.on .mt-cd { display: none; }
.mt-target::after { content: '🎯'; position: absolute; top: -14px; right: -14px; font-size: 30px; }
.mt-target.on { transform: scale(1.04); }
.mt-grid { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: auto; margin-bottom: auto; }
.mt-cell { aspect-ratio: 1; border-radius: 50%; font-size: min(10vw, 44px); background: radial-gradient(circle at 50% 35%, #2c6a52, #1b4d3a);
  box-shadow: inset 0 0 0 3px rgba(255, 244, 220, .12), 0 4px 0 rgba(0, 0, 0, .3); transition: background .1s; }
.mt-cell b { display: block; opacity: 0; transform: scale(.4); transition: transform .18s calc(var(--i) * 8ms) cubic-bezier(.3, 1.5, .5, 1), opacity .06s; }
.mt-grid.on .mt-cell { background: var(--foam); }
.mt-grid.on .mt-cell b { opacity: 1; transform: none; }
.mt-cell:active { transform: scale(.92); }
.mt-cell.hit { background: #2ecc71; transform: scale(1.15); box-shadow: 0 0 0 4px #fff, 0 6px 0 rgba(0, 0, 0, .3); }
.mt-cell.miss { background: var(--cherry); animation: shake .3s; }
.mt-cell.was { box-shadow: 0 0 0 4px #2ecc71, 0 4px 0 rgba(0, 0, 0, .3); }

/* ---------- results ---------- */
.win-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 2px; position: relative; }
.win-crown { font-size: 44px; margin-bottom: -18px; z-index: 2; animation: pop .5s .1s both cubic-bezier(.3, 1.6, .5, 1); }
.win-hero em { font-style: normal; font-size: 20px; }
.win-hero.me .tok { box-shadow: 0 0 0 4px var(--felt), 0 0 0 8px var(--amber), 0 8px 18px rgba(0, 0, 0, .4); }
.win-time { font-family: var(--display); font-size: 46px; color: var(--amber-2); line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.win-gain { font-family: var(--display); font-size: 22px; background: var(--foam); color: var(--stout); padding: 2px 14px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.notch { width: 12px; height: 18px; border-radius: 2px 2px 5px 5px; background: linear-gradient(var(--foam) 0 25%, var(--amber) 25%); box-shadow: inset 0 0 0 2px var(--stout); }
.win-hero.none .win-crown { font-size: 80px; margin: 10px 0; }
.chip.bump { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); box-shadow: inset 0 0 0 2px var(--amber-2); }
.chip .mini-g .glass.micro { width: 15px; height: 24px; }
.my-beers small { font-size: 20px; opacity: .55; }

.res-head { font-size: 58px; font-family: var(--display); }
.rank { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.rank li { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: rgba(0, 0, 0, .22); animation: slidein .4s var(--d) both cubic-bezier(.2, 1.2, .4, 1); }
@keyframes slidein { from { transform: translateX(-30px); opacity: 0; } }
.rank li.me { background: rgba(245, 165, 36, .22); box-shadow: inset 0 0 0 2px var(--amber); }
.rank li.out { opacity: .55; }
.rank em { font-style: normal; font-size: 15px; opacity: .8; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md { width: 36px; text-align: center; font-size: 28px; }
.rk { font-family: var(--display); font-size: 22px; opacity: .7; }
.rk.x { color: var(--cherry); opacity: 1; }
.val { margin-left: auto; font-family: var(--display); font-size: 20px; }
.steps { font-family: var(--display); font-size: 20px; color: var(--amber-2); min-width: 74px; text-align: right; }
.timebar { width: 100%; height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .25); overflow: hidden; margin-top: auto; }
.timebar i { display: block; height: 100%; background: var(--foam); transform-origin: left; animation: drain var(--ms) linear forwards; }
@keyframes drain { to { transform: scaleX(0); } }

/* ---------- board ---------- */
.boardscr { gap: 10px; padding-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 3px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-family: var(--display); font-size: 17px; }
.chip.me { box-shadow: inset 0 0 0 2px var(--amber); }
.chip b { font-weight: 400; color: var(--amber-2); }
.board-wrap { width: 100%; }
.board-box { position: relative; width: 100%; aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 6px var(--wood), 0 0 0 9px var(--wood-d), 0 18px 34px rgba(0, 0, 0, .5); }
.board { width: 100%; height: 100%; display: block; }
.board .frame { fill: #0f3d2d; }
.board .c1 { fill: #165540; } .board .c2 { fill: #124a37; }
.board text { fill: rgba(255, 244, 220, .32); font: 900 2.3px var(--body); }
.board .m-start { fill: rgba(255, 244, 220, .16); }
.board .m-end { fill: var(--amber); stroke: var(--foam); stroke-width: .7; }
.board .m-t { font-size: 4px; text-anchor: middle; fill: #000; }
.board .m-t.big { font-size: 5px; }
.board .ladder line { stroke-linecap: round; }
.board .lad-sh line { stroke: rgba(0, 0, 0, .35); stroke-width: 1.3; }
.board .lad-rungs line { stroke: #e2b06a; stroke-width: .9; }
.board .rail { stroke: var(--wood); stroke-width: 1.2; }
.board .snake path { fill: none; stroke-linecap: round; }
.board .sn-sh { stroke: rgba(0, 0, 0, .35); stroke-width: 3.2; }
.board .sn-out { stroke: #3c1a0b; stroke-width: 3.2; }
.board .sn-body { stroke: #e2463a; stroke-width: 2.4; }
.board .sn-spot { stroke: #ffd23f; stroke-width: .9; stroke-dasharray: .6 2.4; }
.board .sn-head { fill: #e2463a; stroke: #3c1a0b; stroke-width: .5; }
.pieces { position: absolute; inset: 0; pointer-events: none; }
.piece { position: absolute; width: 0; height: 0; transition: left .2s cubic-bezier(.3, .8, .4, 1), top .2s cubic-bezier(.3, .8, .4, 1); }
.piece .tok { --s: calc(var(--cell, 30px) * .72); position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); translate: var(--ox, 0%) var(--oy, 0%); transition: translate .25s; }
.piece.mine .tok { box-shadow: 0 0 0 2px var(--foam), 0 0 0 4px var(--amber), 0 4px 8px rgba(0, 0, 0, .5); }
.piece.off { opacity: .4; }
.piece.hop .tok { animation: hop .2s ease-out; }
@keyframes hop { 50% { margin-top: calc(var(--cell, 30px) * -.35); } }
.piece.climb, .piece.slide { transition-duration: 1s; }
.piece.climb .tok { animation: wob .25s 4; }
@keyframes wob { 50% { rotate: 12deg; } }
.piece.slide .tok { animation: spin 1s; }
@keyframes spin { to { rotate: 720deg; } }

/* my progress */
.mycard { width: 100%; display: flex; align-items: center; gap: 14px; background: rgba(0, 0, 0, .22); border-radius: 26px; padding: 12px 16px; }
.my-glass { width: 54px; height: 86px; flex: none; }
.my-glass .glass { width: 100%; height: 100%; }
.my-info { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.my-bar { width: 100%; height: 12px; border-radius: 99px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.my-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--amber-d), var(--amber-2)); }
.my-nums { display: flex; align-items: baseline; gap: 6px; font-family: var(--display); }
.my-nums b { font-size: 26px; font-weight: 400; }
.my-nums span { opacity: .55; font-size: 18px; }
.my-nums em { font-style: normal; color: var(--amber-2); font-size: 18px; margin-left: 6px; }
.my-beers { display: flex; flex-direction: column; align-items: center; font-family: var(--display); }
.my-beers b { font-size: 40px; font-weight: 400; color: var(--amber-2); line-height: 1; }
.my-beers span { font-size: 26px; }

/* beer celebration */
.celebrate { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(8, 26, 19, .72); backdrop-filter: blur(3px); }
.celebrate[hidden] { display: none; }
.cel-card { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.cel-glass { width: 120px; height: 190px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); }
.cel-glass .glass { width: 100%; height: 100%; }
.cel-card .tok { margin-top: -50px; }
.cel-card em { font-style: normal; font-size: 20px; }
.cel-n { font-family: var(--display); font-size: 58px; color: var(--amber-2); text-shadow: 0 4px 0 rgba(0, 0, 0, .4); }
.celebrate.mine .cel-n { font-size: 76px; animation: throb .6s infinite; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -20px; left: var(--x); width: 10px; height: 16px; background: var(--c); border-radius: 2px; animation: fall 2.2s var(--d) ease-in forwards; transform: rotate(var(--r)); }
@keyframes fall { to { transform: translateY(110vh) rotate(calc(var(--r) + 540deg)); } }

/* ---------- end ---------- */
.trophy { font-size: 90px; animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .4)); }
.total { display: flex; align-items: center; gap: 10px; }
.total .glass.mini { width: 34px; height: 56px; }
.total b { font-family: var(--display); font-weight: 400; font-size: 52px; color: var(--amber-2); }
.beers { margin-left: auto; font-size: 20px; letter-spacing: -2px; }

/* ---------- wait ---------- */
.wait .hour { font-size: 70px; animation: throb 1.4s infinite; }

/* ---------- overlays ---------- */
.sheet { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 520px; background: var(--felt-3); border-radius: 28px 28px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); display: flex; flex-direction: column; gap: 10px; animation: up .25s; }
@keyframes up { from { transform: translateY(100%); } }
#toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translateX(-50%); z-index: 99; background: var(--foam); color: var(--stout); font-family: var(--display); font-size: 24px; padding: 10px 20px; border-radius: 999px; opacity: 0; pointer-events: none; }
#toast.show { animation: toast 2.2s; }
@keyframes toast { 10%, 80% { opacity: 1; transform: translate(-50%, -6px); } }
#net { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 99; background: var(--cherry); padding: 4px 12px; border-radius: 999px; font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (min-height: 760px) { .board-box { max-width: 480px; margin: 0 auto; } }

/* lobby rule strip */
.rule { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 32px; padding: 6px 0; }
.rule .ar { opacity: .6; font-size: 26px; }
.rule .x { font-family: var(--display); font-size: 30px; color: var(--amber-2); }
.rule .glass.mini { width: 26px; height: 42px; }
.seat .sb { font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--amber-2); }
.chip b { min-width: 14px; text-align: center; }
.chip.lead { box-shadow: inset 0 0 0 2px var(--amber-2); }
/* match winner */
.end { position: relative; }
.end .confetti { position: fixed; z-index: 1; }
.champ { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 4px; }
.champ-glass { width: 104px; height: 166px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .5)); animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
.champ-glass .glass { width: 100%; height: 100%; }
.champ-toks { display: flex; gap: 8px; margin-top: -46px; }
.champ.me .cel-n { animation: throb .6s infinite; }
.end .rank .val { margin-left: auto; }
.end .beers { min-width: 44px; text-align: right; }
