/* Brand Bingo — base stylesheet. Every colour, radius, font and shadow comes from
   theme tokens (/theme/{slug}.css, edited in Admin > Themes). Do not hardcode colours here. */
@font-face { font-family: 'Noto Sans Ethiopic'; src: url('../fonts/NotoSansEthiopic.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Noto Sans Ethiopic'; src: url('../fonts/NotoSansEthiopic-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--font-size); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--text); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-contrast); padding: .5rem 1rem; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }
.muted { color: var(--text-muted); } .small { font-size: .85rem; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.lead { font-size: 1.15rem; }

/* Layout */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.main { flex: 1; padding-top: 1.5rem; padding-bottom: 2rem; }
.site-header { background: var(--header-bg); color: var(--header-text); }
.site-header a, .site-header .link-btn { color: var(--header-text); text-decoration: none; }
.header-row { display: flex; align-items: center; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; font-size: 1.15rem; margin-inline-end: auto; }
.brand-logo { height: 36px; width: auto; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.main-nav a:hover { text-decoration: underline; }
.inline { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: var(--primary); }
.lang-switch { display: inline-flex; gap: .3rem; align-items: center; }
.lang-switch select { padding: .25rem .4rem; min-height: 0; width: auto; }
.site-footer { background: var(--surface-2); border-top: 1px solid var(--border); padding: 1.5rem 0; margin-top: auto; }
.footer-row { display: flex; gap: 1.5rem; justify-content: space-between; flex-wrap: wrap; }
.footer-links { display: flex; flex-direction: column; gap: .25rem; }
.rg-notice, .age-badge { font-size: .85rem; }
.age-badge { display: inline-block; border: 2px solid var(--danger); color: var(--danger); border-radius: 50%; width: 2.4rem; height: 2.4rem; line-height: 2.1rem; text-align: center; font-weight: 700; }

/* Cards & grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-bottom: 1.25rem; }
.grid-2, .grid-3 { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-2 > .card, .grid-3 > .card { margin-bottom: 0; }
.grid-2, .grid-3 { margin-bottom: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .5rem 0; }
.toolbar form { margin: 0; }
.prose { max-width: 760px; }
.auth-card { max-width: 460px; margin: 1rem auto; }
.error-card { max-width: 560px; margin: 2rem auto; text-align: center; }
.error-code { font-size: 4rem; font-weight: 700; color: var(--accent); line-height: 1; }
.debug { text-align: start; white-space: pre-wrap; overflow: auto; max-height: 360px; background: var(--surface-2); padding: .75rem; border-radius: var(--radius-sm); font-size: .8rem; }
.notice-card { border-inline-start: 6px solid var(--accent); }

/* Hero & bingo balls */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.hero h1 { font-size: 2.2rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-balls { display: flex; gap: .6rem; flex-wrap: wrap; }
.ball { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; color: var(--ball-text); font-weight: 700; font-size: 1.35rem; line-height: 1; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18), var(--shadow); }
.ball small { font-size: .7rem; opacity: .9; }
.ball-b { background: var(--ball-b); } .ball-i { background: var(--ball-i); } .ball-n { background: var(--ball-n); } .ball-g { background: var(--ball-g); } .ball-o { background: var(--ball-o); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 42px; padding: .5rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.btn-accent { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.site-header .btn-accent { color: var(--accent-contrast); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-sm { min-height: 32px; padding: .25rem .65rem; font-size: .88rem; }
.btn-block { width: 100%; }

/* Forms */
.form .field, .field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input, select, textarea { width: 100%; min-height: 42px; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--primary); }
input[type=color] { width: 48px; padding: 2px; flex: 0 0 48px; }
input[type=file] { min-height: 0; padding: .35rem; }
input:disabled, select:disabled, textarea:disabled { opacity: .65; cursor: not-allowed; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
.check input { margin-top: .3rem; }
.hint { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.field-error, .has-error .error { color: var(--danger); font-size: .85rem; margin-top: .25rem; }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.sticky-actions { position: sticky; bottom: 0; background: var(--surface); padding: .75rem 0; border-top: 1px solid var(--border); z-index: 5; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: .9rem; }
.filters input, .filters select { width: auto; flex: 1 1 160px; }
.filters .check { flex: 0 0 auto; margin: 0; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 140px; }
.w-num { width: 80px !important; flex: none !important; }

/* Switch (checkbox styled as toggle) */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 400; }
.switch input { appearance: none; -webkit-appearance: none; width: 44px; height: 24px; border-radius: 12px; background: var(--border); position: relative; transition: background .15s; border: 0; padding: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(20px); }

/* Alerts, badges, statuses */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border-inline-start: 5px solid var(--info); background: var(--surface-2); }
.alert-success { border-color: var(--success); } .alert-error, .alert-danger { border-color: var(--danger); }
.alert-warning { border-color: var(--warning); } .alert-info { border-color: var(--info); }
.badge, .tag { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-size: .78rem; font-weight: 600; }
.tag { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.lock { display: inline-block; padding: 0 .4rem; border-radius: 4px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; vertical-align: middle; }
.status { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); }
.status-active, .status-ok { border-color: var(--success); color: var(--success); }
.status-pending, .status-skip { border-color: var(--warning); color: var(--warning); }
.status-suspended, .status-closed, .status-error { border-color: var(--danger); color: var(--danger); }
.key { color: var(--text-muted); font-size: .78rem; word-break: break-all; }
.role-chip { padding: .1rem .6rem; border-radius: 999px; background: rgba(255,255,255,.15); font-size: .8rem; }
.role-dev { background: var(--danger); color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; }
.card.table-wrap .pagination { padding: .75rem 1rem; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); text-align: start; vertical-align: top; }
.table thead th { background: var(--surface-2); font-size: .85rem; position: sticky; top: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .center, .matrix td.center, .matrix th.center { text-align: center; }
.group-row th { background: var(--surface-2); color: var(--primary); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
.translations td { min-width: 220px; }
.translations td:first-child { min-width: 180px; max-width: 260px; }
.translations td.empty input, .translations td.empty textarea { border-color: var(--warning); }
.details code { white-space: pre-wrap; word-break: break-all; }
.pagination { display: flex; gap: .75rem; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.dl dt { color: var(--text-muted); } .dl dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: .35rem 0; border-bottom: 1px dashed var(--border); }
.req, .checks { list-style: none; padding: 0; margin: 0; }
.req li, .checks li { padding: .3rem 0; display: flex; gap: .5rem; align-items: center; }
.req li span, .checks li span { display: inline-block; min-width: 2.5rem; text-align: center; border-radius: 4px; font-size: .75rem; font-weight: 700; color: #fff; }
.req .ok span, .checks .ok span { background: var(--success); } .req .bad span, .checks .bad span { background: var(--danger); } .checks .warn span { background: var(--warning); }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; min-width: 100px; }
.progress span { display: block; height: 100%; background: var(--primary); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--text-muted); font-size: .85rem; }

/* Tabs (settings groups) */
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem; }
.tabs a.active, .tabs a[aria-current] { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }

/* Settings rows */
.setting { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting-label label { margin-bottom: .15rem; }
.setting-meta { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-top: .3rem; }
.setting-img { max-height: 60px; display: block; margin-bottom: .5rem; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); }
.reset-list { list-style: none; padding: 0; margin: 0; }
.reset-list li { display: flex; justify-content: space-between; gap: .5rem; padding: .3rem 0; border-bottom: 1px dashed var(--border); }
.reset-list form { margin: 0; }

/* Themes */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.theme-card { margin: 0; }
.theme-card.inactive { opacity: .6; }
.theme-preview { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); margin-bottom: .75rem; }
.tp-head { padding: .45rem .7rem; font-weight: 700; font-size: .85rem; }
.tp-body { display: flex; gap: .4rem; padding: .7rem; }
.tp-body span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-weight: 700; font-size: .8rem; }
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .25rem 1rem; }
.token-group { grid-column: 1 / -1; margin: 1rem 0 .25rem; color: var(--primary); }
.token-input { display: flex; gap: .4rem; }
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.theme-picker label { display: flex; flex-direction: column; gap: .4rem; padding: .6rem; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 400; }
.theme-picker label:has(input:checked) { border-color: var(--primary); }
.theme-picker input { position: absolute; opacity: 0; }
.theme-picker input:focus-visible + .sw { outline: 3px solid var(--focus-ring); }
.theme-swatch, .sw { display: flex; height: 24px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.sw i { flex: 1; }

/* Admin shell */
body.admin { background: var(--bg); }
.admin-header-row { padding: 0 1rem; }
.menu-toggle { display: none; background: transparent; border: 1px solid var(--header-text); color: var(--header-text); border-radius: var(--radius-sm); padding: .3rem .7rem; font: inherit; cursor: pointer; }
.admin-shell { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 250px; flex: 0 0 250px; background: var(--surface); border-inline-end: 1px solid var(--border); padding: 1rem .5rem; overflow-y: auto; }
.sidebar a { display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--primary); color: var(--primary-contrast); }
.side-section { margin: 1rem .75rem .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.side-section:first-child { margin-top: 0; }
.admin-main { flex: 1; min-width: 0; padding: 1.5rem; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-block; }
  .sidebar { position: fixed; inset-block: 60px 0; inset-inline-start: 0; z-index: 50; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  [dir=rtl] .sidebar { transform: translateX(105%); }
  body.sidebar-open .sidebar { transform: none; }
  .setting { grid-template-columns: 1fr; }
  .admin-main { padding: 1rem; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .hero { padding: 1.25rem; } .hero h1 { font-size: 1.7rem; }
  .ball { width: 52px; height: 52px; font-size: 1.1rem; }
  .card { padding: 1rem; }
  .main-nav { gap: .6rem; font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .sidebar, .btn { display: none !important; } }

/* Wallet & payments (v0.2.0) */
.status-approved, .status-paid { border-color: var(--success); color: var(--success); }
.status-verified, .status-initiated { border-color: var(--info); color: var(--info); }
.status-rejected, .status-failed { border-color: var(--danger); color: var(--danger); }
.status-cancelled, .status-expired { color: var(--text-muted); }
a.stat { color: var(--text); text-decoration: none; }
a.stat:hover { border-color: var(--primary); }
.balance { font-size: 2rem; font-weight: 700; line-height: 1.15; margin: .25rem 0; }
.balance small { font-size: .9rem; font-weight: 400; color: var(--text-muted); }
.amount-in { color: var(--success); font-weight: 600; white-space: nowrap; }
.amount-out { color: var(--danger); font-weight: 600; white-space: nowrap; }
.num { text-align: end !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.method-card { display: flex; gap: .75rem; align-items: center; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.method-card:hover { border-color: var(--primary); }
.method-card.closed { opacity: .55; }
.method-card img { width: 44px; height: 44px; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-2); }
.method-logo { max-height: 48px; display: block; margin-bottom: .5rem; }
.pay-to { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin-bottom: 1rem; }
.pay-to strong { font-size: 1.25rem; letter-spacing: .03em; word-break: break-all; }
.instructions { white-space: pre-line; }
.flag { display: inline-block; padding: .05rem .5rem; border-radius: 4px; background: var(--warning); color: #000; font-size: .75rem; font-weight: 600; margin: .1rem 0; }
.receipt-img { max-width: 100%; max-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-start; }
.actions-row form { margin: 0; }

/* ---------- Bingo (v0.3.0) ---------- */
.bcard { display: inline-grid; gap: 3px; background: var(--border); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 3px; font-variant-numeric: tabular-nums; }
.bcard-75 { grid-template-columns: repeat(5, 2.1rem); }
.bcard-90 { grid-template-columns: repeat(9, 1.9rem); }
.bcard .h, .bcard .c { display: grid; place-items: center; height: 2.1rem; border-radius: 4px; font-weight: 700; font-size: .95rem; }
.bcard .h { color: var(--ball-text); }
.bcard .h:nth-child(1) { background: var(--ball-b); } .bcard .h:nth-child(2) { background: var(--ball-i); } .bcard .h:nth-child(3) { background: var(--ball-n); } .bcard .h:nth-child(4) { background: var(--ball-g); } .bcard .h:nth-child(5) { background: var(--ball-o); }
.bcard .c { background: var(--surface); color: var(--text); }
.bcard .c.free { background: var(--accent); color: var(--accent-contrast); font-size: .7rem; }
.bcard .c.empty { background: var(--surface-2); }
.bcard .c.hit { background: var(--primary); color: var(--primary-contrast, #fff); }
.bcard .c.win { outline: 3px solid var(--accent); outline-offset: -3px; }
.bcard-cap { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.bcards { display: flex; flex-wrap: wrap; gap: 1rem; }
.board { display: grid; grid-template-columns: repeat(15, minmax(1.8rem, 1fr)); gap: 3px; }
.board-90 { grid-template-columns: repeat(10, minmax(1.8rem, 1fr)); }
.board span { display: grid; place-items: center; height: 1.9rem; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); font-size: .8rem; font-weight: 600; }
.board span.on { background: var(--primary); color: var(--primary-contrast, #fff); }
.board span.last { background: var(--accent); color: var(--accent-contrast); }
.mask-grid { display: inline-grid; gap: 2px; margin: .25rem; }
.mask-grid-75 { grid-template-columns: repeat(5, 1.6rem); }
.mask-grid-90 { grid-template-columns: repeat(9, 1.4rem); }
.mask-grid label { display: block; width: 100%; height: 1.6rem; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-2); cursor: pointer; }
.mask-grid input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mask-grid input:checked + label { background: var(--primary); }
.mask-grid input:focus-visible + label { outline: 2px solid var(--focus-ring); }
.mask-grid i { display: block; height: 1rem; border-radius: 2px; background: var(--surface-2); }
.mask-grid i.on { background: var(--primary); }
.mask-box { display: inline-flex; flex-direction: column; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .35rem; margin: .25rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }
.stage-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.hash { font-family: ui-monospace, monospace; font-size: .75rem; word-break: break-all; }
@media print { .bcard { break-inside: avoid; } }

/* ---------------- 0.4.0 player web app (lobby, game screen, history) — colours only from theme tokens */
.mt { margin-top: 1rem; }
.play-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.btn-lg { min-height: 52px; padding: .7rem 1.4rem; font-size: 1.1rem; }
.status-open, .status-countdown { border-color: var(--info); color: var(--info); }
.status-running, .status-claiming { border-color: var(--success); color: var(--success); }
.status-finished { color: var(--text-muted); }
.play-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.room-card { display: flex; flex-direction: column; gap: .6rem; margin: 0; }
.room-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.room-card-head h2 { margin: 0; font-size: 1.15rem; }
.room-facts { display: grid; gap: .3rem; margin: 0; font-size: .9rem; }
.room-facts div { display: flex; justify-content: space-between; gap: .75rem; }
.room-facts dt { color: var(--text-muted); } .room-facts dd { margin: 0; font-weight: 600; text-align: end; }
.room-status { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; min-height: 1.6rem; }
.room-card .btn-block { margin-top: auto; }
.empty-state { text-align: center; padding: 2rem 1rem; }

.play-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.play-title { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; flex: 1 1 auto; min-width: 0; }
.play-title h1 { margin: 0; font-size: 1.35rem; }
.play-tools { display: flex; gap: .4rem; align-items: flex-start; position: relative; }
.play-settings summary { list-style: none; }
.play-settings summary::-webkit-details-marker { display: none; }
.play-settings-body { position: absolute; inset-inline-end: 0; top: calc(100% + .35rem); z-index: 20; width: min(320px, 90vw); display: grid; gap: .6rem; box-shadow: var(--shadow); }
.play-settings-body .field { margin: 0; }
.play-line { margin: .6rem 0 0; font-weight: 600; min-height: 1.4rem; }
.play-balance { margin: .1rem 0 .6rem; }
.play.is-offline .play-line { color: var(--danger); }
.play-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 1rem; align-items: start; }
.play-main, .play-side { display: grid; gap: 1rem; min-width: 0; }
.play-main .card, .play-side .card { margin: 0; }
.h3 { font-size: 1.05rem; margin: 0 0 .5rem; }

.play-caller { display: flex; align-items: center; gap: 1rem; }
.caller-ball { width: 96px; height: 96px; font-size: 2.3rem; flex: 0 0 auto; background: var(--surface-2); color: var(--text-muted); }
.caller-ball small { font-size: .9rem; }
.caller-ball.ball-b, .caller-ball.ball-i, .caller-ball.ball-n, .caller-ball.ball-g, .caller-ball.ball-o { color: var(--ball-text); }
.caller-side { display: grid; gap: .3rem; min-width: 0; }
.caller-text { font-size: 1.4rem; font-weight: 700; min-height: 1.6rem; }
.recent { display: flex; flex-wrap: wrap; gap: .3rem; }
.ball-sm { width: 34px; height: 34px; font-size: .85rem; box-shadow: none; }
@media (prefers-reduced-motion: no-preference) {
  .caller-ball { animation: ball-in .35s ease-out; }
  @keyframes ball-in { from { transform: scale(.6); opacity: .4; } to { transform: scale(1); opacity: 1; } }
}

.play-stage-row { display: flex; align-items: center; gap: 1rem; }
.stage-name { font-size: 1.15rem; font-weight: 700; }
.mini-mask { display: inline-grid; grid-template-columns: repeat(var(--cols, 5), 14px); gap: 2px; flex: 0 0 auto; }
.mini-mask span { width: 14px; height: 14px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--border); }
.mini-mask span.on { background: var(--primary); border-color: var(--primary); }
.stage-list { margin: .6rem 0 0; padding-inline-start: 1.2rem; font-size: .88rem; color: var(--text-muted); }
.stage-list li.now { color: var(--text); font-weight: 700; }
.stage-list li.done { text-decoration: line-through; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 300px; overflow-y: auto; padding: 2px; }
.pick { min-height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.pick:hover { border-color: var(--primary); }
.pick:focus-visible, .play-card button.c:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 1px; }
.pick.sel { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.pick.taken { background: var(--surface-2); color: var(--text-muted); text-decoration: line-through; cursor: not-allowed; }
.pick.own { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); cursor: default; }
.shop-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.stepper-value { min-width: 2rem; text-align: center; font-size: 1.2rem; }
.pick-preview { margin-top: .75rem; }

.mine-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.mine-hint { width: 100%; margin: 0; }
.bcard-wrap.mine { display: flex; flex-direction: column; gap: .3rem; }
.bcard-wrap.won .bcard { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent); }
.bcard-cap { display: flex; align-items: center; gap: .4rem; }
.card-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.bingo-btn { font-size: 1.1rem; letter-spacing: .05em; min-width: 7rem; }
.play-card button.c { border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.play-card .c.hit::after { content: '✓'; font-size: .6rem; position: absolute; transform: translate(.75rem, -.6rem); }
.play-card .c { position: relative; }
.play-card .c.due { box-shadow: inset 0 0 0 2px var(--accent); }

.winner-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .9rem; }
.winner-list li.mine { font-weight: 700; color: var(--success); }
.play-banner { margin-top: 1rem; display: grid; gap: .5rem; justify-items: start; border-color: var(--accent); }
.play-banner p { margin: 0; }
.play-toast { position: fixed; inset-inline: 1rem; bottom: 1rem; margin-inline: auto; max-width: 420px; z-index: 50; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); border: 2px solid var(--info); box-shadow: var(--shadow); font-weight: 600; text-align: center; }
.play-toast-ok { border-color: var(--success); } .play-toast-warn { border-color: var(--warning); } .play-toast-err { border-color: var(--danger); }

body.play-big .bcard-75 { grid-template-columns: repeat(5, 3rem); }
body.play-big .bcard-90 { grid-template-columns: repeat(9, 2.4rem); }
body.play-big .bcard .h, body.play-big .bcard .c { height: 3rem; font-size: 1.3rem; }
body.play-big .caller-ball { width: 120px; height: 120px; font-size: 3rem; }
body.play-big .caller-text { font-size: 1.8rem; }
body.play-big .board span { height: 2.3rem; font-size: 1rem; }
body.play-lite .caller-ball { animation: none; }

.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.clip { display: grid; gap: .25rem; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.clip.missing { background: var(--surface-2); color: var(--text-muted); }
.clip audio { width: 100%; height: 32px; }
.offline-page .empty-state img { border-radius: 22%; }

@media (max-width: 860px) {
  .play-layout { grid-template-columns: 1fr; }
  .play-side { order: 2; }
}
@media (max-width: 480px) {
  .caller-ball { width: 76px; height: 76px; font-size: 1.9rem; }
  .bcard-75 { grid-template-columns: repeat(5, 2.3rem); }
  .bcard-90 { grid-template-columns: repeat(9, calc((100vw - 3.5rem) / 9)); }
  .board { grid-template-columns: repeat(10, minmax(1.6rem, 1fr)); }
}
.caller-ball.ball-b { background: var(--ball-b); } .caller-ball.ball-i { background: var(--ball-i); } .caller-ball.ball-n { background: var(--ball-n); } .caller-ball.ball-g { background: var(--ball-g); } .caller-ball.ball-o { background: var(--ball-o); }
.play-board .board { grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 2px; }
.play-board .board-90 { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.play-board .board span { height: auto; aspect-ratio: 1; font-size: .72rem; }
body.play-big .play-board .board span { height: auto; font-size: .85rem; }

/* ---------------- 0.5.0 Telegram Mini App */
.text-danger { color: var(--danger); }
.tg-entry { max-width: 28rem; margin: 2rem auto; text-align: center; }
.tg-entry h1 { margin-top: 0; }
html[data-tg="1"] .main { padding-top: .75rem; }
.plain-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Android app admin (v0.6.0) */
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.checklist li { display: flex; gap: .6rem; align-items: center; }
.checklist .status { min-width: 4.5rem; text-align: center; }
.steps { margin: 1rem 0 .5rem 1.2rem; padding: 0; display: grid; gap: .35rem; }
.plain-fieldset > legend { font-weight: 600; margin: .75rem 0 .35rem; padding: 0; }
.app-get { display: inline-block; margin-top: .5rem; }

/* ---- P7: hall TV, counter slips, responsible gaming, KYC, reports ---- */
.hall-tv { background: var(--header-bg); color: var(--header-text); min-height: 100vh; margin: 0; padding: 2vh 2vw; display: flex; flex-direction: column; gap: 2vh; font-variant-numeric: tabular-nums; }
.hall-tv .muted { color: rgba(255,255,255,.6); }
.tv-head { display: flex; justify-content: space-between; align-items: center; gap: 2vw; font-size: 2.6vh; }
.tv-brand { font-size: 3.4vh; font-weight: 800; }
.tv-status { background: rgba(255,255,255,.1); border-radius: 1vh; padding: .6vh 1.4vw; }
.tv-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.3fr); gap: 2vw; align-items: start; flex: 1; }
.tv-left { display: grid; justify-items: center; gap: 1.4vh; text-align: center; }
.tv-last { display: grid; place-items: center; width: 24vh; height: 24vh; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: 10vh; font-weight: 800; box-shadow: 0 0 6vh rgba(255,255,255,.15); }
.tv-letter { font-size: 4vh; font-weight: 800; min-height: 4vh; }
.tv-recent { display: flex; gap: .8vh; flex-wrap: wrap; justify-content: center; }
.tv-recent span { background: rgba(255,255,255,.12); border-radius: 999px; padding: .4vh 1.2vh; font-size: 2.2vh; font-weight: 700; }
.tv-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1vh; width: 100%; margin: 0; }
.tv-facts dt { grid-row: 1; font-size: 1.8vh; opacity: .7; }
.tv-facts dd { margin: 0; font-size: 3.4vh; font-weight: 800; white-space: nowrap; }
.tv-facts { grid-template-columns: repeat(5, 1fr); }
.tv-facts dt, .tv-facts dd { background: rgba(255,255,255,.06); padding: .4vh .4vw; }
.tv-facts dt { border-radius: 1vh 1vh 0 0; } .tv-facts dd { border-radius: 0 0 1vh 1vh; font-size: 2.3vh; }
.tv-timer { font-size: 3vh; font-weight: 700; min-height: 3vh; }
.tv-stages { list-style: none; padding: 0; margin: 0; display: flex; gap: .8vh; flex-wrap: wrap; justify-content: center; font-size: 2vh; }
.tv-stages li { padding: .4vh 1vh; border-radius: .8vh; background: rgba(255,255,255,.08); }
.tv-stages li.now { background: var(--accent); color: var(--accent-contrast); }
.tv-stages li.done { opacity: .5; text-decoration: line-through; }
.tv-winners { display: grid; gap: .6vh; font-size: 2.4vh; }
.tv-win { background: var(--success); color: var(--ball-text); border: 1px solid var(--success); border-radius: 1vh; padding: .6vh 1vw; }
.tv-board { display: grid; gap: .5vh; }
.tv-board-90 { grid-template-columns: repeat(10, 1fr); }
.tv-row { display: grid; grid-template-columns: 6vh repeat(15, 1fr); gap: .5vh; }
.tv-h { display: grid; place-items: center; font-weight: 800; font-size: 3.4vh; border-radius: .6vh; color: var(--ball-text); }
.tv-row:nth-child(1) .tv-h { background: var(--ball-b); } .tv-row:nth-child(2) .tv-h { background: var(--ball-i); } .tv-row:nth-child(3) .tv-h { background: var(--ball-n); } .tv-row:nth-child(4) .tv-h { background: var(--ball-g); } .tv-row:nth-child(5) .tv-h { background: var(--ball-o); }
.tv-n { display: grid; place-items: center; height: 8vh; border-radius: .6vh; background: rgba(255,255,255,.06); color: rgba(255,255,255,.3); font-size: 3vh; font-weight: 700; }
.tv-board-90 .tv-n { height: 6.6vh; }
.tv-n.on { background: var(--header-text); color: var(--header-bg); }
.tv-n.last { background: var(--accent); color: var(--accent-contrast); outline: .4vh solid var(--header-text); }
body.tv-offline .tv-status { background: var(--danger); color: var(--ball-text); }
body.tv-offline .tv-board { opacity: .5; }
@media (max-width: 800px) { .tv-main { grid-template-columns: 1fr; } }

.print-slip { max-width: 80mm; margin: 0 auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: black; background: white; }
.slip { border: 1px dashed black; padding: 6px; }
.slip h1, .slip h2 { font-size: 14px; margin: 0 0 4px; text-align: center; }
.slip-code { font-size: 22px; font-weight: 800; letter-spacing: .15em; text-align: center; margin: 6px 0; }
.slip-head { text-align: center; font-size: 14px; }
.slip-cards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.slip-cards figure { margin: 0; text-align: center; }
.slip-cards .bcard .c.free { font-size: 7px; letter-spacing: -.02em; }
.print-slip .kv { margin: 4px 0; }
.print-slip .btn { margin-top: 6px; }
.slip-cards .bcard { background: black; border-color: black; }
.slip-cards .bcard .c, .slip-cards .bcard .h { background: white !important; color: black !important; height: 1.4rem; font-size: 11px; }
.slip-cards .bcard-75 { grid-template-columns: repeat(5, 1.5rem); }
.slip-cards .bcard-90 { grid-template-columns: repeat(9, 1.3rem); }
.cards-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; }
@media print {
  .no-print, .site-header, .site-footer, .admin-nav, .admin-side, .flash { display: none !important; }
  body, body.admin { background: white !important; }
  .print-slip { max-width: none; }
  @page { margin: 4mm; }
}

.rg-dialog { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 200; padding: 1rem; }
.rg-dialog[hidden] { display: none; }
.rg-box { background: var(--surface); color: var(--text); border-radius: var(--radius); max-width: 420px; width: 100%; padding: 1.25rem; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.rg-box h2 { margin-top: 0; }
.rg-limit .inline-form input { flex: 1; min-width: 0; width: auto; }
.rg-cancel { display: block; margin: -.5rem 0 1rem; }

.kyc-photos { display: flex; flex-wrap: wrap; gap: .75rem; }
.kyc-photos figure { margin: 0; }
.kyc-photos img { max-width: 320px; max-height: 240px; border: 1px solid var(--border); border-radius: var(--radius-sm); object-fit: contain; background: black; }

.report-table td.num, .report-table th.num { text-align: end; }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); }
.w-date { width: 11rem; }
.w-num { width: 9rem; }
.narrow { max-width: 560px; }
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
