:root {
  --bg: #070a17;
  --card: rgba(19, 25, 46, 0.62);
  --card-border: rgba(255, 255, 255, 0.08);
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #ec4899;
  --green: #34f5a5;
  --red: #ff4d6d;
  --amber: #ffc65c;
  --text: #eef2ff;
  --muted: #8d97c2;
  --grad: linear-gradient(135deg, #22d3ee, #8b5cf6 55%, #ec4899);
  --glow: 0 0 26px rgba(139, 92, 246, 0.45);
}

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

html, body { height: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.flame { fill: currentColor; stroke: none; }

/* Animated background orbs */
.bg-orbs { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.35; }
.orb-a { width: 340px; height: 340px; background: var(--cyan); top: -110px; left: -80px; animation: drift 14s ease-in-out infinite; }
.orb-b { width: 380px; height: 380px; background: var(--violet); bottom: -140px; right: -120px; animation: drift 18s ease-in-out infinite reverse; }
.orb-c { width: 260px; height: 260px; background: var(--magenta); top: 40%; left: 55%; opacity: 0.2; animation: drift 21s ease-in-out infinite; }

@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.12); }
  66% { transform: translate(-30px, 24px) scale(0.94); }
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 12px;
}

.status-icons { display: flex; align-items: center; gap: 8px; }

.si { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.net-pill, .bat-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--cyan);
}

.bat-pill { background: rgba(52, 245, 165, 0.12); border-color: rgba(52, 245, 165, 0.35); color: var(--green); }
.bat-pill.low { color: var(--red); border-color: rgba(255, 77, 109, 0.45); background: rgba(255, 77, 109, 0.14); }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.brand { display: flex; align-items: center; gap: 12px; }

.logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
  animation: pulseLogo 2.6s ease-in-out infinite;
  flex-shrink: 0;
}

.logo-bolt { width: 24px; height: 24px; fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,0.7)); }

@keyframes pulseLogo {
  0%, 100% { transform: scale(1); box-shadow: 0 0 18px rgba(139,92,246,0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 34px rgba(236,72,153,0.6); }
}

.brand-text h1 { font-size: 20px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-text p { font-size: 11px; color: var(--muted); }

.settings-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s, color 0.25s, border-color 0.25s;
}
.settings-btn:active { transform: rotate(90deg) scale(0.9); color: var(--cyan); border-color: rgba(34,211,238,0.4); }

/* Hero / radar */
.hero { text-align: center; margin: 4px 0 18px; position: relative; }

.radar {
  position: relative;
  width: 172px;
  height: 172px;
  margin: 0 auto 14px;
}

.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(139, 92, 246, 0.3);
}
.r1 { inset: 0; animation: spin 6s linear infinite; border-top-color: var(--cyan); border-right-color: rgba(139,92,246,0.6); }
.r2 { inset: 18px; border-style: dashed; animation: spin 9s linear infinite reverse; border-color: rgba(34, 211, 238, 0.32); }
.r3 { inset: 36px; animation: spin 12s linear infinite; border-color: rgba(236, 72, 153, 0.35); }

@keyframes spin { to { transform: rotate(360deg); } }

.radar-sweep {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(34,211,238,0.34), rgba(139,92,246,0.1), transparent 28%);
  animation: sweep 2.2s linear infinite;
}

@keyframes sweep { to { transform: rotate(360deg); } }

.radar-core {
  position: absolute;
  inset: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1c2447, #0d1226 75%);
  border: 2px solid rgba(139, 92, 246, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 22px rgba(139,92,246,0.25), var(--glow);
}

.radar-core span {
  font-size: 30px;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.radar-core small { font-size: 10px; color: var(--muted); letter-spacing: 2px; }

.scan-title { font-size: 16px; font-weight: 700; }
.scan-status { font-size: 12px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.scan-status.ok { color: var(--green); }
.scan-status.scanning { color: var(--cyan); animation: blink 0.7s ease-in-out infinite alternate; }

@keyframes blink { to { opacity: 0.35; } }

.fps-pill {
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(52, 245, 165, 0.12);
  border: 1px solid rgba(52, 245, 165, 0.4);
  color: var(--green);
  letter-spacing: 0.5px;
}

/* Boost button */
.boost-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 18px;
  background: var(--grad);
  background-size: 200% 200%;
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.15s;
  animation: breathe 2.6s ease-in-out infinite, gradShift 6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 16px rgba(139,92,246,0.35); }
  50% { box-shadow: 0 0 42px rgba(236,72,153,0.6); }
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.boost-btn:active { transform: scale(0.96); }

.boost-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shine 3s ease-in-out infinite;
}

@keyframes shine { 0% { left: -80%; } 55%, 100% { left: 130%; } }

.boost-icon { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 0 6px rgba(255,255,255,0.6)); }
.boost-text { font-weight: 800; font-size: 17px; letter-spacing: 2px; text-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.boost-sub { font-size: 11px; opacity: 0.9; }

.boost-btn.boosting .boost-icon { animation: rocket 0.55s ease-in-out infinite; }

@keyframes rocket {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-6px) rotate(-12deg); }
}

/* Stats */
.stats-row { display: flex; gap: 10px; margin: 16px 0 12px; }

.stat-card {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.stat-ico { width: 18px; height: 18px; fill: none; stroke: var(--cyan); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.stat-card:nth-child(2) .stat-ico { stroke: var(--violet); }
.stat-card:nth-child(3) .stat-ico { stroke: var(--magenta); }

.stat-label { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.stat-value { font-size: 20px; font-weight: 800; margin: 2px 0 8px; }

.bar {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
}

.bar .fill { height: 100%; border-radius: 4px; transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1), background 0.5s; }
.fill.ram { width: 64%; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.fill.cpu { width: 42%; background: linear-gradient(90deg, var(--green), var(--cyan)); }
.fill.temp { width: 38%; background: linear-gradient(90deg, var(--cyan), var(--green)); }

/* Device strip */
.device-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.d-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.d-ico { width: 16px; height: 16px; fill: none; stroke: var(--violet); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Sections */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 14px 2px 10px;
}

.chip {
  font-size: 10px;
  background: linear-gradient(135deg, rgba(34,211,238,0.16), rgba(139,92,246,0.16));
  color: var(--cyan);
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(34,211,238,0.4);
}

.chip.offline { color: var(--green); border-color: rgba(52,245,165,0.4); background: rgba(52,245,165,0.1); }
.chip.offline.off { color: var(--red); border-color: rgba(255,77,109,0.45); background: rgba(255,77,109,0.12); }

/* Options */
.options-list {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}
.option:last-child { border-bottom: none; }
.option:active { background: rgba(255,255,255,0.04); }

.opt-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.option.active .opt-icon {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 0 16px rgba(139,92,246,0.4);
}

.opt-info { flex: 1; display: flex; flex-direction: column; }
.opt-name { font-size: 14px; font-weight: 600; }
.opt-desc { font-size: 11px; color: var(--muted); }

/* Toggle */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { display: none; }

.slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  left: 3px; top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.switch input:checked + .slider {
  background: var(--grad);
  box-shadow: 0 0 14px rgba(139,92,246,0.5);
}
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Game card */
.game-card {
  background: linear-gradient(135deg, rgba(236,72,153,0.12), rgba(139,92,246,0.12));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 16px;
  padding: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.game-info { display: flex; align-items: center; gap: 12px; }

.game-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flame 1.8s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(236,72,153,0.45);
}

@keyframes flame {
  0%, 100% { transform: scale(1) rotate(-3deg); filter: brightness(1); }
  50% { transform: scale(1.07) rotate(3deg); filter: brightness(1.25); }
}

.game-name { font-size: 15px; font-weight: 700; display: block; }
.game-desc { font-size: 11px; color: var(--muted); }

.game-badges { display: flex; gap: 8px; margin: 10px 0 12px; }

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}
.badge.hot {
  background: var(--grad);
  color: #fff;
  animation: breathe 2s ease-in-out infinite;
}

.play-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 14px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: var(--glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, filter 0.2s;
}
.play-btn:active { transform: scale(0.95); filter: brightness(1.1); }

.play-ico { width: 18px; height: 18px; fill: #fff; }

/* Install card */
.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(52, 245, 165, 0.08);
  border: 1px solid rgba(52, 245, 165, 0.3);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 14px;
}

.install-text { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--green); }

.install-btn {
  border: none;
  background: var(--green);
  color: #052016;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.install-btn:active { transform: scale(0.94); }

/* Footer */
.footer {
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 22px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: rgba(16, 22, 42, 0.95);
  border: 1px solid rgba(139,92,246,0.6);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--glow);
  z-index: 50;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 88%;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
