:root {
  color-scheme: dark;
  --bg: #000;
  --text: #fff;
  --secondary: rgba(235, 235, 245, 0.6);
  --tertiary: rgba(235, 235, 245, 0.3);
  --sep: rgba(84, 84, 88, 0.55);
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --green: #00d35a;
  --red: #ff453a;
  --orange: #ff9f0a;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --yellow: #ffd60a;
  --pink: #ff6b9a;
  --purple: #bf5af2;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
body {
  padding: calc(8px + env(safe-area-inset-top)) 16px calc(72px + env(safe-area-inset-bottom));
}
button, input, a { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; }
.num { font-variant-numeric: tabular-nums; }
h1, h2 { font-weight: 600; letter-spacing: 0; }
h1 { font-size: 28px; margin: 12px 0; }
h2 { font-size: 20px; margin: 22px 0 10px; }
.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.avatar, .bell, .title {
  min-width: 44px;
  min-height: 44px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-2);
  display: grid;
  place-items: center;
}
.title { font-size: 17px; font-weight: 600; text-align: left; white-space: nowrap; }
.search {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  border-radius: 10px;
  border: 0;
  background: var(--card);
  padding: 0 12px;
  color: var(--text);
}
.bell { margin-left: auto; width: 44px; }
.bell-mark {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  border: 1.5px solid var(--text);
  border-radius: 8px 8px 6px 6px;
}
.balance-row, .subrow, .row { display: flex; align-items: center; gap: 10px; }
.balance {
  display: flex;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: 72px;
  line-height: 1;
  font-weight: 600;
  margin: 8px 0;
}
.digit { display: inline-block; }
.digit.roll { animation: roll 600ms ease-out; }
@keyframes roll {
  from { transform: translateY(0.35em); opacity: 0.35; }
  to { transform: translateY(0); opacity: 1; }
}
.pill {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
}
.pill.paper { background: var(--orange); color: #000; }
.pill.stop { background: var(--red); color: #fff; }
.pill.trail { background: var(--green); color: #000; }
.pill-row { display: flex; gap: 6px; margin-top: 8px; }
.today { color: var(--secondary); }
.books { display: grid; gap: 10px; }
.book { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.roi.up { color: var(--green); }
.roi.down { color: var(--red); }
.today.up { color: var(--green); }
.today.down { color: var(--red); }
.mult {
  margin-left: auto;
  background: var(--green);
  color: #000;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 600;
}
.ranges { display: flex; gap: 6px; margin: 8px 0 4px; }
.ranges button, .tabs button {
  min-height: 44px;
  min-width: 44px;
  color: var(--secondary);
}
.ranges button.on, .tabs button.on { color: var(--text); }
#chart { width: 100%; height: 180px; display: block; }
.card { background: var(--card); border-radius: 22px; }
.live { position: relative; margin-top: 8px; overflow: hidden; }
.live-frame { position: relative; aspect-ratio: 16 / 9; background: var(--card-2); overflow: hidden; }
.live-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live-top {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tertiary); }
.dot.live { background: var(--red); }
.lane { margin-left: auto; color: var(--secondary); }
.bell { position: relative; }
.alert-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
}
#search-results {
  background: var(--card);
  border-radius: 12px;
  margin-top: 8px;
}
#search-results .quiet { display: block; padding: 10px 12px; }
button:disabled { opacity: 0.45; }
#search-results button, #search-results a {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 44px;
  padding: 10px 12px;
  text-decoration: none;
}
.act {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--sep);
}
#stage {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #000;
  overflow: auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));
}
#stage[hidden] { display: none; }
#stage-img { width: 100%; height: auto; touch-action: pinch-zoom; }
#sell-sheet[hidden] { display: none; }
.set input[type="range"] { padding: 0; background: transparent; }
.quiet, .empty { color: var(--secondary); }
.bot-row, #bot-list { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; }
.bot-card {
  scroll-snap-align: start;
  min-width: 220px;
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
}
#bot-list { flex-direction: column; overflow: visible; }
#bot-list .bot-card { min-width: 0; }
.bot-card h3 { margin: 0 0 6px; font-size: 17px; }
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--sep);
  padding-bottom: env(safe-area-inset-bottom);
}
.pad { padding: 16px; }
.field, .set { display: block; margin: 12px 0; color: var(--secondary); font-size: 13px; }
.field input, .set input {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--card-2);
  padding: 0 12px;
  color: var(--text);
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 8px 0;
  border-radius: 12px;
  background: var(--card-2);
  text-decoration: none;
}
.error {
  background: var(--red);
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
#signin { display: flex; gap: 8px; margin-bottom: 8px; }
#signin[hidden] { display: none; }
#signin input { flex: 1; min-width: 0; background: var(--card); color: var(--text); border: 0; border-radius: 12px; padding: 10px 12px; }
#signin button { border: 0; border-radius: 12px; padding: 10px 12px; background: var(--green); color: #04140a; }
.discs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.disc {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  padding: 8px;
}
.disc.ok { color: var(--green); }
.disc.bad { color: var(--red); }
.disc.wait { color: var(--tertiary); }
.beam { height: 2px; background: var(--cyan); margin: 8px 0; }
.report { white-space: pre-wrap; color: var(--secondary); font-size: 13px; }
.skeleton { color: transparent; background: var(--card); border-radius: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  .digit.roll { animation: none; }
}
