/* Olas Galicia — light, minimal. One typeface (Inter), neutral greys, one
   ocean-blue accent. Structure comes from spacing and hairlines, not boxes. */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-wght.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #fafafa;
  --soft-2: #f4f4f5;
  --line: #ececec;
  --line-2: #e2e2e2;
  --text: #111111;
  --text-2: #4b4b4b;
  --muted: #737373;
  --faint: #a3a3a3;
  --accent: #1c5cab;
  /* surf score: one hue, light -> dark = worse -> better (ordinal, >= 2:1 on white) */
  --s0: #86b6ef; --s1: #5598e7; --s2: #2a78d6; --s3: #1c5cab; --s4: #104281;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.025em; margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.label { font-size: 12px; font-weight: 500; color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; padding: calc(var(--safe-t) + 12px) 20px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 650; font-size: 18px; letter-spacing: -0.03em; }
.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.brand small { font-weight: 450; color: var(--muted); font-size: 15px; letter-spacing: -0.01em; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; color: var(--muted); }

main { padding: 0 20px calc(var(--safe-b) + 40px); max-width: 720px; margin: 0 auto; }
section { margin-top: 36px; }
.section-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-h h2 { font-size: 19px; }
.section-h .label { text-align: right; }

/* ---------- hero ---------- */
.hero { display: block; margin-top: 20px; }
.hero-media { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: var(--soft-2); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-live {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 12px; font-weight: 600;
}
.badge-crowd {
  position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px; background: rgba(17,17,17,.78); color: #fff; font-size: 12px; font-weight: 600;
}
.badge-crowd svg { width: 13px; height: 13px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #e5484d; display: inline-block; }
.hero-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-top: 16px; }
.kicker { font-size: 12px; font-weight: 500; color: var(--accent); margin-bottom: 4px; }
.hero h1 { font-size: 28px; line-height: 1.12; }
.hero .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }
.big-score { text-align: right; flex: none; }
.big-score b { display: block; font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.04em; }
.big-score span { font-size: 13px; font-weight: 500; color: var(--text-2); }
.summary { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 12px 0 12px 12px; min-width: 0; }
.stat:first-child { padding-left: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .v { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; letter-spacing: -0.02em; }
.stat .d { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arrow { width: 13px; height: 13px; flex: none; color: var(--accent); }
.cta { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 550; font-size: 15px; border: 1px solid var(--line-2); background: var(--bg);
}
.btn.primary { background: var(--text); color: #fff; border-color: var(--text); }
.btn svg { width: 15px; height: 15px; }

/* ---------- score chip ---------- */
.score {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 28px; padding: 0 8px;
  border-radius: 8px; font-weight: 600; font-size: 14px; color: #fff; background: var(--s2);
}
.score.b0 { background: var(--s0); color: #0d2f5a; } .score.b1 { background: var(--s1); }
.score.b2 { background: var(--s2); } .score.b3 { background: var(--s3); } .score.b4 { background: var(--s4); }
.score.none { background: var(--soft-2); color: var(--muted); }

/* ---------- segmented / planner ---------- */
.seg { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px 2px; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line-2); color: var(--text-2); background: var(--bg);
}
.seg button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.hours { display: flex; gap: 2px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 14px -20px 0; padding: 0 20px; }
.hours::-webkit-scrollbar { display: none; }
.hour { flex: none; width: 40px; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px;
        padding: 8px 0; border-radius: 10px; }
.hour .bar-wrap { height: 64px; width: 12px; display: flex; align-items: flex-end; }
.hour .bar { width: 12px; border-radius: 4px 4px 1px 1px; min-height: 3px; }
.hour .n { font-size: 12px; font-weight: 600; }
.hour .t { font-size: 11px; color: var(--muted); }
.hour.night { opacity: .35; }
.hour[aria-pressed="true"] { background: var(--soft-2); }
.hour.now .t { color: var(--accent); font-weight: 600; }
.sunline { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- rows (windows, list) ---------- */
.rows { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.row .when { width: 70px; flex: none; }
.row .when b { display: block; font-size: 14px; font-weight: 600; }
.row .when span, .row .where span { font-size: 12px; color: var(--muted); }
.row .where { flex: 1; min-width: 0; }
.row .where b { display: block; font-size: 15px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.filters { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 4px; }
.toggle { display: inline-flex; background: var(--soft-2); border-radius: 10px; padding: 3px; }
.toggle button { height: 30px; padding: 0 11px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.toggle button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.link { font-size: 13px; color: var(--accent); font-weight: 500; }

.spot { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--soft-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .3s; }
.thumb img.loaded { opacity: 1; }
.spot-body { min-width: 0; }
.spot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.spot-name { font-weight: 600; font-size: 15px; line-height: 1.25; letter-spacing: -0.015em; }
.spot-meta { font-size: 12px; color: var(--muted); margin-top: 1px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spot-conds { font-size: 13px; margin-top: 5px; color: var(--text-2); display: flex; gap: 10px; flex-wrap: wrap; }
.spot-conds span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.crowd { display: inline-flex; align-items: center; gap: 3px; color: var(--text); font-weight: 600; }
.crowd svg { width: 12px; height: 12px; }
.spark { display: flex; gap: 2px; align-items: flex-end; height: 16px; margin-top: 7px; }
.spark i { flex: 1; border-radius: 2px 2px 1px 1px; min-height: 2px; }
.spark i.sel { box-shadow: 0 0 0 1.5px var(--text); }
.star { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; color: var(--faint); flex: none; }
.star svg { width: 18px; height: 18px; }
.star[aria-pressed="true"] { color: #d99a00; }
.empty { padding: 24px 0; text-align: center; color: var(--muted); font-size: 14px; }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 720px; margin: 0 auto;
  background: var(--bg); border-radius: 20px 20px 0 0; padding: 10px 20px calc(var(--safe-b) + 24px);
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1); max-height: 84dvh; overflow-y: auto;
  visibility: hidden; box-shadow: 0 -8px 30px rgba(0,0,0,.08);
}
.sheet.open { transform: none; visibility: visible; }
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 16px; }
.sheet h3 { font-size: 18px; margin-bottom: 10px; }
.sheet p { color: var(--text-2); font-size: 14px; margin: 0 0 10px; }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 20px; }
.opts button { height: 44px; border-radius: 10px; border: 1px solid var(--line-2); font-weight: 500; font-size: 14px; }
.opts button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }

footer.foot { margin-top: 44px; font-size: 12px; color: var(--faint); line-height: 1.7; }
footer.foot button { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }

.skel { background: linear-gradient(90deg, var(--soft-2) 0%, #fbfbfb 50%, var(--soft-2) 100%);
        background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- spot page ---------- */
.player { position: sticky; top: 0; z-index: 15; background: #000; padding-top: var(--safe-t); }
.stage { position: relative; aspect-ratio: 16 / 9; max-height: 62dvh; margin: 0 auto; }
.stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.pbar { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; gap: 8px; z-index: 2; pointer-events: none; }
.pbar > * { pointer-events: auto; }
.pbtn { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        background: rgba(0,0,0,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 600; }
.pbtn svg { width: 17px; height: 17px; }
.pstate { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
          color: #fff; padding: 4px 9px; border-radius: 999px; background: rgba(0,0,0,.45); pointer-events: none; }
.spot-head { padding-top: 20px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.spot-head h1 { font-size: 26px; line-height: 1.15; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500;
        background: var(--soft-2); color: var(--text-2); }
.now-grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.ring { width: 88px; height: 88px; position: relative; }
.ring svg { width: 88px; height: 88px; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring .val b { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.ring .val span { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.factor { display: grid; grid-template-columns: 62px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; margin: 6px 0; color: var(--text-2); }
.factor .track { display: block; height: 5px; border-radius: 3px; background: var(--soft-2); overflow: hidden; }
.factor .fill { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.factor .pct { text-align: right; color: var(--muted); font-size: 12px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.kv > div { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv > div:nth-child(odd) { padding-right: 12px; }
.kv > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--line); }
.kv .v { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; display: flex; align-items: center; gap: 5px; }
.kv .d { font-size: 12px; color: var(--muted); }
.detect { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; }
.detect .n { font-size: 34px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.detect-img { width: 100%; border-radius: 12px; margin-top: 12px; display: block; background: var(--soft-2); }
.readout { margin: 0 0 10px; font-size: 13px; color: var(--muted); min-height: 38px; }
.readout b { color: var(--text); font-weight: 600; }
.fc-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px 6px; scrollbar-width: none; }
.fc-scroll::-webkit-scrollbar { display: none; }
.fc svg text { font-family: var(--font); }
.fc .col { cursor: pointer; }
.clips { display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 0 20px 4px; scrollbar-width: none; }
.clips::-webkit-scrollbar { display: none; }
.clip { flex: none; width: 150px; text-align: left; }
.clip .thumb { aspect-ratio: 16 / 9; }
.clip span { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.guide dl { display: grid; grid-template-columns: 116px 1fr; margin: 0; border-top: 1px solid var(--line); }
.guide dt, .guide dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.guide dt { color: var(--muted); }
.guide .src { font-size: 12px; color: var(--faint); margin-top: 8px; }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal video { width: 100%; max-height: 80dvh; border-radius: 10px; background: #000; }
.modal .close { position: absolute; top: calc(var(--safe-t) + 14px); right: 16px; }
