/* table.css — Play tab (virtual tabletop). Kiku-inspired palette (research log G1). */
:root {
  --tbl-bg: #0b0f17; --tbl-panel: #141a25; --tbl-panel2: #222c3b; --tbl-border: #2c3647;
  --tbl-text: #f1f5f9; --tbl-muted: #94a3b8; --tbl-accent: #19c39c; --tbl-accent2: #3b82f6;
  --tbl-glow: #5eead4; --tbl-controlled: #f59e0b; --tbl-warning: #fb7185;
}
.play-page { position: relative; display: none; flex-direction: column; gap: 10px; }
.play-page.active { display: flex; }
.tbl-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; background: var(--tbl-panel); border: 1px solid var(--tbl-border); border-radius: 12px; }
.tbl-controls .grow { flex: 1 1 auto; }
.tbl-controls button, .tbl-controls select, .tbl-controls input { background: var(--tbl-panel2); color: var(--tbl-text); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.tbl-controls button:hover { border-color: var(--tbl-accent); }
.tbl-controls .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border-color: transparent; }
.tbl-status { color: var(--tbl-muted); font-size: 12px; }

/* vitals strip */
.tbl-vitals { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 8px 12px; background: var(--tbl-panel); border: 1px solid var(--tbl-border); border-radius: 12px; }
.tbl-vitals .vit-label { color: var(--tbl-muted); font-size: 12px; margin-right: 4px; text-transform: uppercase; letter-spacing: .04em; }
.tbl-vitals .vit-life { display: flex; align-items: center; gap: 6px; }
.tbl-vitals .vit-num { font-size: 22px; font-weight: 800; min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.tbl-vitals button { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 7px; min-width: 28px; padding: 4px 8px; cursor: pointer; font-size: 13px; }
.tbl-vitals button:hover { border-color: var(--tbl-accent); }
.tbl-vitals .vit-counters { display: flex; gap: 8px; flex-wrap: wrap; }
.tbl-vitals .vit-c { display: inline-flex; align-items: center; gap: 4px; color: var(--tbl-text); font-size: 12px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 2px 6px; }
.tbl-vitals .vit-cmd { color: var(--tbl-warning); font-size: 12px; }

.tbl-main { display: grid; grid-template-columns: 1fr 270px; gap: 10px; min-height: 600px; }
@media (max-width: 880px) { .tbl-main { grid-template-columns: 1fr; } }

.tbl-viewport { position: relative; overflow: hidden; background: radial-gradient(1400px 820px at 50% -6%, #18222f, #090d14); border: 1px solid var(--tbl-border); border-radius: 14px; height: min(80vh, 920px); min-height: 560px; touch-action: none; cursor: grab; }
.tbl-viewport.panning { cursor: grabbing; }
.tbl-surface { position: absolute; top: 0; left: 0; width: 1600px; height: 1180px; transform-origin: 0 0; }

.tbl-card { position: absolute; width: 100px; height: 140px; margin-left: -50px; margin-top: -70px; border-radius: 7px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); box-shadow: 0 2px 6px rgba(0,0,0,.5); transition: transform .22s cubic-bezier(.34, 1.3, .64, 1), box-shadow .12s ease; user-select: none; overflow: hidden; will-change: transform; }
.tbl-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.tbl-card .nm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6px; font-size: 11px; color: var(--tbl-text); background: #2a3344; }
.tbl-card.tapped { transform: rotate(90deg); }
/* Local-only "read an opponent's card" view (Task: click on a card you don't control just flips it
   180deg so you can read it -- never synced, never tapped, never logged). Composes with .tapped so the
   card's real tap state stays visible through the peek. */
.tbl-card.peek-rotated { transform: rotate(180deg); }
.tbl-card.peek-rotated.tapped { transform: rotate(270deg); }
.tbl-card.phased { opacity: .4; filter: grayscale(.6); }
.tbl-card.on-stack { opacity: .5; filter: grayscale(.45); outline: 2px dashed rgba(120,180,255,.6); outline-offset: -2px; }
.tbl-stack .stk-resolve { color: #8df0c8; }
.tbl-stack .stk-destroy { color: #ff9a9a; }
/* Create-token: hover/click a thumbnail to explode it (overlay escapes modal overflow) */
.tok-thumb.zoomable { cursor: zoom-in; }
.tok-zoom { position: fixed; inset: 0; z-index: 100001; display: none; align-items: center; justify-content: center; background: rgba(4,8,14,.62); pointer-events: none; }
.tok-zoom img { max-width: 340px; max-height: 86vh; border-radius: 16px; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 30px 90px rgba(0,0,0,.82); animation: tokZoomIn .12s ease-out; }
@keyframes tokZoomIn { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tbl-card:hover { box-shadow: 0 0 0 2px var(--tbl-glow), 0 6px 18px rgba(0,0,0,.6); z-index: 999; }
.tbl-card .badge { position: absolute; bottom: 14%; right: 3px; background: rgba(8,12,20,.86); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 5px; box-shadow: 0 1px 4px rgba(0,0,0,.5); pointer-events: none; }
.tbl-card .kw-strip { position: absolute; top: 20px; left: 3px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; max-height: 84px; flex-wrap: wrap; pointer-events: none; z-index: 4; }
.tbl-card .kw-chip { font: 700 8.5px/1 "Spline Sans Mono", ui-monospace, monospace; letter-spacing: .3px; color: #e7effb; background: rgba(10,16,28,.85); border: 1px solid rgba(140,180,240,.4); border-radius: 4px; padding: 2px 3px; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.tbl-card .cardback { width: 100%; height: 100%; object-fit: cover; display: block; }
.tbl-card.facedown { background: repeating-linear-gradient(45deg, #243, #243 6px, #1c3 6px, #1c3 7px), #234; }

.tbl-pile { position: absolute; width: 104px; height: 146px; margin-left: -52px; margin-top: -73px; border: 1px dashed var(--tbl-border); border-radius: 8px; display: flex; align-items: flex-end; justify-content: center; color: var(--tbl-text); background: rgba(255,255,255,.03); cursor: pointer; }
.tbl-pile .pile-name { position: absolute; top: -21px; left: -10px; right: -10px; text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--tbl-text); text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 3px rgba(0,0,0,.85); }
.tbl-pile .pile-count { margin-bottom: 8px; font-size: 18px; font-weight: 800; }
.tbl-pile .pile-tax { position: absolute; top: -8px; right: -8px; background: #b45309; color: #fff; border: 1px solid #f59e0b; border-radius: 999px; padding: 1px 7px; font-size: 10px; font-weight: 800; letter-spacing: .02em; pointer-events: none; }
.tbl-pile:hover { border-color: var(--tbl-accent); }

.tbl-hand { position: absolute; left: 0; right: 0; bottom: 0; height: 160px; display: flex; justify-content: center; align-items: flex-end; pointer-events: none; }
.tbl-hand .tbl-card { position: relative; margin: 0 -22px; transition: transform .12s; pointer-events: auto; cursor: pointer; }
.tbl-hand .tbl-card:hover { transform: translateX(var(--hand-pan, 0px)) translateY(-26px) scale(1.06); z-index: 50; }

.tbl-rail { display: flex; flex-direction: column; gap: 10px; }
.tbl-stack { border: 1px solid var(--tbl-border); border-radius: 12px; background: var(--tbl-panel); padding: 8px; font-size: 12px; color: var(--tbl-text); }
.tbl-stack .stk-title { color: var(--tbl-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.tbl-stack .stk-empty { color: var(--tbl-muted); }
.tbl-stack .stk-item { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px solid #232c3a; }
.tbl-stack .stk-item button { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 6px; padding: 2px 6px; cursor: pointer; font-size: 11px; }
.tbl-stack .stk-thumb { width: 26px; height: 36px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; background: #0c1420; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.tbl-stack .stk-thumb-x { display: grid; place-items: center; font-weight: 800; color: #7f95b0; font-size: 15px; }
.tbl-stack .stk-name { flex: 1 1 60px; min-width: 60px; font-weight: 600; }
.tbl-stack .stk-top { font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: #8df0c8; border: 1px solid rgba(141,240,200,.4); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.tbl-stack .stk-ord { display: inline-flex; gap: 2px; flex: 0 0 auto; }
.tbl-stack .stk-ord button { padding: 0 3px; line-height: 1; }
.tbl-stack .stk-acts { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.tbl-stack .stk-inspect { padding: 2px 5px !important; }
.tbl-stack .stk-item .msym { margin: 0; font-size: 15px; vertical-align: -3px; }
.tbl-preview { height: 280px; border: 1px solid var(--tbl-border); border-radius: 12px; background: var(--tbl-panel); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tbl-preview img { max-width: 100%; max-height: 100%; }
.tbl-preview .hint { color: var(--tbl-muted); font-size: 12px; padding: 12px; text-align: center; }
.tbl-log { flex: 1 1 auto; min-height: 140px; max-height: 42vh; border: 1px solid var(--tbl-border); border-radius: 12px; background: var(--tbl-panel); padding: 8px; overflow-y: auto; font-size: 12px; color: var(--tbl-muted); }
.tbl-log-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tbl-log-x { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--tbl-border); background: rgba(255,255,255,.05); color: var(--tbl-muted); cursor: pointer; padding: 0; transition: background .12s ease, color .12s ease; }
.tbl-log-x:hover { background: rgba(120,160,230,.18); color: #fff; }
.log-modal { width: 620px; max-width: 94vw; max-height: 84vh; display: flex; flex-direction: column; }
.log-modal-body { overflow-y: auto; margin-top: 4px; padding-right: 4px; }
.log-modal-row { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; color: var(--tbl-text); line-height: 1.5; }
.log-modal-row b { color: #fff; font-weight: 600; }
.log-modal-row .log-who { color: #7fd3ff; font-weight: 700; }
.log-turn-sep { position: sticky; top: 0; background: linear-gradient(180deg, #161d2a, rgba(22,29,42,.94)); color: #8fb6ef; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 8px 6px 4px; border-bottom: 1px solid rgba(120,160,230,.25); z-index: 1; }
.tbl-log .row { padding: 3px 4px; border-bottom: 1px solid #232c3a; }
.tbl-log .row b { color: var(--tbl-text); font-weight: 600; }
.tbl-log .log-ts { color: var(--tbl-muted); opacity: .55; font-variant-numeric: tabular-nums; font-size: 10.5px; margin-right: 3px; }
.tbl-log .log-who { color: #7fd3ff; font-weight: 700; }
.tbl-log .log-card { color: #8fc6ff; cursor: zoom-in; text-decoration: underline dotted rgba(143,198,255,.5); text-underline-offset: 2px; }
.tbl-log .log-card:hover { color: #bfe0ff; text-decoration-style: solid; }

.tbl-menu { position: fixed; z-index: 4000; background: var(--tbl-panel, #1f2937); border: 1px solid var(--tbl-border); border-radius: 10px; padding: 4px; min-width: 180px; box-shadow: 0 12px 40px rgba(0,0,0,.6); }
.tbl-menu button { display: block; width: 100%; text-align: left; background: none; color: var(--tbl-text); border: 0; padding: 8px 10px; border-radius: 7px; font-size: 13px; cursor: pointer; min-height: 36px; }
.tbl-menu button:hover { background: var(--tbl-panel2); }
.tbl-menu .sep { height: 1px; background: var(--tbl-border); margin: 4px 2px; }
.tbl-hotkeys { font-size: 11px; color: var(--tbl-muted); }
.tbl-hotkeys kbd { background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 4px; padding: 0 5px; }

.tbl-pileview { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 4500; }
.pv-panel { width: 760px; max-width: 94vw; max-height: 84vh; overflow: auto; background: var(--tbl-panel); border: 1px solid var(--tbl-border); border-radius: 14px; padding: 14px; }
.pv-head { display: flex; justify-content: space-between; align-items: center; color: #fff; margin-bottom: 10px; font-size: 15px; }
.pv-head .pv-x { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pv-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.pv-chip { font: 600 12px Inter, system-ui, sans-serif; color: #b9c6da; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 4px 11px; cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease; }
.pv-chip:hover { background: rgba(120,160,230,.16); color: #fff; }
.pv-chip.on { background: rgba(77,163,255,.24); color: #eaf3ff; border-color: rgba(77,163,255,.6); }
.pv-colors { margin-top: -4px; }
.pv-cchip { width: 27px; height: 27px; padding: 0; border-radius: 50%; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.pv-c-W { background: #efe9c8; color: #3a3413; border-color: #cabf86; }
.pv-c-U { background: #3b7dd8; color: #eaf3ff; border-color: #6fa8e6; }
.pv-c-B { background: #4a4a52; color: #e8e8ee; border-color: #7a7a86; }
.pv-c-R { background: #d3492f; color: #fff2ee; border-color: #e8846f; }
.pv-c-G { background: #2f9e5f; color: #eafff0; border-color: #6fce97; }
.pv-c-C { background: #b8bcc4; color: #2a2e36; border-color: #d5d8de; }
.pv-cchip.on { box-shadow: 0 0 0 2px #0d1424, 0 0 0 4px #fff; }
.pv-hint { font-size: 11px; color: #8a98ad; margin-left: auto; margin-right: 10px; align-self: center; white-space: nowrap; }
.vit-phases.off-turn { opacity: .5; }
.vit-phases.off-turn button.on { background: none; color: inherit; box-shadow: none; }
.pv-card { background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; overflow: hidden; }
.pv-card img { width: 100%; display: block; }
.pv-card .nm { padding: 10px; color: #fff; font-size: 12px; min-height: 60px; }
.pv-acts { display: flex; gap: 2px; padding: 4px; }
.pv-acts button { flex: 1; background: var(--tbl-bg); color: #fff; border: 1px solid var(--tbl-border); border-radius: 6px; padding: 4px; cursor: pointer; font-size: 11px; }
.ctr-panel { width: 320px; }
.ctr-list { display: flex; flex-direction: column; gap: 4px; }
.ctr-row { display: flex; align-items: center; gap: 8px; padding: 4px 6px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; }
.ctr-row .ctr-name { flex: 1; color: #fff; font-size: 13px; }
.ctr-row .ctr-val { min-width: 28px; text-align: center; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.ctr-row button { background: var(--tbl-bg); color: #fff; border: 1px solid var(--tbl-border); border-radius: 6px; min-width: 30px; padding: 4px 8px; cursor: pointer; }
.tbl-marquee { position: absolute; border: 1px solid var(--tbl-accent); background: rgba(20,184,166,.15); pointer-events: none; display: none; z-index: 40; }
.tbl-card.selected { box-shadow: 0 0 0 3px var(--tbl-accent), 0 6px 18px rgba(0,0,0,.6); z-index: 60; }
.tbl-arrows { position: absolute; left: 0; top: 0; width: 1600px; height: 1000px; pointer-events: none; overflow: visible; z-index: 70; }
.tbl-seltoolbar { position: fixed; transform: translate(-50%, -50%); background: var(--tbl-panel); border: 1px solid var(--tbl-border); border-radius: 10px; padding: 9px 14px; display: flex; gap: 8px; align-items: center; z-index: 4200; box-shadow: 0 16px 50px rgba(0,0,0,.7); color: #fff; font-size: 14px; }
.tbl-seltoolbar button { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.vit-turn { font-size: 12px; color: var(--tbl-accent); font-weight: 700; padding: 2px 8px; border: 1px solid var(--tbl-border); border-radius: 8px; }
.tbl-ghost { position: fixed; width: 90px; height: 126px; margin-left: -45px; margin-top: -63px; pointer-events: none; opacity: .85; z-index: 6000; border-radius: 7px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.7); background: #2a3344; }
.tbl-ghost img { width: 100%; height: 100%; object-fit: cover; }
.tbl-ghost .nm { padding: 8px; color: #fff; font-size: 11px; }
.tbl-anno { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; background: rgba(0,0,0,.8); border: 1px solid var(--tbl-accent); border-radius: 8px; padding: 3px 6px; color: #fff; font-size: 13px; cursor: grab; z-index: 80; white-space: nowrap; }
.tbl-anno button { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 5px; min-width: 22px; padding: 1px 5px; cursor: pointer; }
.tbl-anno .ax { color: #f87171; min-width: 18px; }
.tbl-anno .av { min-width: 20px; text-align: center; font-weight: 700; }
.tbl-anno-counter { background: rgba(20,30,45,.92); }
.tbl-fly { position: fixed; z-index: 5500; pointer-events: none; border-radius: 7px; overflow: hidden; background: #2a3344; transition: left .42s cubic-bezier(.4,0,.2,1), top .42s cubic-bezier(.4,0,.2,1), width .42s, height .42s, opacity .42s; box-shadow: 0 10px 30px rgba(0,0,0,.7); }
.tbl-fly img { width: 100%; height: 100%; object-fit: cover; }
.tbl-card.attached { box-shadow: 0 0 0 2px var(--tbl-accent2), 0 4px 12px rgba(0,0,0,.55); }
.tbl-card .tok-mark { position: absolute; top: 3px; left: 3px; background: #facc15; color: #1a1a1a; font-size: 10px; font-weight: 800; border-radius: 4px; padding: 0 4px; line-height: 15px; box-shadow: 0 1px 3px rgba(0,0,0,.55); pointer-events: none; }
.tbl-seatband { position: absolute; left: 0; width: 1600px; box-sizing: border-box; border-bottom: 1px dashed rgba(75,85,99,.45); pointer-events: none; z-index: 1; }
.tbl-seatband.mine { background: linear-gradient(180deg, rgba(20,184,166,.06), transparent 40%); }
.tbl-seatband .sb-label { position: absolute; left: 12px; top: 8px; font-size: 13px; color: var(--tbl-muted); text-transform: uppercase; letter-spacing: .05em; }
.vit-opps { display: flex; gap: 10px; flex-wrap: wrap; }
.vit-opp { font-size: 12px; color: var(--tbl-text); background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-family: inherit; }
.vit-opp:hover { border-color: var(--tbl-accent); }
.tbl-shuffly { position: fixed; z-index: 5400; pointer-events: none; border-radius: 7px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.6); transition: transform .18s ease, opacity .3s ease; }
.tbl-shuffly img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes tblShuffle { 0%,100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-4px) rotate(-3deg); } 40% { transform: translateX(4px) rotate(3deg); } 60% { transform: translateX(-3px) rotate(-2deg); } 80% { transform: translateX(3px) rotate(2deg); } }
.tbl-pile.shuffling { animation: tblShuffle .5s ease; }
.tbl-card.is-foil::after, .tbl-card.is-etched::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .5; background-size: 200% 200%, 100% 100%; animation: foilShift 5s linear infinite; background: repeating-linear-gradient(115deg, rgba(255,0,204,.13) 0 8%, rgba(0,255,225,.13) 8% 16%, rgba(255,225,0,.13) 16% 24%, transparent 24% 40%), radial-gradient(120% 120% at 50% 40%, rgba(255,255,255,.33), transparent 60%); }
.tbl-card.is-etched::after { mix-blend-mode: overlay; opacity: .4; }
@keyframes foilShift { 0% { background-position: 0 0, 0 0; } 100% { background-position: 200% 200%, 0 0; } }
.tbl-submenu { background: var(--tbl-panel2); border-radius: 7px; margin: 2px 0 2px 8px; }
.tbl-submenu button { display: block; width: 100%; text-align: left; background: none; color: var(--tbl-text); border: 0; padding: 7px 10px 7px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; min-height: 32px; }
.tbl-submenu button:hover { background: var(--tbl-panel); }
.tbl-card.attached { box-shadow: 0 0 0 2px var(--tbl-accent2); }
.tbl-preview { position: relative; }
.tbl-preview .prev-token { position: absolute; top: 10px; left: 10px; background: #facc15; color: #1a1a1a; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; border: 1px solid #ca8a04; border-radius: 6px; padding: 3px 11px; box-shadow: 0 2px 8px rgba(0,0,0,.6); }
.scry-grid { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.scry-cell { width: 132px; border: 2px solid var(--tbl-border); border-radius: 9px; padding: 6px; background: var(--tbl-panel2); }
.scry-cell.keep { border-color: var(--tbl-accent); }
.scry-cell.down { border-color: var(--tbl-warning); opacity: .8; }
.scry-cell img { width: 100%; border-radius: 5px; display: block; }
.scry-cell .scry-nm { height: 168px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-size: 12px; padding: 4px; }
.scry-ctrl { display: flex; gap: 4px; margin-top: 6px; }
.scry-ctrl button { flex: 1; background: var(--tbl-panel); color: #fff; border: 1px solid var(--tbl-border); border-radius: 6px; padding: 5px 2px; cursor: pointer; font-size: 12px; }
.scry-ctrl button:hover { border-color: var(--tbl-accent); }
.scry-foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.scry-foot .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 20px; cursor: pointer; font-size: 14px; }
.hk-panel { width: 470px; max-width: 92vw; }
.hk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 20px; }
.hk-sec { grid-column: 1 / -1; color: var(--tbl-accent); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; border-bottom: 1px solid var(--tbl-border); padding-bottom: 3px; }
.hk-row { display: flex; align-items: center; gap: 10px; color: var(--tbl-text); font-size: 13px; }
.hk-row kbd { display: inline-block; min-width: 22px; text-align: center; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-bottom-width: 2px; border-radius: 5px; padding: 2px 7px; font-size: 12px; font-weight: 700; }
.hk-note { margin-top: 12px; color: var(--tbl-muted); font-size: 12px; }
.tbl-vitals .vit-phases { display: flex; gap: 3px; flex-wrap: wrap; }
.tbl-vitals .vit-phases button { background: var(--tbl-panel2); color: var(--tbl-muted); border: 1px solid var(--tbl-border); border-radius: 6px; padding: 3px 8px; min-width: 0; font-size: 11px; cursor: pointer; }
.tbl-vitals .vit-phases button:hover { border-color: var(--tbl-accent); color: var(--tbl-text); }
.tbl-vitals .vit-phases button.on { background: var(--tbl-accent); color: #06302b; font-weight: 800; border-color: transparent; }
.cmx-panel { width: 640px; max-width: 94vw; }
.cmx-empty { color: var(--tbl-muted); padding: 16px 6px; font-size: 13px; line-height: 1.5; }
.cmx-rows { display: flex; flex-direction: column; gap: 10px; }
.cmx-row { border: 1px solid var(--tbl-border); border-radius: 10px; padding: 9px 11px; background: var(--tbl-panel2); }
.cmx-who { color: var(--tbl-text); font-weight: 700; margin-bottom: 7px; }
.cmx-life { color: var(--tbl-warning); font-weight: 600; margin-left: 8px; font-size: 12px; }
.cmx-cells { display: flex; flex-wrap: wrap; gap: 8px; }
.cmx-cell { border: 1px solid var(--tbl-border); border-radius: 8px; padding: 6px 9px; text-align: center; min-width: 76px; background: var(--tbl-panel); }
.cmx-cell.lethal { border-color: var(--tbl-warning); box-shadow: inset 0 0 0 2px var(--tbl-warning); }
.cmx-from { font-size: 10px; color: var(--tbl-muted); text-transform: uppercase; letter-spacing: .04em; }
.cmx-val { font-size: 21px; font-weight: 800; color: var(--tbl-text); font-variant-numeric: tabular-nums; }
.cmx-btns { display: flex; gap: 4px; margin-top: 4px; }
.cmx-btns button { flex: 1; background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 6px; padding: 3px 0; cursor: pointer; font-size: 14px; }
.cmx-btns button:hover { border-color: var(--tbl-accent); }
.pd-panel { width: 560px; max-width: 94vw; }
.pd-hint { color: var(--tbl-muted); font-size: 12px; margin-bottom: 8px; line-height: 1.5; }
.pd-hint code { background: var(--tbl-panel2); padding: 1px 5px; border-radius: 4px; }
.pd-text { width: 100%; height: 300px; box-sizing: border-box; background: var(--tbl-bg); color: var(--tbl-text); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
.pd-foot { display: flex; justify-content: flex-end; margin-top: 12px; }
.pd-foot .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 20px; cursor: pointer; font-size: 14px; }
.tbl-vitals .vit-opps { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tbl-vitals .vit-opp { display: inline-flex; align-items: center; gap: 5px; color: var(--tbl-text); font-size: 13px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 2px 8px; cursor: pointer; font-family: inherit; transition: border-color .12s ease; }
.tbl-vitals .vit-opp:hover, .tbl-vitals .vit-opp:focus-visible { border-color: var(--tbl-accent); outline: none; }
.tbl-vitals .vit-onum { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.tbl-vitals .vit-opp-ctr { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; color: var(--tbl-muted); background: rgba(255,255,255,.06); border-radius: 5px; padding: 0 4px; }
.tbl-vitals .vit-opp-ctr-poison { color: #b891ff; }
.tbl-vitals .vit-opp-ctr-energy { color: #4fd1e8; }
.tbl-vitals .vit-opp-ctr-experience { color: #ffd166; }
.tbl-vitals .vit-opp-ctr-rad { color: #8bd450; }
.tbl-vitals .vit-opp-ctr-monarch { color: #f2b632; }
.tbl-card .pt-badge { position: absolute; bottom: 3px; right: 3px; background: rgba(0,0,0,.82); color: #fff; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 6px; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.tbl-card .pt-badge.buffed { background: rgba(22,128,46,.92); }
.tbl-card .pt-badge.debuffed { background: rgba(160,32,32,.92); }
.tbl-card .pow-badge { position: absolute; bottom: 3px; left: 3px; display: inline-flex; align-items: center; gap: 3px; background: rgba(0,0,0,.82); color: #ffd66b; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 6px 1px 5px; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0,0,0,.6); }
.tbl-card .pow-badge .pow-ic { font-size: 11px; line-height: 1; opacity: .95; }
.tbl-card .pow-badge.buffed { background: rgba(22,128,46,.92); color: #eaffef; }
.tbl-card .pow-badge.debuffed { background: rgba(160,32,32,.92); color: #ffe9e9; }
.tbl-card.attacking { box-shadow: 0 0 0 2px #ef4444, 0 0 16px rgba(239,68,68,.6); }
.tbl-card .atk-mark { position: absolute; top: 3px; right: 3px; background: #ef4444; color: #fff; font-size: 11px; border-radius: 5px; padding: 0 4px; line-height: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.cmb-panel { width: 460px; max-width: 92vw; }
.cmb-empty { color: var(--tbl-muted); padding: 14px 4px; font-size: 13px; line-height: 1.5; }
.cmb-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.cmb-row { display: flex; justify-content: space-between; padding: 6px 10px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 7px; color: var(--tbl-text); }
.cmb-tot { color: var(--tbl-text); margin-bottom: 10px; font-size: 15px; }
.cmb-target { color: var(--tbl-text); margin-bottom: 14px; }
.cmb-target select { background: var(--tbl-bg); color: var(--tbl-text); border: 1px solid var(--tbl-border); border-radius: 7px; padding: 5px 8px; margin-left: 6px; }
.cmb-block { margin-bottom: 12px; border: 1px solid var(--tbl-border); border-radius: 9px; padding: 8px 10px; background: rgba(255,255,255,.03); }
.cmb-bh { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tbl-muted, #93a6c4); margin-bottom: 6px; }
.cmb-brow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.cmb-brow > span { color: var(--tbl-text); font-size: 13px; }
.cmb-brow i { color: var(--tbl-muted, #93a6c4); font-style: normal; font-weight: 700; margin-left: 4px; }
.cmb-brow select { background: var(--tbl-bg); color: var(--tbl-text); border: 1px solid var(--tbl-border); border-radius: 7px; padding: 4px 8px; font-size: 12.5px; max-width: 55%; }
.cmb-foot { display: flex; gap: 8px; justify-content: flex-end; }
.cmb-foot .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 18px; cursor: pointer; }
.cmb-foot .cmb-clear { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.lob-panel { width: 520px; max-width: 94vw; }
.lob-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.lob-actions .lob-bracket { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.lob-brk { display: inline-grid; place-items: center; min-width: 22px; height: 18px; padding: 0 5px; margin-right: 7px; border-radius: 5px; font-size: 11px; font-weight: 800; color: #06121f; vertical-align: 1px; }
.lob-brk-1 { background: #3fb27f; } .lob-brk-2 { background: #4f8fe0; } .lob-brk-3 { background: #9b5de5; } .lob-brk-4 { background: #e08a1a; } .lob-brk-5 { background: #e0556e; }
.lob-actions .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; }
.lob-actions .lob-refresh { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.lob-lfp { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--tbl-muted, #9fb0c6); cursor: pointer; white-space: nowrap; }
.lob-lfp input { accent-color: var(--tbl-accent, #46c2d8); }
.lob-lfp-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 7px; padding: 0 6px; height: 18px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .03em; color: #06302b; background: var(--tbl-accent, #46c2d8); vertical-align: 1px; }
.lob-lfp-badge .mi { width: .95em; height: .95em; }
.lob-mine { display: inline-block; margin-left: 7px; padding: 0 6px; height: 18px; line-height: 18px; border-radius: 5px; font-size: 10.5px; font-weight: 800; color: #06302b; background: #7ff0e2; vertical-align: 1px; }
.lob-priv { display: inline-block; margin-left: 6px; padding: 0 6px; height: 18px; line-height: 18px; border-radius: 5px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #cbd5e6; background: rgba(255,255,255,.08); border: 1px solid var(--tbl-border); vertical-align: 1px; }
.lob-msg { color: var(--tbl-muted); padding: 14px 4px; font-size: 13px; line-height: 1.5; }
.lob-list { display: flex; flex-direction: column; gap: 8px; }
.lob-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 9px; }
.lob-info { display: flex; flex-direction: column; gap: 2px; color: var(--tbl-text); }
.lob-info span { color: var(--tbl-muted); font-size: 12px; }
.lob-join { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 7px; padding: 7px 16px; cursor: pointer; }
.lob-join:hover { filter: brightness(1.08); }
.end-panel { width: 480px; max-width: 92vw; }
.end-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.end-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; color: var(--tbl-text); cursor: pointer; }
.end-row input { accent-color: var(--tbl-accent); }
.end-name { font-weight: 700; min-width: 72px; }
.end-stat { color: var(--tbl-muted); font-size: 12px; }
.end-foot { display: flex; gap: 8px; justify-content: flex-end; }
.end-foot .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 18px; cursor: pointer; }
.end-foot .end-new { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.tbl-region { position: absolute; transform-origin: center center; background: radial-gradient(130% 130% at 50% 100%, rgba(20,184,166,.07), rgba(0,0,0,.24)); border: 1px solid var(--tbl-border); border-radius: 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), inset 0 0 70px rgba(0,0,0,.5), 0 10px 28px rgba(0,0,0,.5); }
.tbl-region .region-label { z-index: 3; }
.tbl-region.mine { border-color: rgba(20,184,166,.5); }
.region-label { position: absolute; top: 6px; left: 10px; font-size: 13px; font-weight: 700; color: var(--tbl-text); background: rgba(0,0,0,.55); padding: 2px 9px; border-radius: 7px; letter-spacing: .02em; z-index: 2; }
.pc-panel { width: 460px; max-width: 92vw; }
.pc-msg { color: var(--tbl-muted); padding: 14px 4px; font-size: 13px; line-height: 1.5; }
.pc-active { width: 100%; border-radius: 12px; overflow: hidden; background: var(--tbl-panel2); margin-bottom: 10px; }
.pc-active img { width: 100%; display: block; }
.pc-active .pc-nm { padding: 44px 16px; text-align: center; color: #fff; font-size: 15px; }
.pc-name { color: var(--tbl-text); font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.pc-count { color: var(--tbl-muted); font-size: 12px; font-weight: 400; }
.pc-text { color: var(--tbl-muted); font-size: 12px; line-height: 1.5; margin-bottom: 12px; max-height: 130px; overflow: auto; white-space: pre-wrap; }
.pc-foot { display: flex; gap: 8px; }
.pc-foot .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; }
.pc-foot button:not(.primary) { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.pc-result { color: var(--tbl-glow); font-size: 13px; margin-top: 10px; min-height: 18px; font-weight: 600; }
.ins-panel { width: 460px; max-width: 92vw; max-height: 84vh; overflow: auto; }
.ins-sec { color: var(--tbl-accent); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 13px 0 6px; }
.ins-bar { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.ins-bl { width: 78px; font-size: 12px; color: var(--tbl-muted); text-align: right; }
.ins-track { flex: 1; height: 14px; background: var(--tbl-panel2); border-radius: 7px; overflow: hidden; }
.ins-fill { display: block; height: 100%; background: var(--tbl-accent); border-radius: 7px; }
.ins-fill.col-W { background: #f3f4f6; } .ins-fill.col-U { background: #3b82f6; } .ins-fill.col-B { background: #6b7280; }
.ins-fill.col-R { background: #ef4444; } .ins-fill.col-G { background: #22c55e; } .ins-fill.col-C { background: #9ca3af; }
.ins-bv { width: 30px; font-size: 12px; color: var(--tbl-text); font-weight: 700; text-align: right; }
.ins-msg { color: var(--tbl-muted); padding: 14px 4px; font-size: 13px; }
.ins-foot { color: var(--tbl-muted); font-size: 12px; margin-top: 12px; border-top: 1px solid var(--tbl-border); padding-top: 8px; }
.drf-panel { width: 720px; max-width: 94vw; max-height: 86vh; overflow: auto; }
.drf-set { display: flex; gap: 8px; margin-bottom: 10px; }
.drf-input { flex: 1; background: var(--tbl-bg); color: var(--tbl-text); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 9px 11px; font-size: 14px; }
.drf-set .primary { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 18px; cursor: pointer; }
.drf-msg { color: var(--tbl-muted); font-size: 13px; padding: 10px 2px; line-height: 1.5; }
.drf-bar { color: var(--tbl-text); font-size: 13px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.drf-bar .drf-finish { margin-left: auto; background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 7px 14px; cursor: pointer; }
.drf-pack { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.drf-card { border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--tbl-panel2); border: 2px solid transparent; }
.drf-card:hover { border-color: var(--tbl-accent); }
.drf-card img { width: 100%; display: block; }
.drf-card .nm { padding: 18px 6px; text-align: center; color: #fff; font-size: 11px; min-height: 80px; }
.mat-panel { width: 480px; max-width: 92vw; }
.mat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mat-swatch { height: 84px; border-radius: 10px; border: 2px solid var(--tbl-border); cursor: pointer; position: relative; color: #fff; overflow: hidden; }
.mat-swatch:hover { border-color: var(--tbl-accent); }
.mat-swatch span { position: absolute; left: 8px; bottom: 6px; font-size: 12px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.9); }
.mat-custom { display: flex; gap: 8px; margin-bottom: 12px; }
.mat-url { flex: 1; background: var(--tbl-bg); color: var(--tbl-text); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 9px 11px; font-size: 13px; }
.mat-apply { background: var(--tbl-accent); color: #06302b; font-weight: 700; border: none; border-radius: 8px; padding: 9px 14px; cursor: pointer; }
.mat-footr { display: flex; justify-content: flex-end; }
.mat-reset { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 8px 14px; cursor: pointer; }
.tbl-controls .bar-menu-btn { font-weight: 600; }
.tbl-controls .bar-menu-btn:hover { border-color: var(--tbl-accent); }
.tbl-region.active-seat { box-shadow: inset 0 0 0 3px var(--tbl-accent), inset 0 0 70px rgba(20,184,166,.2), 0 6px 22px rgba(0,0,0,.45); }
.tbl-pile.mini { transform: scale(0.78); }
.tbl-region .tbl-pile.mini { box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.region-label { display: inline-flex; align-items: center; gap: 8px; }
.region-label .rl-name { font-weight: 700; }
.region-label .rl-life { font-size: 17px; font-weight: 800; color: var(--tbl-accent); }
.region-label.out .rl-name, .region-label.out .rl-life { opacity: .55; text-decoration: line-through; }
.region-label .rl-out { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #ff8f9e; background: rgba(244,63,94,.18); border: 1px solid rgba(244,63,94,.4); border-radius: 999px; padding: 1px 7px; }
.tbl-toast { position: absolute; top: 16px; left: 50%; transform: translateX(-50%) translateY(-12px); background: rgba(20,184,166,.96); color: #06302b; font-weight: 800; padding: 8px 22px; border-radius: 999px; font-size: 15px; z-index: 50; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.tbl-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.tbl-conn { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; z-index: 52; opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.tbl-conn.show { opacity: 1; transform: translateY(0); }
.tbl-conn .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.tbl-conn.warn { background: rgba(234,179,8,.95); color: #3a2c02; }
.tbl-conn.warn .dot { animation: connPulse 1s ease-in-out infinite; }
.tbl-conn.ok { background: rgba(20,184,166,.96); color: #06302b; }
@keyframes connPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* In-game text chat */
.tbl-chat { position: absolute; top: 66px; right: 14px; width: 280px; max-width: 60vw; display: none; flex-direction: column; background: linear-gradient(180deg, rgba(20,28,40,.96), rgba(12,17,26,.96)); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.5); z-index: 54; overflow: hidden; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tbl-chat.show { display: flex; }
.tbl-chat .chat-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--tbl-muted); border-bottom: 1px solid rgba(255,255,255,.07); }
.tbl-chat .chat-min { background: none; border: none; color: var(--tbl-muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.tbl-chat.collapsed .chat-log, .tbl-chat.collapsed .chat-form { display: none; }
.tbl-chat .chat-log { flex: 1; max-height: 34vh; min-height: 90px; overflow-y: auto; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.tbl-chat .chat-row { color: #c7d1de; line-height: 1.35; }
.tbl-chat .chat-row b { color: #8fc6ff; }
.tbl-chat .chat-row.mine b { color: #8df0c8; }
.tbl-chat .chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255,255,255,.07); }
.tbl-chat .chat-form input { flex: 1; background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.12); color: #eaf1fb; border-radius: 8px; padding: 7px 10px; font-size: 13px; outline: none; }
.tbl-chat .chat-form button { display: grid; place-items: center; width: 36px; border: none; border-radius: 8px; background: #3b82f6; color: #fff; cursor: pointer; }
.tbl-chat .chat-form .msym { margin: 0; font-size: 18px; }

/* Proliferate modal */
.prolif-panel { width: min(460px, 94vw); }
.prolif-empty { padding: 22px 16px; color: var(--tbl-muted); text-align: center; }
.prolif-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.prolif-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.prolif-row:hover { background: rgba(255,255,255,.04); }
.prolif-row input { width: 16px; height: 16px; accent-color: #46c2d8; }
.prolif-nm { flex: 1; color: var(--tbl-text); font-weight: 600; }
.prolif-nm em { font-style: normal; color: var(--tbl-muted); font-weight: 500; }
.prolif-k { color: #8fc6ff; font-size: 12px; }

/* Auto game-over overlay */
.gameover-panel { width: min(460px, 94vw); text-align: center; }
.gameover-hero { padding: 20px 16px 12px; }
.gameover-trophy { font-size: 52px !important; margin: 0 !important; color: #f6c453; display: block; }
.gameover-win { font-size: 24px; font-weight: 900; color: #fff; margin-top: 6px; }
.gameover-sub { color: var(--tbl-muted); font-size: 13px; margin-top: 2px; }
.gameover-rows { padding: 4px 10px 8px; }
.gameover-row { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
.gameover-place { width: 22px; font-weight: 900; font-size: 16px; text-align: center; }
.gameover-name { flex: 1; color: var(--tbl-text); font-weight: 700; }
.gameover-stat { color: var(--tbl-muted); font-size: 12px; }
.gameover-panel .end-foot { display: flex; gap: 8px; justify-content: center; padding: 12px; }
.gameover-panel .end-foot button { padding: 9px 16px; border-radius: 9px; border: 1px solid var(--tbl-border); background: var(--tbl-panel2); color: #fff; font-weight: 700; cursor: pointer; }
.gameover-panel .end-foot .primary { background: linear-gradient(120deg, #3b82f6, #1d4fb0); border-color: transparent; }

/* ---- Playgroup-style premium dark polish ---- */
.play-page { font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; }
.tbl-controls, .tbl-vitals, .tbl-stack, .tbl-preview, .tbl-log { background: linear-gradient(180deg, rgba(28,38,54,.72), rgba(14,19,28,.72)); border-color: rgba(255,255,255,.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 30px rgba(0,0,0,.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tbl-controls button, .tbl-controls select { background: linear-gradient(180deg, #2a3444, #1b2230); border-color: rgba(255,255,255,.08); border-radius: 9px; font-weight: 600; letter-spacing: .01em; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; }
.tbl-controls button:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px var(--tbl-accent), 0 6px 16px rgba(25,195,156,.22); border-color: transparent; }
.tbl-controls .primary, .tbl-controls .bar-menu-btn { background: linear-gradient(180deg, #2f3a4c, #20293a); }
.vit-label, .stk-title, .ins-sec { text-transform: uppercase; letter-spacing: .06em; }
.tbl-vitals .vit-num { text-shadow: 0 1px 10px rgba(25,195,156,.25); }
.tbl-card { box-shadow: 0 3px 8px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.04) inset; }
.tbl-card:hover { box-shadow: 0 0 0 2px var(--tbl-glow), 0 10px 26px rgba(0,0,0,.65); }
.tbl-menu { background: linear-gradient(180deg, #1b2230, #141a25); border-color: rgba(255,255,255,.08); box-shadow: 0 16px 44px rgba(0,0,0,.6); backdrop-filter: blur(8px); }
.pv-panel { background: linear-gradient(180deg, #161d2a, #11161f); border-color: rgba(255,255,255,.08); box-shadow: 0 24px 70px rgba(0,0,0,.65); }
.tbl-region { border-color: rgba(255,255,255,.08); }
.msym { font-family: "Material Symbols Rounded"; font-weight: 400; font-size: 18px; line-height: 1; vertical-align: -4px; margin-right: 6px; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; opacity: .92; }
.tbl-controls button, .tbl-menu button { white-space: nowrap; }
.tbl-hand .tbl-card { transform: translateX(var(--hand-pan, 0px)) rotate(var(--fan-rot, 0deg)) translateY(var(--fan-lift, 0px)); transform-origin: bottom center; }
.tbl-hand .tbl-card:hover,
.tbl-hand .tbl-card.walked { transform: translateX(var(--hand-pan, 0px)) translateY(-32px) scale(1.08) rotate(0deg) !important; z-index: 60; }
.tbl-pile.drop-target { border-color: var(--tbl-accent) !important; box-shadow: 0 0 0 3px var(--tbl-accent), 0 0 20px rgba(25,195,156,.5); }
.insp-panel { max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.insp-img { max-height: 80vh; max-width: 90vw; border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.75); }
.insp-nm { color: #fff; font-size: 20px; padding: 64px 36px; background: var(--tbl-panel2); border-radius: 16px; }
.insp-foot { display: flex; gap: 14px; align-items: center; }
.insp-link { color: var(--tbl-glow); text-decoration: none; font-weight: 700; }
.insp-link:hover { text-decoration: underline; }
.insp-x { background: var(--tbl-panel2); color: #fff; border: 1px solid var(--tbl-border); border-radius: 8px; padding: 9px 20px; cursor: pointer; }
.tbl-vitals .vit-phases button.on { animation: phasePulse 1.8s ease-in-out infinite; }
@keyframes phasePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(25,195,156,.45); } 50% { box-shadow: 0 0 0 5px rgba(25,195,156,0); } }
/* ---- rail + action log polish ---- */
.tbl-rail { gap: 12px; }
.tbl-log .row { padding: 5px 8px; border-bottom: 1px solid rgba(255,255,255,.05); animation: logIn .22s ease; }
.tbl-log .row:hover { background: rgba(255,255,255,.04); border-radius: 6px; }
@keyframes logIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.tbl-preview { border-radius: 14px; transition: box-shadow .2s ease; }
.tbl-preview:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 32px rgba(0,0,0,.45); }
.tbl-stack .stk-item:hover { background: rgba(255,255,255,.03); border-radius: 6px; }
.tbl-status { color: var(--tbl-muted); font-size: 12.5px; letter-spacing: .01em; }
.tbl-stack .stk-title { font-weight: 700; }
.life-float { position: fixed; transform: translate(-50%, 0); font-weight: 800; font-size: 18px; z-index: 5000; pointer-events: none; opacity: 1; transition: transform .8s cubic-bezier(.2,.7,.3,1), opacity .8s ease; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.life-float.up { color: #34d399; }
.life-float.down { color: #fb7185; }
.life-float.go { transform: translate(-50%, -42px); opacity: 0; }
.tbl-vitals .vit-mana { display: flex; gap: 4px; align-items: center; }
.tbl-vitals .vit-mana .mana { display: inline-flex; align-items: center; gap: 3px; min-width: 0; padding: 3px 8px; border-radius: 999px; font-weight: 800; font-size: 12px; border: 1px solid rgba(0,0,0,.25); cursor: pointer; line-height: 1; }
.tbl-vitals .vit-mana .mana:hover { filter: brightness(1.08); }
.mana.m-W { background: #f7f3df; color: #3a3322; } .mana.m-U { background: #aecbeb; color: #0e2a44; } .mana.m-B { background: #5a585c; color: #ece8ea; }
.mana.m-R { background: #e79a82; color: #4a1410; } .mana.m-G { background: #9ec79a; color: #123a1a; } .mana.m-C { background: #cbc4bf; color: #2a2620; }
.tbl-vitals .vit-mana .mana b { font-variant-numeric: tabular-nums; font-weight: 800; }
.tbl-vitals .vit-mana .mana-clear { background: var(--tbl-panel2); color: var(--tbl-muted); border: 1px solid var(--tbl-border); border-radius: 999px; padding: 3px 9px; cursor: pointer; font-size: 11px; }
.tbl-vitals .vit-mana .mana-keep { background: var(--tbl-panel2); color: var(--tbl-muted); border: 1px solid var(--tbl-border); border-radius: 999px; padding: 3px 9px; cursor: pointer; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tbl-vitals .vit-mana .mana-keep.on { background: rgba(43,212,192,.85); color: #06302b; border-color: #2bd4c0; }
.tbl-vitals .vit-tax { color: var(--tbl-text); font-size: 12.5px; margin-left: 8px; white-space: nowrap; }
.tbl-vitals .vit-tax b { color: #9cc9ff; font-variant-numeric: tabular-nums; }
.tbl-vitals .vit-mana .vit-m { position: relative; display: inline-block; }
.tbl-vitals .vit-mana .mana-icon { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: 2px 4px; background: transparent; border: 0; cursor: pointer; border-radius: 8px; }
.tbl-vitals .vit-mana .mana-icon:hover { background: rgba(255,255,255,.08); }
.tbl-vitals .vit-mana .vit-m.open .mana-icon { background: rgba(255,255,255,.12); }
.tbl-vitals .vit-mana .mana-icon img { width: 22px; height: 22px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4)); }
.tbl-vitals .vit-mana .mana-ct { font-size: 11px; font-weight: 800; color: var(--tbl-text); font-variant-numeric: tabular-nums; line-height: 1; }
.tbl-vitals .vit-mana .mana-pop { position: absolute; z-index: 60; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; background: var(--tbl-panel); border: 1px solid var(--tbl-border); border-radius: 999px; padding: 3px 5px; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.tbl-vitals .vit-mana .mana-pop b { min-width: 16px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 900; color: var(--tbl-text); }
.tbl-vitals .vit-mana .mana-step { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--tbl-border); background: var(--tbl-panel2); color: var(--tbl-text); font-weight: 900; font-size: 14px; line-height: 1; border-radius: 6px; cursor: pointer; }
.tbl-vitals .vit-mana .mana-step:hover { background: var(--tbl-accent); color: #07120e; }
.tbl-vitals .vit-ctr-pick { position: relative; display: inline-block; }
.tbl-vitals .ctr-pick-btn { cursor: pointer; color: var(--tbl-text); font-size: 12px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
.tbl-vitals .vit-ctr-pick.open .ctr-pick-btn { background: var(--tbl-accent); color: #07120e; }
.tbl-vitals .vit-ctr-menu { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; display: grid; gap: 1px; min-width: 150px; max-height: 240px; overflow-y: auto; background: var(--tbl-panel); border: 1px solid var(--tbl-border); border-radius: 10px; padding: 8px; box-shadow: 0 14px 32px rgba(0,0,0,.45); }
.tbl-vitals .vit-ctr-menu label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tbl-text); text-transform: capitalize; cursor: pointer; padding: 3px 5px; border-radius: 6px; }
.tbl-vitals .vit-ctr-menu label:hover { background: var(--tbl-panel2); }
.no-msym .msym { display: none; }

/* === Live pod cursors + chat bubbles (Kiku-style presence) === */
.tbl-cursors { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 4200; }
.rc-cursor { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .35s ease; will-change: transform; }
.rc-cursor.show { opacity: 1; }
.rc-cursor svg { display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,.55)); }
.rc-cursor .rc-name { position: absolute; left: 14px; top: 16px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #04101f; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.rc-cursor .rc-bubble { position: absolute; left: 14px; bottom: calc(100% + 2px); max-width: 220px; padding: 6px 10px; border-radius: 12px 12px 12px 3px; background: var(--tbl-panel, #10192a); border: 1px solid var(--tbl-border, rgba(255,255,255,.14)); color: var(--tbl-text, #f3f6fb); font-size: 12px; line-height: 1.35; opacity: 0; transform: translateY(4px); transition: opacity .25s ease, transform .25s ease; box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.rc-cursor .rc-bubble.show { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .rc-cursor, .rc-cursor .rc-bubble { transition: none; } }

/* === Gamewide attention ping (transient pulse — G3.26) === */
.tbl-pings { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 4300; }
.tbl-ping { position: absolute; left: 0; top: 0; width: 0; height: 0; transform: translate(-50%, -50%); }
.tbl-ping .ping-ring { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #f6c453; box-shadow: 0 0 10px rgba(246,196,83,.7); animation: pingRing 1.6s cubic-bezier(.2,.8,.3,1) forwards; }
.tbl-ping .ping-ring.r2 { animation-delay: .3s; border-color: #ffd97a; }
.tbl-ping .ping-dot { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #f6c453; box-shadow: 0 0 8px rgba(246,196,83,.9); animation: pingDot 1.6s ease-out forwards; }
.tbl-ping .ping-name { position: absolute; left: 50%; top: -22px; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: rgba(10,16,28,.9); border: 1px solid rgba(246,196,83,.5); color: #f6c453; font-size: 11px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.4); animation: pingName 1.6s ease-out forwards; }
@keyframes pingRing { 0% { width: 14px; height: 14px; margin: -7px 0 0 -7px; opacity: 1; } 100% { width: 90px; height: 90px; margin: -45px 0 0 -45px; opacity: 0; } }
@keyframes pingDot { 0%, 55% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.6); } }
@keyframes pingName { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tbl-ping .ping-ring, .tbl-ping .ping-dot, .tbl-ping .ping-name { animation-duration: .01ms, .01ms; animation-iteration-count: 1; } }

/* === QA 2026-07-02 · G2/G3/G4 (Agent C-T) ============================================ */
/* G2.17 — the empty stack fades/collapses; the action log slides up to take its place. */
.tbl-stack { max-height: 440px; overflow-y: auto; transition: max-height .4s ease, opacity .32s ease, padding .4s ease, border-width .4s ease, margin .4s ease; }
.tbl-stack.empty { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-width: 0; margin-bottom: -12px; overflow: hidden; pointer-events: none; }
.tbl-stack.stk-enter .stk-item { animation: stkIn .34s ease; }
@keyframes stkIn { from { opacity: 0; transform: translateY(-10px) scale(.97); } to { opacity: 1; transform: none; } }
/* G2.15 — stack rows are drag-reorderable */
.tbl-stack .stk-item { cursor: grab; touch-action: none; }
.tbl-stack .stk-item.stk-dragging { cursor: grabbing; opacity: .88; background: rgba(79,155,255,.12); border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.5); }
.tbl-stack .stk-thumb { cursor: zoom-in; }
/* G2.18 — turn-change full-screen flash + fading popup */
.tbl-flash { position: fixed; inset: 0; z-index: 9000; pointer-events: none; background: #fff; opacity: 0; animation: tblFlash .7s ease forwards; }
.tbl-flash.mine { background: #ffd84a; }
@keyframes tblFlash { 0% { opacity: 0; } 18% { opacity: .5; } 100% { opacity: 0; } }
.tbl-turnpop { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 9001; pointer-events: none; font-family: Cinzel, Inter, serif; font-size: clamp(30px, 5vw, 46px); font-weight: 900; letter-spacing: .04em; color: #fff; text-shadow: 0 4px 26px rgba(0,0,0,.7); opacity: 0; animation: tblPop 1.6s ease forwards; }
.tbl-turnpop.mine { color: #ffd84a; }
@keyframes tblPop { 0% { opacity: 0; transform: translate(-50%, -38%) scale(.85); } 14% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -64%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .tbl-flash, .tbl-turnpop, .tbl-stack.stk-enter .stk-item { animation-duration: .01s; } .tbl-stack { transition: none; } }
/* G3.24 — blocker shield indicator (blue mirror of the attack mark) */
.tbl-card .blk-mark { position: absolute; top: 3px; right: 3px; background: #2563eb; color: #fff; border-radius: 5px; padding: 0 3px; line-height: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.5); pointer-events: none; }
.tbl-card .blk-mark .msym { font-size: 13px; margin: 0; vertical-align: -2px; }
.tbl-card.attacking .blk-mark { top: 22px; }
/* G3.26 — modernized pile viewer: count chip, icon close, icon action buttons + tooltips */
.pv-head .pv-count { display: inline-block; margin-left: 8px; background: rgba(255,255,255,.08); border: 1px solid var(--tbl-border); border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--tbl-muted); font-variant-numeric: tabular-nums; vertical-align: 1px; }
.pv-x-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0 !important; border-radius: 9px !important; }
.pv-x-ic .msym { font-size: 18px; margin: 0; vertical-align: 0; }
.pv-modern .pv-acts { gap: 4px; padding: 5px 4px; justify-content: center; flex-wrap: wrap; }
.pv-modern .pv-acts .pv-act { flex: 0 0 auto; width: 32px; height: 28px; display: inline-grid; place-items: center; padding: 0; border-radius: 7px; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); color: var(--tbl-text); cursor: pointer; transition: color .12s ease, border-color .12s ease, background .12s ease; }
.pv-modern .pv-acts .pv-act:hover { border-color: var(--tbl-accent); color: var(--tbl-accent); background: rgba(25,195,156,.08); }
.pv-modern .pv-acts .pv-act .msym { font-size: 16px; margin: 0; vertical-align: 0; }
.pv-emptymsg { color: var(--tbl-muted); padding: 14px; }
/* G3.23 — command-zone single-card viewer */
.cmdv-panel { width: min(430px, 94vw); text-align: center; }
.cmdv-body { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cmdv-img { width: min(320px, 68vw); border-radius: 16px; box-shadow: 0 22px 60px rgba(0,0,0,.65); display: block; }
.cmdv-nm { width: 280px; height: 380px; display: grid; place-items: center; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 16px; color: var(--tbl-text); font-weight: 800; padding: 12px; }
.cmdv-nav { width: 34px; height: 56px; display: grid; place-items: center; background: var(--tbl-panel2); border: 1px solid var(--tbl-border); border-radius: 10px; color: var(--tbl-text); cursor: pointer; }
.cmdv-nav:hover { border-color: var(--tbl-accent); color: var(--tbl-accent); }
.cmdv-nav .msym { margin: 0; vertical-align: 0; }
.cmdv-meta { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; color: var(--tbl-text); font-weight: 700; }
.cmdv-tax { background: rgba(246,196,83,.14); border: 1px solid rgba(246,196,83,.45); color: #f6c453; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 800; }
.cmdv-count { color: var(--tbl-muted); font-size: 12px; }
.cmdv-foot { margin-top: 14px; }
.cmdv-cast { display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(120deg, #3b82f6, #1d4fb0); border: 0; color: #fff; font-weight: 800; font-size: 15px; padding: 11px 26px; border-radius: 12px; cursor: pointer; box-shadow: 0 10px 26px rgba(29,79,176,.4); transition: filter .12s ease, transform .12s ease; }
.cmdv-cast:hover { filter: brightness(1.12); transform: translateY(-1px); }
.cmdv-cast .msym { font-size: 18px; margin: 0; vertical-align: -3px; }
/* G4.31 — settings "Declare winner" row (select + confirm) */
.hud-set .hud-set-win { display: flex; gap: 6px; }
.hud-set .hud-set-win select { flex: 1; min-width: 0; background: rgba(13,19,30,.9); border: 1px solid rgba(255,255,255,.14); color: #dbe4f3; border-radius: 9px; padding: 7px; font-size: 12.5px; }
.hud-set .hud-set-win button { background: linear-gradient(120deg, #3b82f6, #1d4fb0); border: 0; color: #fff; border-radius: 9px; padding: 7px 12px; font-weight: 700; cursor: pointer; font-size: 12.5px; white-space: nowrap; }
.hud-set .hud-set-win button:hover { filter: brightness(1.12); }
/* G2.17b — the old top-right vitals panel is gone; the stack owns the top of the rail */
body.play-fs #playPage .tbl-rail { padding-top: 0 !important; }

/* === lobby: visibility select, schedule input, Starts-in badge === */
.lob-actions .lob-vis, .lob-actions .lob-when { height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--tbl-border, rgba(255,255,255,.14)); background: var(--tbl-panel2, #0c1320); color: var(--tbl-text, #f3f6fb); font-size: 12.5px; }
.lob-actions .lob-when { color-scheme: dark; }
.lob-sched { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; background: rgba(74,163,230,.16); color: #7cc0f2; border: 1px solid rgba(74,163,230,.35); vertical-align: 1px; }
.lob-sched.live { background: rgba(70,178,119,.18); color: #6fd39c; border-color: rgba(70,178,119,.4); }

/* ==================================================================== */
/* QA G7.46 · Mobile play surface (Agent C-M) — ADDITIVE, phone-only.   */
/* Board pan/zoom is pointer-driven in JS; we only shrink FIXED chrome  */
/* and give overflowing bars a scroll escape. Desktop is untouched.     */
/* ==================================================================== */

/* Hotkey hints are meaningless without a keyboard — hide on touch. */
@media (pointer: coarse) {
  .tbl-hotkeys { display: none; }
  /* Long-press opens the same menu as a desktop right-click (table.js) — suppress the
     iOS/Android text-selection callout + magnifier that would otherwise appear during the hold. */
  .tbl-card { -webkit-touch-callout: none; }
}

@media (max-width: 820px) {
  /* Non-fullscreen play page (Play tab embedded): the two-column main
     already collapses at 880px; make the top controls horizontally
     scrollable rather than wrapping into a tall stack. */
  .tbl-controls {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tbl-controls::-webkit-scrollbar { display: none; }
  .tbl-controls button,
  .tbl-controls select { flex: 0 0 auto; min-height: 40px; }
  .tbl-controls .grow { flex: 1 0 auto; }

  /* Narrower right rail + a capped, scrollable height so the stack/log
     rail never eats the board on a phone. */
  .tbl-main { grid-template-columns: 1fr; }
  .tbl-rail { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .tbl-stack { max-height: 30vh; }
  .tbl-preview { height: 200px; }

  /* Tighter hand fan + smaller cards so more fit across a phone width. */
  .tbl-hand { height: 128px; }
  .tbl-hand .tbl-card { margin: 0 -30px; width: 82px; height: 115px; }

  /* Pile viewers / hotkey / lobby / commander sheets become full-screen
     sheets that fill the phone instead of a centred 760px card. */
  .pv-panel,
  .hk-panel,
  .cmx-panel,
  .cmb-panel,
  .lob-panel,
  .end-panel,
  .pc-panel,
  .ins-panel,
  .drf-panel,
  .mat-panel,
  .cmdv-panel,
  .prolif-panel,
  .gameover-panel,
  .insp-panel {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  .pv-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }

  /* In-game text chat: dock full width at the bottom, above the safe
     area, instead of a floating 280px corner card. */
  .tbl-chat {
    left: 8px; right: 8px; width: auto; max-width: none;
    top: auto; bottom: max(10px, env(safe-area-inset-bottom));
  }

  /* Selection toolbar buttons reach a tappable height. */
  .tbl-seltoolbar button { min-height: 40px; }

  /* Turn phase bar: force one compact row instead of wrapping the last button onto a second
     line — shrink the buttons and let the group scroll sideways if it's still too tight. */
  .tbl-vitals .vit-phases {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: 100%;
  }
  .tbl-vitals .vit-phases::-webkit-scrollbar { display: none; }
  .tbl-vitals .vit-phases button {
    flex: 0 0 auto;
    padding: 3px 6px;
    font-size: 10.5px;
    min-width: 0;
  }
}

/* ===== Engine trigger-reminder tray (opt-in "Trigger reminders" toggle) ===== */
.tbl-trgtray { position: absolute; right: 12px; bottom: 14px; width: 272px; max-height: 44vh; overflow-y: auto; background: rgba(15, 20, 32, .95); border: 1px solid #2b3550; border-radius: 10px; z-index: 55; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); display: none; font-size: 12px; }
.tbl-trgtray .trg-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-bottom: 1px solid #26304a; color: #cbd5f5; font-weight: 700; position: sticky; top: 0; background: rgba(15, 20, 32, .97); }
.tbl-trgtray .trg-clear { background: none; border: 1px solid #33406b; color: #9fb0e8; border-radius: 6px; padding: 1px 8px; cursor: pointer; font-size: 11px; }
.tbl-trgtray .trg-clear:hover { color: #fff; border-color: #4a5a8f; }
.tbl-trgtray .trg-row { display: flex; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #1d2438; align-items: flex-start; }
.tbl-trgtray .trg-row:last-child { border-bottom: none; }
.tbl-trgtray .trg-kind { flex: 0 0 auto; background: #223055; color: #9fc0ff; border-radius: 5px; padding: 1px 6px; font-size: 10px; margin-top: 1px; white-space: nowrap; }
.tbl-trgtray .trg-body { flex: 1 1 auto; min-width: 0; color: #e5e9f5; }
.tbl-trgtray .trg-body b { display: block; font-size: 12px; }
.tbl-trgtray .trg-body i { display: block; font-style: normal; color: #93a0c0; font-size: 11px; line-height: 1.35; }
.tbl-trgtray .trg-x { flex: 0 0 auto; background: none; border: none; color: #7f8db0; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.tbl-trgtray .trg-x:hover { color: #fff; }
@media (max-width: 700px) { .tbl-trgtray { right: 8px; bottom: 8px; width: min(272px, calc(100vw - 16px)); max-height: 36vh; } }
