﻿:root {
  --bg: #0d1117;
  --panel: rgba(255, 255, 255, 0.06);
  --line: #00f2ff;
  --warn: #ff8c00;
  --pulse: #b347ff;
  --text: #e6edf3;
  --muted: #8b949e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, #123 0%, var(--bg) 40%);
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}
.app { max-width: 1024px; margin: 0 auto; padding: 16px 16px 120px; }
.topbar { display: flex; justify-content: space-between; align-items: center; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
h1 { margin: 0; letter-spacing: 0.5px; font-size: 24px; }
.btn-primary {
  background: linear-gradient(135deg, #0ff, #38f);
  color: #021;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.chart-wrap { position: relative; margin-top: 14px; border: 1px solid #1f2937; border-radius: 14px; overflow: hidden; }
#chart { height: 360px; }
.bonk-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 80% 70%, rgba(255, 140, 0, 0.18), transparent 45%);
  opacity: 0;
  transition: opacity 300ms;
}
.glass {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  backdrop-filter: blur(14px);
}
.scorecard { padding: 14px; }
.score-main { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.score-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(7, 15, 24, 0.28));
  padding: 12px;
}
.time-card {
  display: grid;
  align-content: center;
}
.strategy-card {
  position: relative;
  overflow: hidden;
}
.strategy-card::after {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.14), transparent 70%);
  pointer-events: none;
}
.label { color: var(--muted); margin: 0 0 8px; font-size: 12px; }
.big { margin: 0; font-size: 32px; color: var(--line); }
.strategy { margin: 0; color: #d8b4ff; font-size: 16px; }
.strategy-safe { color: #37d67a; }
.strategy-risk { color: #ffcc4d; }
.strategy-bonk { color: #ff6b6b; }
.strategy-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.strategy-meta {
  display: inline-flex;
  gap: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid transparent;
}
.pill-risk {
  color: #ffcc4d;
  border-color: rgba(255, 204, 77, 0.55);
  background: rgba(255, 204, 77, 0.14);
}
.pill-safe {
  color: #37d67a;
  border-color: rgba(55, 214, 122, 0.55);
  background: rgba(55, 214, 122, 0.14);
}
.pill-bonk {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.55);
  background: rgba(255, 107, 107, 0.14);
}
.pill-source {
  color: #6ee7ff;
  border-color: rgba(110, 231, 255, 0.5);
  background: rgba(0, 242, 255, 0.12);
}
.scan-tag {
  font-size: 10px;
  letter-spacing: 1px;
  color: #6ee7ff;
  text-transform: uppercase;
}
.strategy-warning {
  margin: 8px 0 0;
  font-size: 11px;
  color: #a9b8ca;
  border-left: 2px solid rgba(110, 231, 255, 0.55);
  padding-left: 8px;
}
.strategy-plans {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}
.strategy-plans p {
  margin: 0;
  font-size: 12px;
  color: #c3d5ec;
  line-height: 1.45;
  border: 1px solid rgba(78, 121, 155, 0.35);
  border-radius: 8px;
  background: rgba(12, 24, 36, 0.62);
  padding: 8px;
}
.coach-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6ee7ff;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.coach-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00f2ff;
  box-shadow: 0 0 10px #00f2ff, 0 0 24px rgba(0, 242, 255, 0.65);
  animation: coachPulse 1.05s ease-in-out infinite;
}
@keyframes coachPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.55; }
  50% { transform: scale(1.2); opacity: 1; }
}
.gel-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gel {
  border: 1px solid #5d2a88;
  background: rgba(179, 71, 255, 0.16);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}
.drawer {
  position: sticky;
  bottom: 8px;
  margin-top: 14px;
  background: #111821;
  border: 1px solid #273244;
  border-radius: 14px;
  overflow: hidden;
  transition: max-height 250ms cubic-bezier(0.2, 0.75, 0.25, 1), box-shadow 250ms ease;
  max-height: 54px;
}
.drawer.open { max-height: min(72vh, 460px); }
.drawer-top {
  border-bottom: 1px solid rgba(66, 90, 118, 0.45);
  background: #0f1a2a;
}
.handle {
  height: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.handle::after {
  content: "";
  width: 48px;
  height: 4px;
  border-radius: 999px;
  background: #3b4b63;
}
.drawer-conclusion {
  margin: 0;
  padding: 4px 12px 10px;
  color: #9ecae8;
  font-size: 12px;
  line-height: 1.45;
}
.drawer-conclusion.safe { color: #7df1ad; }
.drawer-conclusion.risk { color: #ffd56c; }
.drawer-conclusion.bonk { color: #ff8080; }
.drawer-body {
  padding: 8px 12px 18px;
  display: grid;
  gap: 10px;
  max-height: calc(min(72vh, 460px) - 64px);
  overflow-y: auto;
}
.drawer-section {
  display: grid;
  gap: 10px;
}
.drawer-section-title {
  margin: 2px 0 0;
  color: #7e8fa5;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.advanced-toggle {
  width: 100%;
  border: 1px solid #2c3d55;
  color: #84d8ff;
  background: rgba(8, 25, 40, 0.82);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.advanced-panel {
  display: none;
  border-top: 1px dashed rgba(87, 121, 158, 0.38);
  padding-top: 10px;
  gap: 10px;
}
.advanced-panel.open { display: grid; }
.control { display: grid; gap: 6px; }
.control label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.secondary {
  margin: 0;
  font-size: 11px;
  color: #6f7d90;
  letter-spacing: 0.2px;
}
input[type="range"] { accent-color: #00f2ff; }
progress { width: 100%; height: 10px; }
.gels div { display: flex; align-items: center; gap: 10px; }
.gels button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid #355; color: var(--line); background: #0f1724;
}
@media (max-width: 720px) {
  .app { padding: 12px 12px calc(72px + env(safe-area-inset-bottom)); }
  .topbar {
    align-items: flex-start;
    gap: 10px;
  }
  h1 {
    font-size: 18px;
    letter-spacing: 0.2px;
    white-space: nowrap;
  }
  .topbar-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
  .btn-primary {
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 12px;
  }
  .secondary { font-size: 10px; }
  .chart-wrap { margin-top: 10px; }
  #chart { height: 54vh; min-height: 320px; }
  .score-main { grid-template-columns: 1fr; }
  .scorecard { padding: 10px; }
  .big { font-size: 30px; }
  .drawer {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 60;
    margin-top: 0;
    max-height: none;
    height: calc(44px + env(safe-area-inset-bottom));
    border-radius: 16px;
    background: rgba(15, 23, 36, 0.98);
    border-color: rgba(58, 88, 122, 0.85);
    transition: height 240ms cubic-bezier(0.18, 0.82, 0.22, 1), box-shadow 240ms ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  }
  .drawer.dragging { transition: none; }
  .drawer[data-state="peek"] {
    height: calc(44px + env(safe-area-inset-bottom));
  }
  .drawer[data-state="half"] {
    height: min(56vh, 520px);
  }
  .drawer[data-state="full"] {
    height: min(88vh, 760px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.52);
  }
  .drawer-conclusion {
    padding-bottom: 9px;
    font-size: 11px;
  }
  .drawer-body {
    max-height: calc(100% - 56px);
    max-height: calc(100% - 56px - env(safe-area-inset-bottom));
    padding-bottom: 26px;
  }
  .drawer[data-state="peek"] .drawer-conclusion {
    opacity: 0;
    max-height: 0;
    padding: 0 12px;
    overflow: hidden;
  }
  .drawer[data-state="peek"] .drawer-body {
    opacity: 0;
    pointer-events: none;
  }
  .drawer[data-state="half"] .drawer-section-title,
  .drawer[data-state="half"] .advanced-toggle,
  .drawer[data-state="half"] .advanced-panel {
    display: none;
  }
  .drawer[data-state="half"] .drawer-body {
    padding-top: 10px;
  }
}
