:root {
  --sky: #4EC5FF;
  --ink: #14254A;
  --muted: #4A5878;
  --red: #E8413C;
  --blue: #1F7AE0;
  --green: #2DB84D;
  --yellow: #FFC233;
  --orange: #FF7A1A;
  --purple: #8E5CF7;
  --slate: #5B6B8C;
  --card-red: #D7263D;
  --card-black: #1B1B1F;
  --display: 'Lilita One', 'Fredoka', system-ui, sans-serif;
  --body: 'Fredoka', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: var(--sky);
  color: var(--ink);
  font: 500 16px/1.4 var(--body);
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- sky ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.cloud { position: absolute; left: 0; display: flex; align-items: flex-end; animation: drift linear infinite; }
.cloud span { background: #fff; border-radius: 999px; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(110vw); } }

/* ---------- chunky buttons ---------- */
.chunky {
  border: 4px solid #fff;
  border-radius: 20px;
  color: #fff;
  font-family: var(--display);
  letter-spacing: 1px;
  box-shadow: 0 6px 0 var(--shade);
  text-shadow: 0 2px 0 var(--shade);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.chunky:hover { transform: translateY(-2px); filter: brightness(1.06); }
.chunky:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--shade); }
.chunky:disabled { filter: grayscale(.6); opacity: .7; cursor: default; transform: none; }
.red { background: var(--red); --shade: #A82420; }
.blue { background: var(--blue); --shade: #11519A; }
.green { background: var(--green); --shade: #1B7A31; }
.yellow { background: var(--yellow); --shade: #C98A00; color: var(--ink); text-shadow: none; }
.ghost { background: #fff; --shade: rgba(20, 37, 74, .3); color: var(--ink); text-shadow: none; }

/* ---------- lobby ---------- */
.lobby {
  position: relative;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: 32px;
  align-items: center;
}
.hero, .side { position: relative; z-index: 1; }
.side { display: flex; flex-direction: column; gap: 28px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
#logo3d { width: min(100%, 520px); aspect-ratio: 4 / 3; }
.title {
  margin: -24px 0 0;
  font: 400 clamp(44px, 7vw, 80px)/1 var(--display);
  color: var(--yellow);
  -webkit-text-stroke: 6px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 7px 0 var(--ink);
  letter-spacing: 1px;
  transform: rotate(-3deg);
  animation: titleIn .8s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes titleIn { from { transform: scale(.3) rotate(-10deg); opacity: 0; } }
.tagline {
  margin: 0;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 22px;
  font-size: 18px;
  font-weight: 600;
  box-shadow: 0 4px 0 var(--ink);
}
.pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pills span { background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 14px; font-size: 14px; font-weight: 600; }
.panel {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 32px;
  box-shadow: 0 10px 0 var(--ink);
  padding: 26px 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: panelIn .6s .15s cubic-bezier(.2, 1.3, .4, 1) both;
}
@keyframes panelIn { from { transform: translateY(40px); opacity: 0; } }
.panel h2, .panel .h2 { margin: 0; font: 400 22px/1.1 var(--display); }
.avatars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.avatar-pick {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 18px;
  background: var(--bg);
  border: 4px solid #fff;
  box-shadow: 0 4px 0 rgba(20, 37, 74, .3);
  display: grid;
  place-items: center;
  transition: transform .15s ease;
}
.avatar-pick svg { width: 76%; height: 76%; }
.avatar-pick:hover { transform: translateY(-3px) rotate(-3deg); }
.avatar-pick[aria-checked="true"] { border-color: var(--ink); animation: picked 1.2s ease-in-out infinite; }
@keyframes picked { 50% { transform: translateY(-5px) rotate(3deg); } }
.panel input {
  height: 54px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 0 16px;
  font-size: 20px;
  background: #F4F7FC;
}
.panel input::placeholder { color: #6C7A96; }
.panel input:focus { outline: 4px solid var(--yellow); outline-offset: 1px; }
.big { height: 66px; font-size: 28px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; font-weight: 600; }
.or span { flex: 1; height: 3px; border-radius: 3px; background: #E3E9F4; }
.join { display: flex; gap: 10px; }
.join input { flex: 1; min-width: 0; font: 400 28px var(--display); letter-spacing: 10px; text-transform: uppercase; text-align: center; }
.join button { width: 130px; font-size: 24px; }
.linkbtn { align-self: center; background: none; border: 0; color: var(--blue); font-weight: 600; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--ink); }
.hill { position: fixed; left: -10vw; right: -10vw; bottom: -42vh; height: 70vh; border-radius: 50%; background: #43C463; border-top: 10px solid #2C9E49; }
/* leaderboard */
.leaders { gap: 10px; animation-delay: .3s; }
.leaderlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leaderlist li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 14px; background: #F4F7FC; }
.leaderlist li.me { background: #FFF3C4; box-shadow: inset 0 0 0 3px var(--yellow); }
.leaderlist li.empty { justify-content: center; color: var(--muted); font-weight: 600; }
.leaderlist .rank { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--slate); color: #fff; font: 400 16px/1 var(--display); }
.leaderlist li:nth-child(1) .rank { background: var(--yellow); color: var(--ink); }
.leaderlist li:nth-child(2) .rank { background: #A9B6CC; color: var(--ink); }
.leaderlist li:nth-child(3) .rank { background: var(--orange); }
.leaderlist .pic { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; }
.leaderlist .pic svg { width: 80%; height: 80%; }
.leaderlist .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.leaderlist .won { text-align: right; font: 400 18px/1 var(--display); }
.leaderlist .won small { display: block; font: 500 12px/1.3 var(--body); color: var(--muted); }
.mystats { margin: 0; text-align: center; color: var(--muted); font-size: 14px; font-weight: 600; }
.mystats:empty { display: none; }
@media (max-width: 900px) {
  .side { gap: 20px; }
  .lobby { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px 16px 40px; }
  #logo3d { width: min(100%, 340px); }
  .panel { padding: 20px 18px; }
  .avatars { gap: 6px; }
}

/* ---------- game: a fixed stage scaled to fit the window, laid out like the design ---------- */
.game { position: fixed; inset: 0; z-index: 1; overflow: hidden; }
.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
}
.stage.tall { width: 480px; height: 1040px; }
#table3d { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; pointer-events: none; } /* resized by scene.js to fill the window */
.felt { display: none; }
body.no3d .felt {
  display: block;
  position: absolute;
  left: 11%;
  right: 11%;
  top: 13%;
  bottom: 17%;
  border-radius: 50%;
  background: #43C463;
  border: 12px solid var(--yellow);
  box-shadow: 0 18px 0 #A0714B;
}
body.no3d .tall .felt { left: 5%; right: 5%; top: 11%; bottom: 35%; }

.hud { position: absolute; top: 20px; display: flex; align-items: center; gap: 10px; }
.hud-left { left: 24px; }
.hud-right { right: 24px; }
.tablechip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ink);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 999px;
  padding: 6px 18px 6px 8px;
  font: 400 22px/1 var(--display);
  letter-spacing: 1px;
  box-shadow: 0 4px 0 rgba(20, 37, 74, .35);
}
.tablechip b { font-weight: 400; }
.chipicon { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); border: 4px dashed #fff; }
.blinds { background: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 15px; box-shadow: 0 4px 0 rgba(20, 37, 74, .25); white-space: nowrap; }
.ticker { position: absolute; left: 24px; top: 86px; max-width: 300px; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker:not(:empty) span { display: inline-block; background: rgba(255, 255, 255, .9); border-radius: 999px; padding: 4px 14px; animation: pop .35s ease both; }
.hudbtn {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 0 14px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 5px 0 rgba(20, 37, 74, .3);
  transition: transform .12s ease;
}
.hudbtn:hover { transform: translateY(-2px); }
.hudbtn:active { transform: translateY(3px); }
.hudbtn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.hudbtn.round { width: 50px; padding: 0; justify-content: center; }
.guidebtn { background: var(--yellow); font: 400 20px/1 var(--display); letter-spacing: .5px; box-shadow: 0 5px 0 #C98A00; }
#sound .off, #sound.muted .on { display: none; }
#sound.muted .off { display: block; stroke: var(--red); }
.tall .hud { top: 16px; gap: 8px; }
.tall .hud-left { left: 16px; }
.tall .hud-right { right: 16px; }
.tall .blinds, .tall .tablelabel, .tall .guidebtn span { display: none; }
.tall .hudbtn { width: 48px; height: 48px; padding: 0; justify-content: center; }
.tall .ticker { left: 50%; top: 560px; max-width: 400px; transform: translateX(-50%); text-align: center; font-size: 14px; }
.tall.done .ticker { visibility: hidden; }

/* ---------- seats (positioned by app.js; the avatar sits on the table rim) ---------- */
.seat {
  position: absolute;
  width: 140px;
  transform: translate(-50%, calc(var(--av) / -2 - 4px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  --av: 92px;
}
.tall .seat { width: 112px; --av: 70px; }
.seat.out .avatar, .seat.out .plate { opacity: .6; }
.avatar {
  position: relative;
  width: var(--av);
  height: var(--av);
  border-radius: calc(var(--av) * .26);
  background: var(--bg);
  border: 4px solid #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 0 rgba(20, 37, 74, .35);
}
.avatar > svg.face { width: 76%; height: 76%; }
.avatar.turn { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 6px 0 rgba(20, 37, 74, .35), 0 0 0 10px rgba(255, 194, 51, .55); } }
.ring { position: absolute; left: -14px; top: -14px; width: calc(100% + 28px); height: calc(100% + 28px); pointer-events: none; overflow: visible; }
.ring rect { fill: none; stroke-width: 8; vector-effect: non-scaling-stroke; }
.ring .track { stroke: rgba(20, 37, 74, .25); }
.ring .left { stroke: var(--yellow); stroke-linecap: round; stroke-dasharray: 100; animation: ring 30s linear forwards; }
@keyframes ring { to { stroke-dashoffset: 100; } }
.dealer {
  position: absolute;
  right: -14px;
  top: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ink);
  font: 400 16px/1 var(--display);
  display: grid;
  place-items: center;
  z-index: 2;
}
.hole { position: absolute; top: 18px; display: flex; --w: 40px; z-index: 1; }
.seat.cards-right .hole { left: calc(100% + 4px); }
.seat.cards-left .hole { right: calc(100% + 4px); }
.hole .card:first-child { transform: rotate(-10deg); }
.hole .card + .card { margin-left: -18px; transform: rotate(8deg); }
.hole.up { --w: 48px; top: 2px; }
.tall .hole, .tall .seat.cards-left .hole, .tall .seat.cards-right .hole { --w: 26px; top: auto; bottom: -8px; left: 58%; right: auto; }
.tall .hole.up { --w: 34px; }
.plate { max-width: 140px; background: var(--ink); color: #fff; border-radius: 12px; padding: 3px 14px; text-align: center; line-height: 1.15; }
.plate b { display: block; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate span { font-size: 13px; color: var(--yellow); font-weight: 600; }
.tall .plate { max-width: 112px; padding: 2px 10px; }
.tall .plate b { font-size: 14px; }
.ribbon {
  background: var(--k, var(--slate));
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 3px 12px 1px;
  font: 400 15px/1.1 var(--display);
  letter-spacing: 1px;
  white-space: nowrap;
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.tall .ribbon { font-size: 13px; padding: 2px 9px 1px; }
.handtag { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.betchip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border-radius: 999px;
  padding: 3px 12px 3px 4px;
  font: 400 18px/1 var(--display);
  box-shadow: 0 3px 0 rgba(20, 37, 74, .3);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: bob 3s ease-in-out infinite;
}
.betchip .chipicon { width: 24px; height: 24px; border-width: 3px; background: var(--blue); }
@keyframes bob { 50% { transform: translate(-50%, calc(-50% - 4px)); } }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }

/* ---------- middle of the table ---------- */
.pot {
  position: absolute;
  left: 640px;
  top: 284px;
  transform: translate(-50%, -50%);
  background: var(--ink);
  color: var(--yellow);
  border: 3px solid var(--yellow);
  border-radius: 999px;
  padding: 6px 20px 4px;
  font: 400 24px/1 var(--display);
  letter-spacing: 1px;
  white-space: nowrap;
}
.board-wrap { position: absolute; left: 640px; top: 316px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; --w: 78px; }
.board { display: flex; gap: 10px; perspective: 600px; }
.slot { flex: none; width: var(--w); height: calc(var(--w) * 1.41); box-sizing: border-box; border-radius: calc(var(--w) * .16); border: 3px dashed rgba(255, 255, 255, .8); background: rgba(20, 37, 74, .22); }
.board .card.flip { animation: flip .45s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes flip { from { transform: rotateY(90deg) scale(.7); opacity: 0; } }
.streets { display: flex; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: #fff; }
.streets span { width: var(--w); background: var(--ink); border-radius: 999px; padding: 2px 0; text-align: center; }
.streets .flop { width: calc(var(--w) * 3 + 20px); }
.tall .pot { left: 240px; top: 380px; font-size: 22px; }
.tall .board-wrap { left: 240px; top: 408px; --w: 60px; }
.tall .board, .tall .streets { gap: 6px; }
.tall .streets { font-size: 10px; letter-spacing: 1px; }
.tall .streets .flop { width: calc(var(--w) * 3 + 12px); }
.stage.done .streets { visibility: hidden; }
.banner {
  position: absolute;
  left: 640px;
  top: 498px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-2deg);
  animation: bannerIn .7s cubic-bezier(.2, 1.5, .4, 1) both;
}
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(.2) rotate(-12deg); opacity: 0; } }
.banner b { font: 400 66px/1 var(--display); color: var(--yellow); -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); white-space: nowrap; letter-spacing: 1px; }
.banner span { background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 6px 20px; font-weight: 600; font-size: 17px; white-space: nowrap; }
.tall .banner { left: 240px; top: 610px; }
.tall .banner b { font-size: 42px; -webkit-text-stroke-width: 4px; }

/* ---------- classic playing cards ---------- */
.card {
  position: relative;
  flex: none;
  width: var(--w);
  height: calc(var(--w) * 1.4);
  border-radius: calc(var(--w) * .13);
  background: #fff;
  color: var(--card-black);
  box-shadow: 0 calc(var(--w) * .06) 0 rgba(20, 37, 74, .3), inset 0 0 0 1.5px #DDE3EE;
  font-family: var(--display);
  line-height: .9;
}
.card.red { color: var(--card-red); }
.card .corner { position: absolute; display: flex; flex-direction: column; align-items: center; font-size: calc(var(--w) * .3); }
.card .corner i { font: normal calc(var(--w) * .22)/1 system-ui, sans-serif; margin-top: 1px; }
.card .tl { left: 7%; top: 6%; }
.card .br { right: 7%; bottom: 6%; transform: rotate(180deg); }
.card .pip { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 8%; font: calc(var(--w) * .56)/1 system-ui, sans-serif; }
.card.back::after {
  content: '';
  position: absolute;
  inset: calc(var(--w) * .07);
  border-radius: calc(var(--w) * .08);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 2px, transparent 2px 8px),
    #D7302B;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .6);
}

/* ---------- emoji and quick chat ---------- */
.emote-panel {
  position: absolute;
  right: 24px;
  top: 84px;
  z-index: 6;
  width: 320px;
  padding: 10px;
  background: #1B2A4E;
  border: 3px solid #fff;
  border-radius: 22px;
  box-shadow: 0 8px 0 rgba(20, 37, 74, .35);
  transform-origin: 85% 0;
  animation: pop .25s cubic-bezier(.2, 1.4, .4, 1) both;
}
.tall .emote-panel { right: 16px; top: 74px; width: 300px; }
.emote-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.emote-tabs button { flex: 1; height: 40px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; }
.emote-tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .28); }
.emote-tabs svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.emote-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.emote-grid button { height: 64px; border: 0; border-radius: 14px; background: transparent; color: #fff; font-size: 40px; line-height: 1; transition: transform .12s ease, background .12s ease; }
.emote-grid button:hover { transform: scale(1.15); background: rgba(255, 255, 255, .1); }
.emote-chat { display: flex; flex-direction: column; gap: 8px; }
.phrases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.phrases button { min-height: 40px; padding: 6px 8px; border: 0; border-radius: 12px; background: #fff; color: var(--ink); font-weight: 600; font-size: 14px; line-height: 1.2; transition: transform .12s ease; }
.phrases button:hover { transform: translateY(-2px); }
.chatform { display: flex; gap: 6px; }
.chatform input { flex: 1; min-width: 0; height: 44px; border: 0; border-radius: 12px; padding: 0 12px; font-size: 15px; }
.chatform input:focus { outline: 3px solid var(--yellow); }
.chatform button { height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--yellow); color: var(--ink); font: 400 17px var(--display); letter-spacing: .5px; }
.emote {
  position: absolute;
  z-index: 5;
  max-width: 220px;
  padding: 6px 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 rgba(20, 37, 74, .3);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
  transform: translate(-50%, -100%);
  animation: emoteIn .45s cubic-bezier(.2, 1.6, .4, 1) both, emoteOut .4s ease-in 3.1s forwards;
}
.emote::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: translateX(-50%) rotate(45deg);
}
.emote.big { padding: 6px 10px; border-radius: 22px; font-size: 48px; line-height: 1; }
@keyframes emoteIn { from { transform: translate(-50%, -60%) scale(.2); opacity: 0; } }
@keyframes emoteOut { to { transform: translate(-50%, -150%); opacity: 0; } }

/* ---------- my area ---------- */
.me { position: absolute; left: 30px; top: 512px; width: 150px; display: flex; flex-direction: column; align-items: center; gap: 6px; --av: 104px; }
.me .avatar { border-width: 5px; }
.me .plate { padding: 3px 16px; }
.me .plate b { font-size: 17px; }
.me .plate span { font-size: 14px; }
.tall .me { left: 12px; top: 744px; width: 116px; --av: 64px; }
.mycards { position: absolute; left: 330px; top: 540px; display: flex; align-items: flex-end; --w: 130px; }
.mycards .card { --r: -9deg; transform: rotate(var(--r)); transform-origin: 50% 100%; box-shadow: 0 8px 0 rgba(20, 37, 74, .35), inset 0 0 0 1.5px #DDE3EE; }
.mycards .card + .card { --r: 8deg; margin-left: -18px; }
.mycards.deal .card { animation: dealIn .55s cubic-bezier(.2, 1.5, .4, 1) .8s both; }
.mycards.deal .card + .card { animation-delay: 1.05s; }
@keyframes dealIn { from { transform: translateY(170px) rotate(0deg) scale(.6); opacity: 0; } }
.mycards.folded .card { animation: foldAway .5s ease-in forwards; }
@keyframes foldAway { to { transform: translate(160px, -300px) rotate(50deg) scale(.4); opacity: 0; } }
.tall .mycards { left: 140px; top: 756px; --w: 88px; }
.helper {
  position: absolute;
  left: 292px;
  top: 462px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: 8px 10px 8px 14px;
  box-shadow: 0 5px 0 var(--ink);
}
.helper .label small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .5px; }
.helper .label b { font: 400 21px/1 var(--display); white-space: nowrap; }
.meter { display: flex; gap: 3px; }
.meter i { width: 8px; height: 16px; border-radius: 3px; background: #D5DBE7; }
.meter i.on { background: var(--green); }
.helper .tip { display: block; margin-top: 4px; font-size: 12px; font-weight: 700; color: #1E7A37; white-space: nowrap; }
.helper button { border: 0; background: #EAF4FF; border-radius: 12px; padding: 8px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.tall .helper { left: 16px; right: 16px; top: 680px; justify-content: space-between; }
.tall .helper .tip { display: none; }

.actions { position: absolute; left: 650px; top: 536px; width: 600px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.tall .actions { left: 16px; top: 888px; width: 448px; gap: 10px; }
.turnbar { width: 100%; display: flex; align-items: center; gap: 10px; }
.turnbar .stepper { margin-left: 16px; }
.tall .turnbar .stepper { margin-left: auto; }
.yourturn { font: 400 30px/1 var(--display); color: var(--yellow); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); letter-spacing: 1px; animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 50% { transform: translateY(-5px) rotate(-2deg); } }
.timer { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 4px; height: 42px; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 0 3px; }
.stepper label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stepper button { flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--green); color: #fff; font: 400 20px/1 var(--display); }
.stepper input { width: 72px; border: 0; background: transparent; text-align: center; font: 400 20px var(--display); -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btnrow { display: flex; align-items: flex-start; gap: 12px; }
.col { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.col small { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.act { height: 66px; min-width: 110px; padding: 0 20px; font-size: 25px; white-space: nowrap; }
.allin {
  width: 108px;
  height: 108px;
  margin-top: -14px;
  border-radius: 50%;
  border: 5px solid #fff;
  background: radial-gradient(circle at 35% 30%, #FF9A4D, #E8413C 58%, #B3261E);
  --shade: #8E1C17;
  color: var(--yellow);
  font: 400 29px/.95 var(--display);
  letter-spacing: 1px;
  -webkit-text-stroke: 2px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
  box-shadow: 0 7px 0 var(--shade);
  transform: rotate(-6deg);
  transition: transform .12s ease;
}
.allin:hover { transform: rotate(-6deg) translateY(-3px); }
.allin:active { transform: rotate(-6deg) translateY(4px); }
.status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 52px; }
.status p { margin: 0; background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 10px 22px; font-weight: 600; font-size: 18px; box-shadow: 0 5px 0 var(--ink); }
.status .chunky { height: 56px; padding: 0 24px; font-size: 22px; }
.tall .yourturn { font-size: 24px; -webkit-text-stroke-width: 2px; }
.tall .stepper input { width: 58px; }
.tall .btnrow { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.tall .act { width: 100%; min-width: 0; height: 58px; padding: 0 4px; font-size: 19px; letter-spacing: 0; }
.tall .allin { width: 66px; height: 66px; margin-top: 0; font-size: 18px; border-width: 4px; -webkit-text-stroke-width: 1.5px; }
.tall .col small { font-size: 11px; padding: 2px 6px; white-space: normal; text-align: center; line-height: 1.15; }
.tall .status { margin-top: 20px; }
.tall .status p { flex: 1; font-size: 16px; padding: 10px 16px; border-radius: 18px; }

/* ---------- hand guide drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(20, 37, 74, .35); }
.guide {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 4px solid var(--ink);
  animation: slideIn .35s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes slideIn { from { transform: translateX(100%); } }
.guide-head { background: var(--yellow); border-bottom: 4px solid var(--ink); padding: 16px 16px 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.guide-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guide-title h2 { margin: 0; font: 400 30px/1 var(--display); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); letter-spacing: 1px; }
.guide-title p { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.close { flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: #fff; border: 3px solid var(--ink); display: grid; place-items: center; box-shadow: 0 3px 0 var(--ink); }
.close svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; }
.tabs { display: flex; gap: 6px; background: var(--ink); border-radius: 999px; padding: 4px; }
.tabs button { flex: 1; height: 38px; border: 0; border-radius: 999px; background: transparent; color: #fff; font: 400 16px var(--display); letter-spacing: .5px; }
.tabs button[aria-selected="true"] { background: var(--yellow); color: var(--ink); }
.guide-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; background: #EAF4FF; border-radius: 16px; padding: 10px 12px; font-size: 14px; line-height: 1.35; }
.note.warm { background: #FFF4D6; border: 3px solid var(--yellow); }
.handrow { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 16px; border: 3px solid #E3E9F4; }
.guide-body.animate .handrow, .guide-body.animate .step, .guide-body.animate .btnhelp { animation: rowIn .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.handrow.mine { background: #FFF4D6; border-color: var(--yellow); }
@keyframes rowIn { from { transform: translateX(30px); opacity: 0; } }
.badge { flex: none; width: 30px; height: 30px; border-radius: 10px; background: var(--k); color: #fff; display: grid; place-items: center; font: 400 16px var(--display); }
.handrow .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.handrow .name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 400 16px/1.1 var(--display); }
.handrow .you { background: var(--orange); color: #fff; border-radius: 999px; padding: 1px 8px; font: 700 10px var(--body); letter-spacing: .5px; }
.handrow .desc { font-size: 12px; line-height: 1.25; color: #3A4A6B; }
.minis { flex: none; display: flex; gap: 2px; }
.mini { width: 24px; height: 34px; border-radius: 5px; background: #fff; border: 1.5px solid #C9D2E3; color: var(--card-black); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 400 13px/.9 var(--display); }
.mini i { font: normal 11px/1 system-ui, sans-serif; }
.mini.red { color: var(--card-red); }
.mini.faded { opacity: .3; }
.step { display: flex; gap: 12px; align-items: stretch; }
.step .dot { flex: none; width: 40px; display: flex; flex-direction: column; align-items: center; }
.step .dot b { width: 40px; height: 40px; border-radius: 50%; background: var(--k); border: 3px solid var(--ink); color: #fff; display: grid; place-items: center; font: 400 18px var(--display); }
.step .dot span { flex: 1; border-left: 3px dashed #B9C4DA; margin-top: 4px; }
.step .body { padding-bottom: 12px; display: flex; flex-direction: column; gap: 2px; }
.step h3 { margin: 0; font: 400 19px/1.2 var(--display); }
.step p { margin: 0; font-size: 14px; line-height: 1.35; color: #3A4A6B; }
.step em { align-self: flex-start; margin-top: 4px; background: #EAF4FF; border-radius: 999px; padding: 2px 10px; font-style: normal; font-size: 12px; font-weight: 600; }
.btnhelp { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 16px; background: #F4F7FC; }
.btnhelp .chip { flex: none; width: 92px; height: 44px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 0 var(--shade); color: #fff; display: grid; place-items: center; font: 400 17px var(--display); letter-spacing: .5px; background: var(--k); }
.btnhelp p { margin: 0; font-size: 14px; line-height: 1.35; }
.btnhelp p + p { font-size: 13px; color: #3A4A6B; margin-top: 3px; }

/* ---------- bet history drawer (reuses the guide drawer) ---------- */
.handtabs { overflow-x: auto; scrollbar-width: none; }
.handtabs button { flex: none; padding: 0 14px; white-space: nowrap; }
.hboard { display: flex; align-items: center; justify-content: space-between; gap: 10px; font: 400 17px var(--display); }
.hstreet { margin: 10px 0 0; display: flex; justify-content: space-between; align-items: baseline; font: 400 18px/1.2 var(--display); }
.hstreet span { font: 600 13px var(--body); color: var(--muted); }
.htable { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.htable tr > :first-child { width: 30%; }
.htable.acts tr > :nth-child(2) { width: 32%; }
.htable th { text-align: left; padding: 2px 6px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.htable td { padding: 5px 6px; border-top: 2px solid #E3E9F4; }
.htable .num { text-align: right; }
.htable .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.htable tr.mine td { background: #FFF4D6; }
.htable small { color: var(--muted); font-size: 12px; }
.htable .minis { justify-content: flex-start; }
.note.bad { background: #FFE4E2; border: 3px solid var(--red); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 600;
  box-shadow: 0 4px 0 rgba(20, 37, 74, .35);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .cloud { display: none; }
}
