:root {
  --bg: #0c0e12;
  --panel: #14181f;
  --line: #2a3140;
  --text: #f2f4f7;
  --muted: #8b95a5;
  --daily: #3ddc97;
  --weekly: #5b8cff;
  --lottery: #e8b84a;
  --current: #f2f4f7;
  --high: #ff6b6b;
  --elevated: #e8b84a;
  --low: #3ddc97;
  --btn: #1b212c;
  --btn-on: #263042;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.risk-line {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}
.risk-line .name { color: var(--muted); font-weight: 550; margin-right: 4px; }
.risk-high { color: var(--high); }
.risk-elevated { color: var(--elevated); }
.risk-low { color: var(--low); }
.risk-missing { color: var(--lottery); }
.risk-line .when { color: var(--muted); font-weight: 450; font-size: 14px; }

.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 8px;
}
.tokens button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.tokens button:hover { border-color: #4a5568; }
.tokens button[aria-current="true"] {
  background: var(--btn-on);
  border-color: #6b7c94;
}
.tokens .dist { color: var(--muted); font-weight: 500; margin-left: 6px; }
.tokens button[aria-current="true"] .dist { color: #c5d0dc; }

main { padding: 8px 20px 24px; flex: 1; display: flex; flex-direction: column; }
.chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.chart-title { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 32px; letter-spacing: -0.03em; }
.price { font-size: 28px; font-variant-numeric: tabular-nums; font-weight: 600; }
.miss {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: rgba(232, 184, 74, 0.15);
  color: var(--lottery);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.details-btn {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.details-btn:hover, .details-btn[aria-expanded="true"] { color: var(--text); border-color: #4a5568; }

.details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  max-width: 90ch;
}
.details h2 { margin: 12px 0 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); }
.details h2:first-child { margin-top: 0; }
.details p { margin: 0 0 6px; }
.details .miss-block { color: var(--lottery); }

.chart-wrap {
  position: relative;
  flex: 1;
  min-height: 520px;
  height: calc(100vh - 230px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
#chart { position: absolute; inset: 0; }
.chart-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--lottery);
  font-weight: 650;
  background: var(--panel);
}
.hint { margin: 8px 2px 0; color: var(--muted); font-size: 13px; }
footer { padding: 8px 20px 16px; color: var(--muted); font-size: 13px; }

@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .price { font-size: 22px; }
  .chart-wrap { min-height: 420px; height: calc(100vh - 280px); }
}
