/* AI Analyser Pro panel v2 — original CSS. Dark glass aesthetic, mobile-first (~480px). */
* { box-sizing: border-box; }
/* The `hidden` attribute MUST win over component display rules. Without this,
 * `.modal { display:flex }` and `.login-screen { display:flex }` override the
 * browser's built-in `[hidden] { display:none }`, so a "hidden" modal stays
 * visible from first load and its fixed overlay keeps swallowing every mouse
 * click — while setting `.hidden = true` in JS appears to do nothing. */
[hidden] { display: none !important; }
:root {
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Sora', 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Space Grotesk', monospace;
  --radius: 18px;
  --nav-h: 62px;
}
/* Default theme: Emerald Mint — very dark green-black glass, mint accent.
 * All 18 palettes share the same variable set so any theme can drive the
 * whole panel (background, glass, buttons, signals). */
body, body[data-theme="emerald-mint"] {
  --bg: #03130d; --bg2: #06231a; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eef7f2; --muted: #8fa89c; --border: rgba(255,255,255,.10);
  --accent: #10b981; --accent2: #34d399; --accent-text: #02120a;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #0b3d2c 0%, #04150e 55%, #06231a 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(16,185,129,.07));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="imperial-emerald"] {
  --bg: #02120c; --bg2: #052e1f; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #ecf7f1; --muted: #8aa79a; --border: rgba(255,255,255,.10);
  --accent: #059669; --accent2: #10b981; --accent-text: #02120a;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #064e3b 0%, #02120c 55%, #052e1f 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(5,150,105,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="forest-jade"] {
  --bg: #04120a; --bg2: #0a2a16; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eef7ee; --muted: #8ca892; --border: rgba(255,255,255,.10);
  --accent: #16a34a; --accent2: #4ade80; --accent-text: #04170a;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #14532d 0%, #04120a 55%, #0a2a16 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(22,163,74,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="alpine-sage"] {
  --bg: #07130c; --bg2: #0f2e1c; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eff7f0; --muted: #90ab97; --border: rgba(255,255,255,.10);
  --accent: #4ade80; --accent2: #86efac; --accent-text: #052012;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #166534 0%, #07130c 55%, #0f2e1c 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(74,222,128,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="cyber-emerald"] {
  --bg: #020d08; --bg2: #04241a; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eafff6; --muted: #8db8a6; --border: rgba(255,255,255,.10);
  --accent: #00ff9d; --accent2: #4dffa6; --accent-text: #02120a;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #065f46 0%, #020d08 55%, #04241a 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(0,255,157,.07));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="nordic-teal"] {
  --bg: #02120f; --bg2: #042a26; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eaf7f4; --muted: #8aa8a2; --border: rgba(255,255,255,.10);
  --accent: #14b8a6; --accent2: #2dd4bf; --accent-text: #02201d;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #0f766e 0%, #02120f 55%, #042a26 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(20,184,166,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="royal-cobalt"] {
  --bg: #040a18; --bg2: #0a1a38; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #edf2fb; --muted: #93a5c4; --border: rgba(255,255,255,.10);
  --accent: #3b82f6; --accent2: #60a5fa; --accent-text: #04122e;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #1e3a8a 0%, #040a18 55%, #0a1a38 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(59,130,246,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="pacific-ocean"] {
  --bg: #031018; --bg2: #072a3a; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eaf5fa; --muted: #8ba9b8; --border: rgba(255,255,255,.10);
  --accent: #0ea5e9; --accent2: #38bdf8; --accent-text: #031a26;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #075985 0%, #031018 55%, #072a3a 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(14,165,233,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="arctic-cyan"] {
  --bg: #031419; --bg2: #072e36; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eaf7fa; --muted: #8babb3; --border: rgba(255,255,255,.10);
  --accent: #22d3ee; --accent2: #67e8f9; --accent-text: #032830;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #0e7490 0%, #031419 55%, #072e36 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(34,211,238,.08));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="sapphire-blue"] {
  --bg: #050b1c; --bg2: #0b1e42; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #edf1fb; --muted: #94a5c6; --border: rgba(255,255,255,.10);
  --accent: #2563eb; --accent2: #60a5fa; --accent-text: #eaf1ff;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #1d4ed8 0%, #050b1c 55%, #0b1e42 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(37,99,235,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="deep-indigo"] {
  --bg: #080818; --bg2: #141432; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #eef0fb; --muted: #9aa0c6; --border: rgba(255,255,255,.10);
  --accent: #6366f1; --accent2: #818cf8; --accent-text: #eef0ff;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #4338ca 0%, #080818 55%, #141432 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(99,102,241,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="imperial-purple"] {
  --bg: #0d0716; --bg2: #1e0f33; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #f2ecfb; --muted: #a89cc4; --border: rgba(255,255,255,.10);
  --accent: #8b5cf6; --accent2: #a78bfa; --accent-text: #f1eaff;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #5b21b6 0%, #0d0716 55%, #1e0f33 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(139,92,246,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="champagne-gold"] {
  --bg: #120e03; --bg2: #241c07; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #f8f3e4; --muted: #b3a887; --border: rgba(255,255,255,.10);
  --accent: #d4af37; --accent2: #f0d060; --accent-text: #221a04;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #713f12 0%, #120e03 55%, #241c07 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(212,175,55,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="royal-amber"] {
  --bg: #140c02; --bg2: #2a1a06; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #faf3e6; --muted: #b8a586; --border: rgba(255,255,255,.10);
  --accent: #f59e0b; --accent2: #fbbf24; --accent-text: #2b1c02;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #92400e 0%, #140c02 55%, #2a1a06 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(245,158,11,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="ruby-crimson"] {
  --bg: #140506; --bg2: #280b0d; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #fbeeee; --muted: #bd9596; --border: rgba(255,255,255,.10);
  --accent: #dc2626; --accent2: #f87171; --accent-text: #ffecec;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #7f1d1d 0%, #140506 55%, #280b0d 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(220,38,38,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="velvet-rose"] {
  --bg: #15070e; --bg2: #280e1c; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #fbeef3; --muted: #bd96a5; --border: rgba(255,255,255,.10);
  --accent: #fb7185; --accent2: #fda4af; --accent-text: #2b0a12;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #881337 0%, #15070e 55%, #280e1c 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(251,113,133,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="copper-sunset"] {
  --bg: #150b04; --bg2: #2a1608; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #f9f0e6; --muted: #b89e88; --border: rgba(255,255,255,.10);
  --accent: #c2703d; --accent2: #e0955a; --accent-text: #ffeede;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #7c2d12 0%, #150b04 55%, #2a1608 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(194,112,61,.09));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}
body[data-theme="graphite-silver"] {
  --bg: #0c0d10; --bg2: #1b1d22; --surface: rgba(255,255,255,.06); --surface2: rgba(255,255,255,.09);
  --text: #f0f1f4; --muted: #9aa0ab; --border: rgba(255,255,255,.10);
  --accent: #c0c6d0; --accent2: #e5e7eb; --accent-text: #141519;
  --green: #22c55e; --red: #ef4444; --violet: #a855f7; --amber: #f59e0b;
  --hero-grad: linear-gradient(150deg, #4b5563 0%, #0c0d10 55%, #1b1d22 100%);
  --card-grad: linear-gradient(165deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 55%, rgba(192,198,208,.07));
  --shadow: 0 10px 30px rgba(0,0,0,.5);
}

/* Light mode: keep glass but lighten surfaces */
body.light { --bg:#f2f3f7; --bg2:#ffffff; --surface:rgba(10,10,20,.05); --surface2:rgba(10,10,20,.08); --text:#14141c; --muted:#5b5b6b; --border:rgba(10,10,20,.12); --shadow:0 10px 30px rgba(20,20,40,.12); }
body.amoled { --bg:#000; --bg2:#000; --surface:rgba(255,255,255,.05); --surface2:rgba(255,255,255,.08); }

html, body { margin:0; padding:0; overflow-x:hidden; overflow-x:clip; }
body { background:var(--bg); color:var(--text); font-family:var(--font-body); min-height:100vh;
  background-image:radial-gradient(640px 300px at 50% -90px, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(480px 320px at 8% 32%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    radial-gradient(480px 320px at 95% 68%, color-mix(in srgb, var(--accent2) 8%, transparent), transparent 70%); }
/* Bokeh dots are a real DOM layer (#bokeh-layer, first child of #app-shell);
 * the old body.bokeh::before glow was removed with it. */
#app-shell { max-width:480px; margin:0 auto; position:relative; z-index:1; min-height:100vh; }
h1,h2 { font-family:var(--font-display); margin:0; }
h2 { font-size:15px; }
button { font-family:var(--font-body); cursor:pointer; }
input, select { font-family:var(--font-body); }

/* ---------- Login ---------- */
.login-screen { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px 18px; }
.login-card { width:100%; max-width:400px; background:var(--hero-grad); border:1px solid var(--border); border-radius:24px; padding:32px 24px; text-align:center; box-shadow:var(--shadow); }
.login-logo-img { width:96px; height:96px; margin:0 auto 12px; border-radius:20px; object-fit:cover; display:block; }
.login-title { font-size:28px; letter-spacing:2px; }
.login-sub { color:var(--muted); font-size:12px; letter-spacing:2px; margin:6px 0 18px; }
.login-welcome { font-size:15px; font-weight:600; margin:0 0 14px; }
.field-label { display:block; text-align:left; font-size:12px; color:var(--muted); margin-bottom:6px; }
#key-input { width:100%; padding:13px 14px; border-radius:12px; border:1px solid var(--border); background:var(--surface); color:var(--text); font-size:16px; font-family:var(--font-mono); letter-spacing:2px; text-transform:uppercase; outline:none; }
#key-input:focus { border-color:var(--accent); }
.key-error { color:var(--red); font-size:13px; margin:8px 0 0; text-align:left; }
.login-hint { color:var(--muted); font-size:12.5px; line-height:1.6; }
.login-support { color:var(--accent); font-size:13px; font-weight:600; }

/* ---------- Buttons / shared ---------- */
.btn-primary { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border:none; border-radius:12px; padding:13px 20px; font-weight:700; font-size:15px;
  box-shadow:0 8px 24px color-mix(in srgb, var(--accent) 38%, transparent), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; }
.btn-block { width:100%; margin:10px 0; }
.btn-ghost { background:var(--surface2); color:var(--text); border:1px solid var(--border); border-radius:10px; padding:9px 14px; font-weight:600; font-size:13px; }
.btn-ghost.danger { color:#f87171; border-color:rgba(239,68,68,.4); }
.glass { background:var(--card-grad, var(--surface)); border:1px solid var(--border); border-radius:var(--radius); backdrop-filter:blur(14px); }
.card { padding:16px; margin:12px 14px; box-shadow:var(--shadow); }
.card-head { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:10px; }
.card-sub { color:var(--muted); font-size:11.5px; text-align:right; }
.empty-note { color:var(--muted); font-size:13px; margin:6px 0; }
.fine-print { color:var(--muted); font-size:11.5px; line-height:1.5; }
.centre { text-align:center; }
.disclaimer { color:var(--muted); font-size:11.5px; line-height:1.6; text-align:center; padding:0 6px; }
.select { background:var(--bg2); color:var(--text); border:1px solid var(--border); border-radius:8px; padding:7px 9px; font-size:13px; }

/* ---------- App header / nav ---------- */
.app-header { display:flex; justify-content:space-between; align-items:center; padding:16px 16px 4px; }
.brand { display:flex; align-items:center; gap:8px; }
.brand-mark { width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); font-family:var(--font-display); font-weight:800; display:flex; align-items:center; justify-content:center; box-shadow:0 0 16px color-mix(in srgb, var(--accent) 45%, transparent); }
.brand-name { font-family:var(--font-display); font-weight:800; letter-spacing:1px; }
.brand-tag { color:var(--muted); font-size:10px; letter-spacing:2px; }
.synced { color:var(--muted); font-size:11px; font-family:var(--font-mono); }
.tabs-wrap { padding-bottom:calc(var(--nav-h) + 18px); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.bottom-nav { position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:100%; max-width:480px; height:var(--nav-h); display:flex; background:color-mix(in srgb, var(--bg2) 88%, transparent); border-top:1px solid var(--border); backdrop-filter:blur(16px); z-index:20; }
.tab-btn { flex:1; background:none; border:none; color:var(--muted); font-weight:600; font-size:13px; padding:6px 0 10px; }
.tab-btn.active { color:var(--accent); border-top:2px solid var(--accent); text-shadow:0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
.app-footer { padding:6px 14px 10px; }

/* ---------- Home ---------- */
.welcome-line { padding:12px 16px 0; font-family:var(--font-display); font-weight:700; font-size:13px; letter-spacing:1px; color:var(--accent); }
.clock-card { margin:12px 14px; padding:14px 16px; background:var(--hero-grad); }
.clock-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.live-dot { width:9px; height:9px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); animation:pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity:.4; } }
.clock-label { font-size:12px; font-weight:700; letter-spacing:1px; }
.clock { font-family:var(--font-mono); font-weight:700; font-size:22px; margin-left:auto; text-shadow:0 0 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.period { font-family:var(--font-mono); font-size:12px; color:var(--muted); }
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:0 14px; }
.stat-card { padding:14px; display:flex; flex-direction:column; gap:3px; }
.stat-label { color:var(--muted); font-size:12px; }
.stat-value { font-family:var(--font-display); font-size:19px; font-weight:700; text-shadow:0 0 20px color-mix(in srgb, var(--accent) 28%, transparent); }
.stat-sub { color:var(--muted); font-size:11px; }
.pulse-balls { display:flex; gap:8px; flex-wrap:wrap; min-height:44px; align-items:center; }
.pulse-empty { color:var(--muted); font-size:13px; }
.radar-row { display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; }
.radar-row label { color:var(--muted); font-size:12px; }
.radar-bars { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.radar-bar { display:flex; align-items:center; gap:8px; }
.radar-label { font-size:12px; width:88px; }
.bar-track { flex:1; height:10px; border-radius:6px; background:var(--surface2); overflow:hidden; }
.bar-fill { height:100%; border-radius:6px; transition:width .4s; }
.bar-fill.big { background:linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.small { background:linear-gradient(90deg, #2563eb, #60a5fa); }
.radar-val { font-family:var(--font-mono); font-size:12px; width:44px; text-align:right; }
.radar-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.radar-k { display:block; color:var(--muted); font-size:11px; }
.radar-v { font-family:var(--font-mono); font-size:14px; font-weight:600; }
.rooms-list { display:flex; flex-direction:column; gap:10px; }
.room-card { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:13px; border-radius:14px; background:var(--surface2); border:1px solid var(--border); width:100%; text-align:left; color:var(--text); }
.room-card.active-room { border-color:var(--accent); }
.room-name { font-weight:700; font-size:14px; display:block; }
.room-desc { color:var(--muted); font-size:12px; display:block; margin-top:2px; }
.room-status { font-size:11px; font-weight:700; color:var(--green); white-space:nowrap; }
.room-status.standby { color:var(--muted); }
.recent-signals { display:flex; flex-direction:column; gap:8px; }
.signal-row { display:flex; align-items:center; gap:10px; padding:10px; border-radius:12px; background:var(--surface2); font-size:13px; }
.signal-row .period { flex:1; }

/* ---------- Balls ---------- */
.ball { width:44px; height:44px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:800; font-size:19px; color:#fff; flex:none; box-shadow:inset -3px -4px 8px rgba(0,0,0,.35), 0 4px 10px rgba(0,0,0,.35); }
.ball-red { background:radial-gradient(circle at 32% 28%, #f87171, #dc2626 60%, #991b1b); }
.ball-green { background:radial-gradient(circle at 32% 28%, #4ade80, #16a34a 60%, #14532d); }
.ball-violet { background:radial-gradient(circle at 32% 28%, #c084fc, #9333ea 60%, #581c87); }
.ball-sm { width:34px; height:34px; font-size:15px; }
/* FIX ROUND 5: ball 72px -> 60px, font 34px -> 28px. Class name
   ball-lg is unchanged (JS depends on it); only the values change. */
.ball-lg { width:60px; height:60px; font-size:28px; }
.ball-red-violet { background:linear-gradient(135deg, #dc2626 50%, #9333ea 50%); }
.ball-green-violet { background:linear-gradient(135deg, #16a34a 50%, #9333ea 50%); }

/* ---------- Predict ---------- */
.predict-head { margin:12px 14px; padding:10px 14px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.predict-period-label { color:var(--muted); font-size:11px; }
.predict-period { font-family:var(--font-mono); font-size:15px; font-weight:700; }
.predict-clock { margin-left:auto; text-align:right; }
.api-updated { display:block; color:var(--muted); font-size:11px; font-family:var(--font-mono); }
.mode-pills { display:flex; gap:8px; margin:0 14px; }
.mode-pill { flex:1; padding:10px; border-radius:12px; border:1px solid var(--border); background:var(--surface); color:var(--text); font-weight:600; }
.mode-pill.active { border-color:var(--accent); color:var(--accent); }
.engine-toggle { display:flex; gap:8px; margin:12px 14px; }
.engine-btn { flex:1; padding:11px; border-radius:12px; border:1px solid var(--border); background:var(--surface); color:var(--text); font-weight:600; }
.engine-btn.active { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-color:transparent; }
.consensus-box .consensus-empty { color:var(--muted); font-size:13px; line-height:1.6; }
.consensus-strong { color:var(--green); font-weight:800; font-size:15px; }
.consensus-split { color:var(--amber); font-weight:700; font-size:14px; }
.consensus-picks { display:flex; flex-direction:column; gap:4px; font-size:13px; margin-top:6px; }
.consensus-warn { color:var(--amber); font-size:12.5px; margin-top:6px; }
.locked-card { border-color:var(--accent); }
.tier-badge { background:var(--surface2); border:1px solid var(--border); border-radius:20px; padding:4px 10px; font-size:11px; font-weight:700; color:var(--accent); }
/* FIX ROUND 5: .lock-main is now a COLUMN — the hero row (BIG/SMALL
   text + ball, see .lock-hero below) on top, the conf line below it.
   Round 4's row layout aligned the ball to the whole lock-info block
   (text + conf line), so the ball sat low; the hero row centres it
   on the BIG/SMALL text itself. */
.lock-main { display:flex; flex-direction:column; gap:2px; }
.lock-size { font-family:var(--font-display); font-size:48px; font-weight:800; white-space:nowrap; }
/* FIX ROUND 4: softer glow — ONE soft shadow, lower opacity, small
   blur. Round 3 stacked 8/18/32/48px shadows and looked hazy/blurry.
   Colours unchanged: mint #34d399 BIG, red #f87171 SMALL. JS toggles
   .lock-glow-big / .lock-glow-small. */
@keyframes lock-glow-big {
  from { text-shadow:0 0 6px rgba(52,211,153,.30); }
  to { text-shadow:0 0 12px rgba(52,211,153,.50); }
}
@keyframes lock-glow-small {
  from { text-shadow:0 0 6px rgba(248,113,113,.30); }
  to { text-shadow:0 0 12px rgba(248,113,113,.50); }
}
.lock-size.lock-glow-big { color:#34d399; animation:lock-glow-big 1.6s ease-in-out infinite alternate; }
.lock-size.lock-glow-small { color:#f87171; animation:lock-glow-small 1.6s ease-in-out infinite alternate; }
.lock-conf { font-size:15px; font-weight:700; color:var(--accent); }
.lock-pattern { color:var(--muted); font-size:12.5px; margin-top:4px; }
.threshold-warn { color:var(--amber); background:rgba(245,158,11,.12); border:1px solid rgba(245,158,11,.4); border-radius:10px; padding:9px 11px; font-size:12.5px; }
.lock-actions { display:flex; justify-content:space-between; align-items:center; margin-top:12px; }
.lock-engine { color:var(--muted); font-size:12px; }
.stake-row { display:flex; gap:8px; align-items:center; font-size:14px; }
.stake-row strong { font-family:var(--font-mono); }
.data-table { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th { text-align:left; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.5px; padding:6px 4px; border-bottom:1px solid var(--border); }
.data-table td { padding:8px 4px; border-bottom:1px solid var(--border); font-family:var(--font-mono); }
.status-badge { border-radius:20px; padding:3px 9px; font-size:11px; font-weight:700; font-family:var(--font-body); }
.status-WIN, .status-ULTRA_JACKPOT, .status-JACKPOT { background:rgba(34,197,94,.18); color:#4ade80; }
.status-LOSS { background:rgba(239,68,68,.16); color:#f87171; }
.status-PENDING { background:rgba(245,158,11,.16); color:#fbbf24; }
.sureshot-badge { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-radius:20px; padding:1px 6px; font-size:9px; font-weight:800; margin-left:4px; }

/* ---------- Game ---------- */
.game-live { text-align:center; padding:10px 0; }
.clock-xl { font-size:38px; display:block; margin:0; }

/* ---------- History ---------- */
.history-filters { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
.history-filter { padding:7px 12px; border-radius:20px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-size:12.5px; font-weight:600; }
.history-filter.active { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-color:transparent; }
.history-tools { display:flex; gap:8px; margin-bottom:10px; }
#history-search { flex:1; padding:10px 12px; border-radius:10px; border:1px solid var(--border); background:var(--surface); color:var(--text); font-size:13px; outline:none; }

/* ---------- Settings ---------- */
.profile-card { display:flex; gap:14px; align-items:center; }
.profile-avatar-img { width:52px; height:52px; border-radius:50%; object-fit:cover; flex:none; display:block; }
.profile-name { font-weight:700; font-size:15px; }
.profile-meta { color:var(--muted); font-size:12.5px; margin-top:2px; }
.preset-list { display:flex; flex-direction:column; gap:8px; }
.preset-btn { text-align:left; padding:12px; border-radius:12px; border:1px solid var(--border); background:var(--surface2); color:var(--text); }
.preset-btn.active { border-color:var(--accent); }
.preset-btn strong { display:block; font-size:14px; }
.preset-btn span { color:var(--muted); font-size:12px; }
.toggle-row { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid var(--border); font-size:14px; font-weight:600; cursor:pointer; }
.toggle-row:last-child { border-bottom:none; }
.toggle-sub { display:block; color:var(--muted); font-size:12px; font-weight:400; margin-top:2px; }
.toggle-row input { display:none; }
.switch { width:46px; height:26px; border-radius:20px; background:var(--surface2); border:1px solid var(--border); position:relative; flex:none; transition:background .2s; }
.switch::after { content:""; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:#fff; transition:left .2s; }
.toggle-row input:checked + .switch { background:var(--accent); }
.toggle-row input:checked + .switch::after { left:22px; }
.slider { width:100%; accent-color:var(--accent); }
.theme-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.theme-btn { padding:10px 6px; border-radius:12px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-size:11.5px; font-weight:600; }
.theme-btn.active { border-color:var(--accent); box-shadow:0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.theme-swatch { display:block; width:100%; height:22px; border-radius:7px; margin-bottom:6px; }
.settings-actions { display:flex; flex-direction:column; gap:8px; }

/* ---------- Modal / toasts ---------- */
.modal { position:fixed; inset:0; background:rgba(0,0,0,.68); display:flex; align-items:center; justify-content:center; padding:20px; z-index:50; }
.modal-card { width:100%; max-width:380px; padding:26px 24px 22px; text-align:center; position:relative; z-index:1;
  border:1px solid transparent;
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box,
             linear-gradient(135deg, color-mix(in srgb, var(--accent) 75%, transparent), rgba(255,255,255,.08) 42%, rgba(255,255,255,.08) 58%, color-mix(in srgb, var(--accent2) 75%, transparent)) border-box;
  box-shadow:0 24px 60px rgba(0,0,0,.6), 0 0 44px color-mix(in srgb, var(--accent) 18%, transparent); }
.modal-card.modal-loss {
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box,
             linear-gradient(135deg, rgba(239,68,68,.85), rgba(239,68,68,.08) 45%, rgba(239,68,68,.08) 55%, rgba(239,68,68,.85)) border-box;
  box-shadow:0 24px 60px rgba(0,0,0,.6), 0 0 44px rgba(239,68,68,.28); }
.modal-card.modal-win {
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box,
             linear-gradient(135deg, rgba(16,185,129,.85), rgba(16,185,129,.08) 45%, rgba(16,185,129,.08) 55%, rgba(16,185,129,.85)) border-box;
  box-shadow:0 24px 60px rgba(0,0,0,.6), 0 0 44px rgba(16,185,129,.3); }
.modal-card.modal-jackpot {
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box,
             linear-gradient(135deg, rgba(245,158,11,.9), rgba(245,158,11,.1) 45%, rgba(245,158,11,.1) 55%, rgba(245,158,11,.9)) border-box;
  box-shadow:0 24px 60px rgba(0,0,0,.6), 0 0 48px rgba(245,158,11,.35); }
.modal-x { position:absolute; top:12px; right:12px; width:32px; height:32px; border-radius:50%; border:1px solid var(--border); background:var(--surface2); color:var(--muted); font-size:13px; line-height:1; display:flex; align-items:center; justify-content:center; }
.modal-icon { width:78px; height:78px; margin:2px auto 14px; border-radius:22px; display:flex; align-items:center; justify-content:center; }
.modal-icon svg { width:42px; height:42px; }
.modal-card.modal-loss .modal-icon { color:#f87171; background:linear-gradient(145deg, rgba(239,68,68,.24), rgba(239,68,68,.06)); border:1px solid rgba(239,68,68,.5); box-shadow:0 0 30px rgba(239,68,68,.5), inset 0 0 18px rgba(239,68,68,.2); }
.modal-card.modal-win .modal-icon { color:#34d399; background:linear-gradient(145deg, rgba(16,185,129,.24), rgba(16,185,129,.06)); border:1px solid rgba(52,211,153,.5); box-shadow:0 0 30px rgba(16,185,129,.5), inset 0 0 18px rgba(16,185,129,.2); }
.modal-card.modal-jackpot .modal-icon { color:#fbbf24; background:linear-gradient(145deg, rgba(245,158,11,.28), rgba(245,158,11,.07)); border:1px solid rgba(251,191,36,.6); box-shadow:0 0 34px rgba(245,158,11,.55), inset 0 0 18px rgba(245,158,11,.22); }
.modal-badge { display:inline-block; background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-radius:20px; padding:5px 14px; font-size:12px; font-weight:800; margin-bottom:10px; letter-spacing:.5px; }
.modal-badge-loss { background:linear-gradient(135deg, #7f1d1d, #991b1b); color:#fecaca; }
.modal-badge-win { background:linear-gradient(135deg, #065f46, #10b981); color:#d1fae5; }
.modal-badge-jackpot { background:linear-gradient(135deg, #92400e, #f59e0b); color:#fef3c7; }
#win-modal-title { font-size:27px; letter-spacing:.3px; }
.modal-body { font-size:14px; line-height:1.7; margin:12px 0 6px; }
/* FIX ROUND 8 (w4): reset confirmation modal — Cancel + OK side by
   side, equal width. One neutral OK style: the body text carries
   the warning, so no danger-red OK is needed. */
.confirm-actions { display:flex; gap:10px; margin-top:16px; }
/* FIX ROUND 8 (w9): Loss Target Hit — red banner above the locked
   card, shown while the bust is armed or its modal is open. The
   [hidden] rule is belt-and-braces: .bust-banner sets no display,
   so the UA [hidden] rule already hides it. */
.bust-banner { margin:0 0 10px; padding:10px 12px; border-radius:12px; background:linear-gradient(135deg,#7f1d1d,#991b1b); color:#fecaca; font-weight:800; font-size:13px; letter-spacing:.04em; line-height:1.4; text-align:center; box-shadow:0 0 18px rgba(239,68,68,.45); }
.bust-banner[hidden] { display:none; }
#bust-modal-title { color:#fca5a5; }
.confirm-actions .btn-ghost, .confirm-actions .btn-primary { flex:1; }
.modal-body .ball { margin:0 2px; }
.modal-compare { display:flex; align-items:center; justify-content:space-between; gap:8px; background:var(--surface2); border:1px solid var(--border); border-radius:14px; padding:14px 12px; margin-bottom:10px; }
.modal-side { display:flex; flex-direction:column; align-items:center; gap:6px; flex:1; }
.modal-side-label { color:var(--muted); font-size:10px; font-weight:700; letter-spacing:1px; }
.modal-side-size { font-family:var(--font-display); font-weight:800; font-size:15px; }
.modal-vs { width:30px; height:30px; border-radius:50%; background:var(--surface2); border:1px solid var(--border); color:var(--muted); display:flex; align-items:center; justify-content:center; font-size:15px; flex:none; }
.modal-vs.matched { background:rgba(34,197,94,.18); border-color:rgba(34,197,94,.55); color:#4ade80; box-shadow:0 0 14px rgba(34,197,94,.35); }
.modal-meta { display:flex; justify-content:space-between; color:var(--muted); font-size:13px; font-family:var(--font-mono); }
.modal-meta-sub { color:var(--muted); font-size:12px; margin-top:4px; }
.btn-continue-loss { background:linear-gradient(135deg, #3f3f46, #52525b); color:#f4f4f5; box-shadow:none; }
.confetti-layer { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:2; }
.confetti-piece { position:absolute; top:-14px; border-radius:2px; animation-name:confetti-fall; animation-timing-function:linear; animation-fill-mode:forwards; }
@keyframes confetti-fall { to { transform:translateY(110vh) rotate(720deg); opacity:.85; } }
.toasts { position:fixed; bottom:calc(var(--nav-h) + 12px); left:50%; transform:translateX(-50%); width:min(440px, calc(100% - 28px)); display:flex; flex-direction:column; gap:8px; z-index:60; }
.toast { background:var(--bg2); border:1px solid var(--border); border-left:3px solid var(--accent); border-radius:12px; padding:11px 14px; font-size:13.5px; box-shadow:var(--shadow); }
.toast.error { border-left-color:var(--red); }
.toast.warn { border-left-color:var(--amber); }
@media (max-width:360px) { .stat-grid { grid-template-columns:1fr; } .theme-grid { grid-template-columns:repeat(2,1fr); } }

/* ---------- Auto Next + fast settlement ---------- */
.next-row { display:flex; gap:10px; align-items:stretch; margin:10px 0; }
.next-row .btn-block { margin:0; flex:1; width:auto; min-width:0; }
.auto-next-wrap { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:12px; background:var(--surface2); border:1px solid var(--border); cursor:pointer; flex:none; }
.auto-next-wrap input { display:none; }
.auto-next-wrap .switch { width:40px; height:22px; }
.auto-next-wrap .switch::after { width:16px; height:16px; }
.auto-next-wrap input:checked + .switch { background:var(--green); }
.auto-next-wrap input:checked + .switch::after { left:20px; }
.auto-next-label { font-size:11px; font-weight:800; letter-spacing:1px; line-height:1.25; color:var(--muted); }
.auto-next-sub { font-size:9px; letter-spacing:2px; }
.auto-next-wrap input:checked ~ .auto-next-label { color:var(--green); }
.mode-badge { background:linear-gradient(135deg, #16a34a, #4ade80); color:#052e16; border-radius:20px; padding:4px 10px; font-size:11px; font-weight:800; margin-right:6px; }

/* ---------- Professional signal tables ---------- */
.ball-cell { display:inline-flex; align-items:center; gap:5px; }
.ball-size { font-weight:800; font-size:13px; font-family:var(--font-display); }
.cell-dash { color:var(--muted); }
.data-table td { vertical-align:middle; }
.data-table tbody tr:hover td { background:rgba(255,255,255,.03); }
.status-pill { display:inline-flex; align-items:center; gap:5px; border-radius:20px; padding:4px 10px; font-size:11px; font-weight:800; font-family:var(--font-body); white-space:nowrap; }
.status-pill svg { width:13px; height:13px; flex:none; }
.status-pill-win { background:rgba(34,197,94,.18); color:#4ade80; box-shadow:inset 0 0 0 1px rgba(34,197,94,.45); }
.status-pill-loss { background:rgba(239,68,68,.16); color:#f87171; box-shadow:inset 0 0 0 1px rgba(239,68,68,.45); }
.status-pill-jackpot { background:linear-gradient(135deg, #92400e, #f59e0b); color:#fef3c7; box-shadow:0 0 12px rgba(245,158,11,.35); }
.status-pill-pending { background:rgba(245,158,11,.16); color:#fbbf24; box-shadow:inset 0 0 0 1px rgba(245,158,11,.45); }
/* --- Betting-session header + per-row amounts (fix round 11, item 2):
       #history-session-head sits above the Signal History table
       ("Session started … · Fund ₹… · Target ₹… · n signals · net").
       .hist-amt / .hist-lvl are the two compact block lines inside
       the Status cell (amount, then "L<n> · ₹<stake>"); block layout
       keeps the 21%-wide Status column (~69px at 390px) from ever
       overflowing sideways — each line is short enough to fit on
       one line at 10px. .hist-session-divider marks the earlier
       sessions below the current session in the same table. */
.history-session-head { font-size:12px; color:var(--muted); margin:0 0 10px; line-height:1.5; overflow-wrap:break-word; }
.hist-amt { display:block; font-size:11px; font-weight:800; font-family:var(--font-body); white-space:nowrap; margin-top:2px; }
.hist-amt.hist-win { color:#4ade80; }
.hist-amt.hist-loss { color:#f87171; }
.hist-amt.hist-jackpot { color:#fbbf24; }
.hist-lvl { display:block; font-size:10.5px; color:var(--muted); font-family:var(--font-body); white-space:nowrap; margin-top:1px; }
.hist-session-divider td { text-align:center; font-size:11px; font-weight:700; color:var(--muted); background:rgba(255,255,255,.03); padding:6px 4px; }
.colour-pill { display:inline-block; border-radius:20px; padding:3px 10px; font-size:11px; font-weight:700; }
.colour-RED { background:rgba(239,68,68,.16); color:#f87171; }
.colour-GREEN { background:rgba(34,197,94,.16); color:#4ade80; }
.colour-RED_VIOLET { background:linear-gradient(135deg, rgba(239,68,68,.22), rgba(168,85,247,.22)); color:#f0abfc; }
.colour-GREEN_VIOLET { background:linear-gradient(135deg, rgba(34,197,94,.22), rgba(168,85,247,.22)); color:#bbf7d0; }
.table-footer { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; border-top:1px solid var(--border); margin-top:10px; padding-top:12px; text-align:center; }
.table-footer span { display:block; color:var(--muted); font-size:11px; }
.table-footer strong { font-family:var(--font-mono); font-size:16px; }

/* ---------- Bottom nav: icons + glowing active pill ---------- */
.tab-btn { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; }
.tab-btn svg { width:22px; height:22px; }
.tab-btn .nav-label { font-size:12px; }
.tab-btn.active { color:var(--accent-text); background:linear-gradient(135deg, var(--accent2), var(--accent)); border-radius:14px; margin:6px 5px; padding:8px 0 9px; border-top:none; text-shadow:none; box-shadow:0 0 20px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.35); }

/* ============================================================
   AI Analyser Pro — emerald rebuild (layout + theme additions)
   ============================================================ */

/* ---------- Bokeh layer (pure CSS float, transform/opacity only) ---------- */
#bokeh-layer { position:fixed; inset:0; pointer-events:none; z-index:0; overflow:hidden; }
#bokeh-layer i { position:absolute; border-radius:50%; background:color-mix(in srgb, var(--accent) 55%, transparent); filter:blur(1px); opacity:.5; animation:bokeh-float 9s ease-in-out infinite; }
#bokeh-layer i:nth-child(1) { width:10px; height:10px; left:6%; top:18%; animation-delay:0s; }
#bokeh-layer i:nth-child(2) { width:6px; height:6px; left:14%; top:64%; animation-delay:-1.2s; background:color-mix(in srgb, var(--accent2) 60%, transparent); }
#bokeh-layer i:nth-child(3) { width:14px; height:14px; left:22%; top:38%; animation-delay:-2.4s; opacity:.35; }
#bokeh-layer i:nth-child(4) { width:7px; height:7px; left:31%; top:82%; animation-delay:-.6s; }
#bokeh-layer i:nth-child(5) { width:11px; height:11px; left:38%; top:12%; animation-delay:-3.1s; background:color-mix(in srgb, var(--accent2) 60%, transparent); }
#bokeh-layer i:nth-child(6) { width:5px; height:5px; left:47%; top:52%; animation-delay:-1.8s; }
#bokeh-layer i:nth-child(7) { width:13px; height:13px; left:55%; top:26%; animation-delay:-4.2s; opacity:.35; }
#bokeh-layer i:nth-child(8) { width:8px; height:8px; left:63%; top:74%; animation-delay:-.9s; background:color-mix(in srgb, var(--accent2) 60%, transparent); }
#bokeh-layer i:nth-child(9) { width:6px; height:6px; left:70%; top:8%; animation-delay:-2.8s; }
#bokeh-layer i:nth-child(10) { width:12px; height:12px; left:78%; top:44%; animation-delay:-1.5s; opacity:.35; }
#bokeh-layer i:nth-child(11) { width:7px; height:7px; left:85%; top:68%; animation-delay:-3.6s; }
#bokeh-layer i:nth-child(12) { width:9px; height:9px; left:91%; top:22%; animation-delay:-.3s; background:color-mix(in srgb, var(--accent2) 60%, transparent); }
#bokeh-layer i:nth-child(13) { width:5px; height:5px; left:10%; top:88%; animation-delay:-4.6s; }
#bokeh-layer i:nth-child(14) { width:10px; height:10px; left:44%; top:92%; animation-delay:-2.1s; opacity:.35; }
@keyframes bokeh-float { 0%,100% { transform:translateY(0); opacity:.55; } 50% { transform:translateY(-26px); opacity:.15; } }
body.no-bokeh #bokeh-layer { display:none; }

/* ---------- Sticky glass header ---------- */
.app-header { position:sticky; top:0; z-index:30; display:flex; align-items:center; gap:10px; padding:10px 14px; background:color-mix(in srgb, var(--bg) 82%, transparent); border-bottom:1px solid var(--border); backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); }
.brand-logo-img { width:34px; height:34px; border-radius:10px; object-fit:cover; flex:none; display:block; box-shadow:0 0 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.brand-name { font-size:14px; white-space:nowrap; }
.brand-tag { display:none; }
.topnav { display:flex; gap:4px; margin:0 auto; padding:4px; border-radius:14px; background:var(--surface); border:1px solid var(--border); overflow-x:auto; scrollbar-width:none; flex:none; max-width:46%; }
.topnav::-webkit-scrollbar { display:none; }
.topnav-btn { background:none; border:none; color:var(--muted); font-weight:700; font-size:11.5px; padding:6px 9px; border-radius:10px; white-space:nowrap; }
.topnav-btn.active { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); box-shadow:0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
.header-pills { display:flex; align-items:center; gap:8px; margin-left:auto; }
.live-pill { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:800; letter-spacing:1px; color:#4ade80; background:rgba(34,197,94,.14); border:1px solid rgba(34,197,94,.4); border-radius:20px; padding:5px 10px; }
.account-pill { font-size:12px; font-weight:700; font-family:var(--font-mono); color:var(--text); background:var(--surface2); border:1px solid var(--border); border-radius:20px; padding:5px 11px; white-space:nowrap; }
.header-pills .synced { display:none; }
@media (min-width:520px) { .brand-tag { display:inline; } .header-pills .synced { display:inline; } }

/* ---------- Floating Telegram button ---------- */
#tg-float { position:fixed; right:14px; bottom:calc(var(--nav-h) + 16px); z-index:40; width:46px; height:46px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; background:linear-gradient(135deg, #2aa3dc, #1b7fb8); box-shadow:0 8px 24px rgba(0,0,0,.5), 0 0 20px color-mix(in srgb, var(--accent) 45%, transparent); border:2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
#tg-float svg { width:22px; height:22px; }

/* ---------- Home ---------- */
.home-title { font-family:var(--font-display); font-size:34px; font-weight:800; letter-spacing:1px; line-height:1.1; padding:6px 16px 0; background:linear-gradient(120deg, #fff 20%, var(--accent2) 80%); -webkit-background-clip:text; background-clip:text; color:transparent; }
.progress-line { height:4px; border-radius:4px; background:var(--surface2); overflow:hidden; margin-top:12px; }
.clock-card .progress-line { margin-left:0; margin-right:0; }
.predict-head .progress-line { flex-basis:100%; margin-top:4px; }
.progress-fill { height:100%; width:0; border-radius:4px; background:linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow:0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); transition:width 1s linear; }
.progress-fill.progress-critical { background:linear-gradient(90deg, #f59e0b, #fbbf24); box-shadow:0 0 10px rgba(245,158,11,.6); }
#predict-progress.progress-critical { background:linear-gradient(90deg, #dc2626, #f87171); box-shadow:0 0 10px rgba(239,68,68,.6); }
#pulse-open { margin-left:auto; background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-color:transparent; box-shadow:0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.radar-pills { display:flex; gap:6px; margin-bottom:12px; padding:4px; border-radius:14px; background:var(--surface); border:1px solid var(--border); width:max-content; }
.radar-pill { background:none; border:none; color:var(--muted); font-weight:700; font-size:13px; padding:8px 18px; border-radius:10px; }
.radar-pill.active { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); box-shadow:0 0 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.room-card.active-room { border-color:var(--accent); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 22%, transparent); background:linear-gradient(165deg, color-mix(in srgb, var(--accent) 12%, transparent), var(--surface2)); }
.room-tag { display:inline-block; font-size:11px; font-weight:800; color:var(--accent2); background:rgba(16,185,129,.14); border:1px solid rgba(16,185,129,.45); border-radius:20px; padding:4px 10px; white-space:nowrap; }
.room-icon { width:46px; height:46px; border-radius:14px; flex:none; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); font-size:20px; box-shadow:0 0 16px color-mix(in srgb, var(--accent) 40%, transparent); }
.room-body { flex:1; min-width:0; }

/* ---------- Predict: period card ---------- */
.predict-period-row { display:flex; align-items:center; gap:8px; }
#predict-period-copy { padding:6px 8px; display:inline-flex; align-items:center; }
.time-remaining-label { display:block; color:var(--muted); font-size:11px; margin-bottom:2px; }
.time-tiles { display:flex; align-items:center; gap:5px; }
.time-tile { min-width:32px; height:38px; padding:0 4px; border-radius:8px; display:inline-flex; align-items:center; justify-content:center; font-family:var(--font-mono); font-size:20px; font-weight:700; background:var(--surface2); border:1px solid var(--border); box-shadow:inset 0 1px 0 rgba(255,255,255,.06); }
.time-colon { font-family:var(--font-mono); font-size:18px; font-weight:700; color:var(--accent); }
#predict-tiles.time-critical .time-tile { color:#f87171; border-color:rgba(239,68,68,.65); box-shadow:0 0 12px rgba(239,68,68,.35); }
#predict-tiles.time-critical .time-colon { color:#f87171; }
.predict-actions { display:flex; gap:8px; margin-left:auto; }
.recent-balls { flex-basis:100%; display:flex; align-items:center; gap:6px; flex-wrap:nowrap; border-top:1px solid var(--border); padding-top:8px; min-height:36px; }
.recent-label { color:var(--muted); font-size:12px; font-weight:600; margin-right:2px; }
.recent-balls .ball { width:28px; height:28px; font-size:13px; }

/* ---------- Predict: colour + size buttons ---------- */

/* ---------- Predict: ready card ---------- */
#ready-card { display:flex; gap:14px; align-items:flex-start; }
#ready-card p { color:var(--muted); font-size:13.5px; line-height:1.6; margin:6px 0 0; }
#ready-period { font-family:var(--font-display); font-size:17px; font-weight:800; }

/* ---------- Predict: stake planner ---------- */
#stake-planner summary { cursor:pointer; font-family:var(--font-display); font-size:15px; font-weight:700; list-style:none; display:flex; justify-content:space-between; align-items:center; gap:10px; }
#stake-planner summary::-webkit-details-marker { display:none; }
#stake-planner summary::after { content:"\25BE"; color:var(--muted); font-size:16px; }
#stake-planner[open ] summary::after { content:"\25B4"; }
#stake-summary-badge { background:rgba(16,185,129,.16); color:var(--accent2); border:1px solid rgba(16,185,129,.4); border-radius:20px; padding:4px 10px; font-size:12px; font-weight:800; font-family:var(--font-body); white-space:nowrap; }
.stake-btns { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.stake-btns button { flex:1; min-width:64px; padding:10px 6px; border-radius:11px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-weight:700; font-size:13.5px; font-family:var(--font-mono); }
.stake-btns button.active { border-color:var(--accent); color:var(--accent2); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
#stake-table { margin-top:6px; }
/* Fix round 12 (w2): 5-column planner (Size Bet / Size Win / No. Bet /
   No. Hit) must still fit 390px mobile width — fixed layout, tight
   padding, smaller non-wrapping headers; the payout explainer below
   may wrap. */
#stake-table { table-layout:fixed; }
#stake-table th, #stake-table td { padding:6px 2px; font-size:12px; white-space:nowrap; }
#stake-table th { font-size:10.5px; letter-spacing:.2px; }
#stake-table th:nth-child(1), #stake-table td:nth-child(1) { width:13%; }
#stake-table th:nth-child(2), #stake-table td:nth-child(2) { width:20%; }
#stake-table th:nth-child(3), #stake-table td:nth-child(3) { width:24%; }
#stake-table th:nth-child(4), #stake-table td:nth-child(4) { width:18%; }
#stake-table th:nth-child(5), #stake-table td:nth-child(5) { width:25%; }
.stake-payout-note { font-size:12px; color:var(--muted); line-height:1.55; margin:8px 0 0; }
#stake-table td, #stake-table th { text-align:center; }
#stake-table td:first-child, #stake-table th:first-child { text-align:left; }
/* FIX ROUND 4: "Your Fund" field replaces the old base-amount
   buttons and the reserve footer line (both deleted from the
   markup). Worker 3 wires #stake-fund. */
.stake-fund-field { margin:12px 0 4px; }
/* FIX ROUND 8 (w5): Levels selector sits beside the fund input in
   a flex row; the fund column takes the remaining width. */
.stake-fund-row { display:flex; gap:12px; align-items:flex-end; }
.stake-fund-col { flex:1; min-width:0; }
.stake-levels-col { flex:0 0 auto; }
/* FIX ROUND 8 (w10): Target profit column beside the fund input
   (same flex width as the fund column) + the live profit/target
   progress line + the re-ask input + the green hit title. */
.stake-target-col { flex:1; min-width:0; }
#stake-target { flex:1; min-width:0; padding:11px 0; border:none; outline:none; background:none; color:var(--text); font-size:15px; font-weight:700; font-family:var(--font-mono); -moz-appearance:textfield; appearance:textfield; }
#stake-target::-webkit-outer-spin-button, #stake-target::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.stake-progress { margin:10px 0 0; font-size:12.5px; font-weight:700; color:var(--muted); letter-spacing:.02em; }
#target-modal-title { color:#86efac; }
#target-ask-input { width:100%; box-sizing:border-box; background:var(--surface); border:1px solid var(--border); border-radius:11px; padding:11px 12px; color:var(--text); font-size:16px; font-weight:700; font-family:var(--font-mono); outline:none; -moz-appearance:textfield; appearance:textfield; }
#target-ask-input:focus { border-color:var(--accent); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
#target-ask-hint { margin:10px 0 0; }
#stake-levels { padding:11px 10px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--text); font-size:15px; font-weight:700; font-family:var(--font-mono); outline:none; }
#stake-levels:focus { border-color:var(--accent); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.stake-fund-field label, .stake-number-row label { display:block; font-size:12px; font-weight:700; color:var(--muted); margin-bottom:6px; }
.stake-fund-wrap { display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:11px; padding:0 12px; }
.stake-fund-wrap:focus-within { border-color:var(--accent); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.stake-fund-cur { font-family:var(--font-mono); font-size:15px; font-weight:700; color:var(--accent2); }
#stake-fund, #stake-number-bet { flex:1; min-width:0; padding:11px 0; border:none; outline:none; background:none; color:var(--text); font-size:15px; font-weight:700; font-family:var(--font-mono); -moz-appearance:textfield; appearance:textfield; }
#stake-fund::-webkit-outer-spin-button, #stake-fund::-webkit-inner-spin-button, #stake-number-bet::-webkit-outer-spin-button, #stake-number-bet::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
/* FIX ROUND 12 (w2): Number side bet field sits under the fund row. */
.stake-fund-hint { display:block; font-size:11.5px; color:var(--muted); margin-top:6px; }
.stake-number-row { margin:10px 0 4px; }
.stake-table-caption { font-family:var(--font-display); font-size:13px; font-weight:700; margin:14px 0 2px; }
#stake-planner .stake-row { margin-top:10px; }
/* Five step buttons (2x/2.2x/2.3x/2.5x/3x) fit one row at 390px. */
#stake-step button { min-width:56px; }

/* ---------- Predict: sub-tabs + analytics ---------- */
.subtabs { display:flex; gap:4px; margin:12px 14px 0; padding:4px; border-radius:16px; background:var(--surface); border:1px solid var(--border); }
.subtab-btn { flex:1; background:none; border:none; color:var(--muted); font-weight:700; font-size:13px; padding:10px 6px; border-radius:12px; white-space:nowrap; }
.subtab-btn.active { background:var(--surface2); color:var(--text); box-shadow:inset 0 0 0 1px var(--border), 0 2px 8px rgba(0,0,0,.3); }
.subtab-panel { display:none; }
.subtab-panel.active { display:block; }
#analytics-toggle-row { display:flex; gap:4px; margin:12px 0; padding:4px; border-radius:14px; background:var(--surface); border:1px solid var(--border); width:max-content; max-width:100%; }
#analytics-toggle-row .subtab-btn { flex:none; padding:9px 16px; }
#trend-matrix { overflow-x:auto; }
#trend-matrix table { width:100%; border-collapse:collapse; font-size:12.5px; font-family:var(--font-mono); }
#trend-matrix th, #trend-matrix td { padding:6px 4px; text-align:center; border-bottom:1px solid var(--border); }
#trend-matrix th { color:var(--muted); font-size:11px; text-transform:uppercase; }
#trend-matrix td:first-child, #trend-matrix th:first-child { text-align:left; font-size:11px; }
#freq-bars, #bs-split, #color-dist { margin:10px 0; }
.freq-bar-row { display:flex; align-items:center; gap:8px; margin:5px 0; font-size:12.5px; font-family:var(--font-mono); }
.freq-bar-row .bar-track { flex:1; }

/* ---------- Rules modal ---------- */
#rules-modal .modal-card { text-align:left; }
#rules-modal h2 { text-align:center; margin-bottom:12px; }
.rules-body p { font-size:13.5px; line-height:1.7; color:var(--text); margin:0; }

/* ---------- Game ---------- */
.game-head { display:flex; flex-direction:column; gap:10px; padding:14px 16px 0; }
.game-head h2 { font-size:17px; }
.game-filters { display:flex; gap:6px; flex-wrap:wrap; }
.game-filter { padding:8px 14px; border-radius:20px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-size:12.5px; font-weight:700; }
.game-filter.active { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-color:transparent; box-shadow:0 0 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.game-card { padding:16px; border-radius:var(--radius); background:var(--card-grad, var(--surface)); border:1px solid var(--border); box-shadow:var(--shadow); }
.game-tag { display:inline-block; font-size:11px; font-weight:800; letter-spacing:1px; color:var(--accent2); background:rgba(16,185,129,.14); border:1px solid rgba(16,185,129,.4); border-radius:20px; padding:4px 10px; }
.game-title { font-family:var(--font-display); font-size:17px; font-weight:800; margin:10px 0 4px; }
.game-desc { color:var(--muted); font-size:13px; line-height:1.6; margin:0 0 12px; }
.game-invite { display:flex; align-items:center; gap:8px; background:var(--surface2); border:1px dashed var(--border); border-radius:10px; padding:9px 12px; font-family:var(--font-mono); font-size:13px; margin-bottom:12px; }
.game-invite button { margin-left:auto; }
.game-chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:12px; }
.game-chips span { font-size:11.5px; font-weight:700; background:var(--surface2); border:1px solid var(--border); border-radius:20px; padding:4px 10px; }
.game-actions { display:flex; gap:8px; }
.game-actions .btn-ghost { flex:1; }

/* ---------- History ---------- */
.history-head { display:flex; justify-content:space-between; align-items:center; padding:14px 16px 0; }
.history-head h2 { font-size:19px; }
.winrate-pill { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); border-radius:20px; padding:6px 14px; font-family:var(--font-mono); font-size:14px; font-weight:800; box-shadow:0 0 16px color-mix(in srgb, var(--accent) 40%, transparent); }
#history-stats { margin-top:12px; }
.history-selects { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.history-selects .select { flex:1; min-width:120px; }
.history-selects .btn-ghost { flex:none; }

/* ---------- Settings ---------- */
.seg { display:flex; gap:4px; padding:4px; border-radius:14px; background:var(--surface); border:1px solid var(--border); margin-bottom:6px; }
.seg button { flex:1; background:none; border:none; color:var(--muted); font-weight:700; font-size:13px; padding:9px 6px; border-radius:10px; }
.seg button.active { background:linear-gradient(135deg, var(--accent), var(--accent2)); color:var(--accent-text); box-shadow:0 0 12px color-mix(in srgb, var(--accent) 40%, transparent); }
#threshold-pills { display:flex; gap:8px; margin-top:10px; }
#threshold-pills button { flex:1; padding:9px 6px; border-radius:11px; border:1px solid var(--border); background:var(--surface2); color:var(--text); font-weight:700; font-size:13.5px; font-family:var(--font-mono); }
#threshold-pills button.active { border-color:var(--accent); color:var(--accent2); box-shadow:0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Pre-existing unstyled hooks (kept, now defined) ---------- */
/* FIX ROUND 5: .lock-info is gone (replaced by the .lock-hero row);
   its slot now defines .lock-hero. */
/* FIX ROUND 8 (w1): ball beside the size text — .lock-hero is now
   a right-aligned cluster (justify-content:flex-end, gap 12px) so
   the 60px ball sits immediately right of BIG/SMALL, vertically
   centred on the text, under the AUTO pill. Was space-between,
   which pushed the ball to the far right edge, away from the
   text. DOM order (size-then-ball) and the 60px .ball-lg size
   are unchanged. */
.lock-hero { display:flex; gap:12px; align-items:center; justify-content:flex-end; min-width:0; }
.login-disclaimer { margin-top:14px; }
.pulse-mode, .radar-mode { font-weight:600; }

/* ================================================================
   FIX ROUND — 23 Nov 2026 (user bug list + live original audit)
   1. Locked card moved to the top of the Predict tab with an
      animated RGB rotating border.
   2. Mobile fit: no horizontal page overflow; wide tables scroll
      inside their cards; header reflows at phone width.
   3. Settlement-modal auto-dismiss timer line (original behaviour).
   ================================================================ */

/* --- RGB rotating border on the locked card (theme-aware) ---
   FIX ROUND 2: the padding-box layer MUST be opaque. --card-grad /
   --surface are translucent (rgba white .02–.08), so the conic
   rainbow underneath bled through the WHOLE card body and made the
   text unreadable (user screenshots 23 Nov). --bg2 is an opaque hex
   in all 18 themes + light (#fff) + amoled (#000), so the rainbow
   now lives ONLY in the 2px border-box edge. --- */
@property --rgb-angle { syntax:"<angle>"; inherits:false; initial-value:0deg; }
@keyframes rgb-rotate { to { --rgb-angle:360deg; } }
.locked-card {
  border:2px solid transparent;
  padding:12px 16px;
  background:
    linear-gradient(var(--bg2), var(--bg2)) padding-box,
    conic-gradient(from var(--rgb-angle, 0deg), #ff004c, #ff8a00, #ffee00, #00e676, #00b0ff, #7c4dff, #ff004c) border-box;
  animation:rgb-rotate 3s linear infinite;
}
/* FIX ROUND 4: locked-card header is TWO lines, never truncated —
   the round-3 one-line + ellipsis rule is GONE (no "..." at any
   width, 390px included). Line 1 "Next Prediction", line 2
   "Locked <period>"; AUTO pill stays top-right. Vertical padding
   unchanged (12px card / 6px head margin). */
.locked-card .card-head { display:flex; flex-wrap:nowrap; align-items:flex-start; gap:8px; margin-bottom:6px; }
.locked-card .card-head h2 { flex:1 1 auto; min-width:0; font-size:15px; }
.locked-card .card-head > span { flex:none; }
.lock-head-line1, .lock-head-line2 { display:block; }
.lock-head-line1 { font-size:15px; font-weight:800; line-height:1.3; }
.lock-head-line2 { font-size:14px; font-weight:700; line-height:1.35; }
/* FIX ROUND 5: level + streak rows are BIGGER and BOLDER — 12px ->
   15px, values 800 — and may WRAP to two lines instead of shrinking.
   Round 4's one-line + 11px-at-<=400px rule is GONE (it measured
   304-314px for the fund-400 level row at 12px; at 15px the row is
   ~360px against 290px usable at 390px, so it wraps cleanly: level
   line 1 + "Keep ₹<fund>" line 2, exactly the split worker 2's
   Wallet line needs). white-space:normal + overflow-wrap keep any
   long row inside the card — no horizontal overflow at 390px. */
.lock-meta-row { font-size:15px; font-weight:700; color:var(--text); margin-top:6px; line-height:1.5; white-space:normal; overflow-wrap:break-word; }
.lock-meta-row strong, .lock-meta-row b, .lock-meta-row .lock-meta-val { color:var(--text); font-weight:800; }
/* FIX ROUND 4: live countdown slot in the locked-card footer.
   Worker 2 fills #lock-countdown. FIX ROUND 5: the Copy button is
   gone from the footer — the countdown now lives in its own block
   with a "Next Signal in" label above and a green drain line below. */
.lock-countdown { font-family:var(--font-mono); font-size:13px; font-weight:700; color:var(--accent2); white-space:nowrap; }
/* ============================================================
   FIX ROUND 5 — 24 Nov 2026 (locked-card polish #3)
   - Sureshot banner wiggle: gentle ±3px / ±0.6deg, 1.2s infinite.
     The banner is created by JS with inline cssText that sets NO
     animation, so this class rule applies untouched.
   - Countdown footer: .lock-countdown-block spans the footer width
     (flex:1, right-aligned); #lock-countdown-line is the thin green
     drain line, same #34d399 -> #10b981 as the Recent
     .progress-fill / modal drain line. Worker 2 wires its width
     from JS.
   - .lock-window-tag: small muted pill for the streak row's window
     label (e.g. "Last 24h") — worker 2 adds the span.
   ============================================================ */
@keyframes sureshot-wiggle {
  0%, 100% { transform:translateX(0) rotate(0deg); }
  25% { transform:translateX(-3px) rotate(-.6deg); }
  75% { transform:translateX(3px) rotate(.6deg); }
}
.sureshot-alert { animation:sureshot-wiggle 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sureshot-alert { animation:none; } }
.lock-window-tag { display:inline-block; font-size:11px; font-weight:700; color:var(--muted); background:var(--surface2); border:1px solid var(--border); border-radius:20px; padding:2px 8px; margin-left:0; flex:none; vertical-align:1px; white-space:nowrap; }
/* FIX ROUND 8 (w2): streak window 1h -> 24h — the Max row must keep
   its "Last 24h" pill INLINE after "Max Loss ×n" at 390px, never
   wrapping onto its own line. #lock-max-row is a nowrap flex row:
   the text span flexes (and shrinks) while the pill is flex:none.
   The <=520px rule shrinks the pill further so 2-digit streaks
   still fit (width budget at 390px: text ~216px + pill ~70px =
   ~286px vs ~290px usable). */
#lock-max-row { display:flex; flex-wrap:nowrap; align-items:baseline; gap:6px; }
.lock-max-text { flex:1 1 auto; min-width:0; }
@media (max-width:520px) { .lock-window-tag { font-size:10px; padding:2px 6px; } }
.lock-countdown-block { flex:1 1 auto; margin-left:auto; text-align:right; }
.lock-countdown-label { display:block; font-size:11px; font-weight:700; color:var(--muted); margin-bottom:2px; }
.lock-countdown-line { height:4px; width:100%; border-radius:4px; margin-top:6px; background:linear-gradient(90deg, #34d399, #10b981); transition:width 1s linear; }
/* ============================================================
   FIX ROUND 6 — 24 Nov 2026 (locked-card meta reorder + reset
   buttons + consensus to the bottom of the Predict tab)
   - Meta rows are now four, in DOM order: Wallet, Max, Now,
     Level (ids lock-wallet-row / lock-max-row / lock-now-row /
     lock-level-row). Same .lock-meta-row styling (15px / 700);
     the "Last 24h" pill (.lock-window-tag) now rides at the END
     of the Max row instead of the Now row — the class is
     unchanged, so it renders identically wherever JS puts it.
   - Reset row: small quiet outline buttons at the very bottom
     of the locked card, under the countdown drain line. Reset
     Wallet is muted; Reset All carries a warning amber tint so
     the destructive one reads as the riskier tap. Buttons are
     type="button" (never submit) and centred — FIX ROUND 8 (w3):
     the row was right-aligned and overflowed at 390px once a
     third button joined it; with 2 buttons the smaller centred
     row fits. Full Server Reset moved to the Settings tab.
     The row shares the 40px FAB-clear padding below.
   ============================================================ */
.lock-reset-row { display:flex; justify-content:center; gap:6px; margin-top:12px; }
.btn-reset { font-family:var(--font-body); font-size:11px; font-weight:700; color:var(--muted); background:transparent; border:1px solid var(--border); border-radius:8px; padding:4px 9px; cursor:pointer; white-space:nowrap; }
.btn-reset:active { background:var(--surface2); }
.btn-reset-all { color:#fbbf24; border-color:color-mix(in srgb, #f59e0b 55%, var(--border)); }
/* FIX ROUND 7 (w3): Full Server Reset — main-key only, wipes ALL server
   data for EVERYONE, so it reads as the dangerous one: red border +
   red text on a red-tinted background. The .armed state (second tap
   of the two-tap confirm) is solid red.
   FIX ROUND 8 (w3): moved from the locked-card reset row to the
   Settings tab "Data & History" actions (same id, same rule); the
   class now rides on a .btn-ghost.danger button — no visual fight
   (see the patch-script header for the specificity note). */
.btn-reset-server { color:#f87171; border-color:color-mix(in srgb, #ef4444 60%, var(--border)); background:color-mix(in srgb, #ef4444 10%, transparent); }
.btn-reset-server.armed { color:#fff; background:#dc2626; border-color:#ef4444; }
/* FIX ROUND 2 §8: keep locked-card text clear of the fixed Telegram
   FAB (#tg-float: 46px wide at right:14px -> its left edge is
   390-14-46 = 330px at 390px viewport; card inner right edge is
   390-14-16 = 360px). 40px right padding ends text at 320px, 10px
   clear of the FAB at ANY scroll position. FIX ROUND 5: .lock-info
   no longer exists (replaced by the .lock-hero row), so it drops
   out of this selector list; the other three keep the padding.
   FIX ROUND 6: the reset row joins the list too, so the small
   buttons never slide under the FAB. FIX ROUND 8 (w3): the row
   is centred now (was right-aligned) and its buttons smaller. */
.locked-card .card-head, .locked-card .lock-actions, .locked-card .lock-meta-row, .locked-card .lock-reset-row { padding-right:40px; }
/* Tier / mode badges must not wrap mid-word (seen in user screenshot). */
.tier-badge, .mode-badge { white-space:nowrap; }

/* --- Mobile fit: tables scroll inside their card, never the page --- */
.table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-scroll > .data-table { min-width:340px; }
.table-scroll-md > .data-table { min-width:400px; }
.table-scroll-wide > .data-table { min-width:560px; }

/* --- Header reflow at phone width (brand + account on row 1,
       topnav on its own row; LIVE pill hidden to save space) --- */
@media (max-width:520px) {
  .app-header { flex-wrap:wrap; }
  .live-pill { display:none; }
  .topnav { order:3; flex-basis:100%; max-width:100%; margin-top:8px; }
}

/* ================================================================
   FIX ROUND 2 — 23 Nov 2026 (user bug list, screenshots 7:08–7:10pm)
   §7. Signal History (6 cols) FITS at 390px instead of scrolling.
   Evidence from the saved original bundle: the original does NOT
   fit either — its history tables are `rounded-xl overflow-x-auto`
   wrappers around `w-full text-[11px]` tables (panel-source
   index-HTNx67R_.js @~1126481, @~1129391), i.e. inner horizontal
   scroll, same as our fix-round-1 approach. The user explicitly
   wants FIT, so at <=520px the wide table drops its 560px
   min-width, switches to table-layout:fixed with percentage
   columns, and compacts cells/balls/pills. Desktop untouched
   (base 560px min-width + inner scroll stay). Below ~360px the
   .table-scroll-x:auto wrapper remains as a fallback so the page
   itself never scrolls horizontally.
   Width budget at 390px (FIX ROUND 3): card outer 390-2*14=362, inner
   362-2*16=330. Columns (fixed % of 330): PERIOD 13% (42.9) +
   GAME 12% (39.6) + SIGNAL 17% (56.1) + ACTUAL 17% (56.1)
   + STATUS 21% (69.3) + TIME 20% (66.0) = 100% / 330.0 exactly.
   At 9px headers ("PERIOD" ~33px, "SIGNAL" ~33px, "STATUS" ~33px)
   every header fits its column on one line with 1px cell padding,
   so PERIOD and GAME no longer run together; header text may wrap
   (white-space:normal) as a fallback below ~360px.
   ================================================================ */
@media (max-width:520px) {
  .table-scroll-wide > .data-table { min-width:0; width:100%; table-layout:fixed; }
  .table-scroll-wide .data-table th, .table-scroll-wide .data-table td { padding:6px 1px; font-size:11px; }
  .table-scroll-wide .data-table th { font-size:9px; letter-spacing:0; white-space:normal; overflow-wrap:break-word; }
  .table-scroll-wide .data-table th:nth-child(1), .table-scroll-wide .data-table td:nth-child(1) { width:13%; }
  .table-scroll-wide .data-table th:nth-child(2), .table-scroll-wide .data-table td:nth-child(2) { width:12%; line-height:1.25; }
  .table-scroll-wide .data-table th:nth-child(3), .table-scroll-wide .data-table td:nth-child(3) { width:17%; }
  .table-scroll-wide .data-table th:nth-child(4), .table-scroll-wide .data-table td:nth-child(4) { width:17%; }
  .table-scroll-wide .data-table th:nth-child(5), .table-scroll-wide .data-table td:nth-child(5) { width:21%; }
  .table-scroll-wide .data-table th:nth-child(6), .table-scroll-wide .data-table td:nth-child(6) { width:20%; }
  .table-scroll-wide .data-table .ball { width:20px; height:20px; font-size:10px; }
  .table-scroll-wide .ball-cell { gap:3px; }
  .table-scroll-wide .ball-size { font-size:10.5px; }
  .table-scroll-wide .status-pill { padding:3px 6px; font-size:10px; gap:2px; }
  .table-scroll-wide .hist-amt { font-size:10px; }
  .table-scroll-wide .hist-lvl { font-size:9.5px; }
  .table-scroll-wide .status-pill svg { width:10px; height:10px; }
  .table-scroll-wide .sureshot-badge { font-size:8px; padding:1px 5px; }
}

/* --- Settlement-modal auto-dismiss timer line (original behaviour):
       a thin ~3px gradient line flush with the card's bottom edge,
       draining as the 4s auto-dismiss timer runs (user override,
       fix round 2 — supersedes the ~15s live-audit value). FIX
       ROUND 3: the line is GREEN for every outcome
       (#34d399→#10b981, matching the Recent progress line). No
       numeric countdown anywhere. --- */
.modal-card { overflow:hidden; }
.modal-timer-line {
  position:absolute; left:0; bottom:0; height:3px; width:100%;
  transition:width 1s linear;
}
/* FIX ROUND 3: drain line is GREEN for ALL outcomes (win/jackpot/
   loss alike), matching the Recent progress line (#34d399→#10b981).
   The old win rainbow (yellow→green→blue) and loss
   (red→orange→yellow) gradients are gone. */
.modal-card .modal-timer-line {
  background:linear-gradient(90deg, #34d399, #10b981);
}

/* ================================================================
   FIX ROUND 2 — 23 Nov 2026 (modal only)
   - Auto-dismiss is now 4s (user override, asked twice), NOT the
     ~15s of the fix-round live audit. The stale "~15s" wording in
     the fix-round timer-line comment above is fixed as of this
     section (fix round 2 §6 pass). The 4s value lives in app.js
     (showWinModal + tickClocks).
   - Modal borders per outcome, border-only: the card body stays dark
     in every case — the padding-box layer is an opaque solid
     (var(--bg2) is a solid hex in every theme), so no colour wash
     ever reaches the content. Only the border layer animates; the
     card content (icon, text, button) is never animated.
   - WIN: RGB celebration rotating border, 3s (same rainbow + timing
     as the locked card). LOSS: RED-only rotating border, slower 6s.
     JACKPOT (incl. ULTRA_JACKPOT — same modal-jackpot class):
     multi-colour BLINKING rotating border — faster 1.2s rotation
     plus a 0.9s opacity blink that animates the ::before border ring
     ONLY, never the card content. The ring is a masked ::before
     (2px, content-box cut out), so it is border-only by construction.
   - Persistent celebration: .modal-sparkles twinkles for the whole
     modal lifetime on WIN/JACKPOT (JS hides it on LOSS / on close).
   ================================================================ */

/* FIX ROUND 3: WIN/LOSS modal borders 1px→4px (border-width sets
   the visible border under the border-box gradient technique).
   Base .modal-card stays 1px (rules modal unaffected). */
.modal-card.modal-win, .modal-card.modal-loss { border-width:4px; }

/* --- WIN: RGB celebration rotating border (locked-card rainbow, 3s) --- */
.modal-card.modal-win {
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box,
             conic-gradient(from var(--rgb-angle, 0deg), #ff004c, #ff8a00, #ffee00, #00e676, #00b0ff, #7c4dff, #ff004c) border-box;
  animation:rgb-rotate 3s linear infinite;
}

/* --- LOSS: RED-only rotating border, slower 6s (red hues only) --- */
.modal-card.modal-loss {
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box,
             conic-gradient(from var(--rgb-angle, 0deg), #ef4444, #f87171, #dc2626, #991b1b, #fca5a5, #b91c1c, #ef4444) border-box;
  animation:rgb-rotate 6s linear infinite;
}

/* --- JACKPOT: multi-colour BLINKING rotating border --- */
@keyframes modal-jackpot-blink { 0%, 100% { opacity:1; } 50% { opacity:.3; } }
.modal-card.modal-jackpot {
  /* Neutralise the old static gold border-box gradient: the animated
     ring below supplies the border, the body stays opaque dark. */
  background:linear-gradient(var(--bg2), var(--bg2)) padding-box;
  animation:none;
}
.modal-card.modal-jackpot::before {
  content:"";
  position:absolute; inset:0;
  border-radius:inherit;
  padding:4px;
  background:conic-gradient(from var(--rgb-angle, 0deg), #f59e0b, #fbbf24, #f472b6, #a78bfa, #34d399, #38bdf8, #f59e0b) border-box;
  -webkit-mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite:exclude;
  pointer-events:none;
  /* Fast rotation (1.2s vs WIN's 3s) + blink; both animate the ring
     only — opacity here touches just this ::before layer, never the
     card's icon, text or button. Without @property support the
     gradient stays static but the blink still runs. */
  animation:rgb-rotate 1.2s linear infinite, modal-jackpot-blink .9s ease-in-out infinite;
}

/* --- Persistent celebration stars (WIN/JACKPOT only, JS-gated) --- */
.modal-sparkles { display:none; }
.modal-sparkles:not([hidden]) {
  display:flex; justify-content:center; align-items:center; gap:20px;
  margin:0 0 10px;
}
.modal-sparkles svg { width:20px; height:20px; animation:modal-sparkle-twinkle 1.4s ease-in-out infinite; }
.modal-sparkles svg:nth-child(2) { width:26px; height:26px; animation-delay:.35s; }
.modal-sparkles svg:nth-child(3) { animation-delay:.7s; }
@keyframes modal-sparkle-twinkle {
  0%, 100% { transform:scale(1) rotate(0deg); opacity:1; }
  50% { transform:scale(.65) rotate(20deg); opacity:.55; }
}

/* 24/7 Server status indicator (panel-patch — server247.js). Lives just
   above the locked card. Live = green, offline = muted. Never blocks. */
.server247-status{font-size:12px;line-height:1.4;text-align:center;padding:6px 10px;margin:0 0 10px;border-radius:10px;letter-spacing:.02em}
.server247-status.server247-live{color:#34d399;background:rgba(52,211,153,.12)}
.server247-status.server247-offline{color:#9aa3af;background:rgba(148,163,184,.10)}
