/* ==========================================================================
   Teen Patti — Diwali Chadar
   The game is played on the cloth: an indigo dabu-printed floor, a white
   block-printed sheet, madder cushions for seats, a brass thali for the pot.
   ========================================================================== */

@font-face { font-family: "Yatra One"; src: url("../fonts/yatra-one-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20B9; }
@font-face { font-family: "Yatra One"; src: url("../fonts/yatra-one-deva.woff2") format("woff2"); font-display: swap; unicode-range: U+0900-097F, U+200C-200D; }
@font-face { font-family: "Hind"; font-weight: 400; src: url("../fonts/hind-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Hind"; font-weight: 500; src: url("../fonts/hind-500.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Hind"; font-weight: 600; src: url("../fonts/hind-600.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Hind"; font-weight: 700; src: url("../fonts/hind-700.woff2") format("woff2"); font-display: swap; }

:root {
  /* cloth + dye */
  --indigo-950: #10163A;
  --indigo-900: #161E4B;
  --indigo-800: #1F2A63;
  --indigo-600: #34428C;
  --indigo-300: #B8C0E8;
  --mulmul: #F6F4EF;
  --mulmul-shade: #E9E5DB;
  --madder: #A4322A;
  --madder-deep: #7C2119;
  --madder-soft: #E7C7C1;
  --marigold: #F0A422;
  --marigold-deep: #D9820F;
  --leaf: #2E7D43;
  --brass: #C3963A;
  --brass-light: #E7C46D;
  --brass-dark: #7E5718;
  --ink: #1B2152;
  --ink-soft: #4C5382;

  /* chip denominations */
  --chip-10: var(--leaf);
  --chip-50: var(--madder);
  --chip-100: var(--indigo-600);
  --chip-500: var(--marigold-deep);

  --font-display: "Yatra One", "Hind", system-ui, sans-serif;
  --font-ui: "Hind", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ease-cloth: cubic-bezier(.22, .9, .26, 1);
  --ease-lift: cubic-bezier(.3, .7, .2, 1);
  --t-fast: 160ms;
  --t-med: 320ms;

  --radius-cushion: 16px;
  --radius-card: 7px;
  --gutter: 16px;

  --shadow-rest: 0 1px 1px rgba(0, 0, 0, .18), 0 3px 8px rgba(0, 0, 0, .16);
  --shadow-lift: 0 6px 10px rgba(0, 0, 0, .2), 0 18px 34px rgba(0, 0, 0, .24);

  /* card sizes, overridden per breakpoint */
  --card-w: 76px;
  --mini-w: 22px;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--indigo-800);
  /* dabu: white resist flowers on indigo */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='%23F6F4EF' fill-opacity='.11'%3E%3Cg transform='translate(18 18)'%3E%3Ccircle r='2.4'/%3E%3Cellipse cy='-6' rx='2.4' ry='3.8'/%3E%3Cellipse cy='6' rx='2.4' ry='3.8'/%3E%3Cellipse cx='-6' rx='3.8' ry='2.4'/%3E%3Cellipse cx='6' rx='3.8' ry='2.4'/%3E%3C/g%3E%3Cg transform='translate(54 54) rotate(45)'%3E%3Ccircle r='2.4'/%3E%3Cellipse cy='-6' rx='2.4' ry='3.8'/%3E%3Cellipse cy='6' rx='2.4' ry='3.8'/%3E%3Cellipse cx='-6' rx='3.8' ry='2.4'/%3E%3Cellipse cx='6' rx='3.8' ry='2.4'/%3E%3C/g%3E%3Ccircle cx='54' cy='18' r='1.6'/%3E%3Ccircle cx='18' cy='54' r='1.6'/%3E%3Ccircle cx='50' cy='22' r='.9'/%3E%3Ccircle cx='58' cy='14' r='.9'/%3E%3Ccircle cx='14' cy='58' r='.9'/%3E%3Ccircle cx='22' cy='50' r='.9'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--mulmul);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

::selection { background: var(--marigold); color: var(--ink); }
input { caret-color: var(--madder); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: var(--indigo-600) transparent; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--indigo-600); border-radius: 8px; }

[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.ic { width: 20px; height: 20px; flex: none; }
.num { font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 999px;
  font-family: var(--font-ui); font-weight: 600; font-size: 16px; line-height: 1;
  transition: transform var(--t-fast) var(--ease-cloth), background-color var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .42; }
.btn-lg { min-height: 56px; font-size: 18px; padding: 0 28px; }
.btn-primary { background: var(--marigold); color: var(--ink); box-shadow: 0 2px 0 var(--marigold-deep), 0 4px 10px rgba(0, 0, 0, .22); }
.btn-primary:hover:not(:disabled) { background: #F5B03A; }
.btn-madder { background: var(--madder); color: var(--mulmul); box-shadow: 0 2px 0 var(--madder-deep); }
.btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-ghost:hover:not(:disabled) { background: rgba(246, 244, 239, .08); }
.btn .amt { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.btn .amt svg { width: 16px; height: 16px; }
.btn-madder .amt svg { color: var(--marigold); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; }
.icon-btn:hover { background: rgba(27, 33, 82, .08); }
.link-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 4px; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; text-decoration-color: var(--madder); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ----------------------------------------------------------- screens */
#app { height: 100dvh; }
.screen { height: 100dvh; }

/* the printed sheet: shared by landing, join, and the table */
.landing-cloth, .sheet {
  background-color: var(--mulmul);
  color: var(--ink);
  border: 14px solid transparent;
  /* block-printed madder border, 9-slice */
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 42 42'%3E%3Crect width='42' height='42' fill='%23F6F4EF'/%3E%3Crect width='42' height='42' fill='none' stroke='%23A4322A' stroke-width='18'/%3E%3Cg fill='%23F6F4EF'%3E%3Ccircle cx='7' cy='7' r='2.2'/%3E%3Ccircle cx='35' cy='7' r='2.2'/%3E%3Ccircle cx='7' cy='35' r='2.2'/%3E%3Ccircle cx='35' cy='35' r='2.2'/%3E%3Ccircle cx='21' cy='4.5' r='1.5'/%3E%3Ccircle cx='21' cy='37.5' r='1.5'/%3E%3Ccircle cx='4.5' cy='21' r='1.5'/%3E%3Ccircle cx='37.5' cy='21' r='1.5'/%3E%3C/g%3E%3Cpath d='M0 11.5H42M0 30.5H42M11.5 0V42M30.5 0V42' stroke='%231F2A63' stroke-width='1.2' stroke-dasharray='2 2'/%3E%3C/svg%3E") 14 round;
  position: relative;
  isolation: isolate;
}
.landing-cloth::before, .sheet-print {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  /* butti: madder flowers, half-drop */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='%23A4322A' fill-opacity='.17'%3E%3Cg transform='translate(14 14)'%3E%3Ccircle r='1.9'/%3E%3Cellipse cy='-4.4' rx='1.6' ry='2.6'/%3E%3Cellipse cy='4.4' rx='1.6' ry='2.6'/%3E%3Cellipse cx='-4.4' rx='2.6' ry='1.6'/%3E%3Cellipse cx='4.4' rx='2.6' ry='1.6'/%3E%3C/g%3E%3Cg transform='translate(42 42)'%3E%3Ccircle r='1.9'/%3E%3Cellipse cy='-4.4' rx='1.6' ry='2.6'/%3E%3Cellipse cy='4.4' rx='1.6' ry='2.6'/%3E%3Cellipse cx='-4.4' rx='2.6' ry='1.6'/%3E%3Cellipse cx='4.4' rx='2.6' ry='1.6'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%231F2A63' fill-opacity='.14'%3E%3Ccircle cx='42' cy='14' r='1.2'/%3E%3Ccircle cx='14' cy='42' r='1.2'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .12 0 0 0 0 .3 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* marigold toran across the top */
.toran {
  height: 38px; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='38' viewBox='0 0 64 38'%3E%3Cpath d='M0 3Q32 26 64 3' fill='none' stroke='%232E7D43' stroke-width='1.6'/%3E%3Cpath d='M32 18q-4 8 0 17 4-9 0-17z' fill='%232E7D43'/%3E%3Cg%3E%3Ccircle cx='12' cy='10' r='6.2' fill='%23D9820F'/%3E%3Ccircle cx='12' cy='10' r='4.4' fill='%23F0A422'/%3E%3Ccircle cx='12' cy='10' r='1.6' fill='%23D9820F'/%3E%3Ccircle cx='52' cy='10' r='6.2' fill='%23D9820F'/%3E%3Ccircle cx='52' cy='10' r='4.4' fill='%23F0A422'/%3E%3Ccircle cx='52' cy='10' r='1.6' fill='%23D9820F'/%3E%3Ccircle cx='24' cy='15' r='5.4' fill='%23F0A422'/%3E%3Ccircle cx='24' cy='15' r='2.2' fill='%23F5C15A'/%3E%3Ccircle cx='40' cy='15' r='5.4' fill='%23F0A422'/%3E%3Ccircle cx='40' cy='15' r='2.2' fill='%23F5C15A'/%3E%3C/g%3E%3C/svg%3E") repeat-x top left / 64px 38px;
}

/* ----------------------------------------------------------- landing / join */
.landing, .join {
  display: flex; flex-direction: column; align-items: center;
  overflow-y: auto; padding: 0 var(--gutter) 24px;
}
.landing .toran, .join .toran { align-self: stretch; margin: 0 calc(-1 * var(--gutter)); }
.join .landing-cloth { margin-block: auto; }
.join { padding-bottom: 38px; }
.landing-cloth {
  width: 100%; max-width: 520px; margin-top: 8px;
  padding: 28px 22px 26px;
  box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column; gap: 18px;
}
.wordmark { margin: 0; display: flex; flex-direction: column; align-items: flex-start; line-height: .95; }
.wm-latin { font-family: var(--font-display); font-weight: 400; font-size: clamp(52px, 15vw, 76px); color: var(--madder); letter-spacing: -0.01em; }
.wm-deva { font-family: var(--font-display); font-size: clamp(22px, 6vw, 30px); color: var(--indigo-800); margin-top: 4px; }
.lede { margin: 0; font-size: 18px; line-height: 1.45; color: var(--ink); max-width: 34ch; text-wrap: pretty; }

.landing-fan { position: relative; height: 118px; margin: 2px 0 4px; }
.landing-fan .card { position: absolute; left: 50%; top: 6px; --card-w: 70px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 600; font-size: 15px; color: var(--ink); }
.field input {
  min-height: 52px; padding: 0 16px;
  border: 1.5px solid var(--ink-soft); border-radius: 12px;
  background: #fff; color: var(--ink);
  font: 500 18px var(--font-ui);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input::placeholder { color: #7A7FA3; }
.field input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--marigold); }
.create { display: flex; flex-direction: column; gap: 12px; }
.fineprint { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.join-code { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1.5px dashed rgba(164, 50, 42, .4); }
.code-row { display: flex; gap: 8px; }
.code-row input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 16px;
  border: 1.5px solid var(--ink-soft); border-radius: 12px; background: #fff; color: var(--ink);
  font: 600 18px var(--font-ui); letter-spacing: .14em; text-transform: uppercase;
}
.code-row input::placeholder { letter-spacing: .04em; text-transform: none; font-weight: 500; font-size: 16px; color: var(--ink-soft); }
.code-row input:focus-visible { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--marigold); }
.code-row .btn { min-height: 52px; padding: 0 22px; }
.field-error { margin: 0; color: var(--madder); font-size: 14px; font-weight: 600; }
.how { margin: 4px 0 0; padding: 14px 0 0; list-style: none; display: grid; gap: 6px; border-top: 1.5px dashed rgba(164, 50, 42, .4); counter-reset: how; }
.how li { counter-increment: how; display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: baseline; color: var(--ink); }
.how li::before { content: counter(how); font-family: var(--font-display); color: var(--madder); font-size: 20px; }
.playmoney { max-width: 520px; text-align: center; color: var(--indigo-300); font-size: 14px; margin: 18px 0 0; }

.invite-line { margin: 0; color: var(--ink-soft); font-weight: 500; }
.room-code { margin: -8px 0 4px; font-family: var(--font-display); font-size: 64px; letter-spacing: .08em; color: var(--madder); line-height: 1.05; }
.notfound { display: grid; gap: 10px; padding-top: 14px; border-top: 1.5px dashed rgba(164, 50, 42, .4); }
.notfound h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; color: var(--madder); }
.notfound p { margin: 0; color: var(--ink); }
.join-status { margin: 0; min-height: 1.4em; color: var(--ink-soft); }

/* ----------------------------------------------------------- room layout */
.room {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  max-width: 1280px; margin: 0 auto;
}
.room-bar {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "code tools" "strip strip"; align-items: center; gap: 4px 10px;
  padding: 8px 10px 6px;
}
.room-chip { grid-area: code; justify-self: start; }
.bar-tools { grid-area: tools; justify-self: end; }
.strip-row { grid-area: strip; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 1.3em; }
.strip { text-align: center; }
.sound-btn { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--indigo-300); }
.sound-btn:hover { background: rgba(246, 244, 239, .08); color: var(--mulmul); }
.sound-btn .ic { width: 18px; height: 18px; }
.room-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px 0 14px;
  border: 1.5px dashed rgba(246, 244, 239, .5); border-radius: 999px; background: rgba(0, 0, 0, .35);
  color: var(--mulmul);
}
.room-chip-code { font-family: var(--font-display); font-size: 20px; letter-spacing: .08em; line-height: 1; padding-top: 3px; }
.room-chip .ic { width: 18px; height: 18px; color: var(--marigold); }
.strip {
  margin: 0; min-width: 0; font-size: 14px; line-height: 1.25; color: var(--indigo-300);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip b { color: var(--mulmul); font-weight: 600; }
.strip .fresh { animation: strip-in var(--t-med) var(--ease-cloth); display: inline-block; }
@keyframes strip-in { from { opacity: 0; transform: translateY(6px); } }
.bar-tools { display: flex; gap: 2px; }
.tool {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 44px; min-height: 44px; padding: 4px 6px; border: 0; border-radius: 10px; background: transparent;
  color: var(--mulmul); font-size: 11px; font-weight: 600; letter-spacing: .01em;
}
.tool:hover { background: rgba(246, 244, 239, .08); }
.tool .ic { width: 20px; height: 20px; }
.tool.attn { color: var(--marigold); }

.table { position: relative; padding: 2px 8px 0; min-height: 0; }
.sheet {
  height: 100%;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 22px 40px rgba(0, 0, 0, .45);
  border-radius: 2px;
  overflow: visible;
}

/* ----------------------------------------------------------- seats (cushions) */
.seats { position: absolute; inset: 0; }
.seat {
  position: absolute; width: 76px; transform: translate(-50%, -50%);
  transition: left 600ms var(--ease-cloth), top 600ms var(--ease-cloth), opacity var(--t-med);
  z-index: 2;
}
.cushion {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 5px 5px 7px;
  border-radius: var(--radius-cushion);
  background: var(--madder);
  color: var(--mulmul);
  box-shadow: inset 0 0 0 2px var(--madder), inset 0 0 0 3.5px rgba(246, 244, 239, .55), 0 2px 0 var(--madder-deep), var(--shadow-rest);
  transition: box-shadow var(--t-med), background-color var(--t-med), transform var(--t-med) var(--ease-cloth);
}
.cushion::after { /* stitched piping */
  content: ""; position: absolute; inset: 4px; border-radius: 12px; border: 1px dashed rgba(246, 244, 239, .35); pointer-events: none;
}
.video {
  position: relative; width: 100%; aspect-ratio: 16 / 11; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--indigo-800);
  background-image: radial-gradient(rgba(246, 244, 239, .12) 1px, transparent 1.4px);
  background-size: 7px 7px;
}
.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--t-med); }
.video video.mirror { transform: scaleX(-1); }
.video.live video { opacity: 1; }
.video.live .initials, .video.live .cam-state { visibility: hidden; }
.video .mic-state { position: absolute; left: 4px; bottom: 3px; width: 14px; height: 14px; color: var(--mulmul); display: none; z-index: 1; }
.video.mic-off .mic-state { display: block; }
/* speaking: three bars that move only while LiveKit reports this voice */
.video .talk { position: absolute; right: 4px; top: 4px; z-index: 1; display: none; align-items: flex-end; gap: 2px; height: 12px; padding: 2px 3px; border-radius: 4px; background: rgba(16, 22, 58, .7); }
.video .talk i { display: block; width: 2.5px; height: 4px; border-radius: 2px; background: var(--leaf); }
.video.talking .talk { display: inline-flex; }
.video.talking .talk i { animation: talk .7s ease-in-out infinite alternate; }
.video.talking .talk i:nth-child(2) { animation-delay: .18s; }
.video.talking .talk i:nth-child(3) { animation-delay: .36s; }
.video.talking { box-shadow: inset 0 0 0 2px var(--leaf); }
@keyframes talk { from { height: 3px; } to { height: 10px; } }
.initials { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--mulmul); padding-top: 3px; }
.video .cam-state { position: absolute; right: 4px; bottom: 3px; width: 14px; height: 14px; color: var(--indigo-300); opacity: .8; }
.who { width: 100%; text-align: center; line-height: 1.15; padding: 0 2px; }
.name { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; color: #F7DCD6; }
.stack svg { width: 11px; height: 11px; color: var(--marigold); }
.tag {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  padding: 3px 7px 1px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
  background: var(--mulmul); color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .3);
  white-space: nowrap;
}
.tag.seen { background: var(--indigo-800); color: var(--mulmul); }
.tag.host { background: var(--marigold); color: var(--ink); }
.tag.out { background: var(--mulmul-shade); color: var(--ink-soft); }
.tag.pop { animation: tag-pop 360ms var(--ease-cloth); }
@keyframes tag-pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }

.seat.turn .cushion { box-shadow: inset 0 0 0 3px var(--marigold), inset 0 0 0 4.5px var(--madder-deep), 0 2px 0 var(--madder-deep), 0 10px 18px rgba(0, 0, 0, .28); transform: translateY(-5px); }
.seat.turn .cushion::after { border-color: rgba(240, 164, 34, .8); }
.seat.packed { opacity: .5; }
.seat.packed .cushion { background: #8E6A66; box-shadow: inset 0 0 0 3.5px rgba(246, 244, 239, .3), var(--shadow-rest); }
.seat.away .video::after { content: "away"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(16, 22, 58, .7); font-size: 12px; font-weight: 600; }
.seat.winner .cushion { background: var(--marigold); color: var(--ink); box-shadow: inset 0 0 0 3px var(--madder), 0 2px 0 var(--marigold-deep), var(--shadow-lift); transform: translateY(-5px); }
.seat.winner .cushion::after { border-color: rgba(124, 33, 25, .5); }
.seat.winner .stack { color: var(--ink); }
.seat.winner .stack svg { color: var(--madder); }
.seat.arrive { animation: seat-arrive 520ms var(--ease-cloth); }
@keyframes seat-arrive { from { opacity: 0; transform: translate(-50%, -30%) scale(.8); } }

/* On camera: the video becomes the cushion; name and stack ride a madder
   band over its lower edge. Portrait on phones (faces), square when wide. */
.seat.cam .cushion { padding: 3px; gap: 0; }
.seat.cam .cushion::after { inset: 2px; border-color: rgba(246, 244, 239, .25); }
.seat.cam .video { aspect-ratio: 3 / 4; border-radius: 13px; cursor: zoom-in; }
.me-seat .seat.cam .video { cursor: pointer; }
.seat.cam .who {
  position: absolute; left: 3px; right: 3px; bottom: 3px; z-index: 2; width: auto;
  padding: 3px 4px 4px; border-radius: 0 0 13px 13px;
  background: rgba(0, 0, 0, .2);
  color: rgba(255, 255, 255, .4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  line-height: 1.1;
}
.seat.cam .stack { color: rgba(255, 255, 255, .4); }
.seat.cam .stack svg { opacity: .55; }
.seat.cam .name { font-size: 12px; }
.seat.cam .stack { font-size: 11.5px; }
.seat.cam .timer { z-index: 3; bottom: 4px; }
.seat.cam .video .mic-state { top: 4px; bottom: auto; }
.seat.cam .video .talk { left: 4px; right: auto; }
.seat.winner.cam .who { background: rgba(240, 164, 34, .3); }

.spotlight {
  position: absolute; left: 50%; top: 40%; z-index: 9; margin: 0;
  width: min(68%, 420px); transform: translate(-50%, -50%);
  border-radius: 18px; overflow: hidden; cursor: zoom-out;
  background: var(--indigo-800);
  box-shadow: 0 0 0 3px var(--mulmul), 0 0 0 6px var(--madder), var(--shadow-lift);
}
.spotlight video { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.spotlight figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 8px 12px 6px; background: rgba(124, 33, 25, .88); color: var(--mulmul);
}
.spot-name { font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.spot-close { font-size: 13px; font-weight: 600; opacity: .85; }

.timer { position: absolute; left: 10px; right: 10px; bottom: 3px; height: 3px; border-radius: 3px; background: rgba(246, 244, 239, .2); overflow: hidden; }
.timer::before { content: ""; position: absolute; inset: 0; background: var(--marigold); transform-origin: left; animation: drain var(--dur, 45s) linear forwards; animation-delay: var(--delay, 0s); }
@keyframes drain { to { transform: scaleX(0); } }

/* opponents' face-down hands resting on the sheet */
.mini { position: absolute; width: calc(var(--mini-w) * 2.2); height: calc(var(--mini-w) * 1.4); transform: translate(-50%, -50%); z-index: 1; transition: left 600ms var(--ease-cloth), top 600ms var(--ease-cloth); }
.mini .card { --card-w: var(--mini-w); position: absolute; left: 50%; top: 0; transition: transform 420ms var(--ease-cloth), opacity var(--t-med); }
.mini .card:nth-child(1) { transform: translateX(-90%) rotate(-12deg); }
.mini .card:nth-child(2) { transform: translateX(-50%); }
.mini .card:nth-child(3) { transform: translateX(-10%) rotate(12deg); }
.mini.peeked .card:nth-child(1) { transform: translateX(-95%) translateY(-4px) rotate(-18deg); }
.mini.peeked .card:nth-child(2) { transform: translateX(-50%) translateY(-6px); }
.mini.peeked .card:nth-child(3) { transform: translateX(-5%) translateY(-4px) rotate(18deg); }
.mini.folded .card { opacity: .0; transform: translateX(-50%) scale(.7) rotate(0); }
.mini.revealed { z-index: 6; --mini-w: 46px; width: 130px; height: 70px; }
.mini.revealed .card:nth-child(1) { transform: translateX(-125%) rotate(-8deg); }
.mini.revealed .card:nth-child(3) { transform: translateX(25%) rotate(8deg); }
.mini.revealed.many { --mini-w: 28px; width: 76px; height: 40px; z-index: 3; }
.mini.revealed.many .card:nth-child(1) { transform: translateX(-118%) rotate(-8deg); }
.mini.revealed.many .card:nth-child(3) { transform: translateX(18%) rotate(8deg); }
.mini.many .hand-name { display: none; }
.mini.many.best .hand-name { display: block; font-size: 13px; }
.mini.many.best .card .face { box-shadow: 0 0 0 2px var(--marigold), 0 3px 8px rgba(0, 0, 0, .18); }
@media (min-width: 720px) { .mini.revealed.many { --mini-w: 40px; width: 110px; height: 58px; } }
.mini .hand-name {
  position: absolute; left: 50%; top: auto; bottom: -10px; transform: translateX(-50%); white-space: nowrap; z-index: 2;
  font-family: var(--font-display); font-size: 15px; color: var(--madder); background: var(--mulmul); padding: 2px 8px 0; border-radius: 6px;
  box-shadow: 0 0 0 1.5px var(--madder);
}
.pending { opacity: 0 !important; }

/* ----------------------------------------------------------- cards */
.card {
  width: var(--card-w); aspect-ratio: 5 / 7;
  perspective: 600px; display: block;
}
.card-in {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 560ms var(--ease-lift);
}
.card.up .card-in { transform: rotateY(180deg); }
.face, .back {
  position: absolute; inset: 0; border-radius: calc(var(--card-w) * .09); backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .18);
}
.back {
  background-color: var(--indigo-800);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cg fill='%23F6F4EF' fill-opacity='.5'%3E%3Ccircle cx='8' cy='8' r='1.3'/%3E%3Cellipse cx='8' cy='4.6' rx='.9' ry='1.5'/%3E%3Cellipse cx='8' cy='11.4' rx='.9' ry='1.5'/%3E%3Cellipse cx='4.6' cy='8' rx='1.5' ry='.9'/%3E%3Cellipse cx='11.4' cy='8' rx='1.5' ry='.9'/%3E%3Ccircle cx='0' cy='0' r='.9'/%3E%3Ccircle cx='16' cy='0' r='.9'/%3E%3Ccircle cx='0' cy='16' r='.9'/%3E%3Ccircle cx='16' cy='16' r='.9'/%3E%3C/g%3E%3C/svg%3E");
  background-size: calc(var(--card-w) * .2) calc(var(--card-w) * .2);
  background-position: center;
  border: calc(var(--card-w) * .06) solid var(--mulmul);
  outline: 1px solid rgba(0, 0, 0, .3); outline-offset: -1px;
}
.back::after { content: ""; position: absolute; inset: calc(var(--card-w) * .05); border: 1px solid rgba(240, 164, 34, .7); border-radius: calc(var(--card-w) * .05); }
.face {
  transform: rotateY(180deg);
  background: #FFFDF8;
  border: 1px solid rgba(27, 33, 82, .22);
  color: var(--ink);
  display: grid;
  font-family: var(--font-ui);
}
.face.red { color: var(--madder); }
.face .corner { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: .9; font-weight: 700; }
.face .corner b { font-size: calc(var(--card-w) * .27); letter-spacing: -0.04em; }
.face .corner svg { width: calc(var(--card-w) * .17); height: calc(var(--card-w) * .17); fill: currentColor; margin-top: 1px; }
.face .tl { left: 6%; top: 5%; }
.face .br { right: 6%; bottom: 5%; transform: rotate(180deg); }
.face .pip { place-self: center; width: 46%; height: 46%; fill: currentColor; }
.face .court { place-self: center; font-family: var(--font-display); font-size: calc(var(--card-w) * .56); line-height: 1; padding-top: 6%; }
.mini .face .corner b { font-size: calc(var(--card-w) * .34); }
.mini .face .pip, .mini .face .court { display: none; }
.mini .face .br { display: none; }
.mini .face .corner svg { width: calc(var(--card-w) * .3); height: calc(var(--card-w) * .3); }

/* ----------------------------------------------------------- thali + deck */
.thali {
  position: absolute; left: 50%; top: 43%; width: 132px; aspect-ratio: 1; transform: translate(-50%, -50%);
  display: grid; place-items: center; z-index: 1;
}
.thali-plate { position: absolute; inset: 0; width: 100%; height: 100%; }
.pot-chips { position: absolute; left: 20%; right: 20%; top: 50%; bottom: 14%; }
.pot-chips svg { position: absolute; width: 24px; height: 24px; filter: drop-shadow(0 1px 1px rgba(60, 40, 8, .45)); }
.pot-amount {
  position: absolute; left: 0; right: 0; top: 25%; text-align: center; pointer-events: none;
  font-family: var(--font-display); font-size: 32px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .6);
  transition: transform var(--t-fast) var(--ease-cloth);
}
.pot-amount.bump { animation: bump 320ms var(--ease-cloth); }
@keyframes bump { 40% { transform: scale(1.14); } }
.pot-meta { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); font-size: 12.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }

.deck { position: absolute; left: calc(50% - 58px); top: calc(43% + 72px); width: 34px; aspect-ratio: 5 / 7; transform: translate(-50%, -50%) rotate(8deg); z-index: 1; transition: opacity var(--t-med); }
.deck i { position: absolute; inset: 0; border-radius: 4px; }
.deck i { background: var(--indigo-800); border: 2px solid var(--mulmul); box-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.deck i:nth-child(2) { transform: translate(-1px, -2px); }
.deck i:nth-child(3) { transform: translate(-2px, -4px); }
.deck.shuffle i:nth-child(3) { animation: riffle 520ms var(--ease-cloth) 2; }
.deck.shuffle i:nth-child(2) { animation: riffle 520ms var(--ease-cloth) 2 reverse; }
@keyframes riffle { 50% { transform: translate(-14px, -6px) rotate(-14deg); } }
.deck.gone { opacity: 0; }

.dealer-coin {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-family: var(--font-display); font-size: 14px; line-height: 1; padding-top: 2px;
  background: var(--brass-light); color: var(--brass-dark); box-shadow: 0 0 0 1.5px var(--brass-dark), 0 2px 4px rgba(60, 40, 8, .35);
}

/* ----------------------------------------------------------- lobby (on the sheet) */
.lobby {
  position: absolute; left: 50%; top: 25%; transform: translateX(-50%);
  width: min(320px, calc(100% - 40px));
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; z-index: 4;
}
.lobby h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.1; color: var(--madder); }
.lobby p { margin: 0; color: var(--ink); font-size: 15px; }
.lobby .linkbox {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 6px 6px 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--ink-soft);
}
.lobby .linkbox code { flex: 1; min-width: 0; font: 500 14px var(--font-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.lobby .linkbox .btn { min-height: 40px; padding: 0 14px; font-size: 15px; }
.lobby .settings { display: grid; gap: 10px; width: 100%; text-align: left; }
.seg-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); letter-spacing: .02em; margin-bottom: 4px; display: block; }
.seg { display: flex; gap: 0; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--ink-soft); padding: 3px; background: rgba(255, 255, 255, .7); }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg button[aria-pressed="true"] { background: var(--indigo-800); color: var(--mulmul); }
.lobby.two-rows { top: 38%; }
.lobby .terms { font-size: 14px; color: var(--ink-soft); }
.lobby .terms b { color: var(--ink); font-weight: 700; }
.lobby .terms .link-btn { padding: 0 2px; font-size: 14px; }
.lobby .demo-add { color: var(--ink); padding-top: 0; }
@media (min-width: 720px) { .lobby { top: 33%; } .lobby.two-rows { top: 52%; } }

/* ----------------------------------------------------------- my seat */
.me { position: absolute; inset: auto 0 0 0; height: 0; z-index: 5; pointer-events: none; }
.me .seat, .me .my-cards:not(:empty), .me-av, .me .hint { pointer-events: auto; }
.my-cards:empty { visibility: hidden; }
.me-seat { position: absolute; left: 8px; bottom: 12px; }
.me-av { position: absolute; left: 8px; bottom: calc(12px + var(--me-seat-h, 108px)); display: flex; gap: 6px; }
.av-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--ink); color: var(--mulmul); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.av-btn[aria-pressed="false"] { background: var(--madder); }
.av-btn .ic { width: 18px; height: 18px; }
.tool.on { background: rgba(46, 125, 67, .55); color: var(--mulmul); }
.tool.on:hover { background: rgba(46, 125, 67, .7); }
.hear-table { position: fixed; left: 50%; top: calc(110px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 55; }
.me-seat .seat.turn .cushion, .me-seat .seat.winner .cushion { transform: translateY(-5px); }
.me-seat .seat { position: relative; transform: none; left: auto; top: auto; width: 84px; }
.me-seat .video { cursor: pointer; }
.me-seat .video:hover .cam-state { color: var(--marigold); opacity: 1; }
.my-hand { position: absolute; left: calc(50% + 40px); bottom: 6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.my-cards {
  --card-w: 74px;
  position: relative; display: flex; justify-content: center; height: calc(var(--card-w) * 1.4 + 10px); width: calc(var(--card-w) * 2.5);
  border: 0; background: none; padding: 0;
}
.my-cards .card { position: absolute; top: 6px; left: 50%; transition: transform 460ms var(--ease-cloth), opacity var(--t-med), filter var(--t-med); }
.my-cards .card:nth-child(1) { transform: translateX(-118%) rotate(-7deg); }
.my-cards .card:nth-child(2) { transform: translateX(-50%) translateY(-6px); }
.my-cards .card:nth-child(3) { transform: translateX(18%) rotate(7deg); }
.my-cards:not(:disabled):hover .card:nth-child(1) { transform: translateX(-122%) translateY(-6px) rotate(-9deg); }
.my-cards:not(:disabled):hover .card:nth-child(2) { transform: translateX(-50%) translateY(-12px); }
.my-cards:not(:disabled):hover .card:nth-child(3) { transform: translateX(22%) translateY(-6px) rotate(9deg); }
.my-cards.lifted .card:nth-child(1) { transform: translateX(-124%) translateY(-18px) rotate(-9deg); }
.my-cards.lifted .card:nth-child(2) { transform: translateX(-50%) translateY(-26px); }
.my-cards.lifted .card:nth-child(3) { transform: translateX(24%) translateY(-18px) rotate(9deg); }
.my-cards.folded .card { filter: grayscale(.8) brightness(.8); opacity: .55; }
.my-cards .card:nth-child(1) .card-in { transition-delay: 0ms; }
.my-cards .card:nth-child(2) .card-in { transition-delay: 90ms; }
.my-cards .card:nth-child(3) .card-in { transition-delay: 180ms; }
.my-cards .hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4;
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 3px; border-radius: 999px;
  background: var(--ink); color: var(--mulmul); font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow-rest);
}
.my-cards .hint svg { width: 16px; height: 16px; }
.my-label { margin: 0; min-height: 1.5em; font-family: var(--font-display); font-size: 19px; line-height: 1.2; color: var(--madder); text-align: center; white-space: nowrap; }
.my-label.quiet { font-family: var(--font-ui); font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* ----------------------------------------------------------- actions */
.actions {
  display: grid; gap: 8px; padding: 6px 12px 12px;
  max-width: 640px; width: 100%; margin: 0 auto;
}
.act-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.act-row.extra { grid-auto-columns: auto; justify-content: center; }
.act-row.extra .btn { min-height: 42px; font-size: 15px; padding: 0 18px; }
.act-row .btn { padding: 0 10px; }
.act-row .btn-pack { background: transparent; color: var(--mulmul); box-shadow: inset 0 0 0 1.5px rgba(246, 244, 239, .55); }
.act-row .btn-pack:hover:not(:disabled) { background: rgba(124, 33, 25, .45); }
.act-row .btn-raise { background: var(--mulmul); color: var(--ink); box-shadow: 0 2px 0 var(--mulmul-shade); }
.act-row .btn .sub { display: block; font-size: 12px; font-weight: 600; opacity: .75; margin-top: 2px; }
.act-row .btn.stacked { flex-direction: column; gap: 0; line-height: 1.05; padding-top: 3px; }
.act-row.off-turn { grid-template-columns: 1fr auto; grid-auto-flow: row; align-items: center; }
.act-row.off-turn .btn-pack { min-width: 104px; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; color: var(--indigo-300); font-size: 15px; text-align: center; }
.waiting b { color: var(--mulmul); font-weight: 600; }

/* ----------------------------------------------------------- announcements */
.announce { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 8; }
.announce:has(.banner) { place-items: end center; padding-bottom: calc(var(--card-w) * 1.4 + 92px); }
.announce .word {
  font-family: var(--font-display); font-size: clamp(48px, 15vw, 96px); line-height: 1; color: var(--madder);
  text-shadow: 0 2px 0 var(--mulmul), 0 0 0 var(--mulmul);
  -webkit-text-stroke: 1px var(--mulmul);
  paint-order: stroke fill;
}
.announce .banner {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  padding: 14px 22px 10px; border-radius: 18px; background: var(--mulmul);
  box-shadow: 0 0 0 2px var(--madder), 0 0 0 6px var(--mulmul), 0 0 0 8px var(--marigold), var(--shadow-lift);
  max-width: min(66%, 380px);
}
.announce .banner .b-who { font-family: var(--font-display); font-size: clamp(22px, 6.4vw, 30px); line-height: 1.05; color: var(--madder); }
.announce .banner .b-what { font-size: 15px; font-weight: 600; color: var(--ink); }
.bet-float {
  position: fixed; z-index: 30; pointer-events: none; transform: translate(-50%, -50%);
  padding: 4px 10px 2px; border-radius: 8px; background: var(--ink); color: var(--mulmul);
  font-size: 13px; font-weight: 700; white-space: nowrap; box-shadow: var(--shadow-rest);
}
.bet-float.raise { background: var(--marigold); color: var(--ink); }
.bet-float.pack { background: var(--mulmul); color: var(--madder); }

/* ----------------------------------------------------------- fx layer */
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.fx .card { position: fixed; left: 0; top: 0; }
.fx .card.up .card-in { transition: none; }
.fx svg.flychip { position: fixed; left: 0; top: 0; width: 22px; height: 22px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.fx .confetti { position: fixed; left: 0; top: 0; width: 8px; height: 12px; border-radius: 1.5px; will-change: transform; backface-visibility: visible; }
.fx .confetti.dot { width: 7px; height: 7px; border-radius: 50%; }
.fx .confetti.strip { width: 4px; height: 18px; border-radius: 2px; }
.fx .ring { position: fixed; left: 0; top: 0; border: 3px solid; border-radius: 50%; }
/* Turn ribbon: hangs from the active cushion until that player acts. */
.turn-ribbon {
  position: absolute; left: 50%; top: calc(100% + 5px); z-index: 4; transform: translateX(-50%);
  padding: 4px 11px 2px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font-family: var(--font-display); font-size: 14px; line-height: 1.15;
  background: var(--ink); color: var(--mulmul);
  box-shadow: inset 0 0 0 1.5px var(--marigold), 0 4px 10px rgba(0, 0, 0, .22);
  animation: ribbon-in 420ms var(--ease-cloth) both;
}
.turn-ribbon.mine {
  /* clears the fan even when seen cards lift (-26px) and hover (-12px) */
  top: auto; bottom: calc(100% + 40px);
  padding: 5px 14px 3px; font-size: 18px;
  background: var(--marigold); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--madder), 0 4px 10px rgba(0, 0, 0, .22);
}
@keyframes ribbon-in { from { opacity: 0; transform: translateX(-50%) scale(.5); } 70% { transform: translateX(-50%) scale(1.06); } }
.fx .spark { position: fixed; left: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--marigold); }

/* ----------------------------------------------------------- prompt + toast */
.prompt {
  position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  width: min(360px, calc(100% - 32px)); padding: 16px 16px 14px; border-radius: 18px;
  background: var(--mulmul); color: var(--ink); box-shadow: 0 0 0 2px var(--madder), var(--shadow-lift);
  animation: rise 360ms var(--ease-cloth);
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 16px); } }
.prompt-title { margin: 0; font-family: var(--font-display); font-size: 24px; color: var(--madder); line-height: 1.1; }
.prompt-body { margin: 4px 0 12px; font-size: 15px; }
.prompt .row .btn { flex: 1; }
.prompt .btn-ghost { color: var(--ink); }
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 60;
  padding: 10px 16px 8px; border-radius: 12px; background: var(--mulmul); color: var(--ink); font-weight: 600; font-size: 15px;
  box-shadow: 0 0 0 1.5px var(--madder), var(--shadow-lift); max-width: calc(100% - 32px); text-align: center;
  animation: rise-top 300ms var(--ease-cloth);
}
@keyframes rise-top { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ----------------------------------------------------------- sheets (dialogs) */
.sheet-dlg {
  width: min(560px, 100%); max-height: min(86dvh, 760px); margin: auto auto 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0;
  background: var(--mulmul); color: var(--ink);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.sheet-dlg[open] { display: flex; flex-direction: column; animation: sheet-up 380ms var(--ease-cloth); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-dlg::backdrop { background: rgba(16, 22, 58, .62); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 6px 20px; border-bottom: 1.5px dashed rgba(164, 50, 42, .35); }
.dlg-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; color: var(--madder); line-height: 1.1; padding-top: 4px; }
.dlg-body { padding: 14px 20px 24px; overflow-y: auto; overflow-x: hidden; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.dlg-body h3 { margin: 10px 0 -4px; font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.dlg-body p { margin: 0; }
.dlg-body .muted { color: var(--ink-soft); font-size: 14px; }

.give-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.give-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid rgba(27, 33, 82, .1); }
.give-list .pname { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.give-list .pname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.give-list .pstack { color: var(--ink-soft); font-size: 14px; font-variant-numeric: tabular-nums; }
.give-list .zero { color: var(--madder); font-weight: 700; }
.give-btns { display: flex; gap: 6px; }
.give-btns button { min-height: 40px; min-width: 56px; border: 0; border-radius: 10px; background: var(--indigo-800); color: var(--mulmul); font-weight: 600; font-variant-numeric: tabular-nums; }
.give-btns button:hover { background: var(--indigo-600); }
.give-btns button.soft { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-soft); }
.give-list.asks li { background: rgba(240, 164, 34, .16); border-radius: 10px; padding: 10px 12px; border-bottom: 0; }
.give-custom { display: flex; gap: 8px; }
.give-custom input { flex: 1; min-width: 0; min-height: 44px; border: 1.5px solid var(--ink-soft); border-radius: 10px; padding: 0 12px; font: 500 16px var(--font-ui); color: var(--ink); background: #fff; }
.give-custom select { min-height: 44px; border: 1.5px solid var(--ink-soft); border-radius: 10px; padding: 0 8px; font: 500 15px var(--font-ui); color: var(--ink); background: #fff; max-width: 45%; }
.give-custom .btn { min-height: 44px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-weight: 600; }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 28px; background: var(--mulmul-shade); box-shadow: inset 0 0 0 1.5px var(--ink-soft); position: relative; cursor: pointer; transition: background-color var(--t-fast); flex: none; }
.switch input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink-soft); transition: transform var(--t-fast) var(--ease-cloth), background-color var(--t-fast); }
.switch input:checked { background: var(--marigold); box-shadow: inset 0 0 0 1.5px var(--marigold-deep); }
.switch input:checked::after { transform: translateX(20px); background: var(--ink); }

.ledger { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ledger th { text-align: right; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); padding: 4px 0 8px; }
.ledger th:first-child, .ledger td:first-child { text-align: left; }
.ledger td { text-align: right; padding: 10px 0; border-top: 1px solid rgba(27, 33, 82, .1); }
.ledger td:first-child { font-weight: 600; }
.ledger .up { color: var(--leaf); font-weight: 700; }
.ledger .down { color: var(--madder); font-weight: 700; }

.rules .ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: r; }
.rules .ranks li { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 12px; }
.rules .ranks .ex { position: relative; height: 46px; }
.rules .ranks .ex .card { --card-w: 32px; position: absolute; top: 0; }
.rules .ranks .ex .card:nth-child(1) { left: 0; } .rules .ranks .ex .card:nth-child(2) { left: 28px; } .rules .ranks .ex .card:nth-child(3) { left: 56px; }
.rules .ranks .ex .face .pip, .rules .ranks .ex .face .court, .rules .ranks .ex .face .br { display: none; }
.rules .ranks .ex .face .corner b { font-size: 11px; }
.rules .ranks .ex .face .corner svg { width: 9px; height: 9px; }
.rules .ranks b.rk { font-family: var(--font-display); font-weight: 400; font-size: 19px; color: var(--madder); display: block; line-height: 1.1; padding-top: 3px; }
.rules .ranks span.d { font-size: 14px; color: var(--ink-soft); }
.rules dl { margin: 0; display: grid; gap: 10px; }
.rules dt { font-weight: 700; }
.rules dd { margin: 0; color: var(--ink); font-size: 15px; max-width: 62ch; }

/* ----------------------------------------------------------- wider screens */
@media (min-width: 720px) {
  :root { --card-w: 96px; --mini-w: 30px; }
  .video { aspect-ratio: 4 / 3; }
  .seat.cam .video { aspect-ratio: 1 / 1; }
  .seat.cam .name { font-size: 14px; }
  .turn-ribbon { font-size: 16px; }
  .turn-ribbon.mine { font-size: 20px; }
  .seat.cam .stack { font-size: 13px; }
  .spotlight { width: min(36%, 460px); }
  .spotlight video { aspect-ratio: 4 / 3; }
  .seat { width: 120px; }
  .name { font-size: 15px; }
  .stack { font-size: 14px; }
  .initials { font-size: 30px; }
  .thali { width: 180px; }
  .pot-amount { font-size: 40px; }
  .pot-chips svg { width: 30px; height: 30px; }
  .deck { width: 44px; left: calc(50% - 130px); top: calc(43% + 70px); }
  .me-seat { left: auto; right: calc(50% + 150px); bottom: 16px; }
  .me-av { left: auto; right: calc(50% + 150px); bottom: calc(16px + 168px); }
  .av-btn { width: 40px; height: 40px; }
  .me-seat .seat { width: 132px; }
  .my-hand { left: 50%; bottom: 8px; }
  .my-cards { --card-w: 100px; }
  .my-label { font-size: 22px; }
  .table { padding: 4px 16px 0; }
  .tool { flex-direction: row; gap: 6px; font-size: 14px; padding: 0 12px; }
  .room-bar { grid-template-columns: auto 1fr auto; grid-template-areas: "code strip tools"; padding: 10px 16px 8px; gap: 16px; }
  .strip { font-size: 15px; }
  .pot-amount { top: 24%; }
  .pot-meta { font-size: 14px; }
  .mini.revealed { --mini-w: 56px; width: 160px; height: 84px; }
}
@media (min-width: 1100px) {
  .seat { width: 132px; }
  .thali { width: 200px; }
}
@media (max-height: 700px) and (max-width: 719px) {
  :root { --mini-w: 18px; }
  .seat { width: 74px; }
  .video { aspect-ratio: 16 / 10; }
  .my-cards { --card-w: 60px; }
  .thali { width: 112px; }
}
@media (max-width: 440px) {
  .tool span { display: none; }
  .tool { min-width: 42px; }
  .bar-tools { gap: 0; }
}

/* ----------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .timer::before { animation-duration: var(--dur, 45s) !important; }
}
