/* 110. A pub table at night: deep felt, cream cards, brass accents.
   Layout: one-screen app. Seats across the top, the trick in the middle, your hand pinned to the bottom. */
:root {
  --felt: #0b3d2e;
  --felt-2: #0f5540;
  --felt-edge: #06261c;
  --ink: #f4efe3;
  --ink-dim: rgba(244, 239, 227, 0.62);
  --brass: #f6c453;
  --brass-deep: #d99a1e;
  --card: #fbf7ec;
  --card-ink: #1b1a17;
  --red: #c8352b;
  --good: #4ad17c;
  --bad: #ff6b5a;
  --panel: rgba(6, 38, 28, 0.86);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink);
  background: radial-gradient(120% 90% at 50% 20%, var(--felt-2), var(--felt) 60%, var(--felt-edge));
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0px);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); }

/* ---------- Buttons & fields ---------- */
.btn {
  border: 0; border-radius: 14px; padding: 12px 18px;
  font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .01em;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
.btn-primary { background: linear-gradient(180deg, var(--brass), var(--brass-deep)); color: #2a1d05; box-shadow: 0 6px 0 #8a5f0d, 0 10px 20px rgba(0,0,0,.3); }
.btn-primary:active { box-shadow: 0 3px 0 #8a5f0d; transform: translateY(3px); }
.btn-primary:disabled { filter: grayscale(.6) brightness(.7); box-shadow: none; transform: none; cursor: default; }
.btn-ghost { background: rgba(255,255,255,.1); color: var(--ink); border: 1.5px solid rgba(255,255,255,.22); }
.btn-big { padding: 16px 22px; font-size: 20px; width: 100%; }
.btn-small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255,255,255,.1);
  display: grid; place-items: center; font-size: 18px; position: relative;
}
.icon-btn.on { background: var(--brass); color: #2a1d05; }
.link { background: none; border: 0; color: var(--brass); text-decoration: underline; font-weight: 700; padding: 8px; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); font-weight: 800; }
input {
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.2); border-radius: 12px;
  padding: 12px 14px; width: 100%; min-width: 0;
}
input::placeholder { color: rgba(244,239,227,.4); }
.stack { display: grid; gap: 14px; }
.badge { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; border-radius: 10px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; }

/* ---------- Home ---------- */
#home { justify-content: center; align-items: center; padding-left: var(--gutter-l); padding-right: var(--gutter-r); overflow-y: auto; }
.home-inner { width: min(100%, 380px); display: grid; gap: 22px; padding-block: 24px; text-align: center; }
.logo { display: grid; justify-items: center; gap: 2px; }
.logo-num {
  font-family: var(--display); font-weight: 700; font-size: clamp(88px, 28vw, 128px); line-height: .9;
  color: var(--brass); text-shadow: 0 6px 0 #8a5f0d, 0 14px 30px rgba(0,0,0,.4);
  letter-spacing: -.03em;
}
.logo-sub { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--ink-dim); letter-spacing: .04em; }
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-dim); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.18); }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-input { text-transform: uppercase; font-family: var(--display); font-size: 24px; letter-spacing: .3em; text-align: center; padding: 8px 12px; }
.fine { color: var(--ink-dim); font-size: 13px; margin: 0; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--gutter-r) 8px var(--gutter-l);
  flex: 0 0 auto;
}
.topbar-title { flex: 1; font-family: var(--display); font-weight: 600; font-size: 18px; }
.topbar-actions { display: flex; gap: 6px; }
.status-pills { flex: 1; display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.pill { border-radius: 999px; padding: 6px 11px; font-weight: 800; font-size: 13px; background: rgba(255,255,255,.1); white-space: nowrap; }
.code-pill { font-family: var(--display); letter-spacing: .15em; }
.trump-pill { background: var(--card); color: var(--card-ink); }
.trump-pill.red { color: var(--red); }
.bid-pill { background: var(--brass); color: #2a1d05; }

/* ---------- Lobby ---------- */
.lobby-inner { flex: 1; overflow-y: auto; padding: 8px var(--gutter-r) 24px var(--gutter-l); display: grid; gap: 18px; align-content: start; max-width: 480px; width: 100%; margin: 0 auto; }
.code-card { background: var(--panel); border-radius: 20px; padding: 18px; text-align: center; display: grid; gap: 8px; justify-items: center; border: 1px solid rgba(255,255,255,.08); }
.code-label { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-dim); font-weight: 800; }
.code-big { font-family: var(--display); font-weight: 700; font-size: 56px; letter-spacing: .22em; color: var(--brass); line-height: 1; padding-left: .22em; }
.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.player-list li { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.07); border-radius: 14px; padding: 10px 12px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 16px; color: #2a1d05; flex: 0 0 auto;
}
.player-list .name { flex: 1; font-weight: 800; }
.tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.12); }
.tag.host { background: var(--brass); color: #2a1d05; }
.tag.off { background: rgba(255,107,90,.25); color: var(--bad); }
.lobby-settings { display: grid; gap: 8px; }
.toggle { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.toggle input { width: 20px; height: 20px; accent-color: var(--brass); padding: 0; }
.lobby-foot { display: grid; gap: 10px; }
.hint-text { color: var(--ink-dim); margin: 0; text-align: center; }

/* ---------- Game ---------- */
#game { overflow: hidden; }
.game-top { padding-bottom: 4px; }
.seats {
  display: flex; gap: 6px; padding: 4px var(--gutter-r) 6px var(--gutter-l);
  overflow-x: auto; scrollbar-width: none; flex: 0 0 auto;
}
.seats::-webkit-scrollbar { display: none; }
.seat {
  flex: 1 0 auto; min-width: 72px; max-width: 120px;
  background: rgba(255,255,255,.07); border-radius: 14px; padding: 6px 8px;
  display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center;
  border: 2px solid transparent; transition: border-color .2s, background .2s;
  position: relative;
}
.seat .avatar { width: 30px; height: 30px; font-size: 13px; grid-row: span 2; }
.seat .sname { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .sinfo { font-size: 12px; color: var(--ink-dim); display: flex; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seat .sinfo b { color: var(--ink); }
.seat.turn { border-color: var(--brass); background: rgba(246,196,83,.16); animation: pulse 1.4s ease-in-out infinite; }
.seat.me { background: rgba(255,255,255,.14); }
.seat.me .sname { color: var(--brass); }
.seat .cc { display: inline-flex; align-items: center; gap: 2px; }
.seat .cc i { display: inline-block; width: 7px; height: 10px; border: 1.5px solid var(--ink-dim); border-radius: 2px; }
.seat .hp { color: var(--good); font-weight: 800; }
.seat.off { opacity: .5; }
.seat .chip {
  position: absolute; top: -7px; right: -4px; font-size: 10px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 6px; border-radius: 999px; background: var(--card); color: var(--card-ink);
}
.seat .chip.bidder { background: var(--brass); }
.seat .chip.pass { background: rgba(0,0,0,.45); color: var(--ink-dim); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(246,196,83,.35); } 50% { box-shadow: 0 0 0 6px rgba(246,196,83,0); } }

.table { flex: 1; position: relative; display: flex; flex-direction: column; min-height: 0; padding: 0 var(--gutter-r) 0 var(--gutter-l); }
.felt-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.ticker { flex: 0 0 auto; font-size: 13px; color: var(--ink-dim); text-align: center; padding: 4px 0 6px; min-height: 24px; }
.ticker b { color: var(--ink); }

.trick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.trick .played { display: grid; justify-items: center; gap: 4px; }
.trick .who { font-size: 11px; font-weight: 800; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trick .played.leading .card { box-shadow: 0 0 0 3px #fff, 0 8px 18px rgba(0,0,0,.4); }
.trick .played.leading .who { color: var(--brass); }
.empty-trick { color: var(--ink-dim); font-family: var(--display); font-size: 18px; text-align: center; }
.last-trick { display: grid; gap: 4px; justify-items: center; }
.last-trick .mini { display: flex; gap: 4px; }
.last-trick .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); font-weight: 800; }

/* Center panels (bidding, trumps, results) */
.panel {
  background: var(--panel); border: 1px solid rgba(255,255,255,.1); border-radius: 20px;
  padding: 16px; width: min(100%, 420px); display: grid; gap: 12px; text-align: center;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.panel h2 { font-size: 22px; }
.panel p { margin: 0; color: var(--ink-dim); }
.bid-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bid-grid .btn { padding: 14px 4px; font-size: 20px; }
.pass-btn { width: 100%; }
.suit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.suit-btn { background: var(--card); color: var(--card-ink); border: 0; border-radius: 14px; padding: 12px 4px; display: grid; gap: 2px; justify-items: center; font-weight: 800; font-size: 12px; }
.suit-btn .sym { font-size: 32px; line-height: 1; }
.suit-btn.red { color: var(--red); }
.suit-btn.suggest { box-shadow: 0 0 0 3px var(--brass); }
.waiting { display: grid; gap: 6px; justify-items: center; }
.dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin: 0 3px; animation: bounce 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-6px); } }

/* ---------- Cards ---------- */
.card {
  width: 56px; height: 80px; border-radius: 8px; background: var(--card); color: var(--card-ink);
  position: relative; box-shadow: 0 4px 10px rgba(0,0,0,.35); border: 0; padding: 0;
  font-family: var(--display); font-weight: 700; display: grid; place-items: center;
  user-select: none; -webkit-user-select: none; flex: 0 0 auto;
}
.card.red { color: var(--red); }
.card .corner { position: absolute; top: 4px; left: 5px; font-size: 13px; line-height: 1.05; text-align: center; }
.card .corner small { display: block; font-size: 12px; }
.card .big { font-size: 30px; line-height: 1; }
.card.joker .big { font-size: 24px; }
.card.joker .corner { font-size: 10px; letter-spacing: .02em; }
.card.trump::after { content: ""; position: absolute; inset: 0; border-radius: 8px; border: 2.5px solid var(--brass); pointer-events: none; }
.card.trump::before { content: "TRUMP"; position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 8px; letter-spacing: .12em; color: var(--brass-deep); font-weight: 700; }
.card.sm.trump::before { display: none; }
.card.sm { width: 36px; height: 52px; }
.card.sm .big { font-size: 18px; } .card.sm .corner { font-size: 9px; } .card.sm .corner small { font-size: 8px; }
.card.lg { width: 64px; height: 92px; }
.card.lg .big { font-size: 34px; }

/* ---------- Hand ---------- */
.hand-area {
  flex: 0 0 auto; padding: 6px var(--gutter-r) max(10px, env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  background: linear-gradient(180deg, rgba(6,38,28,0) 0%, rgba(6,38,28,.9) 30%);
  display: grid; gap: 8px;
}
.action-bar { display: flex; gap: 8px; justify-content: center; align-items: center; min-height: 44px; flex-wrap: wrap; }
.action-bar .note { color: var(--ink-dim); font-size: 14px; }
.hand { display: flex; gap: 6px; justify-content: center; overflow-x: auto; padding: 14px 4px 4px; scrollbar-width: none; min-height: 110px; }
.hand::-webkit-scrollbar { display: none; }
.hand .card { transition: transform .15s ease, opacity .15s, box-shadow .15s; }
.hand .card.legal { cursor: pointer; }
.hand .card.legal:active { transform: translateY(-4px); }
.hand .card.dim { opacity: .35; }
.hand .card.selected { transform: translateY(-14px); box-shadow: 0 0 0 3px var(--bad), 0 8px 18px rgba(0,0,0,.4); }
.hand .card.suggest { box-shadow: 0 0 0 3px #fff, 0 0 18px rgba(255,255,255,.5); transform: translateY(-6px); }
.hand.crowded .card { margin-left: -14px; }
.hand.crowded .card:first-child { margin-left: 0; }

/* ---------- Hint bubble ---------- */
.hint-bubble {
  justify-self: center; background: var(--brass); color: #2a1d05; border-radius: 14px; padding: 8px 12px; font-weight: 700; font-size: 13px;
  max-width: min(92vw, 360px); text-align: center; box-shadow: 0 8px 20px rgba(0,0,0,.3); pointer-events: none;
}

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.sheet-panel {
  position: relative; width: min(100%, 560px); max-height: 88%; background: #0d2e24; color: var(--ink);
  border-radius: 22px 22px 0 0; display: flex; flex-direction: column; animation: up .22s ease-out;
  padding-bottom: env(safe-area-inset-bottom, 0px); border-top: 1px solid rgba(255,255,255,.12);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px var(--gutter-r) 10px var(--gutter-l); }
.sheet-head h2 { font-size: 22px; }
.sheet-body { overflow-y: auto; padding: 0 var(--gutter-r) 20px var(--gutter-l); line-height: 1.5; }
.sheet-foot { padding: 10px var(--gutter-r) 14px var(--gutter-l); display: grid; gap: 8px; }
.rules h3 { font-size: 16px; margin-top: 16px; color: var(--brass); }
.score-cheat { background: rgba(246,196,83,.12); border: 1px solid rgba(246,196,83,.35); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; margin-bottom: 12px; }
.sc-title { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--brass); }
.sc-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: center; font-size: 14px; line-height: 1.35; }
.sc-big { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--brass); text-align: center; font-variant-numeric: tabular-nums; }
.sc-note { margin: 0; font-size: 13px; color: var(--ink-dim); line-height: 1.4; }
.power { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.power li { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; font-size: 14px; line-height: 1.3; }
.pc { width: 36px; height: 48px; border-radius: 6px; background: var(--card); color: var(--card-ink); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 18px; box-shadow: 0 0 0 2px var(--brass); }
.pc.red { color: var(--red); }
.rules p { margin: 6px 0; }
.ranking { background: rgba(255,255,255,.06); border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; }
.ranking .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-dim); font-weight: 800; }
.ranking .row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ranking .row .card.sm { width: 30px; height: 42px; }
.ranking .row .card.sm .big { font-size: 15px; }
.ranking .row .card.sm .corner { display: none; }

/* Chat */
.chat-panel { height: 70%; }
.chat-log { flex: 1; overflow-y: auto; padding: 0 var(--gutter-r) 8px var(--gutter-l); display: grid; gap: 6px; align-content: end; }
.msg { background: rgba(255,255,255,.08); border-radius: 12px; padding: 7px 10px; max-width: 85%; justify-self: start; overflow-wrap: anywhere; }
.msg.mine { background: rgba(246,196,83,.22); justify-self: end; }
.msg.sys { background: none; color: var(--ink-dim); font-size: 13px; justify-self: center; text-align: center; max-width: 100%; }
.msg .from { font-size: 11px; font-weight: 800; color: var(--brass); display: block; }
.emoji-row { display: flex; gap: 6px; padding: 6px var(--gutter-r) 6px var(--gutter-l); overflow-x: auto; }
.emoji-row button { border: 0; background: rgba(255,255,255,.1); border-radius: 10px; font-size: 22px; padding: 6px 10px; flex: 0 0 auto; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px var(--gutter-r) 10px var(--gutter-l); }

/* Score sheet */
.score-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.score-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-dim); padding: 6px 4px; }
.score-table td { padding: 8px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.score-table td.num { text-align: right; font-weight: 800; }
.score-table .up { color: var(--good); } .score-table .down { color: var(--bad); }
.score-table .note { font-size: 12px; color: var(--ink-dim); display: block; }
.score-table tr.bidder td:first-child::before { content: "★ "; color: var(--brass); }
.result-head { text-align: center; font-family: var(--display); font-size: 20px; margin-bottom: 10px; }
.result-head.made { color: var(--good); } .result-head.missed { color: var(--bad); }
.winner-banner { text-align: center; font-family: var(--display); font-size: 36px; color: var(--brass); padding: 10px 0; text-shadow: 0 4px 0 #8a5f0d; }

/* Reactions floating over the table */
.reactions { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float { position: absolute; bottom: 160px; font-size: 40px; animation: floatUp 2.2s ease-out forwards; display: grid; justify-items: center; }
.float small { font-size: 11px; font-weight: 800; color: var(--ink); background: rgba(0,0,0,.4); border-radius: 8px; padding: 2px 6px; }
@keyframes floatUp { from { transform: translateY(0) scale(.8); opacity: 0; } 15% { opacity: 1; transform: scale(1.1); } to { transform: translateY(-260px) scale(1); opacity: 0; } }

/* Toast */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%); z-index: 30; background: var(--ink); color: #1b1a17; padding: 10px 16px; border-radius: 12px; font-weight: 800; box-shadow: 0 8px 20px rgba(0,0,0,.35); max-width: 92vw; text-align: center; }
.toast.error { background: var(--bad); color: #fff; }

@media (min-width: 700px) {
  .card { width: 68px; height: 98px; } .card .big { font-size: 36px; } .card .corner { font-size: 15px; }
  .seat { max-width: 160px; }
  .hand { min-height: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Game picker ---------- */
.game-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.game-opt { background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.18); border-radius: 14px; padding: 10px 12px; text-align: left; display: grid; gap: 2px; color: var(--ink); }
.game-opt b { font-family: var(--display); font-size: 20px; }
.game-opt small { color: var(--ink-dim); font-size: 12px; line-height: 1.3; }
.game-opt.on { border-color: var(--brass); background: rgba(246,196,83,.16); }
.game-pick.small .game-opt b { font-size: 16px; }
.game-pick.locked .game-opt { pointer-events: none; opacity: .75; }

/* ---------- Deeds ---------- */
.deeds-main { flex: 1; min-height: 0; overflow-y: auto; padding: 4px var(--gutter-r) 8px var(--gutter-l); display: grid; gap: 10px; align-content: start; }
.opponents { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.opp { background: rgba(255,255,255,.07); border-radius: 14px; padding: 8px 10px; display: grid; gap: 6px; border: 2px solid transparent; }
.opp.turn { border-color: var(--brass); background: rgba(246,196,83,.14); }
.opp.off { opacity: .5; }
.opp-head { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; }
.opp-head .avatar { width: 30px; height: 30px; font-size: 13px; grid-row: span 2; }
.opp-name { font-weight: 800; font-size: 14px; }
.opp-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.opp-stats span { white-space: nowrap; }
.opp-groups, .my-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.pgroup { background: rgba(0,0,0,.25); border-radius: 10px; padding: 6px 8px; display: grid; gap: 4px; min-width: 0; border: 1.5px solid transparent; }
.pgroup.complete { border-color: var(--good); }
.pg-head { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.pg-count { color: var(--ink-dim); }
.pgroup.complete .pg-count { color: var(--good); font-weight: 800; }
.pg-rent { margin-left: auto; color: var(--brass); font-weight: 800; }
.pg-cards { display: flex; flex-wrap: wrap; gap: 4px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.prop-chip { font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; cursor: pointer; }
.build { font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; background: var(--card); color: var(--card-ink); }
.my-table { background: var(--panel); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 10px 12px; display: grid; gap: 8px; }
.my-head { display: flex; gap: 12px; align-items: baseline; font-size: 13px; color: var(--ink-dim); }
.my-head b { font-family: var(--display); font-size: 16px; color: var(--ink); }
.bank-row { display: flex; flex-wrap: wrap; gap: 4px; }
.money-chip { background: #2f8f5b; color: #fff; font-weight: 800; font-size: 12px; padding: 4px 8px; border-radius: 8px; }
.note { color: var(--ink-dim); font-size: 13px; }

/* Deeds cards in hand */
.deeds-hand { min-height: 120px; }
.dcard { width: 74px; height: 104px; border-radius: 9px; background: var(--card); color: var(--card-ink); border: 0; padding: 0; position: relative; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,.35); font-family: var(--body); text-align: left; flex: 0 0 auto; transition: transform .15s, box-shadow .15s; }
.dcard.legal { cursor: pointer; }
.dcard.selected { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--bad), 0 8px 18px rgba(0,0,0,.4); }
.dcard .band { font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px; background: var(--sc, #ddd); color: var(--st, #111); }
.dcard .action-band { background: #2a1d05; color: var(--brass); }
.dcard.rent .band, .dcard.wild .band { text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.dcard .dn { font-weight: 800; font-size: 11px; line-height: 1.15; padding: 5px 6px; align-self: start; }
.dcard .dv { font-family: var(--display); font-weight: 700; font-size: 13px; padding: 0 6px 5px; color: #2f8f5b; }
.dcard.money { place-items: center; grid-template-rows: 1fr auto; background: linear-gradient(180deg, #e9f6ee, #cfeedd); }
.dcard.money .dv { font-size: 28px; padding: 0; color: #1f6f44; }
.dcard.money .dk { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: #1f6f44; padding-bottom: 8px; }
.dcard.big { width: 110px; height: 156px; }
.dcard.big .dn { font-size: 14px; } .dcard.big .band { font-size: 11px; } .dcard.big .dv { font-size: 18px; } .dcard.big.money .dv { font-size: 40px; }
.hand.crowded .dcard { margin-left: -22px; }
.hand.crowded .dcard:first-child { margin-left: 0; }

.plays { display: inline-flex; gap: 4px; }
.plays i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.15); }
.plays i.on { background: var(--brass); }

.card-detail { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.cd-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--brass); font-weight: 800; }
.card-detail p { margin: 6px 0; line-height: 1.4; }
.quip { color: var(--ink-dim); font-style: italic; }
.set-btn { display: flex; align-items: center; gap: 8px; text-align: left; width: 100%; }
.set-btn b { margin-left: auto; color: var(--brass); }
.sheet-foot .btn { width: 100%; }
.pbtn { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; margin-bottom: 8px; }
.pbtn small { display: block; color: var(--ink-dim); font-size: 12px; font-weight: 600; }
.toggle.inline { display: inline-flex; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.pay-item { background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.15); border-radius: 10px; padding: 8px; color: var(--ink); text-align: left; display: grid; gap: 2px; }
.pay-item b { color: var(--brass); font-family: var(--display); font-size: 16px; }
.pay-item span { font-size: 12px; } .pay-item i { color: var(--ink-dim); }
.pay-item.on { border-color: var(--bad); background: rgba(255,107,90,.18); }
#deedsSheetBody .pgroup { cursor: pointer; }
#deedsSheetBody .pgroup:active { background: rgba(246,196,83,.2); }
.sets-table { display: grid; gap: 6px; margin-top: 10px; }
.set-line { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; font-size: 13px; }
.set-line .note, .set-line em { grid-column: 2; }
.set-line em { color: var(--ink-dim); font-size: 12px; }

/* ---------- Deeds look: bright, white, colourful ---------- */
#deeds, #deedsSheet .sheet-panel, #menuSheet.deeds-mode .sheet-panel {
  --ink: #1d1a14; --ink-dim: #6b6456; --panel: #ffffff; --card: #ffffff; --card-ink: #1d1a14;
  --brass: #ffb703; --brass-deep: #f08c00; --good: #2a9d5c; --bad: #e63946;
  color: var(--ink);
}
#deeds { background: #f6f3ec; }
#deeds::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, #d7263d, #f28c28, #f2c531, #2e9e5b, #7ec8e3, #1f4e9c, #d94c8a); z-index: 3; }
#deeds .topbar { background: #fff; border-bottom: 1px solid #e6e1d6; margin-top: 6px; }
#deeds .icon-btn, #deeds .pill, #deeds .opp, #deeds .pay-item { background: #efeae0; }
#deeds .icon-btn.on { background: var(--brass); }
#deeds .bid-pill { background: var(--brass); color: #2a1d05; }
#deeds .badge { background: var(--bad); }
#deeds .opp { background: #fff; box-shadow: 0 2px 8px rgba(40,30,10,.08); border-color: #e6e1d6; }
#deeds .opp.turn { border-color: var(--brass); background: #fff8e1; }
#deeds .pgroup { background: #f6f3ec; border: 1.5px solid #e6e1d6; border-left: 6px solid var(--gc, #ccc); }
#deeds .pgroup.complete { border-color: var(--good); border-left-color: var(--gc, #ccc); background: #ecf8f0; }
#deeds .my-table { background: #fff; border: 1px solid #e6e1d6; box-shadow: 0 4px 14px rgba(40,30,10,.08); }
#deeds .my-head b { color: var(--ink); }
#deeds .ticker { color: var(--ink-dim); }
#deeds .ticker b { color: var(--ink); }
#deeds .hand-area { background: linear-gradient(180deg, rgba(246,243,236,0) 0%, #efeae0 30%); }
#deeds .btn-ghost { background: #fff; color: var(--ink); border-color: #d9d3c6; }
#deeds .plays i { background: #ddd6c8; }
#deeds .plays i.on { background: var(--brass); }
#deeds .dcard { box-shadow: 0 2px 6px rgba(40,30,10,.18); border: 1px solid #e6e1d6; }
#deeds .build { background: #2a1d05; color: var(--brass); }
#deeds .reactions .float small { background: rgba(0,0,0,.6); color: #fff; }
#deedsSheet .sheet-panel { background: #fff; border-top: 1px solid #e6e1d6; }
#deedsSheet .btn-ghost { background: #f6f3ec; color: var(--ink); border-color: #d9d3c6; }
#deedsSheet .pay-item { background: #f6f3ec; border-color: #e6e1d6; }
#deedsSheet .pay-item.on { border-color: var(--bad); background: #fde8ea; }
#deedsSheet .pgroup { background: #f6f3ec; border: 1.5px solid #e6e1d6; border-left: 6px solid var(--gc, #ccc); }
#deedsSheet .pgroup.complete { background: #ecf8f0; border-color: var(--good); border-left-color: var(--gc, #ccc); }
#deedsSheet .cd-kind { color: var(--brass-deep); }
#deedsSheet .quip { color: #8a6d1d; }
#deedsSheet .dcard.big { box-shadow: 0 6px 16px rgba(40,30,10,.2); }
#deedsSheet .icon-btn { background: #efeae0; }
#deedsSheet .toggle input { accent-color: var(--brass-deep); }
#deeds .money-chip, #deedsSheet .money-chip { background: #2a9d5c; }

/* Deeds: full-width stacked player tables */
.opponents { grid-template-columns: 1fr; }
#deeds .opp-groups, #deeds .my-groups { display: grid; grid-template-columns: 1fr; gap: 6px; }
#deeds .pgroup { width: 100%; }
#deeds .pg-cards .prop-chip { font-size: 12px; padding: 5px 9px; }
#deeds .prop-chip.picked { outline: 3px solid var(--bad); outline-offset: 1px; }
/* Pay with real cards */
.pay-cards { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; justify-content: center; }
.pay-card { display: grid; justify-items: center; gap: 4px; cursor: pointer; }
.pay-card .dcard { transition: transform .12s, box-shadow .12s; }
.pay-card.on .dcard { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--bad), 0 8px 18px rgba(0,0,0,.25); }
.pay-from { font-size: 11px; color: var(--ink-dim); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
/* Brutal cards */
.dcard.brutal .action-band { background: #b3001b; color: #fff; }
.dcard.brutal { box-shadow: 0 0 0 2px #b3001b, 0 2px 6px rgba(40,30,10,.18); }
/* Event pop-ups */
.event-pop { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translateX(-50%); z-index: 15; width: min(92vw, 420px); background: #1d1a14; color: #fff; border-radius: 16px; padding: 12px 14px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.35); animation: popIn .25s ease-out; font-size: 14px; line-height: 1.3; }
.event-pop.big { background: linear-gradient(135deg, #b3001b, #f08c00); font-size: 15px; font-weight: 700; }
.event-pop.out { animation: popOut .3s ease-in forwards; }
.event-pop .avatar { width: 36px; height: 36px; font-size: 14px; }
.ev-icon { font-size: 24px; }
.ev-card { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,255,255,.2); border-radius: 6px; padding: 2px 7px; margin-bottom: 4px; }
@keyframes popIn { from { transform: translate(-50%, -20px) scale(.9); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
@keyframes popOut { to { transform: translate(-50%, -16px); opacity: 0; } }
/* Chat toast */
.toast.chat { background: #1d1a14; color: #fff; text-align: left; max-width: min(92vw, 420px); }
/* Winner overlay */
.win-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(8, 20, 14, .92); display: grid; place-items: center; }
.win-overlay canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.win-card { position: relative; text-align: center; display: grid; gap: 8px; justify-items: center; padding: 24px; animation: winIn .6s cubic-bezier(.2, 1.4, .4, 1); }
.win-trophy { font-size: 96px; line-height: 1; filter: drop-shadow(0 10px 20px rgba(0,0,0,.5)); animation: bob 1.6s ease-in-out infinite; }
.win-label { font-size: 14px; text-transform: uppercase; letter-spacing: .3em; color: #f6c453; font-weight: 800; }
.win-name { font-family: var(--display); font-weight: 700; font-size: clamp(44px, 14vw, 84px); color: #fff; line-height: 1; text-shadow: 0 6px 0 #8a5f0d, 0 16px 40px rgba(0,0,0,.5); text-wrap: balance; }
.win-sub { color: rgba(255,255,255,.8); font-size: 18px; margin-bottom: 12px; }
.win-card .btn-big { width: auto; padding-inline: 40px; }
@keyframes winIn { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }

.ev-why { margin-top: 5px; font-size: 12px; font-weight: 600; opacity: .9; line-height: 1.35; border-top: 1px solid rgba(255,255,255,.25); padding-top: 5px; }
