/* CounterFlame Control — responsive, dependency-free interface */
:root {
  color-scheme: dark;
  --bg: #101114;
  --sidebar: #141519;
  --panel: #191b20;
  --surface: #202228;
  --surface-hover: #25272e;
  --border: #2d3038;
  --text: #f4f3f1;
  --muted: #a0a5b1;
  --subtle: #818896;
  --accent: #ff8964;
  --accent-soft: #ff896412;
  --green: #8ed9b8;
  --radius: 20px;
  --shadow: 0 8px 30px #0000000d;
  font-family: 'Segoe UI Variable', 'Segoe UI', Arial, sans-serif;
  font-synthesis: none;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --sidebar: #fff;
  --panel: #fff;
  --surface: #f4f5f8;
  --surface-hover: #ebedf2;
  --border: #dfe3eb;
  --text: #202531;
  --muted: #626b7c;
  --subtle: #667184;
  --accent: #bc4a28;
  --accent-soft: #e97b5310;
  --green: #247957;
  --shadow: 0 6px 24px #24345405;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
::selection { background: #ff896440; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
a { color: inherit; text-decoration: none; }
button, a, input, select { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: -.35px; }
.hidden { display: none !important; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 200; padding: 12px 20px; background: var(--accent); color: var(--bg); border-radius: 10px; }
.skip-link:focus { top: 12px; }
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 250px; position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; flex-direction: column; padding: 30px 18px 0; background: var(--sidebar); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 750; letter-spacing: -.9px; padding-left: 6px; }
.brand-light { font-weight: 400; }
.brand small { display: block; font-size: 8px; font-weight: 600; letter-spacing: 1.75px; color: var(--subtle); margin-top: 5px; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 43px; border-radius: 12px; color: #ff9974; background: linear-gradient(150deg,#583023,#2b201f); border: 1px solid #8e513c; flex-shrink: 0; }
.brand-mark svg { width: 28px; height: 31px; }
.workspace { display: flex; align-items: center; gap: 10px; margin-top: 34px; padding: 13px 11px; border: 1px solid var(--border); border-radius: 12px; font-size: 12px; font-weight: 600; }
.workspace-icon { display: grid; place-items: center; height: 32px; width: 32px; border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 11px; }
.workspace small { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; font-weight: 400; }
.workspace-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-left: auto; flex-shrink: 0; }
.nav-label { margin: 30px 14px 12px; color: var(--subtle); font-size: 9px; font-weight: 600; letter-spacing: 1.8px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; height: 47px; width: 100%; padding: 0 14px; border-radius: 10px; text-align: left; font-size: 13px; color: var(--muted); margin: 5px 0; transition: background .18s, color .18s; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px #ff896423; }
.nav-item.active::before { content: ''; position: absolute; left: -18px; width: 3px; height: 22px; background: var(--accent); border-radius: 0 3px 3px 0; }
.nav-shortcut { margin-left: auto; font-size: 10px; opacity: .65; }
.nav-count { margin-left: auto; min-width: 24px; padding: 3px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; text-align: center; font-size: 10px; color: var(--muted); }
.sidebar-bottom { margin-top: auto; padding-top: 34px; }
.sandbox-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: linear-gradient(125deg,var(--accent-soft),transparent 80%); }
.small-kicker { font-size: 9px; font-weight: 600; letter-spacing: 1.4px; color: var(--subtle); }
.sandbox-card>div { display: flex; align-items: center; gap: 7px; margin-top: 13px; font-size: 12px; line-height: 1.5; }
.status-dot, .mini-dot, .live-dot { display: inline-block; flex-shrink: 0; height: 6px; width: 6px; border-radius: 50%; background: var(--green); }
.status-dot, .live-dot { box-shadow: 0 0 0 4px #8ed9b80b; }
.mini-dot.orange { background: var(--accent); }
.mini-dot.green { background: var(--green); }
.sandbox-card p { margin: 10px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.75; }
.subtle-link { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 5px 0; font-size: 11px; color: var(--accent); }
.admin { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); margin: 22px -18px 0; padding: 20px 22px; font-size: 12px; }
.admin small { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; }
.admin .icon-button { margin-left: auto; }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: 50%; font-size: 10px; font-weight: 650; }
.main-shell { flex: 1; min-width: 0; margin-left: 250px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 0 38px; border-bottom: 1px solid var(--border); }
.breadcrumb { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--subtle); }
.breadcrumb span { opacity: .5; }
.breadcrumb strong { color: var(--text); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.local-label { display: flex; align-items: center; gap: 8px; margin-right: 6px; font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.icon-button { display: grid; place-items: center; flex-shrink: 0; height: 36px; width: 36px; border-radius: 10px; color: var(--muted); font-size: 22px; transition: background .18s, color .18s; }
.icon-button:hover { background: var(--surface-hover); color: var(--text); }
.icon-button svg { width: 18px; height: 18px; }
.mini-avatar { width: 32px; height: 32px; font-size: 9px; margin-left: 3px; }
main { max-width: 1700px; margin: auto; padding: 36px 38px 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin-bottom: 26px; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--subtle); font-size: 9px; font-weight: 650; letter-spacing: 1.8px; }
.eyebrow>span { height: 5px; width: 5px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(28px,2.7vw,40px); font-weight: 650; line-height: 1.2; letter-spacing: -1.5px; margin-top: 12px; }
h1>span { color: var(--accent); }
.page-heading p { color: var(--muted); font-size: 13px; line-height: 1.7; margin-top: 10px; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.date-label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 17px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); background: var(--surface); font-size: 12px; font-weight: 600; line-height: 1.5; transition: background .18s, transform .18s; }
.button:hover { background: var(--surface-hover); transform: translateY(-1px); }
.button svg { width: 16px; height: 16px; }
.button.primary { background: #ff916b; border-color: #ffab8d; color: #281a14; box-shadow: 0 4px 16px #ff896410; }
.button.primary:hover { background: #ffa486; }
.demo-banner { display: flex; align-items: center; gap: 13px; padding: 13px 18px; border: 1px solid #d49c4933; border-radius: 12px; background: #c49b4010; color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 22px; }
.demo-banner strong { color: var(--text); font-weight: 600; }
.banner-icon { display: grid; place-items: center; width: 27px; height: 27px; color: var(--accent); border: 1px solid #ff896430; border-radius: 8px; }
.banner-tag { margin-left: auto; font-size: 8px; letter-spacing: 1px; color: var(--subtle); white-space: nowrap; }
.overview-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.section-label { font-size: 11px; font-weight: 600; letter-spacing: .5px; color: var(--muted); }
.quick-links { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-link { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 10px; font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.quick-link svg { width: 13px; height: 13px; }
.quick-link:hover { background: var(--surface-hover); color: var(--text); }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { position: relative; min-width: 0; min-height: 158px; padding: 21px; background: linear-gradient(145deg,var(--surface),var(--panel) 65%); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.stat-card:first-child { border-color: #ff896449; background: radial-gradient(ellipse at 95% 0,#ff896412,transparent 75%),var(--panel); }
.stat-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.stat-label svg { color: var(--subtle); width: 17px; height: 17px; }
.stat-card:first-child .stat-label svg { color: var(--accent); }
.stat-number { font-size: clamp(28px,2.8vw,40px); font-weight: 600; line-height: 1.15; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; margin-top: 17px; overflow-wrap: anywhere; }
.stat-foot { display: flex; align-items: center; gap: 7px; min-height: 18px; font-size: 10px; color: var(--subtle); line-height: 1.5; margin-top: 12px; }
.stat-trend { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 10px; min-height: 22px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.stat-trend-value { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; background: var(--surface); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-trend-value > span { font-size: 16px; line-height: 1; }
.stat-trend.is-up .stat-trend-value { color: var(--green); background: #66bd9515; }
.stat-trend.is-down .stat-trend-value { color: #f59b9b; background: #e2626215; }
:root[data-theme="light"] .stat-trend.is-down .stat-trend-value { color: #b52f3c; }
.stat-trend + .stat-foot { margin-top: 8px; }
.sparkline { display: none; } /* No decorative data that could be mistaken for a real trend. */
.queue-pill { color: var(--muted); }
.analytics-grid, .lower-grid { display: grid; grid-template-columns: minmax(0,1.85fr) minmax(285px,1fr); gap: 22px; margin-bottom: 24px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 24px 0; }
.panel-heading h2 { display: flex; align-items: center; gap: 10px; line-height: 1.4; }
.panel-heading p { font-size: 11px; line-height: 1.6; color: var(--subtle); margin-top: 6px; }
.period-chip { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; color: var(--muted); background: var(--surface); }
.period-chip svg { width: 13px; height: 13px; }
.chart-legend { display: flex; align-items: center; gap: 7px; margin: 25px 26px 10px; color: var(--muted); font-size: 11px; }
.chart-legend strong { margin-left: auto; font-size: 22px; font-weight: 600; letter-spacing: -.5px; color: var(--text); font-variant-numeric: tabular-nums; }
.chart { height: 200px; margin: 0 22px 22px 17px; }
.chart svg { height: 100%; width: 100%; overflow: visible; stroke: none; }
.chart text { font-family: inherit; font-size: 10px; fill: var(--subtle); }
.chart .chart-grid { stroke: var(--border); stroke-dasharray: 3 5; stroke-width: 1; }
.chart .chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .chart-point { fill: var(--accent); stroke: var(--panel); stroke-width: 3; }
.chart .chart-point:hover, .chart .chart-point:focus { r: 6px; stroke-width: 2; }
.campaign-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 335px; padding: 25px; border: 1px solid #98684955; border-radius: var(--radius); overflow: hidden; color: #fcecdf; background: radial-gradient(ellipse at 100% 15%,#ac623f55,transparent 75%),linear-gradient(135deg,#3e2b23,#272124); box-shadow: var(--shadow); }
.campaign-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; }
.campaign-top>svg { color: #f2bd9f; width: 18px; height: 18px; }
.campaign-badge { padding: 6px 9px; border: 1px solid #df9f7340; border-radius: 6px; background: #ffcb8d08; color: #e7b594; font-size: 8px; letter-spacing: 1.8px; }
.campaign-card h2 { position: relative; z-index: 1; font-size: clamp(28px,2.5vw,36px); font-weight: 500; line-height: 1.12; letter-spacing: -1px; margin-top: 28px; }
.campaign-card p { position: relative; z-index: 1; font-size: 12px; color: #d0b4a3; line-height: 1.75; margin: 14px 0 22px; }
.campaign-bottom { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 17px; border-top: 1px solid #e2b59a25; }
.campaign-bottom strong { font-size: 27px; font-weight: 500; line-height: 1; }
.campaign-bottom span { display: block; margin-top: 6px; color: #cfad98; font-size: 10px; }
.round-button { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 1px solid #ba886055; border-radius: 50%; background: #d39b5d12; color: #f4cfb3; transition: background .18s, transform .18s; }
.round-button:hover { background: #d39b5d35; transform: rotate(-35deg); }
.flame-art { position: absolute; display: grid; place-items: center; right: -35px; top: 76px; width: 200px; height: 200px; transform: rotate(12deg); color: #ffb48513; }
.flame-art>svg { height: 175px; width: 150px; filter: drop-shadow(0 0 28px #ff884420); }
.orbit { position: absolute; width: 185px; height: 185px; border: 1px solid #f1b58817; border-radius: 50%; }
.orbit-two { width: 260px; height: 260px; }
.referral-panel { display: flex; flex-direction: column; }
.referral-panel .panel-heading { gap: 8px; align-items: flex-start; }
.referral-panel h2 { font-size: 16px; gap: 8px; }
.referral-trophy { width: 17px; height: 17px; color: var(--accent); }
.referral-period { padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px; color: var(--subtle); font-size: 9px; white-space: nowrap; }
.referral-leaders { display: grid; gap: 2px; list-style: none; padding: 14px 22px 12px; margin: 0; }
.referral-row { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 45px; padding: 5px 0; }
.referral-rank { width: 18px; flex-shrink: 0; text-align: center; color: var(--subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.referral-rank.rank-1 { color: var(--accent); font-weight: 750; }
.referral-row .player-avatar { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.referral-player { min-width: 0; flex: 1; }
.referral-player strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 12px; font-weight: 600; }
.referral-player>span { display: block; margin-top: 4px; font-size: 10px; color: var(--subtle); }
.referral-score { padding-left: 4px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.referral-row:first-child .referral-score { color: var(--accent); }
.referral-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 22px; border-top: 1px solid var(--border); margin-top: auto; color: var(--muted); font-size: 10px; }
.referral-footer strong { margin-left: 7px; color: var(--text); font-weight: 600; }
.referral-empty { display: flex; flex-direction: column; justify-content: center; flex: 1; min-height: 170px; padding: 20px 0; gap: 7px; color: var(--muted); text-align: center; font-size: 11px; line-height: 1.7; }
.referral-empty .empty-icon { margin-bottom: 2px; }
.referral-empty>strong { color: var(--text); font-size: 13px; font-weight: 600; }
@media(min-width:761px) and (max-width:1200px) { .referral-period { display: none; } .referral-leaders { padding-left: 16px; padding-right: 16px; } }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 36px; padding: 6px 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.text-button:hover { color: var(--accent); }
.table-wrap { position: relative; overflow: auto; margin-top: 22px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-size: 12px; }
th { padding: 13px 20px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); color: var(--subtle); font-size: 9px; font-weight: 600; letter-spacing: .7px; }
td { padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--text); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface); }
.player-cell { display: flex; align-items: center; gap: 10px; }
.player-avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; background: #9180c81a; border: 1px solid #9180c83a; border-radius: 10px; color: #b8a5ed; font-size: 12px; font-weight: 500; }
.player-avatar.color-1 { background: #8ed9b814; border-color: #8ed9b82d; color: var(--green); }
.player-avatar.color-2 { background: #eea16c14; border-color: #eea16c30; color: var(--accent); }
.player-avatar.color-3 { background: #8fa5e014; border-color: #8fa5e030; color: #93aceb; }
.player-name { font-size: 12px; font-weight: 600; color: var(--text); }
.player-id { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; }
.pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); font-size: 10px; line-height: 1.4; white-space: nowrap; }
.green-pill { background: #6cc99b0c; border-color: #6cc99b30; color: var(--green); }
.amber-pill { background: #d8ab5810; border-color: #d8ab582a; color: #d9b679; }
:root[data-theme="light"] .amber-pill { color: #86601b; }
:root[data-theme="light"] .player-avatar:not(.color-1):not(.color-2):not(.color-3) { color: #7555aa; }
:root[data-theme="light"] .player-avatar.color-3 { color: #466ba9; }
.kind-label { color: var(--muted); font-size: 11px; }
.empty-state { padding: 44px 22px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.8; }
.empty-icon { display: grid; place-items: center; height: 46px; width: 46px; margin: 0 auto 12px; border-radius: 14px; background: var(--surface); color: var(--subtle); }
.empty-state strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.empty-state .text-button { color: var(--accent); margin-top: 9px; }
.events { padding: 23px 24px 5px; }
.event { position: relative; display: flex; gap: 12px; padding-bottom: 24px; }
.event:not(:last-child)::before { content: ''; position: absolute; left: 16px; top: 37px; bottom: 5px; width: 1px; background: var(--border); }
.event-icon { display: grid; place-items: center; flex-shrink: 0; width: 33px; height: 33px; border-radius: 10px; border: 1px solid #8ed9b823; background: #8ed9b809; color: var(--green); }
.event-icon svg { width: 15px; height: 15px; }
.event-content { min-width: 0; padding-top: 1px; }
.event-content p { font-size: 12px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.event-content small { display: block; margin-top: 6px; font-size: 10px; color: var(--subtle); }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 0 25px; color: var(--subtle); font-size: 10px; line-height: 1.8; }
footer>span:last-child { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.footer-divider { opacity: .5; margin: 0 7px; }
.search { display: flex; align-items: center; gap: 9px; min-width: 230px; padding: 11px 13px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--subtle); }
.search:focus-within { border-color: var(--accent); }
.search svg { width: 16px; height: 16px; }
.search input { width: 100%; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font-size: 12px; }
.search input::placeholder { color: var(--subtle); opacity: 1; }
.order-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 21px 24px 0; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { padding: 8px 12px; min-height: 36px; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; color: var(--muted); }
.filter-chip:hover { background: var(--surface); }
.filter-chip.active { color: var(--accent); border-color: #ff89644a; background: var(--accent-soft); }
.result-count { color: var(--subtle); font-size: 11px; }
#view-orders .expired-orders-toggle { margin-top: 18px; margin-bottom: 0; }
.section-intro { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); margin-bottom: 22px; }
.section-intro>svg { color: var(--green); width: 26px; height: 26px; }
.section-intro h2 { font-size: 16px; }
.section-intro p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.audience-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; }
.audience-toolbar .result-count { margin-right: auto; }
.page-size-label { display: inline-flex; align-items: center; gap: 9px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.page-size-label select { min-height: 42px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; color: var(--text); cursor: pointer; }
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 22px 0; margin-top: 12px; }
.page-jump { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 12px; }
.page-jump strong { color: var(--text); font-weight: 600; }
.page-jump input { width: 66px; min-height: 42px; padding: 8px; background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 9px; text-align: center; }
@media(max-width:600px) { .audience-toolbar .result-count { width: 100%; } .audience-toolbar .search { flex-basis: 100%; } .page-size-label { margin-left: auto; } .pagination { display: grid; grid-template-columns: 1fr 1fr; } .page-jump { grid-column: 1/-1; grid-row: 2; justify-content: center; } .page-jump input,.page-size-label select { font-size: 16px; } }
.profiles-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.profiles-grid>.empty-state { grid-column: 1/-1; background: var(--panel); border: 1px dashed var(--border); border-radius: var(--radius); }
.profile-card { padding: 24px; }
.profile-card>.player-avatar { height: 47px; width: 47px; font-size: 17px; border-radius: 14px; margin-bottom: 20px; }
.profile-card h2 { overflow-wrap: anywhere; }
.profile-card>p { font-size: 12px; line-height: 1.6; margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.profile-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--border); color: var(--subtle); font-size: 10px; }
.growth-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; }
.flow-card, .rules-card { padding: 32px; }
.flow-card>h2, .rules-card>h2 { margin: 19px 0 30px; font-size: 29px; font-weight: 500; line-height: 1.2; letter-spacing: -.7px; }
.flow { list-style: none; padding: 0; margin: 0; }
.flow li { display: flex; gap: 17px; padding-bottom: 28px; }
.flow li>span { display: grid; place-items: center; height: 36px; width: 36px; flex-shrink: 0; border-radius: 10px; border: 1px solid #ff896430; background: var(--accent-soft); color: var(--accent); font-size: 11px; }
.flow li strong { display: block; padding-top: 2px; font-size: 13px; font-weight: 600; line-height: 1.5; }
.flow li p { font-size: 12px; color: var(--muted); margin-top: 7px; line-height: 1.8; }
.flow li:last-child { padding-bottom: 0; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { position: relative; font-size: 13px; color: var(--muted); line-height: 1.8; padding: 12px 0 12px 25px; border-bottom: 1px solid var(--border); }
.check-list li::before { content: '✓'; position: absolute; left: 0; color: var(--green); }
.muted-note { margin-top: 22px; color: var(--subtle); font-size: 12px; line-height: 1.8; }
.settings-panel { max-width: 1120px; }
.settings-panel .panel-heading { padding-bottom: 22px; }
.integration-row { display: flex; align-items: center; gap: 17px; padding: 23px 25px; border-top: 1px solid var(--border); }
.integration-icon { display: grid; place-items: center; flex-shrink: 0; height: 43px; width: 43px; border: 1px solid #d6b08c30; background: #d6b08c10; color: #c4a27b; border-radius: 12px; }
.integration-icon.telegram { color: #6eafd2; border-color: #6eafd22a; background: #6eafd210; }
.integration-icon.stars { color: #c5a655; border-color: #c5a6552a; background: #c5a65510; }
.integration-icon.database { color: var(--green); border-color: #8ed9b82a; background: #8ed9b810; }
.integration-row strong { font-size: 13px; font-weight: 600; }
.integration-row p { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 5px; }
.integration-row>.pill { margin-left: auto; }
.settings-note { display: flex; align-items: flex-start; gap: 13px; padding: 21px 25px; background: var(--surface); color: var(--muted); border-top: 1px solid var(--border); }
.settings-note p { font-size: 12px; line-height: 1.8; }
.settings-note svg { margin-top: 2px; color: var(--subtle); }
.backdrop { position: fixed; inset: 0; z-index: 50; background: #080a0dbb; backdrop-filter: blur(7px); }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 480px; max-width: 100vw; z-index: 60; padding: 28px; background: var(--sidebar); border-left: 1px solid var(--border); overflow: auto; box-shadow: -20px 0 100px #0004; overscroll-behavior: contain; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-heading h2 { font-size: 27px; font-weight: 500; letter-spacing: -.7px; margin-top: 12px; }
.drawer-description { font-size: 12px; color: var(--muted); line-height: 1.8; margin-top: 14px; max-width: 350px; }
.phone { border: 1px solid #4a4b50; box-shadow: 0 0 0 6px #202227,0 25px 50px #0003; border-radius: 33px; overflow: hidden; margin: 30px auto 22px; max-width: 338px; background: #131e29; color: #d8e8f4; }
.phone-top { height: 36px; display: flex; align-items: center; justify-content: space-between; padding: 0 25px; background: #1c2a38; font-size: 10px; color: #b6c7d7; }
.telegram-head { display: flex; align-items: center; gap: 11px; padding: 7px 15px 14px; background: #1c2a38; font-size: 13px; font-weight: 600; }
.telegram-head>span:first-child { font-size: 27px; color: #70afe1; margin-right: 3px; }
.telegram-head .brand-mark { width: 31px; height: 33px; border-radius: 50%; }
.telegram-head .brand-mark svg { width: 23px; height: 25px; }
.telegram-head small { font-size: 10px; color: #a3b9cb; display: block; margin-top: 4px; font-weight: 400; }
.telegram-head>span:last-child { margin-left: auto; font-size: 20px; color: #93a4b4; }
.phone-chat { padding: 15px 13px 20px; min-height: 380px; background: radial-gradient(ellipse at 15% 50%,#29435855,transparent 75%),#111e2a; }
.chat-date { margin: 0 auto 15px; text-align: center; width: max-content; padding: 4px 9px; border-radius: 20px; background: #1c2d3b; color: #a0b6c8; font-size: 9px; }
.chat-bubble { background: #233448; padding: 14px; border-radius: 12px 12px 12px 3px; font-size: 11px; line-height: 1.7; color: #d4e0eb; }
.chat-bubble strong { font-size: 12px; color: #f1f5f8; }
.chat-bubble p { margin-top: 7px; }
.chat-bubble>span { display: block; font-size: 9px; color: #a2b9ce; margin-top: 8px; }
.phone-label { display: block; color: #a2b9ce; font-size: 9px; letter-spacing: 1px; margin: 16px 0 9px; }
.phone-label input { display: block; width: 100%; background: #182737; border: 1px solid #34516a; border-radius: 8px; color: #d8e8f4; padding: 12px; font-size: 13px; margin-top: 7px; }
.bot-buttons { display: flex; flex-direction: column; gap: 6px; }
.bot-buttons button, .complete-demo { background: #26435a; color: #c6e0f5; border: 1px solid #31536c; border-radius: 7px; font-size: 11px; min-height: 42px; padding: 11px 8px; }
.bot-buttons button:hover, .complete-demo:hover { background: #315873; }
.bot-buttons small { display: block; font-size: 9px; color: #a3c5df; margin-top: 5px; }
.bot-buttons>div { display: flex; gap: 6px; }
.bot-buttons>div>button { flex: 1; }
.response-bubble { margin-top: 12px; border: 1px solid #4a6370; white-space: pre-wrap; font-size: 11px; }
.complete-demo { display: block; width: 100%; margin-top: 7px; background: #25493d; border-color: #3a6956; color: #b6deca; }
.phone-bottom { background: #1c2a38; padding: 14px 19px; color: #9bb0c4; font-size: 12px; display: flex; align-items: center; justify-content: space-between; }
.phone-bottom svg { color: #6d9fc5; width: 17px; height: 17px; }
.simulator-note { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 10px; color: var(--muted); line-height: 1.6; }
.simulator-note svg { width: 14px; height: 14px; }
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 0,#ff896419,transparent 60%),var(--bg); z-index: 100; overflow-y: auto; }
.login-card { width: 420px; max-width: 100%; padding: 38px; border: 1px solid var(--border); border-radius: 24px; background: var(--panel); box-shadow: 0 30px 100px #0002; }
.login-card>.brand-mark { margin-bottom: 30px; }
.login-card h1 { font-size: 30px; letter-spacing: -1px; margin-top: 15px; }
.login-card>p { font-size: 13px; line-height: 1.8; color: var(--muted); margin-top: 12px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 26px 0 18px; }
.login-card input { width: 100%; margin-top: 10px; padding: 13px; border: 1px solid var(--border); border-radius: 9px; color: var(--text); background: var(--bg); }
.login-card .button { width: 100%; }
#login-error { color: var(--accent); }
.toast { position: fixed; left: calc(50% + 125px); bottom: 24px; transform: translateX(-50%); z-index: 120; max-width: min(560px,85vw); width: max-content; padding: 15px 20px; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 10px 40px #0003; background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.6; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; font-size: 10px; color: var(--subtle); }
.connection-state.is-error { color: var(--accent); }
.connection-state.is-error .mini-dot { background: var(--accent); }
.refreshing svg { animation: rotate 1s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.view:not(.hidden) { animation: reveal .24s ease-out; }
@keyframes reveal { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media(min-width:1600px) { main { padding-top: 42px; } .stats-grid { gap: 22px; } .stat-card { padding: 25px; } .chart { height: 226px; } .campaign-card { min-height: 360px; } }
@media(max-width:1200px) { .sidebar { width: 220px; padding-left: 14px; padding-right: 14px; } .main-shell { margin-left: 220px; } .brand { font-size: 20px; gap: 7px; padding-left: 0; } .workspace { font-size: 11px; padding: 11px 8px; } .admin { margin-left: -14px; margin-right: -14px; padding-left: 18px; padding-right: 18px; } .nav-item.active::before { left: -14px; } main { padding: 30px 25px 0; } .topbar { padding: 0 25px; } .analytics-grid,.lower-grid { grid-template-columns: minmax(0,1.7fr) minmax(260px,1fr); gap: 18px; } .stat-card { padding: 18px 15px; } .stat-label { font-size: 11px; } th,td { padding-left: 15px; padding-right: 15px; } .panel-heading { padding: 22px 20px 0; } .events { padding-left: 20px; padding-right: 20px; } .toast { left: calc(50% + 110px); } }
@media(max-width:1050px) and (min-width:761px) { .sidebar { width: 84px; padding: 25px 12px 0; overflow: visible; } .brand { justify-content: center; } .brand>span:last-child,.workspace,.nav-label,.nav-shortcut,.nav-count,.sandbox-card,.admin>div,.admin>.icon-button { display: none; } .sidebar nav { margin-top: 32px; } .nav-item { display: flex; justify-content: center; font-size: 0; height: 48px; padding: 0; margin: 10px 0; } .nav-item svg { width: 21px; height: 21px; } .nav-item:hover::after,.nav-item:focus-visible::after { content: attr(aria-label); position: absolute; left: 66px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); font-size: 12px; white-space: nowrap; box-shadow: var(--shadow); } .nav-item.active::before { left: -12px; } .admin { padding: 20px 0; justify-content: center; margin: 0 -12px; } .main-shell { margin-left: 84px; } .sidebar-bottom { padding-top: 20px; } .toast { left: calc(50% + 42px); } }
@media(max-width:980px) { .lower-grid { grid-template-columns: minmax(0,1fr); } .activity-panel .events { display: grid; grid-template-columns: 1fr 1fr; column-gap: 22px; } .event::before { display: none; } .growth-grid { grid-template-columns: minmax(0,1fr); } .profiles-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .page-heading { align-items: flex-start; } .heading-actions { max-width: 195px; } .stat-label { align-items: flex-start; } .stat-label svg { width: 15px; height: 15px; } }
@media(max-width:760px) {
  .sidebar { inset: auto 0 0; width: auto; height: auto; padding: 7px 7px max(7px,env(safe-area-inset-bottom)); background: var(--sidebar); border: 0; border-top: 1px solid var(--border); overflow: visible; }
  .sidebar>.brand,.workspace,.nav-label,.sidebar-bottom,.nav-shortcut,.nav-count { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 3px; margin: 0; }
  .nav-item { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 55px; font-size: 9px; padding: 5px 0; margin: 0; border-radius: 11px; text-align: center; white-space: nowrap; }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.active::before { display: none; }
  .main-shell { margin-left: 0; }
  .topbar { min-height: 65px; padding: 0 20px; }
  .topbar-right { gap: 5px; }
  .topbar-right>.mini-avatar { display: none; }
  .breadcrumb { font-size: 11px; gap: 9px; }
  .local-label { font-size: 8px; gap: 6px; margin-right: 6px; }
  .icon-button { width: 40px; height: 40px; }
  main { padding: 28px 20px calc(84px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 23px; gap: 16px; }
  h1 { font-size: 31px; letter-spacing: -1.15px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .page-heading p { font-size: 12px; }
  .heading-actions { max-width: none; }
  .date-label { display: none; }
  .heading-actions .button { padding: 9px 12px; }
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
  .stat-card { min-height: 148px; padding: 19px 17px; }
  .stat-label { align-items: center; font-size: 12px; }
  .stat-number { font-size: 34px; }
  .stat-foot { font-size: 10px; }
  .analytics-grid { grid-template-columns: minmax(0,1fr); gap: 20px; }
  .campaign-card { min-height: 290px; padding: 24px; }
  .campaign-card h2 { font-size: 32px; margin-top: 22px; }
  .campaign-card p { max-width: 70%; }
  .campaign-bottom { margin-top: 3px; }
  .flame-art { right: 15px; top: 45px; color: #ffb48520; }
  .panel-heading { padding: 21px 20px 0; }
  .panel-heading h2 { font-size: 16px; }
  .panel-heading p { font-size: 11px; }
  .chart { height: 195px; margin-left: 13px; margin-right: 20px; }
  .chart-legend { margin-left: 22px; margin-right: 22px; }
  .table-wrap { margin-top: 20px; }
  th,td { padding-left: 17px; padding-right: 17px; }
  .order-toolbar { padding-left: 20px; padding-right: 20px; }
  .filter-chip { min-height: 40px; }
  #view-orders .panel-heading { flex-wrap: wrap; }
  #view-orders .search { width: 100%; }
  .search { min-height: 44px; }
  .search input { font-size: 16px; }
  .audience-toolbar { flex-wrap: wrap; }
  .audience-toolbar .search { flex: 1; }
  .section-intro { align-items: flex-start; padding: 20px; }
  .section-intro h2 { font-size: 15px; }
  .flow-card,.rules-card { padding: 26px; }
  .integration-row { flex-wrap: wrap; padding: 21px; gap: 12px; }
  .integration-row>div { flex: 1; min-width: 150px; }
  .integration-row>.pill { margin-left: 55px; }
  .settings-panel .panel-heading { flex-wrap: wrap; }
  footer { flex-wrap: wrap; gap: 8px; padding-bottom: 15px; }
  .toast { left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media(max-width:600px) {
  main { padding-left: 16px; padding-right: 16px; }
  .topbar { padding: 0 14px; }
  .local-label { display: none; }
  .page-heading { display: block; }
  .heading-actions { justify-content: flex-start; margin-top: 16px; }
  .heading-actions:has(.button.hidden) { display: none; }
  h1 { font-size: 30px; }
  .demo-banner { font-size: 11px; padding: 12px; gap: 10px; }
  .banner-tag { display: none; }
  .banner-icon { flex-shrink: 0; }
  .overview-tools { align-items: flex-start; }
  .section-label { padding-top: 2px; }
  .quick-link { min-height: 36px; font-size: 10px; }
  .stat-card { padding: 17px 14px; min-height: 150px; }
  .stat-label { font-size: 11px; gap: 5px; }
  .stat-foot { align-items: flex-start; font-size: 10px; }
  .stat-foot .mini-dot { margin-top: 5px; }
  .stat-number { font-size: 32px; }
  .panel-heading { padding: 20px 17px 0; gap: 10px; }
  .panel-heading h2 { font-size: 15px; }
  .panel-heading p { font-size: 10px; }
  .period-chip { padding: 7px 8px; font-size: 10px; }
  .period-chip svg { display: none; }
  .chart { height: 180px; margin-right: 17px; margin-left: 10px; }
  .chart-legend { font-size: 10px; margin-left: 18px; margin-right: 18px; }
  .activity-panel .events { display: block; }
  .text-button { font-size: 10px; gap: 6px; }
  .profiles-grid { grid-template-columns: minmax(0,1fr); }
  .order-toolbar { padding-left: 17px; padding-right: 17px; }
  .filter-chip { padding: 7px 9px; font-size: 10px; }
  .filter-chips { gap: 5px; }
  .section-intro { padding: 18px; gap: 12px; }
  .section-intro>svg { width: 21px; height: 21px; }
  .section-intro p { font-size: 11px; }
  .flow-card,.rules-card { padding: 23px; }
  .flow-card>h2,.rules-card>h2 { font-size: 26px; }
  .drawer { padding: 24px 17px; }
  .drawer-heading h2 { font-size: 24px; }
  .login-card { padding: 28px; }
  .login-card input { font-size: 16px; }
  .phone-label input { font-size: 16px; }
  .settings-note { padding: 19px; }
  .settings-note p { font-size: 11px; }
}
/* Orders become readable cards on phones; queue diagnostics remain scrollable tables. */
@media(max-width:600px) {
  .orders-table { display: block; white-space: normal; }
  .orders-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .orders-table tbody { display: grid; }
  .orders-table tr { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px 18px; padding: 20px; border-top: 1px solid var(--border); }
  .orders-table td { display: block; min-width: 0; border: 0; padding: 0; overflow-wrap: anywhere; }
  .orders-table td::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--subtle); font-size: 10px; }
  .orders-table .order-player { grid-column: 1/-1; }
  .orders-table .order-player::before,.orders-table .order-action::before { display: none; }
  .orders-table .player-avatar { width: 38px; height: 38px; }
  .orders-table .pill { white-space: normal; }
  .orders-table .order-action { grid-column: 1/-1; }
  .orders-table .order-action:empty { display: none; }
  .orders-table .order-action .text-button { justify-content: center; width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 12px; }
  .orders-table-compact td[data-label="Тип"] { display: none; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
