/* Rummy admin — dark "casino control room" look, light theme too. Class names are shared with admin.js. */
:root {
  --bg: #0d1017; --bg2: #121722; --panel: #161c29; --panel2: #1b2232; --line: #263045; --line2: #313c55;
  --text: #e9edf6; --dim: #8f9bb3; --dim2: #67728a;
  --accent: #f0b429; --accent-2: #d99a0b; --accent-ink: #241a00;
  --brand: #e5484d; --brand-2: #c4363b;
  --ok: #30c48d; --warn: #f5a524; --bad: #f2555a; --info: #4c9aff; --violet: #9b7bff; --cyan: #2ec5d3;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  --radius: 14px;
  --chart-grid: rgba(143,155,179,.14);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f9; --bg2: #eceff5; --panel: #ffffff; --panel2: #f7f8fb; --line: #e1e5ee; --line2: #d3d9e6;
  --text: #121826; --dim: #5d6880; --dim2: #8892a6;
  --accent: #d99a0b; --accent-2: #b97f00; --accent-ink: #fff;
  --brand: #d93c42; --brand-2: #b92f35;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 6px 18px rgba(16,24,40,.06);
  --chart-grid: rgba(93,104,128,.14);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--info); }
.hidden { display: none !important; }
h1, h2, h3, h4 { letter-spacing: -.01em; }
h4 { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); font-weight: 600; }

/* ---------- surfaces */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 15px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card-head .sub { color: var(--dim); font-size: 12px; }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); border-radius: 10px; padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 500; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { border-color: var(--dim2); background: var(--bg2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-color: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #04241a; font-weight: 600; }
.btn.bad { background: transparent; border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); }
.btn.bad:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--dim); padding: 5px 12px; border-radius: 7px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
label { display: block; color: var(--dim); font-size: 12.5px; font-weight: 500; margin: 12px 0 0; }
label input, label select, label textarea { margin-top: 5px; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 14px; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
label.check input { width: auto; margin: 0; accent-color: var(--accent); width: 16px; height: 16px; }
.err { color: var(--bad); min-height: 1em; }
.help { color: var(--dim); font-size: 13px; margin: 0 0 14px; }

/* ---------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%), var(--bg); }
.login .card { width: min(400px, 100%); padding: 28px; }
.login .logo { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #7c1d24); color: #fff; font-size: 24px; margin-bottom: 14px; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 40%, transparent); }
.login h1 { margin: 0 0 4px; font-size: 22px; }
.login .tag { color: var(--dim); margin: 0 0 6px; }
.login button { width: 100%; margin-top: 18px; justify-content: center; padding: 11px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
aside { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), #7c1d24); color: #fff; font-size: 17px; }
.brand small { display: block; font-weight: 500; color: var(--dim); font-size: 11.5px; }
nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
nav .grp { padding: 14px 10px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim2); font-weight: 600; }
nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; color: var(--dim); text-decoration: none; border-radius: 9px; font-weight: 500; }
nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }
nav a span.t { flex: 1; }
nav a:hover { background: var(--panel); color: var(--text); }
nav a.on { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
nav a.on svg { opacity: 1; }
nav .badge { background: var(--brand); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.who { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; font-size: 12px; }
.who .av { width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 700; color: var(--accent); flex: none; }
.who #who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dim); }
main { min-width: 0; }
header { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; padding: 12px 26px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); }
header h2 { margin: 0; font-size: 19px; flex: 1; }
.livepill { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.livepill b { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.menu { display: none; }
section { padding: 22px 26px 70px; max-width: 1500px; }

/* ---------- KPI */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; }
.stat .v { font-size: 25px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .k { color: var(--dim); font-size: 12.5px; font-weight: 500; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 16px 12px; position: relative; overflow: hidden; }
.kpi .k { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; font-weight: 500; }
.kpi .k i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 13px; }
.kpi .v { font-size: 27px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .d { font-size: 12px; color: var(--dim); }
.kpi .d .up { color: var(--ok); font-weight: 600; } .kpi .d .down { color: var(--bad); font-weight: 600; }
.kpi svg.spark { position: absolute; right: 12px; bottom: 12px; width: 72px; height: 28px; opacity: .9; }
.kpi .d { max-width: calc(100% - 80px); }
.stat.click, .kpi.click { cursor: pointer; } .stat.click:hover, .kpi.click:hover { border-color: var(--line2); }

/* ---------- dashboard grid */
.dgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; margin-bottom: 14px; }
.c12 { grid-column: span 12; } .c8 { grid-column: span 8; } .c7 { grid-column: span 7; } .c6 { grid-column: span 6; } .c5 { grid-column: span 5; } .c4 { grid-column: span 4; } .c3 { grid-column: span 3; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel2); border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.35); white-space: nowrap; z-index: 3; transform: translate(-50%, -110%); }
.chart-tip b { display: block; margin-bottom: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--dim); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.barlist { display: grid; gap: 10px; }
.barlist .row { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: 10px; font-size: 13px; }
.barlist .track { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.barlist .fill { height: 100%; border-radius: 99px; }
.barlist .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--dim); }
.heat { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 3px; font-size: 10px; color: var(--dim2); }
.heat div.c { aspect-ratio: 1; border-radius: 3px; background: var(--bg2); }
.feed { display: grid; gap: 2px; max-height: 340px; overflow-y: auto; }
.feed .it { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; font-size: 13px; }
.feed .it:hover { background: var(--bg2); }
.feed .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 13px; }
.feed .tx { flex: 1; min-width: 0; }
.feed .tm { color: var(--dim2); font-size: 11.5px; white-space: nowrap; }
.alerts { display: grid; gap: 8px; margin-bottom: 16px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 12px; border: 1px solid; font-size: 13px; }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
details.setup summary { cursor: pointer; color: var(--dim); font-size: 13px; margin-bottom: 8px; }

/* ---------- tables */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; }
.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { color: var(--dim2); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; background: var(--panel2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--bg2); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--bg2); border: 1px solid var(--line); color: var(--dim); }
.pill.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.pill.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pill.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 10%, transparent); }
.pos { color: var(--ok); } .neg { color: var(--bad); }
.pager { display: flex; gap: 10px; align-items: center; margin-top: 12px; color: var(--dim); }

/* ---------- forms */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 4px 18px; }
.form .full { grid-column: 1 / -1; }
.actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.modes h3 { margin: 0 0 4px; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- modal / toast */
.modal { position: fixed; inset: 0; background: rgba(5,8,14,.62); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 40px 16px; overflow-y: auto; z-index: 10; }
.modal .card { width: min(980px, 100%); }
.modal h3 { margin-top: 0; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line2); color: var(--text); padding: 11px 18px; border-radius: 12px; z-index: 20; max-width: 90vw; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.toast.bad { border-color: var(--bad); color: var(--bad); }

/* ---------- live tables / mirror */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.tcard { cursor: pointer; transition: border-color .15s, transform .15s; }
.tcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.tcard .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.seats { display: flex; flex-wrap: wrap; gap: 6px; }
.seat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 4px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; }
.seat .a { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; }
.seat.cur { border-color: var(--accent); }
.seat.out { opacity: .5; }
.felt { background: radial-gradient(ellipse at center, #1f6b45 0%, #155236 55%, #0e3b27 100%); border-radius: 22px; padding: 16px; border: 6px solid #3b2a1a; box-shadow: inset 0 0 40px rgba(0,0,0,.45); color: #fff; }
.felt .mid { display: flex; justify-content: center; gap: 22px; align-items: center; margin: 6px 0 14px; font-size: 12px; }
.felt .mid .pile { text-align: center; }
.felt .hands { display: grid; gap: 10px; }
.felt .hand { background: rgba(0,0,0,.22); border-radius: 12px; padding: 8px 10px; }
.felt .hand.cur { outline: 2px solid var(--accent); }
.felt .hand .nm { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.cards { display: flex; flex-wrap: wrap; gap: 8px; }
.grp { display: flex; }
.grp + .grp { margin-left: 4px; }
.pc { width: 30px; height: 42px; border-radius: 5px; background: #fff; color: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; line-height: 1; box-shadow: 0 1px 2px rgba(0,0,0,.4); margin-right: -6px; border: 1px solid #ddd; }
.pc.red { color: #c62828; }
.pc.jk { background: linear-gradient(135deg, #fff3c4, #ffd36b); color: #6a3d00; }
.pc.wild { box-shadow: 0 0 0 2px #f0b429; }
.pc.hl { transform: translateY(-5px); box-shadow: 0 0 0 2px #4c9aff, 0 4px 8px rgba(0,0,0,.4); }
.pc.back { background: repeating-linear-gradient(45deg, #8a1c16, #8a1c16 4px, #a3261f 4px, #a3261f 8px); border-color: #5e100c; }
.pc small { font-size: 11px; }
.log { font-size: 12.5px; max-height: 260px; overflow-y: auto; display: grid; gap: 2px; }
.log div { padding: 4px 8px; border-radius: 6px; }
.log div.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text); }
.player-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.player-ctl input[type=range] { flex: 1; min-width: 160px; padding: 0; accent-color: var(--accent); }

/* ---------- wizard / promo preview */
.wizard { display: grid; grid-template-columns: 1fr 320px; gap: 18px; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.steps .s { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-size: 12.5px; color: var(--dim); background: var(--bg2); border: 1px solid var(--line); cursor: pointer; }
.steps .s b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); font-size: 11px; }
.steps .s.on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.steps .s.on b { background: var(--accent); color: var(--accent-ink); }
.steps .s.done b { background: var(--ok); color: #04241a; }
.phone { width: 300px; aspect-ratio: 16 / 9.6; border-radius: 18px; border: 8px solid #0a0a0a; background: linear-gradient(160deg, #7a0d0d, #3e0606); position: relative; overflow: hidden; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.phone .pop { position: absolute; inset: 9% 14%; background: linear-gradient(180deg, #8c1a14, #5a0d0a); border: 2px solid #e8b45a; border-radius: 10px; color: #fff; text-align: center; padding: 8px; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.phone .pop .t { font-weight: 800; font-size: 13px; color: #ffd36b; }
.phone .pop .x { font-size: 9.5px; opacity: .92; }
.phone .pop img { max-width: 100%; max-height: 42%; border-radius: 6px; object-fit: cover; }
.phone .pop .cta { margin-top: 3px; background: linear-gradient(180deg, #2fbf4f, #198a33); border-radius: 99px; padding: 3px 14px; font-size: 10px; font-weight: 700; }
.promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.promo .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line2); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(16px); }
.sharebox { background: var(--bg2); border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; }

/* ---------- misc kept from before */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: 10px; }
.chart .bar { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; }
.chart .bar i { flex: 1; display: block; min-height: 1px; border-radius: 3px 3px 0 0; }
.chart .dep, .lg.dep { background: var(--ok); } .chart .wd, .lg.wd { background: var(--bad); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.note { background: var(--bg2); padding: 8px 10px; border-radius: 8px; margin: 6px 0; white-space: pre-wrap; }
pre.json { max-height: 260px; overflow: auto; background: var(--bg2); padding: 10px; border-radius: 8px; font-size: 12px; }
code.secret { font-size: 18px; letter-spacing: 1px; user-select: all; }
td input, td select { min-width: 0; }

@media (max-width: 1100px) {
  .c8, .c7, .c6, .c5, .c4, .c3 { grid-column: span 12; }
  .wizard { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: fixed; inset: 0 25% 0 0; z-index: 6; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 40px rgba(0,0,0,.4); }
  aside.open { transform: none; }
  .menu { display: inline-flex; }
  section { padding: 16px; }
  header { padding: 10px 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .livepill .hide-sm { display: none; }
}

/* from the live-watch branch: line icons, step replay viewer, watch wall */
.i { width: 18px; height: 18px; flex: none; vertical-align: -3.5px; }
.btn .i { width: 16px; height: 16px; }
.btn.small .i { width: 14px; height: 14px; }
.i.dim { opacity: .6; }
.i.neg { color: var(--bad); }
/* replay viewer (step list) */
.cardc { display: inline-block; min-width: 30px; padding: 3px 4px; margin: 1px; border-radius: 5px; background: #fff; color: #111; border: 1px solid #c9ccd4; font: 700 13px/1.2 system-ui, sans-serif; text-align: center; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.cardc.red { color: #c0152a; }
.cardc.joker { background: #fff4c2; color: #8a4b00; }
.cardc.back { background: #7a1020; color: #fff; }
.cardc.new { outline: 2px solid #f5b700; }
.seat { padding: 8px 10px; margin: 6px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); }
.seat.on { border-color: #f5b700; box-shadow: 0 0 0 1px #f5b700 inset; }
.seat .grp { display: inline-block; padding: 2px; margin-right: 6px; border-bottom: 2px solid var(--line); }
table.moves tr.hl td { background: rgba(245, 183, 0, .18); }
table.moves tr { cursor: pointer; }

/* live wall: several tables at once */
.wall { display: grid; gap: 12px; }
.wall.n1 { grid-template-columns: 1fr; } .wall.n2 { grid-template-columns: 1fr 1fr; } .wall.n3, .wall.n4 { grid-template-columns: 1fr 1fr; } .wall.n6 { grid-template-columns: repeat(3, 1fr); } .wall.n9 { grid-template-columns: repeat(3, 1fr); }
.screen { position: relative; background: #000; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen .cap { position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; gap: 6px; }
.screen .cap .pill { background: rgba(0, 0, 0, .65); color: #fff; border-color: transparent; text-transform: none; }
.screen .cap .live { background: #e5484d; }
.screen .tools { position: absolute; right: 8px; top: 8px; z-index: 2; display: flex; gap: 6px; }
.screen .tools .btn { background: rgba(0, 0, 0, .65); color: #fff; border-color: transparent; }
.screen.empty { display: grid; place-items: center; color: var(--dim); background: var(--panel2); }

@media (max-width: 900px) {
  .wall.n2, .wall.n3, .wall.n4, .wall.n6, .wall.n9 { grid-template-columns: 1fr; }
}

/* Replays: list of played tables + the game-look board */
.rpl { display: grid; grid-template-columns: 320px 1fr; gap: 14px; align-items: start; }
.rpl-side { padding: 10px; position: sticky; top: 10px; }
.rpl-tools { display: flex; gap: 6px; margin-bottom: 8px; }
.rpl-tools select, .rpl-tools input { flex: 1; min-width: 0; }
.rpl-list { max-height: calc(100vh - 200px); overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.rpl-item { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--panel2); }
.rpl-item:hover { border-color: var(--line2); }
.rpl-item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rpl-item .t { display: flex; justify-content: space-between; gap: 8px; }
.rpl-item .t span, .rpl-item .w { color: var(--dim); font-size: 12px; }
.rpl-item .p { font-size: 12.5px; margin: 3px 0; }
.rpl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.rpl-board { width: 100%; }
.rpl-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); }
a.btn[aria-disabled] { pointer-events: none; opacity: .5; }
@media (max-width: 900px) { .rpl { grid-template-columns: 1fr; } .rpl-side { position: static; } .rpl-list { max-height: 300px; } }

/* Push notifications: templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--panel2); display: flex; flex-direction: column; gap: 6px; }
.tpl-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tpl-t { font-weight: 600; }
.tpl-b { color: var(--dim); font-size: 13px; flex: 1; }
.tpl-l { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl .actions { margin-top: 4px; }

/* Push: notification design picker + phone preview */
.np-box { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 6px 0 12px; background: var(--bg2); }
.np-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.np-sw { border: 2px solid transparent; border-radius: 10px; padding: 6px 8px; min-width: 74px; font: 600 16px/1.1 system-ui, sans-serif; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.np-sw small { font-size: 10.5px; font-weight: 600; }
.np-sw.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.np-custom[hidden] { display: none; }
.np-custom { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.np-custom label { display: flex; flex-direction: column; font-size: 12px; }
.np-custom input[type=color] { width: 54px; height: 30px; padding: 0; border: 0; background: none; }
.np-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 8px; }
.np-btnl { flex: 1; min-width: 180px; }
.np-phone { margin-top: 10px; background: #202124; border-radius: 16px; padding: 10px; max-width: 380px; }
.np-app { color: #bdc1c6; font: 12px system-ui, sans-serif; margin: 0 0 6px 4px; }
.np-card { border-radius: 12px; padding: 10px 12px; font: 13px/1.35 system-ui, sans-serif; }
.np-head { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.np-ic { font-size: 24px; }
.np-msg { margin-top: 4px; }
.np-img { display: block; width: 100%; max-height: 120px; object-fit: cover; border-radius: 8px; margin-top: 8px; }
.np-btn { display: inline-block; margin-top: 8px; float: right; padding: 5px 14px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.np-card::after { content: ''; display: block; clear: both; }
.np-mini { border-radius: 8px; padding: 6px 8px; font-size: 12.5px; }
.np-pin { font-size: 11px; opacity: .9; }
.np-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; border: 1px solid var(--line); }

/* Push page: tabs, send form, ledger, notification cards */
.ptabs { flex-wrap: wrap; }
.psend .card { max-width: 980px; }
.psend-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn.big { padding: 11px 22px; font-size: 15px; font-weight: 700; }
.presult { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); }
.presult.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.presult.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.presult a { margin-left: auto; }
.dim { color: var(--dim); }
.small { font-size: 12px; }
.ledger-body { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar { height: 4px; border-radius: 2px; background: var(--line); margin-top: 4px; min-width: 60px; }
.pbar i { display: block; height: 100%; border-radius: 2px; background: var(--ok); }
.row-actions { display: inline-flex; gap: 6px; white-space: nowrap; }
.np-mbtn { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.steps { padding-left: 18px; line-height: 1.7; }
#pnotes { position: fixed; top: 14px; right: 14px; z-index: 50; display: flex; flex-direction: column; gap: 10px; width: min(360px, calc(100vw - 28px)); }
.pnote { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 14px; padding: 10px 14px 12px; box-shadow: 0 12px 30px rgba(0,0,0,.35); animation: pnoteIn .25s ease-out; }
.pnote.bad { border-left-color: var(--bad); }
.pnote.out { opacity: 0; transform: translateX(30px); transition: all .3s; }
.pnote-app { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--dim); margin-bottom: 4px; }
.pnote-ic { width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; font-size: 11px; color: #fff; background: var(--ok); }
.pnote.bad .pnote-ic { background: var(--bad); }
.pnote-x { margin-left: auto; border: 0; background: none; color: var(--dim); font-size: 18px; cursor: pointer; line-height: 1; }
.pnote-msg { font-size: 13px; color: var(--dim); margin-top: 2px; }
@keyframes pnoteIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.modal .card.wide { width: min(1100px, 100%); }
.stat.click { cursor: pointer; } .stat.click:hover { border-color: var(--accent, #c33); }

/* player avatar next to the name */
.avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; background: #2a1414; object-fit: cover; }

/* endless lists: status line under the table, also the trigger for the next page */
.feedmore { padding: 14px; text-align: center; color: var(--dim); font-size: 13px; }

/* dashboard quick switches: one tile per switch with a real toggle */
.qs { padding: 16px 18px; }
.qs-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 12px; }
.qs-head span { color: var(--dim); font-size: 13px; }
.qs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.qs-tile { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.qs-tile:hover { border-color: var(--line2); }
.qs-tile:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.qs-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.qs-name { font-weight: 600; }
.qs-state { font-size: 12px; color: var(--dim); }
.qs-sw { flex: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line2); position: relative; transition: background .15s; }
.qs-sw span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.qs-tile.on { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 8%, var(--bg2)); }
.qs-tile.on .qs-sw { background: var(--ok); }
.qs-tile.on .qs-sw span { transform: translateX(18px); }
.qs-tile.on .qs-state { color: var(--ok); }
.qs-tile.danger.on { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--bg2)); }
.qs-tile.danger.on .qs-sw { background: var(--bad); }
.qs-tile.danger.on .qs-state { color: var(--bad); }

