/* bajk visual system — "instrument panel for dirt".
   Warm humus-dark chassis; chalk text; color is reserved for data (scores,
   grip, difficulty, weather). Dashed strokes = tire tread, used only where
   they mark state: brand dot, active nav, best day, keyboard focus.
   All pairs validated ≥ WCAG AA (text 4.5:1, non-text 3:1) on their bg. */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #12100c;        /* deep humus */
  --card: #1c1914;      /* loam */
  --raised: #262117;
  --border: #2e2a21;    /* dry twig */
  --track: #2a251c;     /* unfilled gauge ring */
  --text: #ece7db;      /* karst chalk */
  --muted: #a49b86;
  --amber: #e2a13d;     /* brand hub — brand dot + active nav only */
  --warn: #f0b429;
  --radius: 14px;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100dvh; display: flex; flex-direction: column;
  font-variant-numeric: tabular-nums;
}

:focus-visible { outline: 2px dashed var(--text); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── chrome ─────────────────────────────────────────── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 56px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.brand {
  font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.brand::after {
  content: ''; display: inline-block; width: 7px; height: 7px;
  border: 2px dashed var(--amber); border-radius: 50%;
  margin-left: 4px; vertical-align: super;
}
.lang-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 6px 12px; font-weight: 700; font-size: 0.85rem;
  letter-spacing: 0.06em; cursor: pointer;
}
main { flex: 1; padding: 14px; max-width: 640px; width: 100%; margin: 0 auto; }
.bottom-nav {
  display: flex; height: 58px; border-top: 1px solid var(--border);
  background: var(--bg); position: sticky; bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 0.8rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  border-top: 2px solid transparent; margin-top: -1px;
}
.nav-btn.active { color: var(--text); border-top: 2px dashed var(--amber); }

/* ── shared ─────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.muted { color: var(--muted); }
.small { font-size: 0.78rem; }
h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; }
h3 {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px;
}

/* ── controls ───────────────────────────────────────── */
.controls { margin-bottom: 12px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  border-radius: 20px; padding: 6px 14px; font-size: 0.85rem; cursor: pointer;
  text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.chip-active { border-color: var(--text); color: var(--text); font-weight: 600; }

/* ── wheel gauge (the signature) ────────────────────── */
/* Conic ring fills with the score; the number sits chalk-on-loam in the hub,
   so text contrast never depends on the score color. JS supplies
   --sc (ring color) and --pct (0–100). */
.score-chip {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.15rem; font-weight: 800; color: var(--text);
  background:
    radial-gradient(closest-side, var(--card) 70%, transparent 73%),
    conic-gradient(var(--sc, var(--track)) calc(var(--pct, 0) * 1%), var(--track) 0);
}
.score-big { width: 64px; height: 64px; font-size: 1.45rem; }

/* ── home: spot cards ───────────────────────────────── */
.spot-card {
  display: flex; gap: 14px; align-items: center;
  text-decoration: none; color: var(--text);
}
.spot-main { flex: 1; min-width: 0; }
.spot-name { font-weight: 700; }
.spot-meta { font-size: 0.8rem; margin: 2px 0; }
.spot-badges { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.78rem; }
.grip-badge { font-weight: 700; }
.grip-dry { color: #8fbf60; } .grip-good { color: #a9c34e; }
.grip-damp { color: #d6b23c; } .grip-muddy { color: #df9450; }
.grip-soaked { color: #ec7053; }
.season-badge, .warn-badge { color: var(--muted); }
.spot-wx { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wx-icon { width: 36px; height: 36px; }
.spot-temp { font-weight: 700; }
.stale-banner {
  background: rgba(226, 161, 61, 0.09); border: 1px solid rgba(226, 161, 61, 0.45);
  border-radius: var(--radius); padding: 8px 14px; margin-bottom: 12px; font-size: 0.85rem;
}

/* ── map ────────────────────────────────────────────── */
.map-wrap {
  height: calc(100dvh - 320px); min-height: 320px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.leaflet-container { background: #100e0a; }

/* ── spot detail ────────────────────────────────────── */
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; }
.spot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.warn { color: var(--warn); margin: 8px 0; font-size: 0.9rem; }
.bd { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.bd-row { display: grid; grid-template-columns: 70px 1fr 32px; gap: 10px; align-items: center; font-size: 0.85rem; }
.bd-label { color: var(--muted); }
.bd-bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; }
.bd-fill { height: 100%; border-radius: 3px; }
.bd-num { text-align: right; font-weight: 700; }
.dual { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wx-panel { min-width: 0; }
.panel-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 6px;
}
.wx-temp { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.panel-grip { margin-top: 10px; }
.sparkline { width: 120px; height: 28px; color: var(--muted); display: block; margin-top: 6px; }
.sun-row { margin-top: 12px; }
.outlook { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.day-cell { flex: 1; min-width: 56px; text-align: center; border-radius: 10px; padding: 6px 2px; }
.day-best { outline: 1.5px dashed var(--text); outline-offset: -1.5px; }
.day-score {
  width: 36px; height: 36px; border-radius: 50%; margin: 4px auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem; color: var(--text);
  background:
    radial-gradient(closest-side, var(--card) 68%, transparent 72%),
    conic-gradient(var(--sc, var(--track)) calc(var(--pct, 0) * 1%), var(--track) 0);
}
.aqi-row { display: flex; gap: 14px; align-items: center; }
.aqi-circle {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--text);
  background:
    radial-gradient(closest-side, var(--card) 70%, transparent 73%),
    var(--sc, var(--track));
}
.trail-map { width: 100%; border-radius: 10px; margin-bottom: 12px; }
.trail-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.trail-item:last-child { border-bottom: none; }
.diff {
  flex-shrink: 0; padding: 2px 10px; border-radius: 12px;
  font-size: 0.75rem; font-weight: 700; height: fit-content; color: #fff;
}
.diff-green { background: #2e7d32; } .diff-blue { background: #1565c0; }
.diff-red { background: #c62828; } .diff-black { background: #16130e; border: 1px solid var(--muted); }
.diff-double-black { background: #000; border: 1px solid var(--muted); }
.note { font-style: italic; }
.info-section { margin: 12px 0; }
.info-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; margin-bottom: 3px;
}
.pricing { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.pricing td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--border); }
.pricing tr:last-child td { border-bottom: none; }
.price { font-weight: 700; white-space: nowrap; }
.comment { border-left: 3px solid var(--border); padding-left: 10px; margin-top: 10px; font-size: 0.88rem; }
.updated { text-align: right; margin: 4px 0 12px; }
