:root {
  --bg: #05101f;
  --bg-2: #081a30;
  --glass: rgba(18, 38, 68, 0.55);
  --glass-2: rgba(13, 28, 51, 0.7);
  --line: rgba(80, 130, 210, 0.22);
  --line-strong: rgba(90, 150, 255, 0.45);
  --text: #eaf2ff;
  --muted: #8ea6cc;
  --blue: #2f8bff;
  --blue-2: #1763e6;
  --cyan: #28d8ff;
  --green: #18d18a;
  --green-2: #0fae72;
  --red: #ff4d5e;
  --gold: #ffc53d;
  --radius: 18px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh; overscroll-behavior: none;
}

/* Animated background */
.bg-fx { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-fx .blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; }
.bg-fx .b1 { width: 320px; height: 320px; background: radial-gradient(closest-side, #1763e6, transparent); top: -90px; left: -60px; animation: float1 14s ease-in-out infinite; }
.bg-fx .b2 { width: 300px; height: 300px; background: radial-gradient(closest-side, #28d8ff, transparent); bottom: -90px; right: -70px; opacity: .35; animation: float2 18s ease-in-out infinite; }
.bg-fx .grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(90,150,255,.06) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(90,150,255,.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 80%);
}
@keyframes float1 { 50% { transform: translate(40px, 50px); } }
@keyframes float2 { 50% { transform: translate(-40px, -40px); } }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 16px 16px 36px; min-height: 100vh; }

/* Screens */
.screen { display: none; animation: fade .3s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.center-col { min-height: 82vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; }
.muted { color: var(--muted); font-size: 15px; line-height: 1.5; }
.hidden { display: none !important; }
.accent { color: var(--cyan); }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-lg { flex-direction: column; gap: 14px; }
.brand-logo {
  display: grid; place-items: center;
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 13px; font-weight: 900; font-size: 18px; letter-spacing: -1px;
  color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 8px 22px rgba(47, 139, 255, .45);
}
.brand-lg .brand-logo { width: 64px; height: 64px; font-size: 24px; border-radius: 18px; }
h1, .brand h1 { font-size: 22px; font-weight: 800; margin: 0; letter-spacing: .3px; }
.brand-lg h1 { font-size: 28px; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.brand-name span { color: var(--cyan); }

/* Hero */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.hero { border-radius: 22px; padding: 16px 16px 12px; margin-bottom: 16px; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; margin: 4px 0 0; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(24,209,138,.6); animation: live 1.6s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(24,209,138,.5); } 70% { box-shadow: 0 0 0 8px rgba(24,209,138,0); } }
.balance-chip { text-align: right; }
.balance-chip .muted { font-size: 11px; display: block; }
.balance-chip b { color: var(--green); font-size: 16px; }

.hero-chart { width: 100%; height: 120px; display: block; margin: 12px 0 8px; }

/* Live stats */
.live-stats { display: flex; gap: 10px; margin: 4px 0 10px; }
.stat-pill {
  flex: 1; display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  border-radius: 14px; padding: 9px 12px;
}
.stat-pill .stat-ic { font-size: 17px; line-height: 1; }
.stat-pill .stat-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(24,209,138,.6); animation: live 1.6s infinite;
}
.stat-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.stat-txt b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.stat-txt small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

/* Ticker */
.ticker { display: flex; gap: 10px; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker-track { display: flex; gap: 10px; animation: tick 22s linear infinite; }
.tick-item { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--muted); }
.tick-item b { color: var(--text); }
.tick-item .up { color: var(--green); }
.tick-item .down { color: var(--red); }
@keyframes tick { to { transform: translateX(-50%); } }

.hero-sub { color: var(--muted); font-size: 13.5px; line-height: 1.6; margin: 0 2px 16px; }
.hero-sub b { color: var(--text); }

/* Signal mode cards */
.signal-modes { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.mode-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 16px; border-radius: var(--radius); cursor: pointer;
  border: 1px solid var(--line-strong); color: var(--text); text-align: left;
  background: linear-gradient(135deg, rgba(47,139,255,.16), rgba(23,99,230,.05));
  transition: transform .14s ease, box-shadow .25s;
}
.mode-card:active { transform: scale(.985); }
.mode-card .mode-ic { font-size: 26px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: rgba(47,139,255,.18); }
.mode-card .mode-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mode-card .mode-txt b { font-size: 17px; }
.mode-card .mode-txt span { font-size: 12.5px; color: var(--muted); }
.mode-card .mode-go { font-size: 26px; color: var(--muted); }
.mode-card.standard { box-shadow: 0 10px 26px rgba(23, 99, 230, .25); }
.mode-card.ultra {
  border-color: rgba(255,197,61,.5);
  background: linear-gradient(135deg, rgba(255,197,61,.18), rgba(47,139,255,.12));
  box-shadow: 0 12px 30px rgba(255, 197, 61, .22);
  overflow: hidden;
}
.mode-card.ultra::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transform: skewX(-20deg); animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.mode-card.ultra .mode-ic { background: rgba(255,197,61,.22); }
.ultra-badge {
  position: absolute; top: 10px; right: 12px; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; color: #241a00;
  background: linear-gradient(135deg, var(--gold), #ffdd7a); letter-spacing: .6px;
}

/* Buttons */
.actions { display: flex; flex-direction: column; gap: 12px; }
.actions-row { display: flex; gap: 12px; }
.actions-row .btn { flex: 1; }
.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--glass-2); color: var(--text);
  font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(180deg, var(--blue), var(--blue-2)); border-color: transparent; box-shadow: 0 10px 24px rgba(23,99,230,.4); }
.btn-success { background: linear-gradient(180deg, var(--green), var(--green-2)); border-color: transparent; box-shadow: 0 10px 24px rgba(15,174,114,.32); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-admin { background: var(--glass-2); border-color: var(--line-strong); }
.btn:disabled { opacity: .5; pointer-events: none; }

/* Topbar */
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.topbar h2 { font-size: 18px; margin: 0; flex: 1; }
.back {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--glass-2); color: var(--text);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.mode-pill {
  font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--cyan); white-space: nowrap;
}
.mode-pill.ultra { color: #241a00; background: linear-gradient(135deg, var(--gold), #ffdd7a); border-color: transparent; }

/* Card */
.card { border-radius: var(--radius); padding: 18px; font-size: 15px; line-height: 1.65; margin-bottom: 16px; }
.card a { color: var(--cyan); }
.card b { color: var(--text); }

/* Field */
.field { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.field label { color: var(--muted); font-size: 14px; }
.field input {
  width: 100%; padding: 15px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(5,16,31,.6); color: var(--text);
  font-size: 18px; letter-spacing: 1px; outline: none;
}
.field input:focus { border-color: var(--blue); }
.error { color: var(--red); font-size: 14px; margin: 4px 0 0; }

/* Language screen */
.lang-title { color: var(--muted); font-size: 15px; margin: 6px 0 8px; }
.lang-list { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
.lang-btn {
  padding: 16px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--glass); color: var(--text); font-size: 17px; font-weight: 600; cursor: pointer;
  transition: transform .12s ease, border-color .2s; backdrop-filter: blur(10px);
}
.lang-btn:active { transform: scale(.98); }
.lang-btn:hover { border-color: var(--blue); }

/* Pairs grid */
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-cell {
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 10px; font-size: 14px; font-weight: 700; text-align: center; cursor: pointer;
  transition: transform .12s ease, border-color .2s; backdrop-filter: blur(8px);
}
.pair-cell .otc { display: block; font-size: 11px; color: var(--muted); font-weight: 600; margin-top: 3px; }
.pair-cell .spark { display: block; height: 18px; margin-top: 6px; }
.pair-cell:active { transform: scale(.97); }
.pair-cell:hover { border-color: var(--blue); }

/* Expiration */
.selected-pair { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 16px; color: var(--cyan); }
.exp-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.exp-cell {
  background: var(--glass); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 10px; font-size: 18px; font-weight: 700; text-align: center; cursor: pointer;
  transition: transform .12s ease, border-color .2s; backdrop-filter: blur(8px);
}
.exp-cell:active { transform: scale(.97); }
.exp-cell:hover { border-color: var(--blue); }

/* Loader / analyzer */
.loader { position: relative; width: 88px; height: 88px; display: grid; place-items: center; }
.loader-ring { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--blue); border-right-color: var(--cyan); animation: spin 1s linear infinite; }
.loader-mark { font-weight: 900; font-size: 24px; color: #fff; letter-spacing: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.analysis-wrap { padding-top: 8px; }
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.analysis-pair { font-weight: 800; color: var(--cyan); font-size: 16px; }
.analysis-chart { width: 100%; height: 160px; display: block; border-radius: 16px; border: 1px solid var(--line); background: rgba(5,16,31,.4); margin-bottom: 20px; }
.analyzer { position: relative; width: 120px; height: 120px; margin: 0 auto; display: grid; place-items: center; }
.analyzer-ring { position: absolute; inset: 0; width: 120px; height: 120px; border-radius: 50%; border: 6px solid var(--line); border-top-color: var(--blue); border-right-color: var(--cyan); animation: spin 1s linear infinite; }
.analyzer-count { font-size: 40px; font-weight: 800; }
.analysis-step { text-align: center; font-size: 16px; color: var(--text); min-height: 24px; margin-top: 16px; }
.analysis-bars { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.analysis-bars i { width: 6px; height: 22px; border-radius: 4px; background: var(--line); animation: eq 1s ease-in-out infinite; }
.analysis-bars i:nth-child(2) { animation-delay: .1s; } .analysis-bars i:nth-child(3) { animation-delay: .2s; }
.analysis-bars i:nth-child(4) { animation-delay: .3s; } .analysis-bars i:nth-child(5) { animation-delay: .4s; }
@keyframes eq { 0%,100% { transform: scaleY(.4); background: var(--line); } 50% { transform: scaleY(1.3); background: var(--blue); } }

.pulse-ring {
  width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; font-size: 42px;
  background: radial-gradient(closest-side, rgba(47,139,255,.3), transparent); animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.big-emoji { font-size: 64px; }

/* Signal card */
.signal-card { position: relative; border-radius: 22px; padding: 24px 18px; text-align: center; margin-bottom: 18px; overflow: hidden; }
.signal-card.up { border-color: rgba(24,209,138,.5); box-shadow: 0 16px 40px rgba(24,209,138,.2); }
.signal-card.down { border-color: rgba(255,77,94,.5); box-shadow: 0 16px 40px rgba(255,77,94,.2); }
.signal-card.up::before, .signal-card.down::before { content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none; }
.signal-card.up::before { background: radial-gradient(120% 80% at 50% 0%, var(--green), transparent); }
.signal-card.down::before { background: radial-gradient(120% 80% at 50% 0%, var(--red), transparent); }
.signal-mode-badge { position: absolute; top: 14px; left: 14px; font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; color: #241a00; background: linear-gradient(135deg, var(--gold), #ffdd7a); }
.signal-arrow { font-size: 60px; line-height: 1; position: relative; }
.signal-head { font-size: 22px; font-weight: 800; margin: 6px 0 14px; position: relative; }
.signal-card.up .signal-head { color: var(--green); }
.signal-card.down .signal-head { color: var(--red); }
.signal-chart { width: 100%; height: 96px; display: block; margin-bottom: 16px; position: relative; }
.signal-rows { display: flex; flex-direction: column; gap: 10px; text-align: left; position: relative; }
.signal-row { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.signal-row .k { color: var(--muted); } .signal-row .v { font-weight: 700; }
.prob-wrap { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.prob-top { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 8px; }
.prob-top .k { color: var(--muted); } .prob-top .v { font-weight: 800; color: var(--gold); }
.prob-bar { height: 9px; border-radius: 6px; background: rgba(5,16,31,.7); overflow: hidden; }
.prob-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold)); }

/* ULTRA cooldown timer on card */
.ultra-timer { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; color: var(--gold); background: rgba(0,0,0,.3); border-radius: 999px; padding: 3px 9px; }
.ultra-timer .lock { font-size: 11px; }
.mode-card.ultra.locked { filter: grayscale(.25) brightness(.92); }
.mode-card.ultra.locked .mode-go { display: none; }

/* Nav grid */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 16px; }
.nav-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; border-radius: var(--radius); cursor: pointer; color: var(--text);
  border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px);
  transition: transform .12s ease, border-color .2s;
}
.nav-card:active { transform: scale(.97); }
.nav-card:hover { border-color: var(--blue); }
.nav-ic { font-size: 28px; }
.nav-label { font-size: 14px; font-weight: 700; }
.nav-tag { position: absolute; top: 10px; right: 10px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: linear-gradient(135deg, var(--gold), #ffdd7a); color: #241a00; font-size: 12px; font-weight: 800; display: grid; place-items: center; }

/* ULTRA analysis FX */
.ultra-fx { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); }
.analysis-wrap.ultra { animation: ultraPulse 1.1s ease-in-out infinite; }
.analysis-wrap.ultra .analyzer-ring { border-top-color: var(--gold); border-right-color: #ff7ad9; box-shadow: 0 0 24px rgba(255,197,61,.5); }
.analysis-wrap.ultra .analyzer-count { color: var(--gold); text-shadow: 0 0 14px rgba(255,197,61,.7); animation: glitch .25s steps(2) infinite; }
.analysis-wrap.ultra .analysis-step { color: #ffe7a3; text-shadow: 0 0 10px rgba(255,197,61,.4); }
.analysis-wrap.ultra .analysis-chart { border-color: rgba(255,197,61,.4); box-shadow: 0 0 30px rgba(255,197,61,.18) inset; }
.analysis-wrap.ultra .analysis-bars i { animation-duration: .5s; }
@keyframes ultraPulse { 50% { transform: scale(1.012); } }
@keyframes glitch { 0% { transform: translate(0,0); } 50% { transform: translate(-1px,1px); } 100% { transform: translate(1px,-1px); } }

/* Contests */
.contest-card { position: relative; border-radius: 20px; padding: 18px; margin-bottom: 16px; overflow: hidden; }
.contest-glow { position: absolute; inset: -50% 30% auto; height: 180px; background: radial-gradient(closest-side, rgba(255,197,61,.4), transparent); filter: blur(20px); }
.contest-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.contest-badge { font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--red); color: #fff; letter-spacing: .5px; animation: live 1.6s infinite; }
.contest-timer { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--cyan); font-size: 15px; }
.contest-card h3 { margin: 12px 0 6px; font-size: 19px; position: relative; }
.contest-prize { display: flex; align-items: baseline; gap: 8px; position: relative; }
.contest-prize span { font-size: 34px; font-weight: 900; background: linear-gradient(135deg, var(--gold), #ffe9a8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.contest-prize small { color: var(--muted); font-size: 12px; }
.contest-desc { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 12px 0 0; position: relative; }

.lb-me { display: flex; align-items: center; justify-content: space-between; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; border-color: var(--line-strong); }
.lb-me .me-rank { font-weight: 900; font-size: 18px; color: var(--cyan); }
.lb-me .me-info { flex: 1; margin-left: 12px; }
.lb-me .me-info b { display: block; }
.lb-me .me-info small { color: var(--muted); }
.lb-title { font-size: 16px; margin: 0 0 10px; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); }
.lb-row.me { border-color: var(--gold); background: linear-gradient(90deg, rgba(255,197,61,.12), transparent); }
.lb-rank { width: 28px; text-align: center; font-weight: 800; color: var(--muted); }
.lb-rank.top { font-size: 18px; }
.lb-name { flex: 1; font-weight: 600; font-size: 14px; }
.lb-count { font-weight: 800; color: var(--cyan); font-size: 14px; }
.lb-count small { color: var(--muted); font-weight: 600; font-size: 11px; }

/* Promo */
.promo-hero { border-radius: 20px; padding: 22px; text-align: center; margin-bottom: 16px; }
.promo-emoji { font-size: 52px; }
.promo-hero p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 10px 0 14px; }
.spins-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); }
.spins-chip span { color: var(--muted); font-size: 13px; }
.spins-chip b { font-size: 20px; color: var(--gold); }
.promo-msg { font-size: 14px; margin: 4px 0 0; }
.promo-msg.ok { color: var(--green); } .promo-msg.err { color: var(--red); }

/* Wheel */
.wheel-stage { position: relative; width: 300px; max-width: 86vw; aspect-ratio: 1; margin: 10px auto 18px; }
.wheel-canvas { width: 100%; height: 100%; display: block; filter: drop-shadow(0 12px 30px rgba(0,0,0,.5)); }
.wheel-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2; width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 24px solid var(--gold); filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.wheel-prize { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 14px; min-height: 28px; }
.wheel-prize.win { color: var(--gold); text-shadow: 0 0 14px rgba(255,197,61,.5); animation: popIn .4s ease; }
@keyframes popIn { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
