/* Card Platform: the game screens' own layer (#tp-root). v0.1.9 (Task 9R): the invented felt / seat / card layouts are
   gone; the table itself is Cambio's (css/cp-table.css, js/games/table/). This file keeps the portrait setup screens,
   the session / online screens and the small shared pieces (chip stack, bet meter, leave confirm, joker picker). */
html.tp-open, html.tp-open body { overflow: hidden; }
#tp-root { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; background: var(--c-bg); color: var(--text);
  font-family: var(--font-ui); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#tp-root button { font: inherit; min-height: var(--tap-min); min-width: var(--tap-min); border-radius: var(--r-md); border: 1px solid var(--panel-line);
  background: var(--c-surface); color: var(--text); padding: 0 var(--sp-3); cursor: pointer; }
#tp-root button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: var(--fw-semibold); }
#tp-root button.danger { color: var(--c-card-red); }
#tp-root button.ghost { background: transparent; }
#tp-root button:disabled { opacity: .42; cursor: default; }
#tp-root .hidden { display: none !important; }
/* v0.1.10: the game setup is Cambio's Play now modal (#modal-box.play-diff); these screens are the playlist / online session pages */
.tp-setup { margin: 0 auto; width: min(560px, 100%); max-height: 100%; overflow-y: auto; padding: var(--sp-5) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.tp-setup-head { display: flex; align-items: center; justify-content: space-between; }
.tp-setup h2 { font-family: var(--font-display); font-size: var(--fs-p-h1); margin: 0; }
.tp-setup h2 small { display: block; font-family: var(--font-ui); font-size: var(--fs-p-small); color: var(--muted); font-weight: var(--fw-medium); }
.tp-field { display: flex; flex-direction: column; gap: var(--sp-1); font-weight: var(--fw-semibold); font-size: var(--fs-p-small); }
.tp-field select { font: inherit; font-weight: var(--fw-regular); font-size: var(--fs-p-body); min-height: var(--tap-min); border-radius: var(--r-md); border: 1px solid var(--panel-line); background: var(--c-surface-2); color: var(--text); padding: 0 var(--sp-2); }
.tp-hint, .tp-note { margin: 0; font-size: var(--fs-p-small); color: var(--muted); line-height: var(--lh-snug); }
.tp-error { margin: 0; min-height: 1.2em; color: var(--c-card-red); font-size: var(--fs-p-small); font-weight: var(--fw-semibold); }
.tp-row { display: flex; gap: var(--sp-2); justify-content: flex-end; flex-wrap: wrap; }
/* v0.1.4 chips (chip stack with its number), flying chips */
.tp-chips { display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; font-weight: var(--fw-bold); }
.tp-pile { display: inline-flex; flex-direction: column-reverse; }
.tp-pile i, .tp-fly { display: block; width: 14px; height: 5px; margin-top: -2px; border-radius: 50%; background: #C9A44C; border: 1px solid #7a5a1e; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.tp-pile i:nth-child(2) { background: #B3382C; border-color: #6d1f18; } .tp-pile i:nth-child(3) { background: #1F5A9E; border-color: #123866; } .tp-pile i:nth-child(4) { background: #1E2A2C; border-color: #000; }
.tp-chips.stack b::before { content: none; }
.tp-stack::before { content: none; }
.tp-chips.stack .tp-pile i { width: 10px; height: 4px; margin-top: -1px; }
.tp-chips.stack .tp-pile i:nth-child(n+3) { display: none; }
.tp-fly { position: absolute; z-index: 4; width: 16px; height: 16px; border-radius: 50%; margin: 0; border: 2px dashed #fff8; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .tp-fly { display: none; } .tp-pop { animation: none !important; } }
/* v0.1.4 betting meter (v0.1.9: inside the table's bet sheet) */
.tp-meter { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 6px; width: min(100%, 520px); }
.tp-meter input[type=range] { width: 100%; min-height: 32px; accent-color: var(--accent); }
#tp-root .tp-q { min-width: 44px; padding: 0 6px; font-size: var(--fs-p-small); }
.tp-meter.off { opacity: .55; }
.tp-chipval { min-width: 56px; }
.tp-meter.q3 { grid-template-columns: auto 1fr auto auto auto auto; }
/* setup: table type, number fields */
#tp-root .tp-seg button.on { border: 2px solid var(--accent); font-weight: var(--fw-semibold); }
.tp-field input[type=number] { font: inherit; min-height: var(--tap-min); border-radius: var(--r-md); border: 1px solid var(--panel-line); background: var(--c-surface-2); color: var(--text); padding: 0 var(--sp-2); }
.tp-me { position: relative; }
.tp-emoji-panel { position: absolute; bottom: 100%; right: 8px; z-index: 6; background: var(--c-surface); border: 1px solid var(--panel-line); border-radius: var(--r-lg); padding: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); width: min(320px, calc(100% - 16px)); }
/* v0.1.5: leave confirm, joker picker */
#tp-root.hidden { display: none; }
.tp-confirm { position: absolute; inset: 0; z-index: 8; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: var(--sp-4); }
.tp-confirm-box { background: var(--c-surface); border-radius: var(--r-lg); padding: var(--sp-4); max-width: 340px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.tp-confirm-box h3 { margin: 0 0 var(--sp-2); font-family: var(--font-display); }
.tp-confirm-box p { margin: 0 0 var(--sp-3); }
#tp-root .tp-jp { min-width: 44px; padding: 0 8px; }
#tp-root .tp-jp.on { border: 2px solid #C9A44C; background: #F6E8C3; color: #1E2A2C; }
/* v0.1.6 multi-game session: playlist setup, the in-table strip, the next-game screen, results */
.ss-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ss-entry { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid var(--panel-line); border-radius: var(--r-md, 10px); background: var(--c-surface); }
.ss-entry select { min-height: 36px; max-width: 46%; }
.ss-n { font-weight: var(--fw-bold); min-width: 1.4em; }
.ss-rounds { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.ss-rounds input { width: 3.6em; min-height: 36px; }
.ss-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.ss-tools button { min-width: 36px; min-height: 36px; padding: 0 6px; }
.ss-add { flex-wrap: wrap; }
.ss-check { flex-direction: row; align-items: center; gap: 8px; }
.ss-strip { margin: 0 var(--sp-2); padding: 2px 8px; border-radius: var(--r-pill); background: #1E2A2C; color: #F3EEE2; font-size: 12px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ss-table th, .ss-table td { padding: 6px 4px; border-bottom: 1px solid var(--panel-line); text-align: right; }
.ss-table th:first-child, .ss-table td:first-child { text-align: left; }
.ss-table tr.me td { font-weight: var(--fw-bold); }
.ss-table td.up { color: var(--accent); } .ss-table td.down { color: var(--c-card-red); }
.ss-tally { font-weight: var(--fw-bold); }
/* v0.1.7 online tables (flag onlineTables only): wallet, online session, the strip's Away button */
.ss-strip-away { display: flex; align-items: center; gap: 6px; padding-right: 2px; }
.ss-strip-away .ss-strip-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ss-strip-away.away { background: #5A4A1E; }
.ot-panel { border: 1px solid var(--panel-line); border-radius: 12px; padding: var(--sp-2); margin: var(--sp-2) 0; }
.ot-panel h3 { margin: 0 0 4px; font-size: 15px; }
.ot-bank b { font-variant-numeric: tabular-nums; }
.ot-card { display: inline-block; min-width: 28px; padding: 2px 4px; margin: 0 2px; border-radius: 4px; background: #fff; color: #111; text-align: center; font-weight: var(--fw-bold); }
.ot-card.back { background: #1E2A2C; color: #F3EEE2; }
.ot-away { padding: 4px 8px; border-radius: 8px; background: #5A4A1E; color: #F3EEE2; }
/* v0.1.8 profile (chips flag only) */
.ot-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--sp-2); margin: var(--sp-2) 0; }
.ot-stats div { border: 1px solid var(--panel-line); border-radius: 10px; padding: 6px 10px; }
.ot-stats dt { font-size: 12px; opacity: .8; } .ot-stats dd { margin: 0; font-size: 18px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.ot-stats dd.up { color: var(--accent); } .ot-stats dd.down { color: var(--c-card-red); }
.ot-profile h3 { font-size: 15px; margin: var(--sp-2) 0 4px; }
.ot-profile .ss-table small { opacity: .75; font-weight: normal; }
.ot-profile .ss-table td.live { color: inherit; font-style: italic; opacity: .8; }
/* v0.1.9 ad slots on the session screens (outside a hand only): in the page flow, fixed AdSense sizes */
.tp-setup .ad-slot.ss-ad { position: relative; inset: auto; margin: 10px auto 4px; width: 300px; max-width: 100%; }
.tp-setup .ss-ad-break { height: calc(250px + var(--ad-label-h, 16px)); }
.tp-setup .ad-reward-slot { height: calc(50px + var(--ad-label-h, 16px)); }
.tp-setup .ss-ad .ad-fill a { pointer-events: auto; }
/* v0.1.12: the 8px rule on the playlist and online session pages: every control >= 8px from the next control and from
   nearby text (the playlist rows, the up / down / remove tools, the Hands field, the labelled selects, the online panels) */
.ss-list, .ss-entry, .ss-rounds, .ss-tools { gap: 8px; }
.tp-field { gap: 8px; }
.ot-panel { display: flex; flex-direction: column; gap: 8px; }
.ot-panel > h3, .ot-panel > p, .ot-panel > .tp-row { margin: 0; }
.tp-setup .ad-slot.ss-ad { margin: 8px auto; }
.tp-setup .ad-slot.ss-ad .ad-label { margin-bottom: 8px; } /* the label text 8px clear of the ad under it: */
.tp-setup .ad-slot.ss-ad .ad-label { height: auto; min-height: var(--ad-label-h, 16px); line-height: 1.25; text-align: center; } /* a long label may wrap on a narrow phone */
.tp-setup .ss-ad-break, .tp-setup .ad-reward-slot { height: auto; }
.tp-setup .ss-ad-break .ad-fill { flex: none; height: 250px; }
.tp-setup .ad-reward-slot .ad-fill { flex: none; height: 50px; }
.tp-setup .tp-note, .tp-setup .tp-hint { line-height: 1.4; } /* a tight line box let the text run 1px into the 8px gap */
