:root {
  /* Muted light blue theme */
  --bg: #eef4fb;
  --card: #ffffff;
  --muted: #c7d7eb;
  --accent: #3e7bb6;
  --text: #0f2a3f;
  --text-muted: #49627a;
  /* Score gradient endpoints for JS helpers */
  --score-red: 231, 76, 60;     /* #e74c3c */
  --score-yellow: 241, 196, 15; /* #f1c40f */
  --score-blue: 62, 123, 182;   /* #3e7bb6 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; }

.site-header { padding: 28px; text-align: center; border-bottom: 1px solid rgba(15,42,63,0.06); background: #f7fbff; }
.site-header h1 { margin: 0; font-size: 34px; letter-spacing: 0.5px; font-weight: 800; color: var(--text); }
.subtitle { margin: 6px 0 0; color: var(--text-muted); font-size: 15px; }
.gh-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--text-muted); text-decoration: none; font-size: 13px; }
.gh-link:hover { color: var(--accent); }
.gh-icon { vertical-align: middle; }
.controls { margin-top: 12px; }
.toggle { color: var(--text-muted); font-size: 13px; }
.toggle input { margin-right: 8px; }

.container { max-width: 1100px; margin: 0 auto; padding: 16px; }

.meta { margin-bottom: 16px; color: var(--text-muted); font-size: 14px; }

.day-card { background: var(--card); border: 1px solid rgba(15,42,63,0.08); border-radius: 12px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15,42,63,0.05); }
.day-header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.day-title { font-size: 18px; margin: 0; color: var(--text); }
.sun { color: #b28f00; font-size: 12px; }

/* Minimal moon phase icon drawn with CSS mask using radial-gradients */
.moon-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff 0 40%, #ddd 60% 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1) inset, 0 0 1px rgba(0,0,0,0.2);
  position: relative;
}

/* We approximate phase with a clipped overlay controlled by data-phase [0..1] */
.moon-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #0f2a3f;
  /* Default: new moon (covered) */
  clip-path: circle(0% at 50% 50%);
}

/* Map coarse buckets for simplicity */
.moon-icon[data-phase^="0."]::after { clip-path: circle(10% at 50% 50%); }
.moon-icon[data-phase^="0.1"]::after { clip-path: circle(20% at 50% 50%); }
.moon-icon[data-phase^="0.2"]::after { clip-path: circle(35% at 50% 50%); }
.moon-icon[data-phase^="0.3"]::after { clip-path: circle(50% at 50% 50%); }
.moon-icon[data-phase^="0.4"]::after { clip-path: circle(65% at 50% 50%); }
.moon-icon[data-phase^="0.5"]::after { clip-path: circle(80% at 50% 50%); }
.moon-icon[data-phase^="0.6"]::after { clip-path: circle(65% at 50% 50%); }
.moon-icon[data-phase^="0.7"]::after { clip-path: circle(50% at 50% 50%); }
.moon-icon[data-phase^="0.8"]::after { clip-path: circle(35% at 50% 50%); }
.moon-icon[data-phase^="0.9"]::after { clip-path: circle(20% at 50% 50%); }
.moon-icon[data-phase="1"]::after { clip-path: circle(0% at 50% 50%); }

.windows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.window { background: #f5f9ff; border: 1px solid rgba(15,42,63,0.06); border-radius: 10px; padding: 10px; }
.score { font-weight: 800; color: var(--accent); }
.conditions { color: var(--text-muted); font-size: 13px; }

.chart-wrap { height: 220px; position: relative; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; display: block; }

.error { background: #ffecec; border: 1px solid #e7a3a3; color: #7a1f1f; padding: 12px; border-radius: 8px; }
.hidden { display: none; }

.site-footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 12px; }

.badge { display: inline-block; padding: 2px 6px; border-radius: 6px; background: var(--muted); color: #0f2a3f; font-size: 12px; font-weight: 700; }
.badge.good { background: rgba(var(--score-blue), 0.28); color: var(--text); }
.badge.warn { background: rgba(var(--score-yellow), 0.32); color: #5a4b00; }
.badge.bad { background: rgba(var(--score-red), 0.32); color: #6b1212; }

/* Star rating inside badges */
.stars { position: relative; display: inline-block; line-height: 1; font-size: 16px; letter-spacing: 1px; }
.stars .base { color: rgba(15,42,63,0.25); }
.stars .fill { position: absolute; top: 0; left: 0; width: var(--fill, 0%); overflow: hidden; white-space: nowrap; color: var(--star-color, #FFD700); filter: drop-shadow(0 0 1px rgba(0,0,0,0.1)); }


