:root {
  --bg: #070d1c;
  --bg2: #0a1228;
  --panel: #101a33;
  --panel2: #152040;
  --lime: #b8ff2e;
  --lime2: #7fd914;
  --ink: #e8f0ff;
  --muted: #8a9bb8;
  --danger: #ff5c7a;
  --line: rgba(184, 255, 46, 0.22);
  --glow: 0 0 28px rgba(184, 255, 46, 0.28);
  --radius: 18px;
  --dock-h: 74px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Trebuchet MS", "Segoe UI", sans-serif;
  --display: "Arial Black", "Arial Narrow", Impact, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(120% 80% at 10% -10%, #16305a 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 0%, #1a3a18 0%, transparent 45%),
    linear-gradient(165deg, #0c1530 0%, var(--bg) 48%, #050914 100%);
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 12px 14px calc(var(--dock-h) + var(--safe-b) + 18px);
  position: relative;
  overflow: hidden;
}

.bolt-slash {
  position: absolute;
  inset: -20% -30% auto auto;
  width: 70%;
  height: 40%;
  background: linear-gradient(125deg, transparent 40%, rgba(184,255,46,0.08), transparent 62%);
  transform: rotate(-18deg);
  pointer-events: none;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.brand-mark {
  width: 52px;
  height: 52px;
  filter: drop-shadow(var(--glow));
}
.brand-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff, var(--lime));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-copy p { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; }

.screen { display: none; animation: rise 0.28s ease; }
.screen.active { display: block; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero-bolt {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(184,255,46,0.12), transparent 55%),
    var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.hero-art { width: 88px; height: 88px; object-fit: contain; }
.eyebrow {
  margin: 0 0 4px;
  color: var(--lime);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.hero-bolt h2, .screen-title {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.muted { color: var(--muted); font-size: 0.88rem; line-height: 1.35; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  padding: 12px;
  border-radius: 14px;
  background: var(--panel2);
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--lime), transparent);
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.25rem;
  color: var(--lime);
}
.stat span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.panel {
  background: linear-gradient(180deg, #152040, #0e1730);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.panel.slash {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.panel-head h3, .panel h3 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--display);
}

.text-btn {
  color: var(--lime);
  font-size: 0.8rem;
  font-weight: 700;
}
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed.tall { max-height: 52vh; overflow: auto; }

.card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(184,255,46,0.12);
  text-align: left;
  width: 100%;
}
.card:active { transform: scale(0.99); }
.card .title { font-weight: 700; }
.card .meta { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; }
.card .badge {
  align-self: start;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(184,255,46,0.15);
  color: var(--lime);
  font-weight: 700;
  text-transform: uppercase;
}
.card.empty, .target-card.empty {
  color: var(--muted);
  font-size: 0.88rem;
}
.target-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(184,255,46,0.08);
  border: 1px dashed var(--line);
  margin-bottom: 12px;
}
.target-card strong { display: block; margin-bottom: 4px; color: var(--lime); }

.primary-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--lime), var(--lime2));
  color: #081018;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: var(--glow);
  margin-top: 4px;
}
.primary-cta img { width: 28px; height: 28px; }
.primary-cta.solid { display: inline-flex; }
.primary-cta.small { padding: 10px 14px; width: auto; font-size: 0.85rem; }

.log-form { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.log-form.hidden, .hidden { display: none !important; }
.log-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.log-form input, .log-form textarea, .search-wrap input {
  width: 100%;
  border: 1px solid rgba(184,255,46,0.18);
  background: #0a1224;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
}
.log-form textarea { resize: vertical; min-height: 64px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend {
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #0c152c;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.chip.active {
  background: rgba(184,255,46,0.16);
  border-color: var(--lime);
  color: var(--lime);
}

.bars { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 72px 1fr 36px; gap: 8px; align-items: center; font-size: 0.78rem; }
.bar-track {
  height: 8px;
  border-radius: 999px;
  background: #0a1224;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lime2), var(--lime));
  border-radius: inherit;
}

.pulse-arena {
  height: 180px;
  margin: 10px 0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 55%, rgba(184,255,46,0.12), transparent 55%),
    #070d1c;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.pulse-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  opacity: 0.25;
  transform: scale(0.85);
  transition: opacity 0.05s, transform 0.08s, box-shadow 0.08s;
}
.pulse-btn img { width: 84px; height: 84px; }
.pulse-btn.lit {
  opacity: 1;
  transform: scale(1);
  box-shadow: var(--glow);
}
.pulse-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ghost-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink);
  font-weight: 700;
}
.ghost-btn.danger { border-color: rgba(255,92,122,0.45); color: var(--danger); }

.bolt-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + var(--safe-b));
  background: linear-gradient(180deg, rgba(10,18,40,0.92), #070d1c);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  z-index: 20;
}
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.dock-item img { width: 26px; height: 26px; opacity: 0.65; }
.dock-item.active { color: var(--lime); }
.dock-item.active img {
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(184,255,46,0.55));
}

.level-low { color: #9ad4ff; }
.level-mid { color: var(--lime); }
.level-high { color: #ffb347; }
