/* WittyWit Card Games — same cream / forest / gold look as the homepage and Pocket Table. */
:root {
  --bg: #F7F2E9; --paper: #FCFAF5; --card-bg: #FFFDF8; --ink: #22382D; --muted: #6E746B; --line: rgba(47, 84, 67, .14);
  --forest: #2F5443; --forest-2: #3E5B48; --felt: #2F6B52; --felt-2: #24563F; --gold: #C9A66B; --gold-2: #E2C68F;
  --red: #B8574D; --teamA: #2E7D6B; --teamA-soft: #D7EDE6; --teamB: #B4664F; --teamB-soft: #F4E0D8;
  --shadow: 0 2px 6px rgba(34, 56, 45, .06), 0 14px 34px rgba(34, 56, 45, .10);
  --serif: 'Cormorant Garamond', Georgia, serif; --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cw: 58px; --ch: 82px; --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141A17; --paper: #1C2420; --card-bg: #FBF8F2; --ink: #EDE6D8; --muted: #A3A89F; --line: rgba(237, 230, 216, .12);
    --forest: #7FB89A; --forest-2: #5E9A7C; --teamA-soft: #1F3A33; --teamB-soft: #3C2822; --shadow: 0 14px 34px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--bg); min-height: 100vh; overflow-x: clip; -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45;
  background-image: radial-gradient(1100px 560px at 8% -10%, rgba(201, 166, 107, .18), transparent 60%), radial-gradient(900px 520px at 110% 0%, rgba(47, 84, 67, .14), transparent 60%); background-attachment: fixed; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--forest); }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; justify-content: center; }
.red { color: var(--red) !important; } .ok { color: var(--teamA); } .gold-text { color: #9A7A3A; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.center { justify-content: center; margin-top: 14px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.house { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--gold-2); color: #3a2f18; }

/* Buttons */
.btn { appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; background: var(--forest); color: #F7F2E9; text-decoration: none; transition: transform .15s var(--ease), opacity .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); } .btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(180deg, #D8BC84, var(--gold)); color: #2C3022; }
.btn.soft { background: var(--paper); color: var(--forest); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--forest); border: 1px solid var(--line); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.iconbtn { appearance: none; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; min-width: 40px; height: 40px; padding: 0 12px; cursor: pointer; font-weight: 700; color: var(--forest); display: inline-flex; align-items: center; gap: 6px; }
.iconbtn .lbl { font-size: 13px; font-weight: 600; }
.chip { display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--forest); text-decoration: none; cursor: pointer; margin: 0 6px 6px 0; }
.chip.on { background: var(--forest); color: #F7F2E9; }
.linkbtn { background: none; border: 0; color: var(--forest); text-decoration: underline; cursor: pointer; padding: 0; }

/* Pages */
.topbar { display: flex; align-items: center; gap: 14px; padding: 14px 16px; max-width: 1100px; margin: 0 auto; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 22px; text-decoration: none; color: var(--ink); }
.brand.sm { font-size: 18px; }
.crumb { color: var(--muted); font-size: 14px; } .crumb a { color: var(--muted); }
.page { max-width: 1100px; margin: 0 auto; padding: 18px 16px 64px; }
.page.narrow { max-width: 480px; }
.display { font-family: var(--serif); font-weight: 600; font-size: clamp(40px, 8vw, 68px); line-height: 1; margin: 6px 0 12px; }
.display.sm { font-size: clamp(30px, 6vw, 46px); }
.lead { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 0 32px; }
.tagline { text-align: center; font-family: var(--serif); font-size: 20px; color: var(--muted); margin-top: 40px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 12px; font-size: 17px; }
.panel label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
input:not([type=checkbox]), select { border: 1px solid var(--line); background: var(--bg); border-radius: 12px; min-height: 44px; padding: 0 12px; width: 100%; }
.pick-grid, .variant-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pick { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 22px; background: var(--paper); border: 1px solid var(--line); text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .18s var(--ease); }
.pick:hover { transform: translateY(-3px); }
.pick h2 { font-family: var(--serif); font-size: 30px; margin: 4px 0 0; font-weight: 600; }
.pick p { margin: 0; color: var(--muted); }
.pick-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; font-weight: 700; background: var(--forest); color: #F7F2E9; font-family: var(--serif); }
.tag { align-self: flex-start; margin-top: auto; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--gold); color: #22382D; }
.resume { margin-top: 32px; } .resume h3 { font-size: 15px; }
.variant { text-align: left; cursor: pointer; border: 2px solid var(--line); background: var(--paper); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 6px; transition: border-color .15s, transform .15s; }
.variant h3 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.variant p { margin: 0; color: var(--muted); }
.variant.on { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 166, 107, .2), var(--shadow); }
.v-no { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .facts span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.forms { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin: 24px 0; }

/* Lobby */
.lobby-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 18px; }
.invite { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.code { font-family: var(--serif); font-size: 44px; font-weight: 700; letter-spacing: .14em; line-height: 1; }
.lobby-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: start; }
.mini-table { position: relative; display: grid; grid-template-columns: 1fr 1.1fr 1fr; grid-template-rows: auto auto auto; gap: 8px; margin: 8px 0 14px; }
.lseat { border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; border: 2px solid transparent; min-width: 0; }
.lseat.team0 { background: var(--teamA-soft); border-color: rgba(46, 125, 107, .25); } .lseat.team1 { background: var(--teamB-soft); border-color: rgba(180, 102, 79, .25); }
.lseat.empty { background: transparent; border-style: dashed; }
.lseat.top { grid-column: 2; grid-row: 1; } .lseat.right { grid-column: 3; grid-row: 2; } .lseat.bottom { grid-column: 2; grid-row: 3; } .lseat.left { grid-column: 1; grid-row: 2; }
.mt-felt { grid-column: 2; grid-row: 2; border-radius: 50%; background: radial-gradient(circle at 50% 40%, var(--felt), var(--felt-2)); color: #E9F1EA; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: 11px; text-align: center; min-height: 110px; padding: 8px; }
.sname { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.pname { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; word-break: break-word; }
.badge { font-size: 10px; background: var(--gold); color: #22382D; border-radius: 999px; padding: 1px 7px; }
.assign { min-height: 30px; font-size: 12px; padding: 0 6px; margin-top: 2px; }
.av { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.av.team0 { background: var(--teamA); } .av.team1 { background: var(--teamB); }
.lobby-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.settings { display: flex; flex-direction: column; }
.setting { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.setting:last-child { border-bottom: 0; }
.s-label { display: block; font-weight: 600; font-size: 14px; } .s-help { display: block; color: var(--muted); font-size: 12px; }
.s-ctl { flex: none; max-width: 52%; text-align: right; } .s-ctl select { min-height: 38px; font-size: 14px; } .num-in { width: 80px !important; }
.switch { position: relative; display: inline-block; width: 46px; height: 28px; margin: 0 !important; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--forest); } .switch input:checked + span::after { transform: translateX(18px); }
.facts-list { list-style: none; padding: 0; margin: 0; } .facts-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.facts-list span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.log { margin-top: 20px; color: var(--muted); font-size: 13px; } .log ul { padding-left: 18px; }

/* Cards */
.card { position: relative; width: var(--cw); height: var(--ch); border-radius: 8px; background: var(--card-bg); color: #22303A; border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 4px 10px rgba(0, 0, 0, .10); flex: none; user-select: none; font-family: var(--sans); }
.card.red { color: var(--red); }
.c-tl, .c-br { position: absolute; font-weight: 700; font-size: calc(var(--cw) * .27); line-height: .95; display: flex; flex-direction: column; align-items: center; }
.c-tl { top: 4px; left: 4px; } .c-br { bottom: 4px; right: 4px; transform: rotate(180deg); }
.c-tl i, .c-br i { font-style: normal; font-size: .85em; }
.c-mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cw) * .5); }
.card.trumped { box-shadow: 0 0 0 2px var(--gold), 0 4px 10px rgba(0, 0, 0, .15); }
.card.xs { --cw: 36px; --ch: 50px; }
.mini { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--card-bg); color: #22303A; font-weight: 700; }
.mini.red, .rs { color: var(--red); }

/* Table */
.table-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: 1100px; margin: 0 auto; }
.tbar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.tb-title { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; } .tb-title b { font-size: 15px; } .tb-title span { font-size: 12px; color: var(--muted); }
.tb-score { display: flex; gap: 8px; align-items: center; margin-left: auto; font-size: 14px; }
.tb-score i { font-style: normal; color: var(--muted); font-size: 12px; }
.sc { padding: 4px 10px; border-radius: 999px; font-weight: 700; } .sc b { font-weight: 600; font-size: 12px; } .sc small { font-weight: 500; }
.sc.team0 { background: var(--teamA-soft); } .sc.team1 { background: var(--teamB-soft); }
.tb-btns { display: flex; gap: 6px; }
.info-strip { display: flex; gap: 8px 14px; flex-wrap: wrap; padding: 0 12px 8px; font-size: 13px; color: var(--muted); align-items: center; }
.hukum { padding: 3px 10px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); }
.hukum.active { background: var(--gold-2); border-color: var(--gold); color: #2c2617; }
.hukum b.red { color: #A3443A !important; }
.felt-wrap { padding: 0 10px; flex: 1; display: flex; }
.felt { position: relative; flex: 1; min-height: 340px; border-radius: 28px; background: radial-gradient(ellipse at 50% 40%, var(--felt), var(--felt-2) 75%); box-shadow: inset 0 0 0 8px rgba(0, 0, 0, .08), inset 0 0 60px rgba(0, 0, 0, .25), var(--shadow);
  display: grid; grid-template-columns: minmax(84px, 1fr) minmax(200px, 2.4fr) minmax(84px, 1fr); grid-template-rows: auto 1fr auto; padding: 10px; gap: 6px; color: #EEF4EF; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; min-width: 0; }
.seat.top { grid-column: 2; grid-row: 1; } .seat.bottom { grid-column: 2; grid-row: 3; } .seat.left { grid-column: 1; grid-row: 2; justify-content: center; } .seat.right { grid-column: 3; grid-row: 2; justify-content: center; }
.seat-tag { display: flex; align-items: center; gap: 6px; background: rgba(0, 0, 0, .22); border-radius: 14px; padding: 5px 8px; max-width: 100%; border: 2px solid transparent; }
.seat.team0 .seat-tag { border-color: rgba(120, 210, 185, .45); } .seat.team1 .seat-tag { border-color: rgba(240, 160, 135, .45); }
.seat.active .seat-tag { background: rgba(226, 198, 143, .95); color: #2c2617; box-shadow: 0 0 0 3px rgba(226, 198, 143, .35); }
.seat.away { opacity: .6; }
.st-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; } .st-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 110px; } .st-text small { font-size: 11px; opacity: .85; }
.tagd, .tagh { font-size: 10px; font-weight: 700; border-radius: 6px; padding: 1px 5px; background: #F7F2E9; color: #22382D; }
.tagh { background: var(--gold); }
.backs { display: flex; } .backs span { width: 16px; height: 24px; border-radius: 3px; margin-left: -8px; background: repeating-linear-gradient(45deg, #7e2d2d, #7e2d2d 3px, #9c3a3a 3px, #9c3a3a 6px); border: 1px solid #F7F2E9; }
.backs span:first-child { margin-left: 0; }
.timer { width: 90px; height: 4px; background: rgba(0, 0, 0, .25); border-radius: 4px; overflow: hidden; }
.timer span { display: block; height: 100%; background: var(--gold-2); transform-origin: left; transform: scaleX(var(--start)); animation: timer linear forwards; }
.timer span.stop { animation-play-state: paused; }
@keyframes timer { to { transform: scaleX(0); } }
.bubble { position: absolute; top: -10px; right: -6px; font-size: 26px; animation: pop .4s var(--ease); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.centre { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; }
.trick { position: relative; width: 200px; height: 170px; }
.tcard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform .3s var(--ease); }
.tcard.at-bottom { transform: translate(-50%, -22%); } .tcard.at-top { transform: translate(-50%, -78%); }
.tcard.at-left { transform: translate(-108%, -50%) rotate(-6deg); } .tcard.at-right { transform: translate(8%, -50%) rotate(6deg); }
.fx .tcard { animation: deal .28s var(--ease); }
@keyframes deal { from { opacity: 0; margin-top: 30px; } }
.tcard.win .card { box-shadow: 0 0 0 3px var(--gold-2), 0 6px 18px rgba(0, 0, 0, .35); }
.tcard .auto { position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); font-size: 10px; background: rgba(0, 0, 0, .4); padding: 0 5px; border-radius: 4px; }
.led { font-size: 13px; background: rgba(0, 0, 0, .2); padding: 3px 10px; border-radius: 999px; } .led b.red { color: #FFB4A8 !important; }
.led.last { background: rgba(226, 198, 143, .25); }
.pile { display: flex; align-items: center; gap: 10px; font-size: 13px; background: rgba(0, 0, 0, .18); padding: 6px 12px; border-radius: 14px; }
.pile small { display: block; opacity: .8; } .pile.empty { opacity: .7; }
.pile-stack { position: relative; width: 30px; height: 36px; }
.pile-stack span { position: absolute; width: 24px; height: 34px; border-radius: 4px; border: 1px solid #F7F2E9; background: repeating-linear-gradient(45deg, #7e2d2d, #7e2d2d 3px, #9c3a3a 3px, #9c3a3a 6px); left: calc(var(--k) * 1px); top: calc(var(--k) * -1px); }
.totals { display: flex; gap: 10px; }
.tot { display: flex; flex-direction: column; align-items: center; padding: 4px 14px; border-radius: 12px; line-height: 1.1; }
.tot b { font-size: 22px; } .tot small { font-size: 10px; opacity: .85; }
.tot.team0 { background: rgba(46, 125, 107, .45); } .tot.team1 { background: rgba(180, 102, 79, .45); }
.turnbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; text-align: center; font-weight: 600; font-size: 14px; }
.turnbar.mine { color: var(--forest); }
.turnbar .tip { flex-basis: 100%; font-weight: 400; font-size: 13px; color: var(--muted); }
.suits { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.suitbtn { border: 1px solid var(--line); background: var(--card-bg); color: #22303A; border-radius: 12px; min-height: 48px; padding: 4px 14px; font-size: 22px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.suitbtn small { font-size: 13px; }
.hand-area { padding: 0 8px 8px; }
.hand-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 0 4px 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; background: var(--paper); padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--forest); }
.seg button.on { background: var(--forest); color: #F7F2E9; }
.hand { display: flex; align-items: flex-end; padding: 14px 4px 6px; min-height: calc(var(--ch) + 22px); }
.hand .card { cursor: pointer; transition: transform .15s var(--ease), opacity .15s, margin .15s; }
.hand .card:hover { transform: translateY(-6px); }
.hand.my-turn .card.dim { opacity: .4; }
.hand .card.legal { box-shadow: 0 0 0 2px rgba(201, 166, 107, .9), 0 4px 10px rgba(0, 0, 0, .12); }
.hand .card.sel { transform: translateY(-16px); box-shadow: 0 0 0 3px var(--forest), 0 10px 18px rgba(0, 0, 0, .2); }
.hand .card.swap { outline: 3px dashed var(--forest); }
.hand-area.big .hand { flex-wrap: wrap; gap: 6px; justify-content: center; }
.reserved { margin-left: 12px; display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); }
.card.locked { opacity: .75; filter: saturate(.4); }
.reactions { display: flex; justify-content: center; gap: 4px; padding: 0 8px 12px; flex-wrap: wrap; }
.reactions button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.watching { text-align: center; color: var(--muted); padding: 14px; }
.offline { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: #8a4f45; color: #fff; text-align: center; padding: 6px; font-size: 13px; }
.paused { position: fixed; inset: 0; background: rgba(20, 26, 23, .55); display: grid; place-items: center; z-index: 40; color: #fff; text-align: center; }

/* Overlays */
.scrim { position: fixed; inset: 0; background: rgba(20, 26, 23, .45); z-index: 50; }
.sheet { position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--paper); border-radius: 22px; padding: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.sheet.wide { width: min(760px, calc(100vw - 24px)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; position: sticky; top: -20px; background: var(--paper); padding: 4px 0 8px; margin-top: -4px; z-index: 1; }
.sheet h2 { font-family: var(--serif); font-size: 30px; margin: 0; font-weight: 600; }
.sheet h3 { font-size: 15px; margin: 18px 0 8px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.tabs button { flex: none; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--forest); }
.tabs button.on { background: var(--forest); color: #F7F2E9; }
.rules h4 { margin: 16px 0 6px; } .rules p, .rules li { line-height: 1.55; }
.rules .example { background: var(--bg); border-left: 3px solid var(--gold); padding: 8px 12px; border-radius: 8px; }
.ranks { font-weight: 700; font-size: 17px; letter-spacing: .02em; }
.diagram { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto auto auto; gap: 6px; max-width: 320px; margin: 10px auto; text-align: center; font-size: 13px; }
.diagram > div { padding: 6px; border-radius: 10px; } .d-n, .d-s { background: var(--teamA-soft); } .d-e, .d-w { background: var(--teamB-soft); }
.d-n { grid-column: 2; } .d-w { grid-column: 1; grid-row: 2; } .d-c { grid-column: 2; grid-row: 2; background: var(--felt); color: #fff; border-radius: 50% !important; display: grid; place-items: center; } .d-e { grid-column: 3; grid-row: 2; } .d-s { grid-column: 2; grid-row: 3; }
.hist { border-bottom: 1px solid var(--line); padding: 10px 0; }
.hist-head { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; align-items: baseline; } .hist-head span { color: var(--muted); }
.hist-cards { display: flex; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.hc { display: flex; flex-direction: column; align-items: center; font-size: 11px; color: var(--muted); padding: 3px; border-radius: 8px; }
.hc.w { background: var(--gold-2); color: #2c2617; } .hc em { font-size: 10px; }
.hist-foot { font-size: 13px; }
.menu { display: flex; flex-direction: column; gap: 8px; }
.menu label { display: flex; flex-direction: column; gap: 4px; }
.toggle { flex-direction: row !important; align-items: center; gap: 8px !important; }
.loglist { font-size: 13px; color: var(--muted); padding-left: 18px; }
.stats-table { overflow-x: auto; } .stats-table table, .res { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table th, .stats-table td, .res th, .res td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.stats-table td:first-child, .res td:first-child { text-align: left; }
.res th.team0 { color: var(--teamA); } .res th.team1 { color: var(--teamB); } .res tr.total td { font-weight: 700; }
.result h2, .champion h2 { text-align: center; } .result .eyebrow, .champion .eyebrow, .result > p { text-align: center; }
.honour { text-align: center; font-weight: 700; padding: 10px; border-radius: 12px; background: linear-gradient(90deg, #E9D29F, #C9A66B); color: #2c2617; margin: 10px 0; }
.honour.soft { background: var(--bg); color: var(--ink); }
.champion { text-align: center; overflow: hidden; }
.champ { line-height: 1.05; margin: 4px 0 10px !important; font-size: clamp(28px, 7vw, 42px) !important; color: #9A7A3A; letter-spacing: .02em; }
.winners { font-size: 18px; font-weight: 700; } .winners.team0 { color: var(--teamA); } .winners.team1 { color: var(--teamB); }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -10px; left: calc(var(--x) * 1%); width: 8px; height: 14px; background: var(--gold); border-radius: 2px; animation: fall 2.6s linear var(--d) infinite; opacity: .8; }
.confetti i:nth-child(3n) { background: var(--teamA); } .confetti i:nth-child(3n+1) { background: var(--teamB); }
@keyframes fall { to { transform: translateY(620px) rotate(540deg); } }
.banner { position: fixed; z-index: 70; left: 50%; top: 38%; transform: translate(-50%, -50%); background: rgba(28, 36, 32, .92); color: #F7F2E9; padding: 16px 28px; border-radius: 20px; text-align: center; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: bannerIn .5s var(--ease), bannerOut .4s ease 2.2s forwards; cursor: pointer; }
.banner b { font-family: var(--serif); font-size: 34px; } .banner small { font-size: 14px; opacity: .9; }
.banner.gold { background: linear-gradient(135deg, #E9D29F, #C9A66B); color: #2c2617; } .banner.big b { font-size: 46px; }
.banner.still { animation: none; }
@keyframes bannerIn { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
@keyframes bannerOut { to { opacity: 0; transform: translate(-50%, -60%); } }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 6px; align-items: center; width: calc(100vw - 32px); max-width: 420px; pointer-events: none; }
.toast { background: #22382D; color: #F7F2E9; padding: 10px 16px; border-radius: 14px; font-size: 14px; box-shadow: var(--shadow); transition: opacity .4s; }
.toast.bad { background: #8a4f45; } .toast.out { opacity: 0; }
@media (prefers-reduced-motion: reduce) { *:not(.tspan), *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Card Games hub */
.hub-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 8px 0 18px; } .hub-filter > .small:first-child { margin-right: 10px; } .hub-filter > .small:last-child { margin-left: 6px; }
.hub-sec { margin-bottom: 34px; }
.hub-title { font-family: var(--serif); font-weight: 600; font-size: 28px; margin: 0 0 12px; }
.pick .alias { font-size: 13px; font-weight: 600; color: var(--forest); }
.pick.soon { opacity: .62; box-shadow: none; } .pick.soon:hover { transform: none; } .pick.soon .pick-icon { background: var(--muted); }
.tag.soon { background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.big-facts span { font-size: 13px; padding: 5px 12px; }
.rules-peek { margin-top: 8px; }

/* Default settings */
.defaults-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin-bottom: 8px; border-radius: 14px; background: var(--bg); border: 1px dashed var(--gold); }
.defaults-bar .small { flex: 1; min-width: 180px; }
.rules-state { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--teamA-soft); color: var(--teamA); vertical-align: middle; margin-left: 4px; }
.rules-state.custom { background: var(--gold-2); color: #3a2f18; }
.setting.changed .s-label { color: #9A7A3A; }
.chg { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9A7A3A; }
.facts-list li small { color: var(--muted); font-size: 12px; }

/* Table-game lobby */
.seat-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.srow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.srow.empty { border-style: dashed; background: transparent; }
.srow .assign { width: auto; margin-left: auto; }
.sno { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--paper); border: 1px solid var(--line); flex: none; }

/* Table-game table */
.opps { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 0 10px 8px; }
.opp { position: relative; display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 14px; background: var(--paper); border: 2px solid var(--line); flex-wrap: wrap; max-width: 220px; }
.opp.active { border-color: var(--gold); background: var(--gold-2); color: #2c2617; }
.opp.away { opacity: .6; }
.opp .timer { flex-basis: 100%; width: auto; background: rgba(0, 0, 0, .12); }
.mybadge { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mybadge .timer { background: rgba(0, 0, 0, .12); }
.tfelt { display: flex; align-items: center; justify-content: center; min-height: 260px; }
.tcentre { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.stack { position: relative; width: 44px; height: 60px; } .stack b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; z-index: 2; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.stack span { position: absolute; width: 40px; height: 56px; border-radius: 5px; border: 1px solid #F7F2E9; background: repeating-linear-gradient(45deg, #7e2d2d, #7e2d2d 3px, #9c3a3a 3px, #9c3a3a 6px); left: calc(var(--k) * 1px); top: calc(var(--k) * -1px); }
.pilebox, .topcard, .activesuit, .stockbtn { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: #EEF4EF; }
.stockbtn, button.topcard { background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 12px; }
.stockbtn:disabled, button.topcard:disabled { cursor: default; }
.stockbtn:not(:disabled), button.topcard:not(:disabled) { box-shadow: 0 0 0 2px var(--gold-2); }
.activesuit b { font-size: 20px; background: var(--card-bg); color: #22303A; padding: 4px 12px; border-radius: 12px; }
.activesuit b.red { color: var(--red) !important; } .activesuit b.big { font-size: 30px; }
.c8 { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; }
.badam-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 640px; }
.brow { display: flex; align-items: center; gap: 10px; min-height: 54px; background: rgba(0, 0, 0, .14); border-radius: 12px; padding: 4px 10px; }
.bsuit { font-size: 26px; width: 26px; text-align: center; } .bsuit.red { color: #FFB4A8 !important; }
.bcards { display: flex; } .bcards .card { margin-left: -14px; } .bcards .card:first-child { margin-left: 0; }
.bluff-centre { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; }
.claimbox { display: flex; flex-direction: column; align-items: center; } .claimbox b { font-family: var(--serif); font-size: 30px; } .claimbox small { font-size: 12px; opacity: .85; }
.claims { list-style: none; padding: 0; margin: 4px 0 0; font-size: 12px; opacity: .85; text-align: center; }
.window { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; background: rgba(0, 0, 0, .22); padding: 10px; border-radius: 16px; }
.wtimer { width: 180px; height: 6px; background: rgba(0, 0, 0, .3); border-radius: 6px; overflow: hidden; }
.wtimer span { display: block; height: 100%; background: var(--gold-2); transform-origin: left; animation: timer linear forwards; }
.btn.bluffbtn { background: linear-gradient(180deg, #D4685D, #A9473E); color: #fff; font-size: 20px; min-height: 52px; padding: 0 30px; letter-spacing: .04em; }
.reveal { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 16px; }
.reveal b { font-family: var(--serif); font-size: 30px; } .reveal.lied { background: rgba(169, 71, 62, .45); } .reveal.honest { background: rgba(46, 125, 107, .45); }
.ranks-pick { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; flex-basis: 100%; }
.ranks-pick button { min-width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card-bg); color: #22303A; font-weight: 700; cursor: pointer; }
.ranks-pick button.on { background: var(--forest); color: #F7F2E9; }
.fish { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.books { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; } .books div { display: flex; flex-direction: column; align-items: center; background: rgba(0, 0, 0, .18); padding: 4px 10px; border-radius: 10px; font-size: 13px; } .books small { font-size: 11px; opacity: .85; }
.lastask { font-size: 13px; background: rgba(226, 198, 143, .25); padding: 4px 12px; border-radius: 999px; text-align: center; }
.nn { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; }
.total { display: flex; flex-direction: column; align-items: center; } .total b { font-family: var(--serif); font-size: 76px; line-height: 1; } .total small { opacity: .85; }
.total.hot b { color: #FFD08A; }
.res tr.win td { font-weight: 700; background: rgba(226, 198, 143, .25); }
.reveal-hands { margin-top: 10px; font-size: 13px; } .rh { margin: 6px 0; } .rh small { color: var(--muted); }
@media (max-width: 640px) {
  .tfelt { min-height: 220px; }
  .opp { max-width: 46%; } .total b { font-size: 60px; }
  .bcards .card { margin-left: -20px; }
  .brow { min-height: 50px; }
}

/* Wave 2: tricks, President, Golf, Rummy */
.card.sm { --cw: 44px; --ch: 62px; }
.card.back { background: repeating-linear-gradient(45deg, #7e2d2d, #7e2d2d 4px, #9c3a3a 4px, #9c3a3a 8px); border: 2px solid #F7F2E9; }
.card.joker { color: #6b3fa0; } .card.wildc { box-shadow: 0 0 0 2px #9b7bd0, 0 4px 10px rgba(0, 0, 0, .12); }
.tg-trick { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.trick-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 80px; align-items: center; }
.tplay { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; }
.tplay.win .card { box-shadow: 0 0 0 3px var(--gold-2), 0 6px 18px rgba(0, 0, 0, .35); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chipx { font-size: 12px; background: rgba(0, 0, 0, .22); padding: 3px 10px; border-radius: 999px; } .chipx b.red, .led b.red { color: #FFB4A8 !important; }
.muted-light { opacity: .75; font-size: 13px; }
.ranks-pick button:disabled { opacity: .35; cursor: not-allowed; }
.golf-centre { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.golf-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 4px; justify-content: center; }
.golf-grid.mine { gap: 8px; } .golf-grid.mine .card { cursor: pointer; }
.golf-opps { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; } .golf-opps > div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.golf-opps .card { --cw: 32px; --ch: 44px; }
.golf-mine { display: flex; flex-direction: column; align-items: center; }
.rgroups { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.rgroup { border: 1px solid var(--line); border-radius: 12px; padding: 2px 6px 4px; background: var(--paper); }
.rgroup small { font-size: 11px; font-weight: 600; color: var(--muted); } .rgroup.pure small { color: var(--teamA); } .rgroup.loose { border-style: dashed; }
.rgroup .hand { padding: 6px 0 0; min-height: 0; } .rgroup .hand .card { margin-left: -18px; } .rgroup .hand .card:first-child { margin-left: 0; }
@media (max-width: 640px) { .rgroup .hand .card { margin-left: -24px; } .golf-opps .card { --cw: 26px; --ch: 36px; } }

/* Phones */
@media (max-width: 640px) {
  :root { --cw: 46px; --ch: 66px; }
  .tbar { padding: 8px; gap: 6px; }
  .tb-score { order: 3; width: 100%; justify-content: center; margin: 0; font-size: 13px; }
  .tb-btns { margin-left: auto; }
  .iconbtn .lbl { display: none; }
  .felt { min-height: 300px; grid-template-columns: 74px 1fr 74px; padding: 6px; border-radius: 22px; }
  .seat-tag { flex-direction: column; gap: 2px; padding: 4px; text-align: center; }
  .st-text b { max-width: 70px; font-size: 12px; } .st-text small { font-size: 10px; }
  .seat.left .backs, .seat.right .backs { display: none; }
  .trick { width: 150px; height: 150px; }
  .tcard .card { --cw: 42px; --ch: 60px; }
  .tcard.at-left { transform: translate(-104%, -50%) rotate(-6deg); } .tcard.at-right { transform: translate(4%, -50%) rotate(6deg); }
  .centre { min-height: 170px; }
  .tot { padding: 3px 10px; } .tot b { font-size: 18px; }
  .hand { padding-top: 18px; }
  .hand-area.big .card { --cw: 52px; --ch: 74px; }
  .mini-table { grid-template-columns: 1fr 1fr 1fr; font-size: 13px; }
  .setting { flex-direction: column; align-items: stretch; } .s-ctl { max-width: none; text-align: left; }
  .sheet { padding: 16px; top: auto; bottom: 0; transform: translateX(-50%); border-radius: 22px 22px 0 0; max-height: 88dvh; width: 100vw; }
  .banner b { font-size: 28px; } .banner.big b { font-size: 34px; }
}
