/* Hold'em / Poker Day — felt on a wooden table, parchment + wax seals. Phone-first 390x844. poker1 */
@font-face { font-family: "Cinzel Deco"; src: url("assets/fonts/CinzelDecorative-Bold.ttf"); font-weight: 700; }
@font-face { font-family: "Crimson"; src: url("assets/fonts/CrimsonText-Regular.ttf"); }
@font-face { font-family: "Crimson"; src: url("assets/fonts/CrimsonText-Bold.ttf"); font-weight: 700; }
:root { --ink: #2a1a0c; --ink-soft: #5a4028; --brass: #b8893a; --wood: #6b4226; --wood-dark: #3a2410; --parch: #f3e2c0; --parch-dark: #d9bf8e; --wax: #9c1e1e; --felt: #1f6b45; --felt-d: #124a2f; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }   /* ns2: lock page scroll */
body.poker-page { font-family: "Crimson", Georgia, serif; color: var(--ink); height: 100%; min-height: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255, 190, 110, .28), transparent 55%), linear-gradient(180deg, #3a2a1c 0%, #2a1d13 60%, #1c140d 100%); }
.pill-row { display: flex; gap: 6px; flex: 1; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); font-weight: 700; font-size: .95rem; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
.pill.gems i { width: 18px; height: 18px; background: url("assets/town/icon_gems.png") center/contain no-repeat; display: inline-block; }
.poker { max-width: 520px; margin: 0 auto; padding: 66px 8px 30px; }
.parchment { background: linear-gradient(180deg, #f7e8c8, #e8d0a0); border: 2px solid #a07a3e; border-radius: 14px; box-shadow: inset 0 0 30px rgba(120, 80, 30, .25), 0 8px 20px rgba(0,0,0,.4); }
.btn { font-family: "Crimson", serif; font-weight: 700; cursor: pointer; border-radius: 10px; border: 2px solid var(--brass); color: #fbe7bf;
  background: linear-gradient(180deg, #7a4d2b, #4f2f16); box-shadow: 0 4px 0 #2d1b0b; padding: 10px 14px; font-size: 1rem; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2d1b0b; }
.btn[disabled] { opacity: .45; }
.btn.small { font-size: .9rem; padding: 7px 10px; }
.btn.big { font-size: 1.12rem; padding: 12px; flex: 1; }
.btn.wide { display: block; width: 100%; margin-top: 8px; }
.btn.huge { display: block; width: 100%; font-size: 1.3rem; padding: 15px; margin: 12px 0 4px; font-family: "Cinzel Deco", serif; }
.btn.wax { background: radial-gradient(circle at 35% 30%, #d0413a, var(--wax) 60%, #5a0e0e); border-color: #e9c27a; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.btn.danger { background: linear-gradient(180deg, #8a2b22, #5a160f); }

/* lobby */
.lobby-card { position: relative; text-align: center; padding: 34px 18px 16px; margin-top: 26px; }
.lobby-card .seal { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: #fbe7bf; background: radial-gradient(circle at 35% 30%, #d0413a, var(--wax) 60%, #5a0e0e); border: 3px solid #e9c27a; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.lobby-card h1 { font-family: "Cinzel Deco", serif; margin: 4px 0 6px; font-size: 1.7rem; }
.lobby-card .prize { font-size: 1.35rem; margin: 4px 0; }
.lobby-card .free { display: inline-block; margin: 2px 0 8px; padding: 3px 14px; border-radius: 999px; background: #2f6b3f; color: #f3ffe8; font-weight: 700; }
.facts { list-style: none; padding: 0; margin: 6px 0 10px; font-size: 1.02rem; }
.facts li { padding: 3px 0; border-bottom: 1px dashed rgba(90, 64, 40, .3); }
.field { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0; font-weight: 700; }
.seg { display: inline-flex; border: 2px solid var(--brass); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-weight: 700; padding: 6px 14px; border: 0; background: #f3e2c0; color: var(--ink); cursor: pointer; }
.seg button.on { background: #6b4226; color: #fbe7bf; }
.standin { font-size: .82rem; color: var(--ink-soft); margin: 10px 0 0; }

/* strip */
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 4px 0 6px; }
.strip div { text-align: center; padding: 5px 2px; border-radius: 9px; background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); }
.strip small { display: block; font-size: .68rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .02em; }
.strip b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.table-head { display: flex; align-items: center; gap: 8px; justify-content: center; color: #fbe7bf; margin: 2px 0 4px; font-size: 1.05rem; }
.table-head .ft { font-family: "Cinzel Deco", serif; color: #ffd98a; }
.table-head .eye { font-size: .88rem; padding: 2px 9px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(233, 194, 122, .5); }
.table-head .watch-tag { font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: #1d3f6a; color: #e6f0ff; }

/* table */
.table-wrap { padding: 4px 0; }
.table { position: relative; width: 100%; height: 440px; }
.felt { position: absolute; left: 7%; right: 7%; top: 9%; bottom: 9%; border-radius: 48% / 42%;
  background: radial-gradient(ellipse at 50% 40%, #2a8a5a, var(--felt) 55%, var(--felt-d));
  border: 14px solid #6b4226; box-shadow: inset 0 0 0 3px #b8893a, inset 0 8px 30px rgba(0,0,0,.45), 0 0 0 4px #3a2410, 0 12px 26px rgba(0,0,0,.6);
  background-clip: padding-box; }
.felt::before { content: ""; position: absolute; inset: -14px; border-radius: inherit; background: repeating-linear-gradient(95deg, rgba(0,0,0,.08) 0 3px, transparent 3px 9px); pointer-events: none; }
.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.board { display: flex; gap: 4px; }
.pot { text-align: center; color: #fbe7bf; min-height: 36px; }
.pot-main { display: block; font-weight: 700; font-size: 1.02rem; text-shadow: 0 1px 2px #000; }
.pot-sub { display: block; font-size: .82rem; color: #ffe6a8; }
.seal-chip { font: inherit; font-size: .74rem; padding: 3px 9px; border-radius: 999px; border: 1px solid #e9c27a; background: rgba(40, 20, 8, .55); color: #fbe7bf; cursor: pointer; }
.seal-chip[hidden] { display: none; }

/* cards */
.pcard { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 30px; height: 42px; border-radius: 5px; background: #fffaf0; border: 1px solid #7a6040;
  color: #1a1a1a; font-weight: 700; line-height: 1; box-shadow: 0 2px 4px rgba(0,0,0,.4); }
.pcard b { font-size: .92rem; } .pcard i { font-style: normal; font-size: .95rem; }
.pcard.red { color: #b3121d; }
.pcard.bd { width: 38px; height: 54px; } .pcard.bd b { font-size: 1.1rem; } .pcard.bd i { font-size: 1.2rem; }
.pcard.slot { background: rgba(0,0,0,.18); border: 1px dashed rgba(255, 230, 170, .35); box-shadow: none; }
.pcard.back { background: radial-gradient(circle at 50% 50%, #c33a33 0 28%, transparent 30%), repeating-linear-gradient(45deg, #7c1616 0 4px, #9c1e1e 4px 8px); border: 2px solid #e9c27a; }
.pcard.sm { width: 24px; height: 34px; } .pcard.sm b { font-size: .78rem; } .pcard.sm i { font-size: .8rem; }
.pcard.lg { width: 56px; height: 80px; border-radius: 8px; } .pcard.lg b { font-size: 1.5rem; } .pcard.lg i { font-size: 1.6rem; }

/* seats */
.seat { position: absolute; transform: translate(-50%, -50%); width: 80px; text-align: center; z-index: 2; }
.seat .cards { height: 34px; display: flex; justify-content: center; gap: 2px; margin-bottom: -6px; }
.seat .plate { display: block; padding: 3px 4px; border-radius: 9px; background: linear-gradient(180deg, #f7e8c8, #dcc08c); border: 2px solid #8a6a38; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.seat .nm { display: block; font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .nm .bot { font-style: normal; font-size: .7rem; }
.seat .ch { display: block; font-size: .8rem; font-variant-numeric: tabular-nums; }
.seat.me .plate { background: linear-gradient(180deg, #ffe9a8, #e6b94a); border-color: #8a5a10; }
.seat.acting .plate { box-shadow: 0 0 0 3px #ffd24a, 0 0 14px #ffd24a; }
.seat.folded { opacity: .5; }
.seat.won .plate { box-shadow: 0 0 0 3px #7fe08a, 0 0 16px #7fe08a; }
.seat .st { display: inline-block; margin-top: 2px; font-size: .72rem; padding: 1px 6px; border-radius: 999px; background: rgba(20, 10, 4, .75); color: #fbe7bf; }
.seat .dealer { position: absolute; right: -4px; top: 30px; width: 20px; height: 20px; border-radius: 50%; background: #fffaf0; border: 2px solid #3a2410; font-size: .7rem; font-weight: 700; line-height: 16px; }
.seat .bet { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); font-size: .74rem; padding: 1px 7px; border-radius: 999px; background: #f0d27a; border: 1px solid #7a5a1a; font-weight: 700; white-space: nowrap; }
.seat.empty { opacity: .35; } .seat .open { font-size: .72rem; color: #fbe7bf; border: 1px dashed #fbe7bf; border-radius: 8px; padding: 2px 8px; }

/* my row + actions */
.me-row { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 84px; }
.my-cards { display: flex; gap: 6px; } .my-cards.folded { opacity: .45; }
.my-info { color: #fbe7bf; text-align: left; } .my-info b { display: block; font-size: 1.3rem; } .my-info small { opacity: .8; }
.my-info .hn { display: block; margin-top: 3px; font-size: .86rem; padding: 1px 8px; border-radius: 999px; background: rgba(0,0,0,.35); }
.spect-note { color: #e6f0ff; background: rgba(29, 63, 106, .7); padding: 8px 14px; border-radius: 10px; margin: 6px auto; }
.actions { display: flex; gap: 8px; min-height: 64px; align-items: stretch; }
.btn.act { flex: 1; font-size: 1.2rem; padding: 16px 6px; }
.btn.act.fold { background: linear-gradient(180deg, #5a5048, #3a332d); }
.btn.act.call { background: linear-gradient(180deg, #2f7a4a, #1d5232); }
.wait { color: #fbe7bf; margin: auto; opacity: .85; }
.raise-panel { flex: 1; padding: 8px; border-radius: 12px; background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); }
.raise-panel .quick { display: flex; gap: 6px; } .raise-panel .quick .btn { flex: 1; }
.raise-panel input[type=range] { width: 100%; margin: 12px 0; accent-color: #9c1e1e; height: 28px; }
.raise-panel .row { display: flex; gap: 8px; }
.controls { display: flex; gap: 6px; justify-content: center; margin: 10px 0 4px; flex-wrap: wrap; }
.feed { text-align: center; color: #ffd98a; min-height: 1em; margin: 2px 0; }

/* sheets */
.sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(20,10,4,.65); display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop[hidden] { display: none; }
.sheet { position: relative; width: min(100vw, 520px); max-height: 86vh; overflow: auto; padding: 22px 16px 18px; border-radius: 18px 18px 0 0; }
.sheet-close { position: absolute; right: 10px; top: 8px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--brass); background: #f3e2c0; font-size: 1rem; cursor: pointer; }
.sheet h2 { font-family: "Cinzel Deco", serif; margin: 4px 0 8px; text-align: center; }
.big-seal { width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #fbe7bf;
  background: radial-gradient(circle at 35% 30%, #d0413a, var(--wax) 60%, #5a0e0e); border: 3px solid #e9c27a; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.big-seal.gold { background: radial-gradient(circle at 35% 30%, #ffe08a, #c08a1e 60%, #6a4a0a); color: #3a2410; }
.notice, .bust, .champ { text-align: center; } .notice p, .bust p, .champ p { font-size: 1.1rem; margin: 6px 0; }
.won { font-size: 1.25rem !important; } .place { font-size: 1.2rem !important; } .honor { font-weight: 700; }
.fine { font-size: .85rem; color: var(--ink-soft); }
.seal-sheet code { display: block; word-break: break-all; font-size: .78rem; padding: 6px 8px; border-radius: 8px; background: #fffaf0; border: 1px dashed #a07a3e; }
.watch-list .watch-row-old { display: grid; grid-template-columns: 1.3fr 1fr 1fr .8fr; gap: 4px; align-items: center; width: 100%; margin: 5px 0; padding: 12px 10px; border-radius: 10px; font: inherit; text-align: left;
  background: linear-gradient(180deg, #7a4d2b, #4f2f16); color: #fbe7bf; border: 2px solid var(--brass); cursor: pointer; }
.watch-row.on { box-shadow: 0 0 0 3px #ffd24a; } .watch-row .wt { font-weight: 700; } .watch-row .eye { text-align: right; }
.tip { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); z-index: 95; width: min(92vw, 360px); padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(180deg, #fff6df, #efd9a8); border: 2px solid var(--brass); box-shadow: 0 8px 24px rgba(0,0,0,.45); text-align: center; }
.tip p { margin: 0 0 8px; font-size: 1.02rem; }
.tip[hidden] { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; padding: 10px 16px; border-radius: 10px; background: rgba(30, 16, 6, .92); color: #fbe7bf; border: 1px solid var(--brass); }
.toast[hidden] { display: none !important; }
.dev { margin-top: 18px; padding: 10px; border-radius: 10px; background: rgba(0,0,0,.35); color: #d8c3a0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dev .note { flex-basis: 100%; font-size: .78rem; margin: 4px 0 0; }
.screen[hidden] { display: none; }

/* away + action timer + late registration */
.seat .away-tag{position:absolute;left:50%;top:-6px;transform:translateX(-50%);background:#5a4630;color:#f6e7c1;border:1px solid #c9a86a;border-radius:8px;font:700 10px/1 Georgia,serif;padding:3px 6px;letter-spacing:.04em;text-transform:uppercase;z-index:3}
.seat.me .away-tag{background:#8a2f22}
.turn-timer{display:inline-block;margin-top:4px;padding:3px 8px;border-radius:10px;background:#2f4a2c;color:#f6e7c1;font:700 13px/1.2 Georgia,serif}
.turn-timer.bank{background:#8a2f22;animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.65}}
.away-row{width:100%;text-align:center;background:#f3e3bd;border:2px solid #b08a4e;border-radius:14px;padding:10px 12px;box-shadow:0 3px 0 #6b4b22}
.away-row p{margin:0 0 8px;color:#3b2a16;font:15px/1.35 Georgia,serif}
#btnLateReg{display:block;margin:8px auto 0;width:92%}
#meRow:has(#spectNote){flex-direction:column;align-items:center;gap:6px}
#meRow:has(#spectNote) #btnLateReg{width:auto;padding:10px 22px;margin:0}

/* High Table card */
.lobby-card.high{margin-top:40px}
.lobby-card .seal.gold{background:radial-gradient(circle at 35% 30%,#f3d77a,#b8872a 70%);color:#3b2a16}
.lobby-card .free.earned{background:#7a5a1e}
.ht-when{margin:2px 0 6px;font-size:.98rem}
.ht-status{display:inline-block;margin:2px 0 6px;padding:3px 12px;border-radius:999px;border:1px dashed rgba(90,64,40,.5);font-weight:700;font-size:.95rem}
.ht-status.on{background:#2f6b3f;color:#f3ffe8;border-style:solid}
.lobby-card.high h3{margin:8px 0 2px;font-family:"Cinzel Deco",serif;font-size:1.05rem}
.facts.earn li{font-size:.95rem;text-align:left;padding-left:6px}
.table-head .ht-tag{color:#e9c46a;margin-right:4px}

/* Poker Day schedule: ONE day every 3 weeks, three games (pokerday_v1) */
.pday{margin-top:6px;padding:12px 12px 10px;text-align:center}
.pday .pd-title{font-family:"Cinzel Deco",serif;margin:0;font-size:1.6rem}
.pday .pd-date{margin:2px 0 0;font-size:1.25rem;font-weight:700;color:#7a2a1e}
.pday.today .pd-date{color:#2f6b3f}
.pday .pd-sub{margin:0 0 8px;font-size:.95rem;color:var(--ink-soft)}
.pd-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.pd-row{display:grid;grid-template-columns:78px 1fr auto;align-items:center;gap:8px;padding:7px 10px;border-radius:10px;border:1px solid rgba(90,64,40,.35);background:rgba(255,248,230,.55);text-align:left}
.pd-row .pd-time{font:700 1.02rem/1.1 Georgia,serif;font-variant-numeric:tabular-nums}
.pd-row .pd-name{font-size:1.05rem;line-height:1.15}
.pd-row .pd-name b{display:block;font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;color:var(--ink-soft)}
.pd-row .pd-name small{display:block;font-size:.82rem;color:var(--ink-soft)}
.pd-row .pd-cd{font-weight:700;font-size:.9rem;text-align:right;padding:3px 8px;border-radius:999px;background:#ead6ad;white-space:nowrap}
.pd-row.live{background:#e4f3dc;border-color:#2f6b3f;box-shadow:0 0 0 2px #2f6b3f inset}
.pd-row.live .pd-cd{background:#2f6b3f;color:#f3ffe8}
.pd-row.done{opacity:.55}
.pday .pd-next{margin:8px 0 0;font-weight:700;font-size:.98rem}
.slot-tag{margin:0;font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;color:var(--ink-soft);font-weight:700}
.pd-cd-line{margin:2px 0 6px;font-weight:700;font-size:1rem}
.pd-cd-line.live{color:#2f6b3f}
.lobby-card.live{box-shadow:0 0 0 3px #e9c46a,0 6px 18px rgba(0,0,0,.4)}
.lobby-card .seal.night{background:radial-gradient(circle at 35% 30%,#4a5a9a,#1d2552 70%);color:#f3e7b8}
.lobby-card .free.buyin{background:#1d2552}
.table-head .ht-tag.night{color:#b9c6ff}
.lobby-card.night{margin-top:40px}
#clockSeg{flex-wrap:wrap}
@media (min-width:1000px){
  .poker.lobby-wide{max-width:1180px}
  .pday{max-width:620px;margin:6px auto 0}
  .pd-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;align-items:start}
  .pd-cards .lobby-card{margin-top:40px}
  .poker.lobby-wide .test-tools{max-width:620px;margin-left:auto;margin-right:auto}
}
.off-week{margin:8px 4px 4px;padding:8px;border:1px dashed rgba(90,64,40,.5);border-radius:10px;font-style:italic}
.lobby-card.resting h1,.lobby-card.resting .prize{opacity:.55}
[hidden]{display:none !important}
.ht-status.earned{background:#7a5a1e;color:#fbeed0;border-style:solid}
.claim-by{margin:4px 0 6px;font-size:.9rem;font-style:italic}

/* 🧪 Test tools drawer: every prototype-only control lives here */
.test-tools{display:block;margin-top:22px;border:2px dashed #b8893a}
.test-tools summary{cursor:pointer;font-weight:700;color:#f3d9a4;list-style:none;padding:4px 2px;font-size:1rem}
.test-tools summary::-webkit-details-marker{display:none}
.test-tools summary::after{content:" ▸";}
.test-tools[open] summary::after{content:" ▾";}
.test-tools:not([open]){background:rgba(0,0,0,.25);padding:8px 10px}
.test-tools[open]{display:flex}
.test-tools .tt-label{flex-basis:100%;margin:0 0 4px;color:#ffcf8a;font-weight:700;font-size:.9rem}
.test-tools .field{flex-basis:100%;display:flex;align-items:center;gap:8px;color:#d8c3a0}
/* showdown pause */
.pcard.win{box-shadow:0 0 0 2px #ffd54a,0 0 12px 3px rgba(255,213,74,.85);transform:translateY(-3px);z-index:2}
.pcard.dim{opacity:.45;filter:saturate(.6)}
.seat.lost .cards,.seat.lost .plate{opacity:.5;filter:grayscale(.5)}
.seat .hname{position:absolute;left:50%;bottom:-17px;transform:translateX(-50%);white-space:nowrap;background:rgba(20,40,25,.92);color:#fbe7bf;border:1px solid #c9a86a;border-radius:8px;font:700 10px/1.2 Georgia,serif;padding:2px 6px;z-index:4}
.seat.won .hname{background:#b8872a;color:#2a1a0c;border-color:#ffe08a}
.seat .lost-tag{position:absolute;right:-6px;top:-6px;background:#5a5048;color:#f3e2c0;border-radius:6px;font:700 9px/1 Georgia,serif;padding:2px 4px;text-transform:uppercase;z-index:4}
#sdResult{font-weight:700}
#sdPots{font-size:.78rem;line-height:1.25}
.chipfly{position:absolute;left:50%;top:50%;width:16px;height:16px;margin:-8px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe9a0,#c9941e 60%,#7a5a10);border:2px dashed #fff3c4;animation:chipfly 1.1s ease-in forwards;pointer-events:none;z-index:5}
.chipfly.d2{animation-delay:.15s;opacity:0}
@keyframes chipfly{0%{transform:translate(0,0) scale(1);opacity:1}85%{opacity:1}100%{transform:translate(var(--dx),var(--dy)) scale(.7);opacity:0}}
.next-hand{background:linear-gradient(180deg,#2f7a4a,#1d5232)}
.pot{position:relative}

/* showdown side panel (slides in from the right during the pause; narrow so the table stays visible) */
.sd-panel { position: fixed; right: 0; top: 112px; z-index: 60; width: 136px; max-height: 214px; overflow-y: auto; padding: 6px 6px 8px; border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); border-right: 0; box-shadow: -4px 6px 16px rgba(0,0,0,.45);
  transform: translateX(105%); transition: transform .28s ease-out; }
.sd-panel.in { transform: translateX(0); }
.sd-panel[hidden] { display: none; }
.sd-head { display: flex; align-items: center; justify-content: space-between; font-size: .9rem; border-bottom: 1px solid var(--brass); padding-bottom: 3px; margin-bottom: 4px; }
.sd-x { border: 0; background: none; font-size: .95rem; color: var(--ink-soft); cursor: pointer; padding: 2px 4px; min-width: 28px; min-height: 28px; }
.sd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sd-row { padding: 3px 4px; border-radius: 8px; background: rgba(255,255,255,.35); border: 1px solid rgba(90,64,40,.3); }
.sd-row.sd-win { background: rgba(255,215,120,.55); border-color: var(--brass); }
.sd-top { display: flex; justify-content: space-between; gap: 4px; align-items: baseline; }
.sd-name { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-rank { color: var(--ink-soft); font-weight: 400; }
.sd-amt { font-style: normal; font-weight: 700; font-size: .78rem; color: #1f6b45; }
.sd-body { display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.sd-cards { display: flex; gap: 2px; flex: none; }
.pcard.xs { width: 19px; height: 27px; font-size: .72rem; border-radius: 4px; }
.pcard.xs b { font-size: .68rem; line-height: 1; } .pcard.xs i { font-size: .62rem; line-height: 1; }
.sd-panel .pcard.win { transform: none; box-shadow: 0 0 0 2px #ffd54a; }
.sd-hand { display: block; font-size: .68rem; line-height: 1.1; color: var(--ink); }
.sd-note { display: block; font-size: .68rem; color: var(--ink-soft); }
@media (min-width: 700px) { .sd-panel { width: 210px; max-height: 60vh; } .sd-name { font-size: .95rem; } .sd-hand { font-size: .85rem; } }

/* watch list: one parchment card per table */
.watch-list .watch-row { margin: 7px 0; border-radius: 12px; background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); box-shadow: 0 3px 8px rgba(0,0,0,.25); overflow: hidden; }
.watch-list .watch-row.gold { background: linear-gradient(180deg, #fff1b8, #e8c35a); border-color: #b8860b; box-shadow: 0 0 0 2px #ffd54a, 0 4px 12px rgba(0,0,0,.3); }
.watch-list .watch-row.on { box-shadow: 0 0 0 3px #ffd24a; }
.wr-head { display: grid; gap: 3px; width: 100%; padding: 10px 11px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; min-height: 48px; }
.wr-top { display: flex; align-items: baseline; gap: 8px; } .wr-top .wt { font-size: 1.05rem; flex: 1; }
.wr-top .eye { font-size: .85rem; color: var(--ink-soft); } .wr-top .wpot { font-weight: 700; font-size: .9rem; }
.wr-lead { font-size: .92rem; } .wr-lead .ally, .seat-list .fa { font-style: normal; color: var(--ink-soft); font-size: .82rem; }
.wr-rest { font-size: .8rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wr-rest .more { color: var(--ink); }
.wr-full { padding: 0 11px 11px; } .wr-full[hidden] { display: none; }
.seat-list { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid rgba(90,64,40,.35); }
.seat-list li { display: grid; grid-template-columns: 1.1fr 1.3fr .8fr; gap: 6px; padding: 5px 0; border-bottom: 1px dashed rgba(90,64,40,.25); font-size: .86rem; align-items: baseline; }
.seat-list li.me { font-weight: 700; } .seat-list .fc { text-align: right; font-weight: 700; }
.standin-note { margin-top: 8px; }

/* chat drawer: Table chat when seated, Rail chat when watching */
#btnChat.unread::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 5px; border-radius: 50%; background: var(--wax); vertical-align: middle; }
.chat-drawer { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 70; max-width: 420px; margin: 0 auto; padding: 8px; border-radius: 14px;
  background: linear-gradient(180deg, var(--parch), var(--parch-dark)); border: 2px solid var(--brass); box-shadow: 0 -4px 18px rgba(0,0,0,.5); }
.chat-drawer[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; }
.chat-tab { font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.5); border: 1px solid var(--brass); }
.chat-who { margin-left: 6px; color: var(--ink-soft); font-size: .78rem; }
.chat-list { list-style: none; margin: 6px 0; padding: 0 2px; height: 150px; overflow-y: auto; font-size: .9rem; }
.chat-list li { padding: 3px 0; border-bottom: 1px dashed rgba(90,64,40,.2); } .chat-list li.empty { color: var(--ink-soft); border: 0; }
.chat-list li.mine .cw { color: #1f6b45; }
.chat-list .cw { border: 0; background: none; font: inherit; font-weight: 700; color: var(--wood); padding: 0; cursor: pointer; }
.c-acts { display: inline-flex; gap: 6px; margin-left: 6px; } .c-acts[hidden] { display: none; }
.c-acts button { font: inherit; font-size: .78rem; padding: 2px 8px; border-radius: 8px; border: 1px solid var(--brass); background: #fff6df; cursor: pointer; }
.chat-form { display: flex; gap: 6px; } .chat-form input { flex: 1; min-width: 0; font: inherit; padding: 9px 10px; border-radius: 10px; border: 2px solid var(--brass); background: #fffaf0; }

/* hero-face portraits: round, wood ring + small wax seal */
.pface { display: inline-block; border-radius: 50%; object-fit: cover; background: #3a2410; border: 2px solid #6b4226; box-shadow: 0 0 0 1px #e9c27a, 0 2px 5px rgba(0,0,0,.5); vertical-align: middle; }
.seat .plate { position: relative; }
.seat .plate.has-face { padding-left: 22px; }
.seat-face { position: absolute; left: -12px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; }
.seat.me .seat-face { border-color: #8a1616; box-shadow: 0 0 0 2px #e9c27a, 0 0 0 4px #9c1e1e, 0 2px 6px rgba(0,0,0,.6); }
.seat .plate.has-face::after { content: ""; position: absolute; left: 12px; top: calc(50% + 9px); width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d24a3a, #8a1616); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.seat.me .plate.has-face::after { display: none; }
.sd-face { width: 16px; height: 16px; border-width: 1px; margin-right: 3px; }
.wl-face { width: 28px; height: 28px; margin-right: 5px; }
.sl-face { width: 20px; height: 20px; border-width: 1px; margin-right: 4px; }

/* ---------- showdown (ns1): big and centered for ~2.6 s, then it shrinks to the side summary ---------- */
.sd-main { display: none; }
.sd-panel.big { right: auto; left: 50%; top: 50%; width: min(94vw, 520px); max-height: min(86vh, 640px); overflow: hidden; padding: 14px 16px 16px; border-radius: 18px; border-right: 2px solid var(--brass);
  transform: translate(-50%, -50%) scale(1); z-index: 120; box-shadow: 0 0 0 100vmax rgba(10,6,2,.35), 0 18px 50px rgba(0,0,0,.6); animation: sdPop .32s ease-out; cursor: pointer; }
@keyframes sdPop { from { transform: translate(-50%, -50%) scale(.6); opacity: 0; } }
.sd-panel.big .sd-head { flex-wrap: wrap; justify-content: center; text-align: center; font-size: 1.15rem; padding-bottom: 6px; margin-bottom: 8px; position: relative; }
.sd-panel.big .sd-head > b { width: 100%; font-family: "Cinzel Deco", serif; letter-spacing: .04em; color: var(--ink-soft); font-size: .95rem; }
.sd-panel.big .sd-main { display: block; width: 100%; margin: 2px 0 0; font: 700 1.45rem/1.15 "Cinzel Deco", serif; color: var(--ink); }
.sd-panel.big .sd-x { position: absolute; right: -6px; top: -8px; }
.sd-panel.big .sd-list { gap: 8px; }
.sd-panel.big .sd-row { padding: 8px 10px; }
.sd-panel.big .sd-row:nth-child(n+5) { display: none; }
.sd-panel.big .sd-name { font-size: 1.15rem; } .sd-panel.big .sd-amt { font-size: 1.15rem; }
.sd-panel.big .sd-face { width: 26px; height: 26px; }
.sd-panel.big .sd-body { gap: 10px; margin-top: 4px; }
.sd-panel.big .sd-cards { gap: 4px; }
.sd-panel.big .pcard.xs { width: 44px; height: 62px; border-radius: 6px; }
.sd-panel.big .pcard.xs b { font-size: 1.3rem; } .sd-panel.big .pcard.xs i { font-size: 1.15rem; }
.sd-panel.big .sd-hand { font-size: 1.05rem; font-weight: 700; }
.sd-panel.big .sd-row:not(.sd-win) { opacity: .85; }
.sd-panel.big .sd-row:not(.sd-win) .pcard.xs { width: 34px; height: 48px; } .sd-panel.big .sd-row:not(.sd-win) .pcard.xs b { font-size: 1rem; }

/* ---------- no-scroll lobby (ns1): Poker Day list picks ONE game card; fine print behind "How it works" ---------- */
#lobby .pday { margin-top: 0; padding: 8px 10px 8px; }
#lobby .pday .pd-title { font-size: 1.3rem; } #lobby .pday .pd-date { font-size: 1.05rem; } #lobby .pday .pd-sub { margin: 0 0 6px; font-size: .85rem; }
#lobby .pd-list { gap: 5px; }
#lobby .pd-row { padding: 5px 10px; cursor: pointer; }
#lobby .pd-row.picked { border: 2px solid #b8893a; background: #fff3d6; box-shadow: 0 0 0 2px rgba(233,196,106,.6); }
#lobby .pday .pd-next { margin: 5px 0 0; font-size: .88rem; }
#lobby .lobby-card { margin-top: 34px; padding: 30px 14px 12px; }
#lobby .lobby-card h1 { font-size: 1.45rem; margin: 2px 0 4px; }
#lobby .lobby-card .prize { font-size: 1.2rem; margin: 2px 0; }
#lobby .lobby-card .free { margin: 2px 0 4px; }
#lobby .lobby-card .pd-cd-line, #lobby .lobby-card .ht-status { margin: 4px auto; }
#lobby .lobby-card h3, #lobby .lobby-card ul.facts { display: none; }
#lobby .how-btn { display: inline-block; margin: 4px 0 6px; padding: 6px 14px; min-height: 40px; }
#lobby .lobby-card .btn.huge { margin: 6px 0 2px; }
#lobby .lobby-card .btn.wide { margin-top: 6px; }
.how-sheet .facts { display: block; text-align: left; }
.how-sheet h3 { font-family: "Cinzel Deco", serif; margin: 4px 0; font-size: 1.05rem; }
@media (max-width: 999px) { #lobby .pd-cards .lobby-card:not(.picked) { display: none; } }
@media (min-width: 1000px) { #lobby .pd-cards .lobby-card { margin-top: 34px; } #lobby .pd-row.picked { border-color: rgba(90,64,40,.35); box-shadow: none; background: rgba(255,248,230,.55); } }
/* test tools: small pill in the corner */
.poker > .test-tools { position: fixed; z-index: 130; right: 8px; bottom: 8px; margin: 0 !important; padding: 0 !important; border: 0; background: none !important; max-width: none !important; }
.poker > .test-tools > summary { height: 32px; line-height: 28px; padding: 0 10px; border-radius: 999px; border: 2px solid #b8893a; background: rgba(40,24,10,.8); color: #f3d9a4; font-size: .8rem; opacity: .85; list-style: none; }
.poker > .test-tools > summary::after { content: ""; }
.poker > .test-tools[open] { left: 8px; max-width: 560px !important; margin-left: auto !important; padding: 10px !important; border-radius: 12px; background: rgba(30,18,8,.97) !important; border: 2px solid #b8893a; max-height: calc(100vh - 80px); overflow-y: auto; }

/* ---------- table (ns1): fits the screen; action tags sit ON the name plate so they never cover anyone's cards ---------- */
#game:not([hidden]) { height: calc(100vh - 74px); height: calc(100dvh - 74px); display: flex; flex-direction: column; }
#game > .strip { margin: 2px 0 4px; flex: none; } #game > .table-head { flex: none; margin: 0 0 2px; }
#game > .table-wrap { flex: 1; min-height: 300px; padding: 2px 0; display: flex; }
#game .table { height: auto; flex: 1; }
#game > .me-row, #game > .actions, #game > .controls, #game > .feed { flex: none; }
#game > .me-row { min-height: 76px; }
#game > .controls { margin: 6px 0 2px; }
#game > .feed { margin: 0; height: 1.25em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.seat .st { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); margin: 0; z-index: 5; white-space: nowrap; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.5); pointer-events: none; }
.seat.me .bet, .seat.me .hname { top: auto; bottom: calc(100% + 2px); }
.seat.me .hname { bottom: calc(100% + 2px); }
.poker { padding-bottom: 8px; }
@media (max-width: 699px) { #game > .table-wrap { padding: 2px 30px; } .seat { width: 76px; } }
/* all-in run-out: each new street flips onto the board */
.pcard.bd.deal { animation: dealIn .45s ease-out both; }
.pcard.bd.deal.d1 { animation-delay: .12s; } .pcard.bd.deal.d2 { animation-delay: .24s; }
@keyframes dealIn { from { transform: translateY(-26px) rotateY(90deg) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.wait.runout { color: #ffd98a; font-weight: 700; }
.seat.me { transform: translate(-50%, -78%); }    /* lift your plate so its tags never touch your own big cards below */
/* night1: Poker Day fits a ~664px phone (Night Game card with its Buy button) */
@media (max-width: 999px) and (max-height: 760px) {
  #lobby .pday .pd-sub, #lobby .pday .pd-next { display: none; }
  #lobby .lobby-card { margin-top: 30px; padding-top: 26px; padding-bottom: 8px; }
  #lobby .lobby-card h1 { font-size: 1.3rem; margin: 0 0 2px; }
  #lobby .how-btn { margin: 2px 0 2px; min-height: 38px; }
  #lobby .lobby-card .btn.huge { margin-top: 4px; }
}
