:root {
  --bg: #0a0a0a;
  --bg-2: #0f0f0f;
  --card: #141414;
  --card-2: #1b1b1b;
  --hover: #222222;
  --border: #242424;
  --border-2: #313131;
  --text: #f2f2f2;
  --text-2: #c9c9c9;
  --muted: #8e8e8e;
  --faint: #5c5c5c;
  --accent: #f2f2f2;
  --accent-2: #d6d6d6;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --good: #3ba55d;
  --good-text: #6fd08f;
  --warning: #e0a83a;
  --serious: #d9825b;
  --critical: #d65151;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.025) inset, 0 10px 30px -14px rgba(0, 0, 0, 0.8);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0a0a0a; }
:root { color-scheme: dark; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

.boot { display: grid; place-items: center; height: 100vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: #f2f2f2; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--border); background: #0c0c0c;
  padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 700; letter-spacing: -.01em; font-size: 15px; }
.brand-logo { width: 30px; height: 30px; flex: none; background: url(/img/logo-mark.png) center / contain no-repeat; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; letter-spacing: .02em; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; transition: background .15s, color .15s; min-width: 0;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item .ico { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item .game-ico { width: 24px; height: 24px; border-radius: 6px; flex: none; background: var(--card-2); object-fit: cover; }
.nav-item .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.nav-item .live-dot { flex: none; }
.sidebar-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }

.main { min-width: 0; padding: 26px 32px 60px; max-width: 1560px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; font-weight: 700; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.page-head .spacer { flex: 1; }
.game-head-ico { width: 52px; height: 52px; border-radius: 12px; background: var(--card-2); object-fit: cover; border: 1px solid var(--border); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tab {
  padding: 10px 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; font-weight: 500; transition: color .15s, border-color .15s; display: flex; gap: 7px; align-items: center;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--text); border-bottom-color: #f2f2f2; }
.tab svg { width: 15px; height: 15px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--card-2); cursor: pointer; font-weight: 500;
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap;
}
.btn:hover { background: var(--hover); border-color: #444; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: #f2f2f2; border-color: transparent; color: #0a0a0a; }
.btn.primary:hover { background: #ffffff; }
.btn.danger { color: #ff8a8a; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--hover); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset; }

.input, select.input, textarea.input {
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 8px 12px;
  outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.input:focus { border-color: #6a6a6a; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
input[type="date"].input { color-scheme: dark; padding: 6px 10px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Cards & grid ---------- */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 28px; }

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 40%), var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
  display: flex; flex-direction: column;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 4px; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.card-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.card-head .spacer { flex: 1; }
.card-body { padding: 10px 18px 16px; flex: 1; min-width: 0; }
.card-body.flush { padding: 6px 0 0; }
.chart { width: 100%; height: 280px; }
.chart.sm { height: 200px; }
.chart.lg { height: 340px; }
.chart.xl { height: 420px; }

.section-title { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- KPI tiles ---------- */
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; line-height: 1.15; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.kpi .foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); min-height: 18px; }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 46%; height: 46px; opacity: .9; pointer-events: none; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--good-text); background: rgba(12, 163, 12, .12); }
.delta.down { color: #ff8a8a; background: rgba(224, 85, 85, .12); }
.delta.flat { color: var(--muted); background: rgba(255, 255, 255, .04); }
.info-tip { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--faint); color: var(--faint); font-size: 9px; display: inline-grid; place-items: center; cursor: help; font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--card); }
.t td { padding: 9px 14px; border-bottom: 1px solid rgba(255, 255, 255, .045); white-space: nowrap; font-variant-numeric: tabular-nums; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr:hover { background: rgba(255, 255, 255, .025); }
.t tbody tr.click { cursor: pointer; }
.t .num { text-align: right; }
.t th.num { text-align: right; }
.t th.sortable { cursor: pointer; }
.t th.sortable:hover { color: var(--text); }
.scroll-y { max-height: 440px; overflow-y: auto; }

.user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--card-2); flex: none; object-fit: cover; border: 1px solid var(--border); }
.user .n { font-weight: 500; }
.user .s { color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: rgba(255, 255, 255, .05); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.accent { background: rgba(255, 255, 255, .08); border-color: #3a3a3a; color: #e6e6e6; }
.badge.good { background: rgba(12, 163, 12, .12); border-color: rgba(12, 163, 12, .3); color: var(--good-text); }
.badge.warn { background: rgba(250, 178, 25, .1); border-color: rgba(250, 178, 25, .3); color: #ffd27a; }
.badge.bad { background: rgba(224, 85, 85, .1); border-color: rgba(224, 85, 85, .3); color: #ff9c9c; }
.cc { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-2); margin-right: 6px; }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, .6); animation: pulse 2s infinite; display: inline-block; }
.live-dot.off { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(12, 163, 12, .55); } 70% { box-shadow: 0 0 0 8px rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--card-2); font-size: 13.5px; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert.danger { border-color: rgba(224, 85, 85, .35); background: rgba(224, 85, 85, .07); }
.alert.danger svg { color: var(--critical); }
.alert.warning { border-color: rgba(250, 178, 25, .3); background: rgba(250, 178, 25, .06); }
.alert.warning svg { color: var(--warning); }
.alert.info { border-color: var(--border-2); background: var(--card-2); }
.alert.info svg { color: var(--text-2); }
.alert.good { border-color: rgba(12, 163, 12, .3); background: rgba(12, 163, 12, .06); }
.alert.good svg { color: var(--good); }
.alert b { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Funnel ---------- */
.funnel { display: flex; flex-direction: column; gap: 6px; }
.f-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) 92px 110px; gap: 14px; align-items: center; padding: 8px 4px; border-radius: 10px; }
.f-step:hover { background: rgba(255, 255, 255, .02); }
.f-num { width: 28px; height: 28px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--border); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--text-2); }
.f-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.f-name { display: flex; gap: 10px; align-items: baseline; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-name small { color: var(--muted); font-weight: 400; font-size: 12px; }
.f-bar { height: 26px; background: rgba(255, 255, 255, .03); border-radius: 7px; position: relative; overflow: hidden; }
.f-bar > div { height: 100%; border-radius: 4px 7px 7px 4px; background: linear-gradient(90deg, #cfcfcf, #f0f0f0); color: #0a0a0a; transition: width .6s cubic-bezier(.2, .8, .2, 1); display: flex; align-items: center; padding-left: 10px; font-size: 12px; font-weight: 600; min-width: 2px; }
.f-users { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.f-users small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.f-drop { text-align: right; }
.f-gap { margin-left: 48px; padding: 2px 0 2px 14px; border-left: 2px dashed var(--border-2); font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.f-gap.bad { border-left-color: rgba(224, 85, 85, .55); }
.f-gap.warn { border-left-color: rgba(250, 178, 25, .5); }

/* ---------- Home cards ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.game-card { padding: 18px; cursor: pointer; transition: border-color .15s, transform .15s; gap: 14px; }
.game-card:hover { border-color: var(--border-2); transform: translateY(-2px); }
.game-card .top { display: flex; gap: 14px; align-items: center; }
.game-card img.icon { width: 56px; height: 56px; border-radius: 12px; background: var(--card-2); object-fit: cover; border: 1px solid var(--border); flex: none; }
.game-card .title { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-card .owner { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.game-card .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.game-card .stat .l { font-size: 11px; color: var(--muted); }
.game-card .stat .v { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.game-card .spark { height: 44px; }
.add-card { border: 1px dashed var(--border-2); background: transparent; display: grid; place-items: center; min-height: 220px; color: var(--muted); cursor: pointer; border-radius: var(--radius); transition: border-color .15s, color .15s, background .15s; }
.add-card:hover { border-color: #555; color: var(--text); background: var(--accent-soft); }
.add-card .plus { font-size: 30px; line-height: 1; margin-bottom: 6px; text-align: center; }

/* ---------- Modal / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .72); backdrop-filter: blur(4px); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(680px, 100%); max-height: 88vh; overflow: auto; background: var(--card); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); gap: 10px; }
.modal-head h2 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { width: min(720px, 100vw); height: 100vh; overflow: auto; background: var(--bg-2); border-left: 1px solid var(--border-2); animation: slide .2s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }

.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.pick { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); cursor: pointer; }
.pick:hover { border-color: var(--border-2); }
.pick img { width: 40px; height: 40px; border-radius: 9px; background: var(--card-2); }
.pick input { accent-color: #f2f2f2; width: 16px; height: 16px; }
.pick .meta { flex: 1; min-width: 0; }
.pick .meta div:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .meta div:last-child { font-size: 12px; color: var(--muted); }

pre.code { background: #080808; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow: auto; font: 12.5px/1.6 var(--mono); color: #d6dbe6; margin: 0; }
code.inline { font-family: var(--mono); font-size: 12.5px; background: var(--card-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; }
.steps-list { counter-reset: s; display: flex; flex-direction: column; gap: 18px; }
.steps-list > li { list-style: none; position: relative; padding-left: 42px; }
.steps-list > li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 8px; background: #f2f2f2; color: #0a0a0a; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.steps-list h4 { margin: 0 0 6px; font-size: 14px; }
.steps-list p { margin: 0 0 8px; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 15px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.copy-box { display: flex; gap: 8px; align-items: center; }
.copy-box .input { flex: 1; font-family: var(--mono); font-size: 12.5px; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--card-2); border: 1px solid var(--border-2); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: pop .2s; font-size: 13.5px; }
.toast.err { border-color: rgba(224, 85, 85, .5); }

.login { display: grid; place-items: center; height: 100vh; }
.login .card { width: 360px; padding: 28px; gap: 14px; }

.skeleton { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 110px; border: 1px solid var(--border); }
@keyframes sk { to { background-position: -200% 0; } }

.cohort td.c { text-align: center; font-size: 12px; padding: 7px 6px; color: #fff; font-weight: 500; }
.cohort td.c.na { color: var(--faint); background: transparent !important; }

.menu-btn { display: none; }

@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-3 { grid-template-columns: minmax(0, 1fr); }
  .g-3 > .span-2, .span-3 { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .main { padding: 18px 14px 50px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3 { grid-column: auto; }
  .f-step { grid-template-columns: 28px minmax(0, 1fr) 70px; }
  .f-step .f-drop { display: none; }
}

/* ---------- Paragon ---------- */
.login .logo-full { width: 200px; margin: 0 auto 6px; display: block; }
.purchase-pop { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.purchase-pop .pp { display: flex; gap: 12px; align-items: center; background: rgba(22,22,22,.96); color: var(--text); border: 1px solid var(--border-2); padding: 12px 16px 12px 12px; border-radius: 14px; box-shadow: 0 18px 40px -12px rgba(0,0,0,.9); backdrop-filter: blur(10px); animation: pop .25s; min-width: 280px; }
.purchase-pop .pp b { font-size: 15px; letter-spacing: .01em; }
.purchase-pop .pp .s { font-size: 12px; color: var(--muted); line-height: 1.45; }
.purchase-pop .pp img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.push-offer { position: fixed; z-index: 130; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(460px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 10px 12px 12px; background: rgba(22,22,22,.97); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: 0 22px 50px -14px rgba(0,0,0,.95); backdrop-filter: blur(12px); animation: poIn .45s cubic-bezier(.16,1,.3,1) both; }
.push-offer.out { animation: poOut .25s ease both; }
.push-offer img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.push-offer .po-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.push-offer .po-text b { font-size: 14px; }
.push-offer .po-text span { font-size: 12px; color: var(--muted); }
.push-offer .po-x { background: none; border: 0; color: var(--muted); width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; border-radius: 8px; font-size: 18px; }
.push-offer .po-x svg { width: 16px; height: 16px; }
@keyframes poIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes poOut { to { opacity: 0; transform: translate(-50%, 12px); } }
.switch { position: relative; display: inline-block; vertical-align: middle; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #2c2c2c; border-radius: 22px; transition: background .15s; cursor: pointer; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #888; border-radius: 50%; transition: transform .15s, background .15s; }
.switch input:checked + span { background: #f2f2f2; }
.switch input:checked + span::before { transform: translateX(16px); background: #0a0a0a; }
details.card > div > .card { border: 0; box-shadow: none; background: transparent; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary { padding-bottom: 14px; }

/* ---------- Coortes ---------- */
.cohort-help { padding: 4px 18px 12px; color: var(--text-2); }
.cohort th .th-sub { font-size: 10.5px; color: var(--faint); font-weight: 400; margin-top: 1px; }
.cohort td.c { text-align: center; font-size: 12.5px; padding: 6px 8px; font-weight: 600; border-left: 2px solid var(--card); min-width: 92px; }
.cohort td.c small { display: block; font-size: 10.5px; font-weight: 500; opacity: .75; }
.cohort td.c.na { color: var(--faint); background: transparent !important; font-weight: 400; font-size: 11.5px; }
.cohort tr.avg td { border-bottom: 2px solid var(--border-2); background: var(--card-2); }

/* ---------- Funis ---------- */
.funnel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.funnel-card { padding: 14px 16px; gap: 8px; transition: border-color .15s, transform .15s; }
.funnel-card:hover { border-color: #3a3a3a; transform: translateY(-1px); }
.funnel-card.active { border-color: #f2f2f2; box-shadow: 0 0 0 1px #f2f2f2 inset, var(--shadow); }
.funnel-card .fc-name { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-card .fc-bars { display: flex; align-items: flex-end; gap: 2px; height: 46px; padding: 2px 0; }
.funnel-card .fc-bars > div { flex: 1; min-width: 2px; border-radius: 3px 3px 1px 1px; }
.funnel-card .fc-bad { color: #ff9c9c; }
.funnel.compact { gap: 2px; }
.funnel.compact .f-step { padding: 3px 4px; }
.funnel.compact .f-bar { height: 18px; }
.funnel.compact .f-bar > div { font-size: 11px; }
.funnel.compact .f-num { width: 24px; height: 24px; font-size: 11px; }
.funnel.compact .f-gap { padding: 0 0 0 14px; font-size: 11.5px; }

/* ---------- Loja ---------- */
.input.sm { padding: 6px 9px; font-size: 13px; border-radius: 7px; width: 100%; }
select.input.sm { width: auto; }
.st-edit td { padding: 6px 8px; vertical-align: middle; }
.st-icon { width: 38px; height: 38px; border-radius: 9px; border: 1px dashed var(--border-2); background: var(--bg-2); color: var(--muted); cursor: pointer; display: grid; place-items: center; padding: 0; overflow: hidden; font-size: 18px; }
.st-icon:hover { border-color: #666; color: var(--text); }
.st-icon img { width: 100%; height: 100%; object-fit: cover; }
.st-thumb { width: 34px; height: 34px; border-radius: 8px; background: var(--card-2); display: block; object-fit: cover; border: 1px solid var(--border); }
.st-foot { padding: 12px 18px; border-top: 1px solid var(--border); gap: 10px; }
.st-progress { height: 8px; border-radius: 8px; background: var(--card-2); overflow: hidden; }
.st-progress > div { height: 100%; background: linear-gradient(90deg, #d4a72a, #2fa05a); transition: width .4s; }

/* ---------- App mobile: barra do topo, gaveta, sheets e transições ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior-y: none; }
.topbar, .nav-backdrop { display: none; }
.menu-btn { display: none !important; }
body.modal-open { overflow: hidden; }

.page-enter { animation: pageIn .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }

.overlay.closing { animation: fadeOut .2s ease forwards; }
.overlay.closing .modal { animation: popOut .2s ease forwards; }
.overlay.closing .drawer { animation: slideOut .22s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { transform: translateY(8px) scale(.98); opacity: 0; } }
@keyframes slideOut { to { transform: translateX(48px); opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }

@media (max-width: 860px) {
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 45; align-items: center; gap: 10px;
    height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 10px 0;
    background: rgba(10, 10, 10, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .topbar .brand-logo { width: 22px; height: 22px; }
  .topbar-title { flex: 1; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-btn { width: 42px; height: 42px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 12px; color: var(--text); cursor: pointer; }
  .topbar-btn:active { background: var(--hover); }
  .topbar-btn svg { width: 22px; height: 22px; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0; height: 100%; width: min(300px, 84vw); z-index: 60;
    transform: translate3d(-100%, 0, 0); transition: transform .3s cubic-bezier(.2, .8, .2, 1); will-change: transform;
    padding-top: calc(18px + env(safe-area-inset-top)); padding-bottom: calc(18px + env(safe-area-inset-bottom));
    background: #0c0c0c;
  }
  body.nav-open .sidebar { transform: translate3d(0, 0, 0); box-shadow: 24px 0 60px -12px rgba(0, 0, 0, .85); }
  .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .62); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .nav-item { padding: 11px 12px; }

  .main { padding: 16px 14px calc(40px + env(safe-area-inset-bottom)); }
  .page-head { gap: 12px; margin-bottom: 12px; }
  .game-head-ico { width: 44px; height: 44px; border-radius: 10px; }
  #range-ctl { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #range-ctl::-webkit-scrollbar { display: none; }
  .tabs {
    position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 30; background: var(--bg);
    margin: 0 -14px 16px; padding: 0 14px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 28px), transparent);
  }
  .tab { padding: 13px 11px; }

  .g-4, .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 13px; }
  .kpi .label { font-size: 11.5px; }
  .kpi .value { font-size: 20px; margin-top: 4px; }
  .kpi .value small { font-size: 11px; }
  .kpi .foot { font-size: 11px; flex-wrap: wrap; gap: 4px; }
  .kpi .spark { display: none; }
  .page-head h1 { display: none; }
  .card-head { padding: 14px 14px 2px; }
  .card-body { padding: 10px 14px 14px; }
  .chart { height: 240px; }
  .chart.lg { height: 280px; }
  .chart.xl { height: 340px; }
  .section-title { margin: 24px 0 10px; }
  .input, select.input, textarea.input { font-size: 16px; } /* evita zoom automático ao focar */
  .t th, .t td { padding: 8px 10px; }
  .games-grid { grid-template-columns: 1fr; }

  /* Modais viram "sheet" que sobe de baixo */
  .overlay { place-items: end stretch; padding: 0; }
  .modal { width: 100% !important; max-height: 92vh; border-radius: 18px 18px 0 0; border-bottom: 0; animation: sheetIn .32s cubic-bezier(.2, .8, .2, 1); padding-bottom: env(safe-area-inset-bottom); }
  .modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--border-2); margin: 8px auto 0; }
  .overlay.closing .modal { animation: sheetOut .24s ease forwards; }
  .modal-foot { position: sticky; bottom: 0; background: var(--card); }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .drawer { width: 100vw; }

  .purchase-pop { left: 12px; right: 12px; bottom: auto; top: calc(66px + env(safe-area-inset-top)); align-items: stretch; }
  .purchase-pop .pp { min-width: 0; }
  #toast { bottom: calc(20px + env(safe-area-inset-bottom)); width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
