/* SteamFarm — Telegram Mini App (dashboard style) */
:root {
  --bg: #f3f5f8;
  --bg-glow: #e8eef7;
  --card: #ffffff;
  --card-2: #f6f7f9;
  --card-3: #eceef2;
  --line: #eaecf0;
  --line-strong: #dfe2e8;
  --text: #15181e;
  --text-2: #3f4652;
  --muted: #8a909c;
  --accent: #2e7cf6;
  --accent-2: #1f6ae6;
  --accent-soft: #e8f1fe;
  --green: #3ec34a;
  --green-ink: #2a9a35;
  --green-soft: #e9f8e7;
  --pink: #f25b6a;
  --pink-ink: #e0384a;
  --pink-soft: #fdecee;
  --yellow: #f2c94c;
  --yellow-ink: #b98a05;
  --yellow-soft: #fdf6dc;
  --cyan-ink: #0e98b8;
  --cyan-soft: #e3f6fb;
  --gray-soft: #f0f1f4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px -10px rgba(16, 24, 40, .12);
  --shadow-lg: 0 18px 40px -18px rgba(16, 24, 40, .35);
  --radius: 18px;
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --safe-bottom: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d1016;
  --bg-glow: #121826;
  --card: #161a22;
  --card-2: #1d222c;
  --card-3: #262c38;
  --line: #232833;
  --line-strong: #2d3340;
  --text: #eef1f6;
  --text-2: #c2c8d3;
  --muted: #7f8796;
  --accent: #4b8ff8;
  --accent-2: #3a7ff0;
  --accent-soft: rgba(75, 143, 248, .15);
  --green-ink: #5fd769;
  --green-soft: rgba(62, 195, 74, .15);
  --pink-ink: #ff7b88;
  --pink-soft: rgba(242, 91, 106, .15);
  --yellow-ink: #f4cf5d;
  --yellow-soft: rgba(242, 201, 76, .14);
  --cyan-ink: #4fd3ee;
  --cyan-soft: rgba(79, 211, 238, .13);
  --gray-soft: #1f242e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 40px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
  background:
    radial-gradient(120% 340px at 50% -80px, var(--bg-glow), transparent 70%),
    var(--bg);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }

.view {
  max-width: 600px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-top)) 14px calc(104px + var(--safe-bottom));
  animation: viewIn .28s ease both;
}
.view.no-tabbar { padding-bottom: calc(28px + var(--safe-bottom)); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.num { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace; }
.muted { color: var(--muted); }

/* ---------- App header ---------- */
.appbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0;
  background: radial-gradient(circle at 30% 25%, #4a5568, #111827 70%); border: 2px solid #f2c94c;
}
.brand-text b { display: block; font-size: 13.5px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.brand-text span { display: block; font-size: 10px; font-weight: 700; color: var(--green-ink); letter-spacing: .06em; }
.theme-toggle { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--card-2); }
.theme-toggle button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s; }
.theme-toggle button.on { background: var(--accent); color: #fff; box-shadow: 0 4px 10px -4px var(--accent); }
.round-btn {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2);
  border: 1px solid var(--line-strong); background: var(--card); position: relative; transition: transform .15s;
}
.round-btn:active { transform: scale(.93); }
.round-btn.spin svg { animation: spin .8s linear infinite; }
.round-btn .badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card); }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; overflow: hidden; flex-shrink: 0; position: relative;
  display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #5b8def, #2e7cf6);
}
.avatar > * { grid-area: 1 / 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.avatar.sq { border-radius: 12px; }
.avatar.lg { width: 72px; height: 72px; border-radius: 22px; font-size: 26px; border: 3px solid rgba(255,255,255,.85); }

.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin: 18px 2px 14px; }
.welcome .date { font-size: 12px; font-weight: 600; color: var(--text-2); }
.welcome h1 { margin: 2px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.asf-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; color: var(--text-2); box-shadow: var(--shadow);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; display: inline-block; }
.dot.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); }
  70% { box-shadow: 0 0 0 6px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 2px 14px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

/* ---------- Hero (dark image card) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; min-height: 196px; padding: 16px; color: #fff;
  background: #10141c; isolation: isolate; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero .hero-img { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center right; transform: scale(1.02); }
.hero .hero-img.fallback { background: radial-gradient(80% 120% at 85% 20%, #2f6b3a 0%, #17301d 40%, #0c1410 75%); }
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8, 11, 16, .92) 0%, rgba(8, 11, 16, .65) 48%, rgba(8, 11, 16, .1) 100%);
}
.hero-title { font-size: 13.5px; font-weight: 700; }
.hero-value { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 8px 0 8px; letter-spacing: -.01em; }
.hero-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.hpill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.hpill.green { background: var(--green); color: #fff; }
.hpill.glass { background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(6px); }
.hero-foot { margin-top: 18px; }
.hero-foot span { font-size: 12.5px; opacity: .85; font-weight: 600; }
.hero-foot b { display: block; font-size: 26px; font-weight: 800; line-height: 1.15; }
.hero-foot button { color: #fff; font-size: 12.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-top: 2px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card { min-width: 0; padding: 12px; display: flex; flex-direction: column; min-height: 124px; }
.stat-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.ibox { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.ibox.blue { background: var(--accent-soft); color: var(--accent); }
.ibox.green { background: var(--green-soft); color: var(--green-ink); }
.ibox.pink { background: var(--pink-soft); color: var(--pink-ink); }
.ibox.yellow { background: var(--yellow-soft); color: var(--yellow-ink); }
.ibox.gray { background: var(--card-2); color: var(--text-2); }
.stat-val { font-size: 25px; font-weight: 800; margin-top: auto; padding-top: 12px; display: flex; align-items: center; gap: 8px; line-height: 1.1; }
.stat-bot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 4px; }
.stat-bot span { font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.trend.up { color: var(--green-ink); }
.trend.down { color: var(--pink-ink); }
.trend.flat { color: var(--muted); }
.ava-stack { display: flex; }
.ava-stack .avatar { width: 24px; height: 24px; font-size: 10px; border: 2px solid var(--card); margin-left: -7px; }
.ava-stack .avatar:first-child { margin-left: 0; }

/* ---------- Panels ---------- */
.panel { margin-top: 12px; padding: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.005em; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; font-weight: 600; color: var(--text-2); }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }
.select-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--card); font-size: 11.5px; font-weight: 700; color: var(--text-2);
}
.panel-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: center; }
.big-total span { font-size: 12px; font-weight: 600; color: var(--text-2); }
.big-total b { display: block; font-size: 24px; font-weight: 800; margin-top: 2px; }

/* Heatmap */
.heat { display: grid; grid-template-columns: 44px repeat(7, 1fr); gap: 4px; align-items: center; }
.heat .hl { font-size: 9.5px; font-weight: 700; color: var(--muted); text-align: center; padding-bottom: 2px; }
.heat .hr { font-size: 9.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.heat .cell { height: 26px; border-radius: 6px; background: var(--card-3); position: relative; display: grid; place-items: center; }
.heat .cell.l1 { background: var(--accent-soft); }
.heat .cell.l2 { background: color-mix(in srgb, var(--accent) 30%, var(--card)); }
.heat .cell.l3 { background: var(--pink-soft); }
.heat .cell.l3::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--pink); }

/* Charts */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { font-size: 9.5px; fill: var(--muted); font-weight: 600; font-family: var(--font); }
.chart .grid { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.tip {
  position: absolute; pointer-events: none; transform: translate(-50%, -100%); z-index: 2;
  background: #1c2028; color: #fff; border-radius: 8px; padding: 6px 9px; font-size: 11px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(0,0,0,.5); transition: left .2s, top .2s;
}
.tip b { display: block; font-size: 11.5px; padding-bottom: 4px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.12); }
.tip i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.bar { transition: opacity .2s; cursor: pointer; }
.chart.has-sel .bar:not(.sel) { opacity: .45; }

/* Status summary (payment-summary style) */
.sum-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sum-thumbs { display: flex; gap: 8px; }
.sum-thumbs div { width: 82px; height: 62px; border-radius: 12px; overflow: hidden; background: var(--card-3); }
.sum-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sum-row { display: grid; grid-template-columns: 1fr 1.05fr; gap: 10px; align-items: center; padding: 10px 0; }
.sum-row + .sum-row { border-top: 1px solid var(--line); }
.sum-label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; min-width: 0; }
.sum-label i { width: 13px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.sum-label span { color: var(--muted); font-weight: 500; font-size: 11.5px; white-space: nowrap; }
.track { height: 22px; border-radius: 999px; background: repeating-linear-gradient(-45deg, var(--card-3) 0 4px, var(--card-2) 4px 8px); overflow: hidden; }
.fill { height: 100%; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 800; min-width: 38px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.fill.blue { background: #8fb4f7; color: #0f2a5c; }
.fill.green { background: #8fe07c; color: #11420b; }
.fill.yellow { background: #f7dc84; color: #4d3800; }
.fill.pink { background: #f7a9b1; color: #5c0d17; }
.fill.gray { background: #cfd3da; color: #2b2f36; }
:root[data-theme="dark"] .fill.gray { background: #4a505c; color: #fff; }

/* ---------- Bots table ---------- */
.tbl-tools { display: flex; gap: 8px; margin-bottom: 12px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--muted); min-width: 0; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13px; color: var(--text); }
.search:focus-within { border-color: var(--accent); }
.tbl { margin: 0 -14px; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: minmax(0, 1fr) 100px 36px 32px; gap: 8px; align-items: center; padding: 0 14px; }
.tbl-head { height: 34px; background: var(--card-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 800; letter-spacing: .05em; color: var(--muted); text-transform: uppercase; }
.tbl-head > :nth-child(2), .tbl-row > :nth-child(2) { text-align: right; }
.tbl-head .r, .tbl-row .r { text-align: right; justify-content: flex-end; }
.tbl-row { min-height: 62px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.tbl-row:active { background: var(--card-2); }
.who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.who .avatar { width: 34px; height: 34px; font-size: 13px; }
.who b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acts { display: flex; gap: 6px; justify-content: flex-end; }
.sq-btn { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line-strong); color: var(--text-2); background: var(--card); transition: transform .15s; }
.sq-btn:active { transform: scale(.92); }
.sq-btn.green { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green-ink); }
.sq-btn.pink { background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 40%, transparent); color: var(--pink-ink); }
.sq-btn.round { border-radius: 50%; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 0 0; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tbl-foot b { color: var(--text); }
.pager { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--card-2); color: var(--text-2); font-weight: 700; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.st-farming { color: var(--green-ink); background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.st-online { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.st-paused, .st-needs_input { color: var(--yellow-ink); background: var(--yellow-soft); border-color: color-mix(in srgb, var(--yellow) 35%, transparent); }
.st-connecting { color: var(--cyan-ink); background: var(--cyan-soft); }
.st-stopped, .st-unknown { color: var(--pink-ink); background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 22%, transparent); }

/* ---------- Bot detail ---------- */
.profile { min-height: 0; padding: 18px 16px 16px; align-items: center; text-align: center; }
.profile::after { background: linear-gradient(180deg, rgba(8, 11, 16, .55) 0%, rgba(8, 11, 16, .9) 100%); }
.profile .avatar { margin: 0 auto 10px; }
.profile h2 { margin: 0; font-size: 20px; font-weight: 800; }
.profile .sub { font-size: 12.5px; opacity: .8; margin: 2px 0 10px; }
.profile .sid { margin-top: 10px; display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; opacity: .85; color: #fff; }
.profile .pill { background: rgba(255,255,255,.92); }

.banner { display: flex; gap: 10px; padding: 12px; border-radius: 16px; margin-top: 10px; align-items: flex-start; border: 1px solid; }
.banner.warn { background: var(--yellow-soft); border-color: color-mix(in srgb, var(--yellow) 45%, transparent); }
.banner.err { background: var(--pink-soft); border-color: color-mix(in srgb, var(--pink) 35%, transparent); }
.banner .ibox { background: var(--card); }
.banner.warn .ibox { color: var(--yellow-ink); }
.banner.err .ibox { color: var(--pink-ink); }
.banner b { display: block; font-size: 13.5px; }
.banner p { margin: 2px 0 10px; font-size: 12.5px; color: var(--text-2); }
.banner.err p { margin-bottom: 0; }

.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.mini { padding: 11px; }
.mini .stat-top { font-size: 11px; color: var(--muted); gap: 6px; }
.mini .stat-top .ibox { width: 24px; height: 24px; border-radius: 8px; }
.mini b { display: block; font-size: 18px; font-weight: 800; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.ctrl { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 4px; font-size: 11px; font-weight: 700; color: var(--text-2); transition: transform .15s; }
.ctrl:active { transform: scale(.95); }
.ctrl:disabled { opacity: .45; pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 18px; width: 100%;
  border-radius: 14px; font-weight: 800; font-size: 14.5px; transition: transform .15s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 10px 22px -12px var(--accent); }
.btn.success { background: var(--green); color: #fff; box-shadow: 0 10px 22px -12px var(--green); }
.btn.outline { background: var(--card); color: var(--text); border: 1px solid var(--line-strong); }
.btn.danger-soft { background: var(--pink-soft); color: var(--pink-ink); }
.btn.sm { height: 34px; border-radius: 999px; font-size: 12.5px; padding: 0 14px; width: auto; }
.btn.warn { background: var(--yellow); color: #3b2c00; }
.btn .spinner, .spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }

.games-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -14px; padding: 0 14px 2px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.games-row::-webkit-scrollbar { display: none; }
.game-tile { flex: 0 0 74%; max-width: 280px; scroll-snap-align: start; border-radius: 14px; overflow: hidden; position: relative; aspect-ratio: 460/215; background: var(--card-3); }
.game-tile img { width: 100%; height: 100%; object-fit: cover; }
.game-tile .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(5, 8, 12, .88)); }
.game-tile .meta { position: absolute; left: 10px; right: 10px; bottom: 8px; color: #fff; }
.game-tile .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-tile .meta span { font-size: 11px; opacity: .85; }
.game-tile .live { position: absolute; top: 8px; left: 8px; }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .thumb { width: 62px; height: 29px; border-radius: 7px; overflow: hidden; background: var(--card-3); flex-shrink: 0; }
.list-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-row .rm { flex: 1; min-width: 0; }
.list-row .rm b { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .rm span { font-size: 11px; color: var(--muted); }
.list-row .rv { font-weight: 800; font-size: 13px; }
.tl-time { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-resp { font-size: 11.5px; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 3em; overflow: hidden; }
.more { width: 100%; padding: 10px 0 0; color: var(--accent); font-weight: 700; font-size: 12.5px; border-top: 1px solid var(--line); }

/* ---------- Forms ---------- */
.field { padding: 4px 0 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.input-wrap { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px; transition: border-color .2s, box-shadow .2s; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap svg { color: var(--muted); }
.input-wrap input, .input-wrap textarea { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; font-size: 14.5px; }
.input-wrap textarea { height: auto; min-height: 116px; padding: 12px 0; resize: none; line-height: 1.5; }
.input-wrap input::placeholder, .input-wrap textarea::placeholder { color: var(--muted); opacity: .8; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field.error .input-wrap { border-color: var(--pink); }
.field.error .hint { color: var(--pink-ink); }
.eye { color: var(--muted); padding: 6px; margin-right: -6px; }
.disclosure { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; }
.disclosure .dt { flex: 1; }
.disclosure .dt b { display: block; font-size: 13.5px; }
.disclosure .dt span { font-size: 11.5px; color: var(--muted); }
.disclosure .chev { color: var(--muted); transition: transform .25s; }
.disclosure[aria-expanded="true"] .chev { transform: rotate(90deg); }
.note { display: flex; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--text-2); font-size: 12px; margin-top: 12px; }
.note svg { color: var(--accent); margin-top: 1px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--card-3); transition: background .3s; }
.steps i.on { background: var(--accent); }

/* ---------- Settings ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--card-2); border-radius: 999px; }
.seg button { height: 36px; border-radius: 999px; font-weight: 700; font-size: 12.5px; color: var(--muted); transition: background .2s, color .2s; }
.seg button.on { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.set-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .srt { flex: 1; min-width: 0; }
.set-row .srt b { display: block; font-size: 13.5px; font-weight: 700; }
.set-row .srt span { font-size: 11.5px; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 20px; }

/* ---------- Empty / skeleton ---------- */
.empty { text-align: center; padding: 22px 12px 10px; }
.empty .art { width: 104px; height: 104px; margin: 0 auto 10px; }
.empty h3 { margin: 0 0 4px; font-size: 16px; }
.empty p { margin: 0 auto 14px; color: var(--muted); font-size: 13px; max-width: 280px; }
.full-center { min-height: 72vh; display: grid; place-items: center; text-align: center; }
.skel { background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 18px; border: 1px solid var(--line); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-bottom)); z-index: 40;
  width: calc(100% - 28px); max-width: 440px; height: 60px; padding: 6px; border-radius: 999px;
  display: flex; align-items: center; justify-content: space-between; gap: 2px;
  background: color-mix(in srgb, var(--card) 88%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 14px 34px -14px rgba(16, 24, 40, .35);
}
.tab {
  height: 46px; min-width: 46px; padding: 0 12px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 7px;
  color: var(--text-2); font-size: 12.5px; font-weight: 700; transition: background .25s, color .25s, padding .25s;
}
.tab span { display: none; white-space: nowrap; }
.tab.on { background: var(--accent); color: #fff; padding: 0 16px; box-shadow: 0 8px 18px -8px var(--accent); }
.tab.on span { display: inline; }

/* ---------- Sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 14, 22, .45); animation: fade .2s ease both; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-width: 600px; margin: 0 auto;
  background: var(--card); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line);
  padding: 10px 16px calc(16px + var(--safe-bottom)); max-height: 88vh; overflow-y: auto;
  animation: sheetUp .32s cubic-bezier(.2, .9, .3, 1.05) both;
}
.sheet.closing { animation: sheetDown .22s ease both; }
.backdrop.closing { animation: fade .22s ease reverse both; }
.sheet .handle { width: 38px; height: 5px; border-radius: 5px; background: var(--card-3); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.sheet .lead { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; }
.sheet .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheetDown { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.otp { display: flex; gap: 8px; justify-content: center; margin: 4px 0; position: relative; }
.otp .cell { width: 50px; height: 58px; border-radius: 14px; background: var(--card-2); border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-size: 23px; font-weight: 800; font-family: ui-monospace, 'SF Mono', Menlo, monospace; transition: border-color .15s, box-shadow .15s; }
.otp .cell.on { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.otp input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; font-size: 16px; }
.token-box { text-align: center; padding: 16px 10px 4px; }
.token { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 40px; font-weight: 800; letter-spacing: .18em; margin: 8px 0; }
.token-ring { width: 54px; height: 54px; margin: 0 auto; position: relative; }
.token-ring svg { transform: rotate(-90deg); }
.token-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; }
.picker { display: flex; flex-direction: column; }
.picker .tbl-row { border: 0; border-top: 1px solid var(--line); margin: 0 -16px; padding: 0 16px; grid-template-columns: minmax(0, 1fr) auto; }
.output { background: var(--card-2); border-radius: 12px; padding: 11px; font-size: 12px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; color: var(--text-2); margin-top: 12px; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; top: calc(12px + var(--safe-top)); left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { display: flex; align-items: center; gap: 9px; max-width: 420px; padding: 10px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--card); color: var(--text); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.toast.ok svg { color: var(--green-ink); }
.toast.err svg { color: var(--pink-ink); }
.toast.out { animation: toastOut .25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }

@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- One-click controls, account CTA, games library ---------- */
.welcome h1 { display: flex; align-items: center; gap: 8px; }
.wave { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--yellow-soft); color: var(--yellow-ink); flex-shrink: 0; }
.hero-foot-row { display: flex; gap: 22px; }
.panel-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.power-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.power {
  height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: 800; border: 1px solid transparent; transition: transform .15s, opacity .2s, box-shadow .2s;
}
.power:active { transform: scale(.96); }
.power.on { background: var(--green-soft); color: var(--green-ink); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.power.pause { background: var(--yellow-soft); color: var(--yellow-ink); border-color: color-mix(in srgb, var(--yellow) 45%, transparent); }
.power.stop { background: var(--pink-soft); color: var(--pink-ink); border-color: color-mix(in srgb, var(--pink) 35%, transparent); }
.power.active.on { background: var(--green); color: #fff; box-shadow: 0 10px 20px -12px var(--green); }
.power.active.pause { background: var(--yellow); color: #3b2c00; }
.power.active.stop { background: var(--pink); color: #fff; }
.power:disabled { pointer-events: none; }
.power:disabled:not(.active) { opacity: .4; }
.power .spinner { width: 16px; height: 16px; }

.add-cta { width: 100%; margin-top: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; transition: transform .15s; }
.add-cta:active { transform: scale(.985); }
.add-cta .brand-logo { width: 42px; height: 42px; }
.add-cta-t { flex: 1; min-width: 0; }
.add-cta-t b { display: block; font-size: 14px; font-weight: 800; }
.add-cta-t span { display: block; font-size: 11.5px; color: var(--muted); }
.add-cta .sq-btn { background: var(--accent); color: #fff; border-color: var(--accent); }

.chart-sum { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }

.st-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.st-cell .num { font-size: 11px; font-weight: 800; color: var(--text-2); }
.tbl-head, .tbl-row { grid-template-columns: minmax(0, 1fr) auto 72px !important; }
.sq-btn.yellow { background: var(--yellow-soft); border-color: color-mix(in srgb, var(--yellow) 45%, transparent); color: var(--yellow-ink); }
.sq-btn:disabled { opacity: .35; pointer-events: none; }
.sq-btn .spinner { width: 13px; height: 13px; border-width: 2px; }
.controls.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.games-panel .search { margin-bottom: 4px; }
.g-results:not(:empty) { margin: 6px 0 4px; padding-bottom: 6px; border-bottom: 1px dashed var(--line-strong); }
.g-selected { margin-top: 6px; }
.g-act { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.g-act .pill { font-size: 10px; }
.games-panel .thumb { width: 74px; height: 28px; }
.g-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 0; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.g-warn { display: flex; align-items: center; gap: 8px; padding: 9px 11px; margin: 4px 0; border-radius: 12px; background: var(--yellow-soft); color: var(--yellow-ink); font-size: 12px; font-weight: 600; }
.g-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.flag { width: 20px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); flex-shrink: 0; }
.stat-bot > span:first-child { flex: 1; min-width: 0; }
.trend { flex-shrink: 0; }

/* Toggle switch */
.switch { width: 46px; height: 28px; border-radius: 999px; background: var(--card-3); position: relative; flex-shrink: 0; transition: background .2s; }
.switch i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--green); }
.switch.on i { transform: translateX(18px); }

/* Confirmation sheet */
.btn.danger { background: var(--pink); color: #fff; box-shadow: 0 10px 22px -12px var(--pink); }
.confirm-ico { width: 60px; height: 60px; margin: 4px auto 12px; border-radius: 20px; display: grid; place-items: center; background: var(--pink-soft); color: var(--pink-ink); }

/* ---------- Profile ---------- */
.avatar-btn { border-radius: 50%; transition: transform .15s; }
.avatar-btn:active { transform: scale(.92); }
.avatar.xl { width: 96px; height: 96px; font-size: 36px; border: 4px solid var(--card); box-shadow: 0 10px 24px -10px rgba(16, 24, 40, .45); }
.profile-card { overflow: hidden; margin-top: 4px; }
.profile-banner { height: 104px; background: radial-gradient(120% 140% at 85% 0%, #5b8def 0%, #2e7cf6 45%, #1d4fbf 100%); position: relative; }
.profile-banner::after { content: ''; position: absolute; inset: 0; opacity: .25; background-image: linear-gradient(rgba(255,255,255,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.2) 1px, transparent 1px); background-size: 20px 20px; }
.profile-body { text-align: center; padding: 0 16px 18px; margin-top: -48px; position: relative; }
.profile-ava { display: flex; justify-content: center; margin-bottom: 10px; }
.profile-body h2 { margin: 0; font-size: 21px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; }
.profile-body .muted { font-size: 13px; margin-top: 2px; }
.premium { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #a78bfa, #6d5df5); color: #fff; }
.set-row .srt span + b { font-weight: 700; font-size: 14px; margin-top: 1px; }
.set-row .srt b.muted { color: var(--muted); font-weight: 600; }
.profile-link { width: 100%; text-align: left; display: block; transition: transform .15s; }
.profile-link:active { transform: scale(.985); }

/* Back header */
.back-bar { display: flex; align-items: center; gap: 12px; margin: 4px 2px 14px; }
.back-bar h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back-bar .round-btn { width: 42px; height: 42px; flex-shrink: 0; background: var(--card); box-shadow: var(--shadow); }
