/* Daily Chart Challenge. Same tokens as site.css, laid out for one-thumb use on a phone. */

:root {
  --bg: #08090c;
  --surface: #0f1217;
  --surface-2: #151920;
  --border: #1a1f27;
  --border-strong: #262c36;
  --text: #e8ebf0;
  --text-2: #b3b9c5;
  --muted: #858e9e;
  --accent: #33c6e3;
  --accent-hover: #52d4ec;
  --accent-ink: #04141a;
  --bull: #22c39a;
  --bear: #f0616d;
  --radius: 12px;
  --radius-sm: 7px;
  --font: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.app {
  max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; height: 60px; flex: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.streak { font-size: 13px; color: var(--text-2); padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; }
.streak b { color: var(--text); }
.chip {
  height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--muted); }

main { flex: 1; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--muted); }
.btn-lg { height: 52px; font-size: 16px; padding: 0 24px; }
.btn-block { width: 100%; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1 1 auto; }

/* Intro */
.intro { justify-content: center; gap: 18px; padding: 24px 0 48px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bull); box-shadow: 0 0 0 0 rgba(34, 195, 154, .5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 195, 154, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 195, 154, 0); } }
.intro h1 { margin: 0; font-size: clamp(44px, 13vw, 64px); line-height: 1; letter-spacing: -.035em; }
.sub { margin: 0; color: var(--text-2); font-size: 17px; max-width: 30em; }
.fine { margin: 0; color: var(--muted); font-size: 13px; }
.err { margin: 0; color: var(--bear); font-size: 14px; }

/* Game */
.game { gap: 12px; padding-bottom: 16px; }
.hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-2); min-height: 24px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--border-strong); }
.dots i.ok { background: var(--bull); }
.dots i.no { background: var(--bear); }
.dots i.cur { background: var(--muted); }
.chart-wrap {
  position: relative; flex: 1; min-height: 260px; max-height: 460px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.chart-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.meta { position: absolute; left: 12px; top: 10px; font-size: 11px; color: var(--muted); pointer-events: none; }
.verdict { margin: 0; min-height: 48px; font-size: 15px; color: var(--text-2); }
.verdict b { margin-right: 6px; }
.verdict .when { color: var(--muted); font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.verdict.ok b { color: var(--bull); }
.verdict.no b { color: var(--bear); }
.actions { display: flex; gap: 10px; }
.pick {
  flex: 1; height: 60px; border-radius: var(--radius); border: 1px solid; cursor: pointer;
  font-size: 18px; font-weight: 700; letter-spacing: .01em;
  transition: transform .1s ease, background-color .15s ease, opacity .15s ease;
}
.pick:active { transform: scale(.97); }
.pick.long { color: var(--bull); background: rgba(34, 195, 154, .1); border-color: rgba(34, 195, 154, .35); }
.pick.long:hover { background: rgba(34, 195, 154, .18); }
.pick.short { color: var(--bear); background: rgba(240, 97, 109, .1); border-color: rgba(240, 97, 109, .35); }
.pick.short:hover { background: rgba(240, 97, 109, .18); }
.pick:disabled { opacity: .45; cursor: default; }

/* Result */
.done { gap: 14px; padding: 12px 0 28px; }
.label { font-size: 12px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.score { font-size: 72px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
.score small { font-size: 32px; color: var(--muted); font-weight: 600; }
.grid { font-size: 26px; letter-spacing: 4px; line-height: 1; }
.done h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.streak-line { margin: 0; color: var(--text-2); font-size: 13px; }
.countdown { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.countdown b { color: var(--text); font-weight: 500; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.cta { margin-top: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.cta h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.cta p { margin: 0; color: var(--text-2); font-size: 14px; }

.foot { flex: none; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.foot a { color: var(--text-2); }

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  .btn, .pick { transition: none; }
}
