/* Pocket Table — soft premium lounge */
:root {
  --cream: #F7F2E9;
  --cream-2: #FCFAF5;
  --beige: #EADFCB;
  --beige-2: #F1E8D8;
  --sage: #A9BA9D;
  --sage-soft: #DFE7D7;
  --forest: #3E5B48;
  --forest-deep: #2C4335;
  --felt: #557461;
  --gold: #C8A96A;
  --gold-deep: #A8884A;
  --gold-soft: #EEDFBE;
  --blush: #E6BFB6;
  --blush-soft: #F6E4DF;
  --ink: #2C3630;
  --muted: #7B8379;
  --line: rgba(62, 91, 72, 0.12);
  --danger: #B5655A;
  --card-red: #B8574D;
  --card-black: #2C3630;
  --shadow-sm: 0 1px 2px rgba(44, 54, 48, 0.06), 0 2px 8px rgba(44, 54, 48, 0.05);
  --shadow: 0 2px 6px rgba(44, 54, 48, 0.06), 0 12px 32px rgba(44, 54, 48, 0.08);
  --shadow-lg: 0 8px 24px rgba(44, 54, 48, 0.10), 0 30px 80px rgba(44, 54, 48, 0.14);
  --radius: 20px;
  --radius-sm: 12px;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { overflow-x: clip; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(233, 198, 190, 0.35), transparent 60%),
    radial-gradient(900px 600px at 110% 10%, rgba(169, 186, 157, 0.30), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--forest); }
html { font-variant-numeric: lining-nums; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Buttons & inputs ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; letter-spacing: .01em;
  background: var(--forest); color: var(--cream-2);
  box-shadow: 0 6px 16px rgba(62, 91, 72, 0.22);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, opacity .18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(62, 91, 72, 0.26); }
.btn:active { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.gold { background: linear-gradient(180deg, #D4B77C, var(--gold)); color: #2C3022; box-shadow: 0 6px 16px rgba(168, 136, 74, 0.28); }
.btn.soft { background: var(--cream-2); color: var(--forest); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--forest); box-shadow: none; border: 1px solid var(--line); }
.btn.blush { background: var(--blush-soft); color: #8A4F45; box-shadow: none; border: 1px solid rgba(181, 101, 90, .18); }
.btn.sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn {
  appearance: none; border: 1px solid var(--line); background: var(--cream-2); cursor: pointer;
  height: 40px; min-width: 40px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  color: var(--forest); font-weight: 500; font-size: 14px; box-shadow: var(--shadow-sm); transition: background .15s;
}
.icon-btn:hover { background: #fff; }
.icon-btn svg { width: 18px; height: 18px; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--cream-2);
  outline: none; transition: border .15s, box-shadow .15s;
}
.input:focus { border-color: var(--sage); box-shadow: 0 0 0 4px rgba(169, 186, 157, .3); }
.input.code { text-transform: uppercase; letter-spacing: .3em; font-weight: 600; text-align: center; font-size: 18px; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--beige-2); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button {
  appearance: none; border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left;
  transition: background .2s, box-shadow .2s; color: var(--muted);
}
.seg button.on { background: var(--cream-2); box-shadow: var(--shadow-sm); color: var(--ink); }
.seg button b { display: block; font-size: 14px; color: var(--ink); }
.seg button small { font-size: 12px; }

.stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stepper:last-child { border-bottom: 0; }
.stepper .lbl b { display: block; font-weight: 500; }
.stepper .lbl small { color: var(--muted); font-size: 12.5px; }
.stepper .ctl { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.stepper .ctl button {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--cream-2); cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--forest); display: grid; place-items: center;
}
.stepper .ctl button:disabled { opacity: .35; cursor: default; }
.stepper .ctl .val { min-width: 44px; text-align: center; font-weight: 600; font-size: 17px; }
.stepper .ctl input.input { width: 96px; height: 38px; text-align: center; padding: 0 8px; }

/* ---------- Layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.card-panel { background: rgba(252, 250, 245, .86); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--forest-deep); }
.brand .mark { width: 32px; height: 32px; }
.brand b { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .01em; }

/* ---------- Home ---------- */
.home { padding: 28px 0 60px; }
.home header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(44px, 6vw, 76px); line-height: .98; margin: 0 0 18px; color: var(--forest-deep); letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--gold-deep); font-weight: 500; }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 440px; margin: 0 0 26px; }
.hero-art { position: relative; height: 230px; margin-top: 10px; }
.hero-art .mini-table {
  position: absolute; inset: 20px 6% 0; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #6E8E77, var(--felt) 55%, #46634F);
  border: 10px solid #E3D3B3; box-shadow: inset 0 0 0 2px rgba(200, 169, 106, .6), inset 0 10px 40px rgba(0,0,0,.25), var(--shadow);
}
.hero-art .fan { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); display: flex; }
.hero-art .fan .pcard { margin: 0 -10px; }
.hero-art .fan .pcard:nth-child(1) { transform: rotate(-14deg) translateY(8px); }
.hero-art .fan .pcard:nth-child(2) { transform: rotate(-5deg); }
.hero-art .fan .pcard:nth-child(3) { transform: rotate(5deg); }
.hero-art .fan .pcard:nth-child(4) { transform: rotate(14deg) translateY(8px); }
.hero-art .chip-stack { position: absolute; }
.forms { display: grid; gap: 18px; }
.forms h2 { font-family: var(--serif); font-size: 28px; margin: 0 0 4px; font-weight: 600; color: var(--forest-deep); }
.forms .sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 44px; }
.feature { padding: 18px 20px; border-radius: var(--radius); background: rgba(252,250,245,.6); border: 1px solid var(--line); }
.feature b { font-family: var(--serif); font-size: 20px; display: block; color: var(--forest-deep); }
.feature span { color: var(--muted); font-size: 14px; }
.tabs-mini { display: flex; gap: 6px; margin-bottom: 16px; }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); color: #5E4B22; font-size: 13.5px; margin: 6px 0 14px; }
.notice.sage { background: var(--sage-soft); color: var(--forest-deep); }
.notice.blush { background: var(--blush-soft); color: #7C463D; }
.notice svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

/* ---------- Room chrome ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; max-width: 1200px; margin: 0 auto; }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; background: var(--sage-soft); color: var(--forest-deep); white-space: nowrap; }
.pill.gold { background: var(--gold-soft); color: #6B5527; }
.pill.blush { background: var(--blush-soft); color: #7C463D; }
.pill.code { letter-spacing: .18em; cursor: pointer; background: var(--cream-2); border: 1px solid var(--line); }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; background: #9BB58E; display: inline-block; }
.conn-dot.off { background: #D5A89F; }

/* ---------- Lobby ---------- */
.lobby { max-width: 980px; margin: 8px auto 60px; padding: 0 20px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.lobby h1 { font-family: var(--serif); font-size: 40px; margin: 0; font-weight: 600; color: var(--forest-deep); line-height: 1.05; }
.invite { text-align: center; padding: 28px 24px; }
.invite .codebox { font-family: var(--serif); font-size: 54px; letter-spacing: .14em; font-weight: 600; color: var(--forest-deep); margin: 6px 0 4px; }
.invite .link { display: flex; gap: 8px; margin-top: 14px; }
.invite .link .input { font-size: 13px; color: var(--muted); }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); animation: fadeUp .4s var(--ease) both; }
.plist li:last-child { border-bottom: 0; }
.plist .grow { flex: 1; min-width: 0; }
.plist .name { font-weight: 600; }
.plist .meta { font-size: 12.5px; color: var(--muted); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 15px; flex-shrink: 0; box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), 0 2px 6px rgba(44,54,48,.12); position: relative; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--cream-2); background: #9BB58E; }
.avatar .dot.off { background: #D5A89F; }
.rules-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.rules-summary div { background: var(--beige-2); border-radius: 14px; padding: 10px 12px; }
.rules-summary small { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.rules-summary b { font-size: 18px; font-weight: 600; }
.section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-title h3 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; color: var(--forest-deep); }

/* ---------- Table ---------- */
.game { max-width: 1440px; margin: 0 auto; padding: 0 16px 150px; }
.table-area { position: relative; width: 100%; max-width: min(1340px, max(640px, calc((100vh - 300px) * 1.8))); margin: 10px auto 0; aspect-ratio: 16 / 9; }
.felt {
  position: absolute; inset: 8% 6%; border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255,255,255,.12), transparent 55%),
    radial-gradient(ellipse at 50% 50%, #658670 0%, var(--felt) 55%, #46634F 100%);
  box-shadow: 0 0 0 12px #E3D3B3, 0 0 0 14px rgba(200, 169, 106, .75), 0 0 0 22px #EFE4CF, var(--shadow-lg), inset 0 12px 50px rgba(0,0,0,.28);
}
.felt::after { content: ''; position: absolute; inset: 7%; border-radius: 50%; border: 1.5px solid rgba(238, 223, 190, .22); }
.felt .watermark { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-family: var(--serif); font-style: italic; color: rgba(247, 242, 233, .22); font-size: clamp(16px, 2.4vw, 26px); letter-spacing: .04em; white-space: nowrap; }
.center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: 70%; z-index: 2; }
.board { display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; min-height: 10px; }
.pot { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; background: rgba(44, 67, 53, .55); color: var(--cream); border-radius: 999px; font-weight: 600; font-size: 14px; backdrop-filter: blur(4px); }
.pot.bump { animation: bump .45s var(--ease); }
.street { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(247, 242, 233, .7); font-weight: 600; }
.center .between { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--cream); text-align: center; }
.center .between p { margin: 0; font-size: 14px; opacity: .85; }

.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: 150px; z-index: 3; transition: opacity .3s; }
.seat .plate {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  background: rgba(252, 250, 245, .96); box-shadow: var(--shadow); border: 1px solid var(--line); min-width: 120px; position: relative;
  transition: box-shadow .3s, transform .3s var(--ease);
}
.seat .plate .avatar { width: 40px; height: 40px; font-size: 14px; }
.seat .plate .info { min-width: 0; line-height: 1.15; }
.seat .plate .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px; }
.seat .plate .ch { font-size: 12.5px; color: var(--muted); }
.seat.turn .plate { box-shadow: 0 0 0 3px var(--gold), 0 8px 24px rgba(168, 136, 74, .35); transform: translateY(-2px); }
.seat.folded { opacity: .5; }
.seat.out { opacity: .45; }
.seat .hole { display: flex; justify-content: center; margin-bottom: -10px; height: 52px; position: relative; z-index: -1; }
.seat .hole .pcard { margin: 0 -9px; }
.seat .hole .pcard:nth-child(odd) { transform: rotate(-6deg); }
.seat .hole .pcard:nth-child(even) { transform: rotate(6deg); }
.seat .tag { position: absolute; top: -13px; right: -10px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--forest); color: var(--cream); letter-spacing: .04em; text-transform: uppercase; animation: pop .3s var(--ease); }
.seat .tag.fold { background: #B9B1A3; }
.seat .tag.allin { background: var(--blush); color: #6E3A31; }
.seat .tag.win { background: var(--gold); color: #2C3022; }
.seat .timer { position: absolute; left: 10px; right: 10px; bottom: -5px; height: 3px; border-radius: 3px; background: rgba(200,169,106,.25); overflow: hidden; }
.seat .timer i { display: block; height: 100%; background: var(--gold); width: 100%; transform-origin: left; }
.dealer-btn { position: absolute; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #F3E7CC); color: var(--forest-deep); font-family: var(--serif); font-size: 16px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); border: 2px solid var(--gold-soft); z-index: 4; transform: translate(-50%, -50%); transition: left .6s var(--ease), top .6s var(--ease); }
.bet { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 5px; z-index: 2; color: var(--cream); font-weight: 600; font-size: 12.5px; animation: chipIn .4s var(--ease); text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.blind-tag { font-size: 10px; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }

/* Chips */
.chip { width: 18px; height: 18px; border-radius: 50%; display: inline-block; position: relative; flex-shrink: 0;
  background: var(--c, #C8A96A); border: 2.5px dashed rgba(255, 255, 255, .85);
  box-shadow: inset 0 0 0 2px var(--c, #C8A96A), 0 1px 2px rgba(0,0,0,.3); }
.chip.stack { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--c, #C8A96A), 0 2px 0 rgba(0,0,0,.2), 0 3px 0 var(--c, #C8A96A), 0 5px 0 rgba(0,0,0,.2), 0 6px 0 var(--c, #C8A96A), 0 7px 3px rgba(0,0,0,.3); }
.chip.green { --c: #5E8A6B; }
.chip.blush { --c: #D08D80; }
.chip.cream { --c: #E6D6B5; }

/* Playing cards */
.pcard {
  --w: 44px; width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .14);
  background: linear-gradient(180deg, #FFFEFB, #F6F0E4); box-shadow: 0 1px 1px rgba(0,0,0,.08), 0 4px 10px rgba(30, 40, 34, .18);
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0;
  font-weight: 600; color: var(--card-black); border: 1px solid rgba(44, 54, 48, .08); user-select: none;
}
.pcard .r { font-family: var(--serif); font-size: calc(var(--w) * .5); line-height: .9; font-weight: 700; }
.pcard .s { font-size: calc(var(--w) * .36); line-height: 1; }
.pcard .corner { position: absolute; top: calc(var(--w) * .06); left: calc(var(--w) * .1); font-size: calc(var(--w) * .2); line-height: 1; display: flex; flex-direction: column; align-items: center; font-family: var(--serif); font-weight: 700; }
.pcard.red { color: var(--card-red); }
.pcard.back { background: repeating-linear-gradient(45deg, #5F8069 0 5px, #557461 5px 10px); border: 3px solid #FBF7EE; }
.pcard.back::after { content: ''; position: absolute; inset: 4px; border-radius: calc(var(--w) * .08); border: 1px solid rgba(238, 223, 190, .5); }
.pcard.slot { background: rgba(247, 242, 233, .08); border: 1.5px dashed rgba(247, 242, 233, .25); box-shadow: none; }
.pcard.sm { --w: 32px; }
.pcard.md { --w: 52px; }
.pcard.lg { --w: 70px; }
.pcard.xl { --w: 84px; }
.pcard.win { box-shadow: 0 0 0 2.5px var(--gold), 0 6px 16px rgba(168, 136, 74, .45); transform: translateY(-4px); }
.pcard.dim { opacity: .45; filter: saturate(.6); }
.pcard.deal { animation: deal .5s var(--ease) both; }
.board .pcard.deal { animation: flip .55s var(--ease) both; }

/* My hand dock */
.dock { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; flex-wrap: wrap; }
.dock .mycards { display: flex; gap: 6px; }
.dock .mycards .pcard:hover { transform: translateY(-6px); transition: transform .2s var(--ease); }
.dock .handname { font-family: var(--serif); font-size: 22px; color: var(--forest-deep); font-weight: 600; }
.dock .hint { font-size: 12.5px; color: var(--muted); }

/* Action bar */
.actionbar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(760px, calc(100% - 24px));
  background: rgba(252, 250, 245, .96); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg);
  padding: 14px; z-index: 20; animation: slideUp .35s var(--ease);
}
.actionbar .status { text-align: center; color: var(--muted); font-size: 14px; padding: 0; }
.actionbar.compact { width: auto; padding: 11px 24px; border-radius: 999px; }
.actionbar .row { display: flex; gap: 10px; align-items: center; }
.actionbar .row .btn { flex: 1; height: 50px; }
.actionbar .raise { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.actionbar .raise input[type=range] { flex: 1; accent-color: var(--forest); }
.actionbar .raise .input { width: 110px; height: 40px; text-align: center; }
.actionbar .presets { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.actionbar .presets button { appearance: none; border: 1px solid var(--line); background: var(--beige-2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-weight: 500; }
.actionbar .presets button:hover { background: var(--gold-soft); }
.actionbar .yourturn { font-family: var(--serif); font-size: 19px; color: var(--forest-deep); text-align: center; margin: -4px 0 6px; font-weight: 600; }

.log { max-width: 760px; margin: 22px auto 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.log span b { color: var(--ink); font-weight: 600; }

/* ---------- Modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(44, 54, 48, .28); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .25s ease; }
.modal { background: var(--cream-2); border-radius: 26px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: rise .35s var(--ease); position: relative; }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; position: sticky; top: 0; background: var(--cream-2); z-index: 2; }
.modal-head h2 { margin: 0; font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--forest-deep); }
.modal-body { padding: 8px 24px 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 24px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--cream-2); }
.close { appearance: none; border: 0; background: var(--beige-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--forest); }
.tabs { display: flex; gap: 4px; background: var(--beige-2); padding: 4px; border-radius: 14px; margin-bottom: 16px; overflow-x: auto; }
.tabs button { appearance: none; border: 0; background: transparent; padding: 8px 14px; border-radius: 10px; cursor: pointer; font-weight: 500; color: var(--muted); white-space: nowrap; flex: 1; }
.tabs button.on { background: var(--cream-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.presets-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chipbtn { appearance: none; border: 1px solid var(--line); background: var(--cream-2); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 13.5px; }
.chipbtn.on { background: var(--forest); color: var(--cream-2); border-color: var(--forest); }
.preview { padding: 14px 16px; border-radius: 16px; background: var(--sage-soft); color: var(--forest-deep); margin: 14px 0 4px; font-size: 14px; }
.preview.bad { background: var(--blush-soft); color: #7C463D; }
.group { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 4px 16px; margin-bottom: 14px; }
.group-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 2px 8px; }

/* Bank */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat small { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat.hl { background: var(--forest); color: var(--cream-2); border-color: var(--forest); }
.stat.hl small { color: rgba(247,242,233,.7); }
.stat.warn b { color: var(--danger); }
.bank-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.bank-actions .box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.bank-actions .box h4 { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--forest-deep); }
.bank-actions .box p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.bank-actions .inline { display: flex; gap: 8px; }
.bank-actions .inline .input { height: 44px; }
.quick { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.quick button { appearance: none; border: 1px solid var(--line); background: var(--beige-2); border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 8px 8px; border-bottom: 1px solid var(--line); }
table.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list td.r, table.list th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.list tr:last-child td { border-bottom: 0; }
.tx-type { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; text-transform: capitalize; }
.tx-loan { background: var(--gold-soft); color: #6B5527; }
.tx-repay { background: var(--sage-soft); color: var(--forest-deep); }
.tx-interest { background: var(--blush-soft); color: #7C463D; }
.tx-buyin { background: var(--beige-2); color: var(--muted); }
.pos { color: #4E7A5A; }
.neg { color: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 24px 0; font-size: 14px; }
.scroll-x { overflow-x: auto; }

/* Results */
.result-hero { text-align: center; padding: 6px 0 14px; }
.result-hero .crown { font-size: 34px; }
.result-hero h3 { font-family: var(--serif); font-size: 34px; margin: 4px 0 2px; color: var(--forest-deep); font-weight: 600; }
.result-hero p { margin: 0; color: var(--muted); }
.result-board { display: flex; justify-content: center; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.result-row:last-child { border-bottom: 0; }
.result-row .cards { display: flex; gap: 4px; }
.result-row .grow { flex: 1; min-width: 0; }
.result-row.winner .name { color: var(--gold-deep); }
.pots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }

/* Toasts */
#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--forest-deep); color: var(--cream); padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); animation: toastIn .3s var(--ease); }
.toast.err { background: #8A4F45; }

.banner { max-width: 760px; margin: 10px auto 0; }
.reconnecting { position: fixed; top: 0; left: 0; right: 0; text-align: center; padding: 6px; background: var(--blush-soft); color: #7C463D; font-size: 13px; z-index: 60; }

/* ---------- Animations ---------- */
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 30px); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes bump { 40% { transform: scale(1.12); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }
@keyframes chipIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.5); } }
@keyframes deal { from { opacity: 0; transform: translate(0, -40px) rotate(-20deg) scale(.6); } }
@keyframes flip { 0% { opacity: 0; transform: rotateY(90deg) translateY(-10px); } 100% { opacity: 1; transform: rotateY(0); } }
@keyframes glow { 50% { box-shadow: 0 0 0 4px rgba(200,169,106,.45), 0 8px 24px rgba(168, 136, 74, .35); } }
.seat.turn .plate { animation: glow 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero-art { height: 170px; }
  .features { grid-template-columns: 1fr; }
  .lobby { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .topbar { padding: 10px 12px; }
  .topbar .hide-sm { display: none; }
  .icon-btn { height: 36px; min-width: 36px; padding: 0 10px; font-size: 13px; }
  .table-area { aspect-ratio: 3 / 4.2; margin-top: 4px; max-width: min(100%, max(320px, calc((100svh - 250px) * .72))); }
  .game { padding-bottom: 210px; }
  .dock { margin-top: 8px; gap: 12px; }
  .felt { inset: 9% 10%; box-shadow: 0 0 0 9px #E3D3B3, 0 0 0 11px rgba(200, 169, 106, .75), 0 0 0 16px #EFE4CF, var(--shadow-lg), inset 0 12px 40px rgba(0,0,0,.28); }
  .seat { width: 100px; }
  .seat .plate { min-width: 0; padding: 4px 9px 4px 4px; gap: 6px; }
  .seat .plate .avatar { width: 28px; height: 28px; font-size: 11px; }
  .seat .plate .nm { font-size: 12px; max-width: 56px; }
  .seat .plate .ch { font-size: 11.5px; }
  .seat .hole { height: 40px; }
  .seat .hole .pcard { --w: 25px; margin: 0 -7px; }
  .center { width: 78%; gap: 6px; }
  .board .pcard { --w: 34px; }
  .board { gap: 3px; }
  .pcard.lg { --w: 58px; }
  .bet { font-size: 11.5px; }
  .modal { border-radius: 22px; }
  .modal-head { padding: 18px 18px 6px; }
  .modal-head h2 { font-size: 26px; }
  .modal-body { padding: 6px 18px 20px; }
  .modal-foot { padding: 12px 18px 18px; }
  .overlay { padding: 10px; align-items: flex-end; }
  .bank-actions { grid-template-columns: 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .rules-summary { grid-template-columns: 1fr 1fr; }
  .invite .codebox { font-size: 42px; }
  .lobby h1 { font-size: 32px; }
  .actionbar { padding: 12px; border-radius: 22px; }
  .actionbar .row .btn { height: 48px; padding: 0 10px; }
}

/* ---------- Photos, dealer, chat, sound ---------- */
.avatar { overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar.xl { width: 96px; height: 96px; font-size: 32px; font-family: var(--serif); }
.profile { display: flex; gap: 18px; align-items: center; padding: 6px 0 4px; }
.me-btn { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.me-btn .avatar { width: 38px; height: 38px; font-size: 13px; box-shadow: 0 0 0 2px var(--cream-2), 0 0 0 3px var(--line); }
.linkish { appearance: none; border: 0; background: none; color: var(--gold-deep); font-weight: 600; font-size: 12.5px; cursor: pointer; padding: 0 0 0 4px; text-decoration: underline; text-underline-offset: 2px; }
.chat-btn { position: relative; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; animation: pop .3s var(--ease); }
.dealer-tag { margin-top: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: linear-gradient(180deg, #D9BD84, var(--gold)); color: #2C3022; box-shadow: 0 2px 8px rgba(168, 136, 74, .35); animation: pop .35s var(--ease); }
.seat.is-dealer .plate { border-color: rgba(200, 169, 106, .7); }
.bubble { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 14px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 200px; width: max-content; z-index: 6; animation: bubbleIn 6s ease forwards; pointer-events: none; }
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
@keyframes bubbleIn { 0% { opacity: 0; transform: translate(-50%, 6px); } 6% { opacity: 1; transform: translate(-50%, 0); } 88% { opacity: 1; } 100% { opacity: 0; } }
.chat-panel { position: fixed; top: 76px; right: 16px; bottom: 16px; width: 340px; z-index: 40; background: rgba(252, 250, 245, .97); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: chatIn .3s var(--ease); }
@keyframes chatIn { from { opacity: 0; transform: translateX(20px); } }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.chat-head b { font-size: 22px; color: var(--forest-deep); font-weight: 600; }
.chat-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.msg .avatar { width: 28px; height: 28px; font-size: 11px; }
.msg .meta { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.msg .text { background: #fff; border: 1px solid var(--line); padding: 8px 12px; border-radius: 16px 16px 16px 4px; font-size: 14px; word-wrap: break-word; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; }
.msg.mine .meta { text-align: right; }
.msg.mine .text { background: var(--forest); color: var(--cream-2); border-color: var(--forest); border-radius: 16px 16px 4px 16px; }
.chat-quick { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; }
.chat-quick button { appearance: none; border: 1px solid var(--line); background: var(--beige-2); border-radius: 999px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px 12px; }
.chat-form .input { height: 44px; }
.switch { appearance: none; border: 0; width: 46px; height: 28px; border-radius: 999px; background: #D8D1C2; position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch.on { background: var(--forest); }
.switch.on i { transform: translateX(18px); }
.seg.seg3 button { padding: 9px 10px; }
.seg button:disabled { cursor: default; }
@media (max-width: 640px) {
  .chat-panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 72vh; border-radius: 22px; animation: rise .3s var(--ease); }
  .me-btn .avatar { width: 34px; height: 34px; }
  .topbar .right { gap: 6px; }
  .dealer-tag { font-size: 9px; padding: 2px 7px; margin-top: 3px; letter-spacing: .08em; }
  .dealer-btn { width: 24px; height: 24px; font-size: 13px; }
  .seg.seg3 { grid-auto-flow: row; }
  .profile { flex-direction: column; text-align: center; }
  .bubble { max-width: 140px; font-size: 12px; }
}

/* Desktop: your cards and the betting controls sit side by side under the table. */
@media (min-width: 1000px) {
  .console { display: flex; align-items: center; justify-content: center; gap: 32px; margin-top: 12px; }
  .console .dock { margin-top: 0; flex-wrap: nowrap; }
  .console .actionbar { position: static; transform: none; width: 520px; animation: fadeUp .3s var(--ease); flex-shrink: 0; }
  .console .actionbar.compact { width: auto; }
  .game { padding-bottom: 40px; }
}

@media (min-width: 900px) {
  body.chat-open .game, body.chat-open .lobby, body.chat-open .topbar { margin-right: 372px; transition: margin .3s var(--ease); }
  body.chat-open .chat-panel { top: 16px; }
}

/* ---------- Round 3: boards, jokers, choices, standings ---------- */
.boards { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.board { align-items: flex-end; }
.slotwrap { position: relative; display: inline-flex; flex-direction: column; align-items: center; }
.rv { position: absolute; bottom: -15px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: rgba(247, 242, 233, .8); }
.rv.dark { color: var(--muted); bottom: -16px; }
.blabel { align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: rgba(247, 242, 233, .65); font-weight: 700; margin-right: 4px; }
.blabel.dark { color: var(--muted); }
.center.multi { gap: 8px; }
.center.multi .board .pcard { --w: 44px; }
.center-extras { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.joker-box { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border-radius: 14px; background: rgba(44, 67, 53, .5); color: var(--cream); backdrop-filter: blur(4px); line-height: 1.15; }
.joker-box b { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-soft); }
.joker-box small { font-size: 12px; opacity: .9; }
.joker-box .pcard { --w: 28px; }
.joker-ind:not(.back) { box-shadow: 0 0 0 2px var(--gold), 0 4px 12px rgba(200, 169, 106, .5); }
.fees { font-size: 11.5px; color: rgba(247, 242, 233, .8); background: rgba(44, 67, 53, .45); padding: 5px 10px; border-radius: 999px; }
.pcard.pickable, .joker-box.pickable { cursor: pointer; animation: pulseGold 1.2s ease-in-out infinite; }
.pcard.pickable:hover { transform: translateY(-5px); }
@keyframes pulseGold { 0%, 100% { box-shadow: 0 0 0 2px rgba(200,169,106,.9), 0 4px 10px rgba(30,40,34,.2); } 50% { box-shadow: 0 0 0 4px rgba(238,223,190,1), 0 6px 18px rgba(200,169,106,.6); } }
.pcard.wild { box-shadow: 0 0 0 2.5px var(--gold), 0 0 18px rgba(200, 169, 106, .55); }
.pcard.wild::before { content: '★'; position: absolute; top: -8px; right: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #2C3022; font-size: 10px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.mycards.choosing .pcard { cursor: pointer; transition: transform .2s var(--ease), opacity .2s; }
.pcard.picked { transform: translateY(-10px); box-shadow: 0 0 0 3px var(--forest), 0 10px 20px rgba(44, 67, 53, .3); }
.pcard.picked.out { box-shadow: 0 0 0 3px var(--danger), 0 10px 20px rgba(181, 101, 90, .35); opacity: .75; }
.pcard.picked.out::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .7); color: var(--danger); font-weight: 700; background: rgba(252, 250, 245, .4); border-radius: inherit; }
.pcard.slot.dark { background: rgba(62, 91, 72, .05); border: 1.5px dashed rgba(62, 91, 72, .3); cursor: pointer; }
.seat .tag.think { background: var(--sage); color: var(--forest-deep); }

.alloc { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; width: 100%; }
.agroup { background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 10px 12px 12px; min-width: 120px; transition: border-color .2s, box-shadow .2s; cursor: pointer; }
.agroup.ok { border-color: rgba(95, 127, 104, .45); }
.agroup .ag-head { margin-bottom: 8px; line-height: 1.2; }
.agroup .ag-head b { font-family: var(--serif); font-size: 18px; color: var(--forest-deep); display: block; }
.agroup .ag-head small { color: var(--muted); font-size: 12px; }
.agroup .ag-cards { display: flex; gap: 6px; }
.agroup .pcard { cursor: pointer; }

.actionbar .bar-timer { position: absolute; left: 22px; right: 22px; top: 0; height: 3px; border-radius: 3px; background: rgba(200,169,106,.2); overflow: hidden; }
.actionbar .bar-timer i { display: block; height: 100%; background: var(--gold); transform-origin: left; }
.change-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.change-row .chipbtn { padding: 6px 12px; font-size: 13px; }
.chipbtn:disabled { opacity: .45; cursor: default; }

/* Game picker */
.var-tools { display: flex; gap: 8px; margin-bottom: 8px; }
.var-tools .input { height: 42px; }
.var-tools select.input { width: 190px; flex-shrink: 0; }
.var-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; padding: 4px; }
.var-sec { position: sticky; top: -4px; background: #fff; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); padding: 10px 10px 4px; z-index: 1; }
.vrow { appearance: none; width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.vrow:hover { background: var(--beige-2); }
.vrow.on { background: var(--sage-soft); box-shadow: inset 0 0 0 1.5px var(--forest); }
.vrow .vid { width: 30px; height: 30px; border-radius: 50%; background: var(--beige-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--forest); }
.vrow.on .vid { background: var(--forest); color: var(--cream-2); }
.vrow .vname { font-weight: 600; font-size: 14px; line-height: 1.25; min-width: 0; }
.vrow .vname small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow.on .vname small { white-space: normal; }
.vrow .vmeta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.vrow.warn .vmeta { color: var(--danger); }
.vrow:disabled { cursor: default; }
.group-title .count { float: right; letter-spacing: 0; text-transform: none; font-weight: 500; }

/* Results for multi-board games */
.rgroups { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.rg { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.rg .lbl { width: 58px; flex-shrink: 0; font-weight: 600; }
.rg .cards { display: flex; gap: 2px; }
.rg .cards .pcard { --w: 22px; }
.rg.won { color: var(--forest-deep); }
.rg.won .nm { font-weight: 600; }
.result-board { align-items: center; position: relative; margin-bottom: 18px; }

/* Standings dashboard */
.game-wrap { display: block; }
.standings { display: none; }
.icon-btn.on { background: var(--sage-soft); }
.sm-only { display: none; }
body.standings-open .standings {
  display: block; position: fixed; z-index: 30; top: 76px; left: 16px; width: 300px; max-height: calc(100vh - 92px); overflow-y: auto;
  background: rgba(252, 250, 245, .97); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 14px 14px 10px;
  animation: standIn .3s var(--ease);
}
@keyframes standIn { from { opacity: 0; transform: translateX(-16px); } }
.st-head { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.st-head b { font-size: 24px; color: var(--forest-deep); font-weight: 600; flex: 1; }
.st-cols { display: none; }
.st-row { display: grid; grid-template-columns: 18px 1fr; gap: 6px 8px; padding: 10px 8px; border-radius: 16px; border: 1px solid transparent; transition: background .2s; }
.st-row + .st-row { margin-top: 4px; }
.st-row.me { background: var(--sage-soft); }
.st-row.turn { border-color: var(--gold); }
.st-row .rank { font-family: var(--serif); font-size: 18px; font-weight: 700; color: var(--gold-deep); padding-top: 6px; }
.st-row .who { display: flex; gap: 8px; align-items: center; min-width: 0; }
.st-row .who .avatar { width: 32px; height: 32px; font-size: 12px; }
.st-row .who .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.st-row .vals { grid-column: 2; display: grid; grid-template-columns: 1fr 1.2fr .9fr; gap: 6px; }
.st-row .vals div { background: rgba(255,255,255,.7); border-radius: 10px; padding: 5px 7px; line-height: 1.2; min-width: 0; }
.st-row .vals small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.st-row .vals b { font-size: 15px; font-weight: 600; }
.st-row .vals i { display: block; font-style: normal; font-size: 11px; }
.st-row .bar { display: block; height: 3px; border-radius: 3px; background: var(--beige); margin-top: 3px; overflow: hidden; }
.st-row .bar i { display: block; height: 100%; background: var(--forest); }
.st-foot { margin: 10px 4px 2px; font-size: 11.5px; line-height: 1.4; }
.neg { color: var(--danger); }

/* Wide screens: the standings sit beside the table instead of over it. */
@media (min-width: 1180px) {
  body.standings-open .game-wrap { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; max-width: 1760px; margin: 0 auto; padding-left: 16px; }
  body.standings-open .standings { position: sticky; top: 12px; left: auto; align-self: start; margin-top: 10px; max-height: calc(100vh - 24px); animation: none; }
  body.standings-open .game { max-width: none; width: 100%; padding-left: 0; }
  body.chat-open .game-wrap { margin-right: 372px; }
}
@media (max-width: 1179px) {
  .sm-only { display: grid; }
}
@media (max-width: 640px) {
  body.standings-open .standings { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; max-height: 70vh; }
  .center.multi .board .pcard { --w: 26px; }
  .center.multi .boards { gap: 12px; }
  .agroup { padding: 8px; min-width: 0; }
  .agroup .ag-head b { font-size: 15px; }
  .var-tools { flex-direction: column; }
  .var-tools select.input { width: 100%; }
  .vrow { grid-template-columns: 30px 1fr; }
  .vrow .vmeta { grid-column: 2; }
  .joker-box small { font-size: 11px; }
  .rv { bottom: -13px; font-size: 9px; }
}
@media (max-width: 640px) {
  .topbar .right { gap: 4px; }
  .topbar .left { gap: 6px; }
  .icon-btn { padding: 0 8px; min-width: 34px; }
}
@media (max-width: 370px) {
  .topbar .brand { display: none; }
}
/* Card split sheet: always floats above the table so the choices are in view. */
.actionbar.split { position: fixed !important; left: 50% !important; bottom: max(14px, env(safe-area-inset-bottom)) !important; transform: translateX(-50%) !important; width: min(980px, calc(100% - 24px)) !important; max-height: calc(100vh - 90px); overflow-y: auto; z-index: 36; }
.actionbar.split .alloc { flex-wrap: wrap; }
.dock .handname { min-width: 170px; }
.table-area.busy-center .watermark { display: none; }
.street .gname { }
.rg .cards .pcard { --w: 28px; }
@media (max-width: 640px) {
  .street { width: 100%; display: flex; justify-content: center; font-size: 10px; letter-spacing: .1em; }
  .street span { text-align: left; display: block; min-width: 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .street .gname { }

  body.standings-open .standings { top: 64px; bottom: auto; max-height: calc(100vh - 300px); }
  .actionbar.split { max-height: 74vh; }
  .agroup .pcard.md { --w: 40px; }
  .agroup .ag-head small { display: block; max-width: 140px; }
}

/* Games 83-96: assumed cards, vetoes and the choice sheet */
.pcard.assumed { background: linear-gradient(180deg, #FFFDF6, #F4EAD2); border: 1.5px dashed var(--gold-deep); }
.pcard.assumed::before { content: 'A'; position: absolute; top: -7px; right: -6px; width: 16px; height: 16px; border-radius: 50%; background: var(--gold-deep); color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.pcard.assumed.active, .pcard.slot.ask.active { box-shadow: 0 0 0 3px var(--forest), 0 6px 14px rgba(44, 67, 53, .25); }
.pcard.slot.ask { color: var(--forest); font-family: var(--serif); font-size: 22px; font-weight: 700; }
.pcard.vetoed { opacity: .35; filter: grayscale(.8); }
.pcard.vetoed::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--w) * .7); color: var(--danger); font-weight: 700; }
.chooser .ch-pool { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 40px; margin-bottom: 12px; align-items: center; }
.chooser .ch-pool .pcard { cursor: pointer; }
.chooser .agroup.can-drop { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 169, 106, .25); }
.chooser .agroup .plus { align-self: center; color: var(--muted); font-weight: 700; }
.chooser .ch-targets { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.chooser .ch-target { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.chooser .ch-target small { font-size: 12px; color: var(--muted); }
.chooser .idpick { margin-top: 12px; text-align: center; }
.chooser .idpick-head { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.chooser .idpick-row { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-bottom: 6px; }
.chooser .idpick-row .chipbtn { min-width: 38px; padding: 6px 8px; font-weight: 600; }
.chooser .idpick-row.suits .chipbtn { min-width: 52px; font-size: 18px; }
.chipbtn.suit.red:not(.on) { color: var(--card-red); }
.chooser .seg { margin: 0 auto 6px; max-width: 420px; }
.chooser .ch-preview { text-align: center; margin-top: 10px; font-family: var(--serif); font-size: 17px; color: var(--forest-deep); }
.chooser .ch-note { text-align: center; margin: 10px 0 0; }
@media (max-width: 640px) {
  .chooser .idpick-row .chipbtn { min-width: 30px; padding: 5px 6px; font-size: 12.5px; }
}
.pcard.assumed.named::before { content: '★'; }
.chooser .ch-pool { min-height: 76px; }

/* ---------- Rule book ---------- */
.header-btns { display: flex; gap: 8px; }
.rulebook-home { margin-top: 28px; }
.rulebook-home h2 { font-family: var(--serif); font-size: 34px; margin: 0; color: var(--forest-deep); font-weight: 600; }
.rulebook-home .sub { color: var(--muted); margin: 4px 0 18px; }
.rb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.rulebook { font-size: 14.5px; line-height: 1.55; }
.rulebook h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 8px; color: var(--forest-deep); font-weight: 600; }
.rb-sec { margin-bottom: 16px; }
.rb-sec h4 { font-family: var(--serif); font-size: 20px; margin: 0 0 6px; color: var(--forest-deep); font-weight: 600; }
.rb-sec p { margin: 0 0 8px; }
.rb-sec ol, .rb-sec ul { margin: 0 0 8px; padding-left: 20px; }
.rb-sec li { margin-bottom: 4px; }
.rb-sec .ranks li b { display: inline-block; min-width: 124px; }
.rb-group { margin-bottom: 14px; }
.rb-group-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); padding: 6px 2px; display: flex; justify-content: space-between; }
.rb-group-title span { color: var(--muted); letter-spacing: 0; }
.rb-game { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 6px; }
.rb-game summary { cursor: pointer; padding: 9px 12px; font-weight: 600; display: flex; gap: 10px; align-items: center; list-style: none; }
.rb-game summary::-webkit-details-marker { display: none; }
.rb-game summary::after { content: '+'; margin-left: auto; color: var(--muted); font-weight: 500; }
.rb-game[open] summary::after { content: '−'; }
.rb-game summary i { font-style: normal; width: 28px; height: 28px; border-radius: 50%; background: var(--beige-2); display: grid; place-items: center; font-size: 12px; color: var(--forest); flex-shrink: 0; }
.rb-game[open] { box-shadow: inset 0 0 0 1.5px var(--forest); }
.rb-game p { margin: 0 12px 8px 50px; }
.rb-game .rb-meta { font-size: 12px; color: var(--muted); }
.rb-now { background: var(--forest); color: var(--cream-2); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; }
.rb-now small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .8; font-weight: 600; }
.rb-now b { font-family: var(--serif); font-size: 24px; font-weight: 600; line-height: 1.2; }
@media (max-width: 900px) { .rb-cols { grid-template-columns: 1fr; } }

/* ---------- Voice chat ---------- */
.voice-btn.voice-on { background: var(--forest); color: var(--cream-2); border-color: var(--forest); }
.voice-btn.voice-on.muted { background: var(--blush-soft); color: #7C463D; border-color: var(--blush); }
.badge.soft { background: var(--forest); }
.vmic { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--forest); color: #fff; flex-shrink: 0; }
.vmic svg { width: 11px; height: 11px; }
.vmic.muted { background: #B9B1A3; }
.plist .vmic { width: 28px; height: 28px; }
.plist .vmic svg { width: 16px; height: 16px; }
.vmic.talking { box-shadow: 0 0 0 3px rgba(95, 127, 104, .35); }
.seat .plate .vmic { position: absolute; left: -4px; top: -6px; box-shadow: 0 0 0 2px var(--cream-2); }
.seat .plate.speaking { box-shadow: 0 0 0 3px #7FB08C, 0 0 16px rgba(127, 176, 140, .7); }
.voice-audio { display: none; }

/* ---------- Host tools & settle up ---------- */
.host-box { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.host-box p { margin: 0 0 10px; }
.settle-hero { text-align: center; padding: 4px 0 8px; }
.settle-hero .crown { font-size: 34px; color: var(--gold-deep); line-height: 1; }
.settle-hero h3 { font-family: var(--serif); font-size: 28px; margin: 6px 0 2px; color: var(--forest-deep); }
.settle-hero p { margin: 0; }
.tx-settle { background: var(--sage-soft); color: var(--forest-deep); }

/* ---------- Bigger table that fits the screen ---------- */
.table-area { max-width: min(1400px, max(640px, calc((100vh - 270px) * 1.85))); }
.felt { inset: 7% 5%; }
@media (max-width: 640px) {
  /* Phones: the table fills the width and the height left over by your cards and the controls. */
  .table-area { aspect-ratio: auto; max-width: none; width: 100%; height: clamp(330px, calc(100svh - 300px), 150vw); margin-top: 2px; }
  .felt { inset: 7% 7%; }
  .game { padding: 0 10px 190px; }
  .topbar { padding: 8px 10px; }
  .pill.code { letter-spacing: .1em; padding: 0 9px; height: 28px; font-size: 12px; }
  .icon-btn { min-width: 34px; height: 34px; padding: 0 7px; }
  .topbar .right { gap: 4px; }
  .dock { margin-top: 4px; gap: 10px; flex-wrap: nowrap; }
  .dock .handname { font-size: 18px; min-width: 0; }
  .dock .hint { font-size: 11.5px; }
  .actionbar { padding: 10px 10px 10px; bottom: max(8px, env(safe-area-inset-bottom)); width: calc(100% - 16px); }
  .actionbar .yourturn { display: none; }
  .actionbar .presets { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
  .actionbar .presets::-webkit-scrollbar { display: none; }
  .actionbar .presets button { flex: 1 0 auto; padding: 6px 10px; }
  .actionbar .raise { margin-bottom: 8px; }
  .actionbar .raise .input { width: 86px; height: 36px; }
  .actionbar .row .btn { height: 46px; font-size: 15px; }
  .actionbar.compact { padding: 9px 18px; }
  .rulebook-home h2 { font-size: 28px; }
  .rb-game p { margin-left: 12px; }
  .header-btns .btn { padding: 0 10px; }
}
@media (max-width: 640px) {
  .topbar .right { gap: 3px; }
  .topbar .right .icon-btn { min-width: 32px; width: 32px; height: 32px; padding: 0; justify-content: center; }
  .topbar .right .icon-btn svg { width: 18px; height: 18px; }
  .topbar .me-btn .avatar { width: 32px; height: 32px; font-size: 12px; }
  .pill.code { letter-spacing: .06em; padding: 0 8px; }
}
.topbar { max-width: 1440px; }
.icon-btn, .brand b, .pill { white-space: nowrap; }
@media (max-width: 1320px) { .voice-btn .hide-sm, .topbar .pill.gold { display: none; } }
@media (max-width: 1000px) { .topbar .icon-btn .hide-sm { display: none; } }
.voice-btn { position: relative; }
