:root {
  --bg: #10141c;
  --panel: #1a2130;
  --panel-2: #222b3c;
  --ink: #eef2f7;
  --muted: #9aa8bb;
  --line: rgba(255, 255, 255, 0.08);
  --green: #31aa35;
  --yellow: #fff000;
  --orange: #ff8c00;
  --red: #cc0000;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(49, 170, 53, 0.18), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(255, 140, 0, 0.12), transparent 50%),
    var(--bg);
}
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }
.topnav {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
}
.topnav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.topnav a.active, .topnav a:hover {
  color: var(--ink);
  background: var(--panel);
}
header { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 28px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -0.03em; }
.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.75rem; margin-bottom: 8px; }
.meta { color: var(--muted); font-size: 0.95rem; text-align: right; }
.flash, .error, .setup, .hero, .card, .period {
  background: color-mix(in srgb, var(--panel) 92%, black);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.flash, .error { padding: 14px 18px; margin-bottom: 18px; }
.error { border-color: color-mix(in srgb, var(--red) 50%, transparent); }
.setup, .card { padding: 28px; }
.setup ol { color: var(--muted); padding-left: 20px; }
a { color: #8ecbff; }
form { display: grid; gap: 14px; margin-top: 20px; }
label { font-size: 0.85rem; color: var(--muted); }
input, select {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0e131c;
  color: var(--ink);
  font: inherit;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.check input { width: auto; margin: 0; }
button, .btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--ink);
  color: #111;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.hero {
  padding: 28px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  overflow: hidden;
  position: relative;
}
.level {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  margin: 14px 0 10px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.advice { color: var(--muted); max-width: 46ch; line-height: 1.5; }
.vignette { margin: 0; min-width: 0; }
.vignette-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}
.vignette figcaption { margin-top: 8px; text-align: center; }
.map {
  width: 100%;
  border-radius: 12px;
  background: #0b0f16;
  border: 1px solid var(--line);
  display: block;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.period { padding: 22px; }
.period h2 { margin-bottom: 6px; }
.validity { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }
.comment { background: var(--panel-2); border-radius: 12px; padding: 14px 16px; color: #d5deea; margin-bottom: 16px; line-height: 1.5; }
.phenomenon {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.phenomenon:first-of-type { border-top: 0; }
.name { font-weight: 600; }
.slots { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.badge {
  min-width: 76px;
  text-align: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #111;
}
.bulletin { margin-top: 18px; padding: 22px; }
.bulletin h2 { margin-bottom: 8px; }
.bloc { margin-top: 16px; }
.bloc h3 { font-size: 1.05rem; margin-bottom: 8px; }
.bloc p { margin: 0 0 8px; color: #d5deea; line-height: 1.55; }
.note { color: var(--muted); font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.stack { display: grid; gap: 18px; }
footer {
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.85rem;
  display: grid;
  gap: 8px;
}
.footer-note, .credit { margin: 0; }
.credit { font-weight: 500; color: var(--ink); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.stat-card { padding: 22px; }
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.stat-value { font-family: Fraunces, Georgia, serif; font-size: 2.6rem; margin: 8px 0 0; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
.stats-table { width: 100%; border-collapse: collapse; }
.stats-table th, .stats-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.stats-table th:not(:first-child), .stats-table td:not(:first-child) { text-align: right; }
.year-cal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 16px;
}
.month-cal h3 { font-size: 1rem; margin-bottom: 10px; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}
button.cal-day {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 6px;
  font-weight: 600;
  font-size: inherit;
  color: #111;
  background: #2a3344;
  border: 0;
  padding: 0;
  cursor: pointer;
}
button.cal-day:hover, button.cal-day:focus-visible, button.cal-day.is-open {
  outline: 2px solid #eef2f7;
  outline-offset: 1px;
}
button.cal-day.future {
  background: transparent;
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}
button.cal-day.c1 { background: var(--green); }
button.cal-day.c2 { background: var(--yellow); }
button.cal-day.c3 { background: var(--orange); }
button.cal-day.c4 { background: var(--red); color: #fff; }
.day-pop {
  position: fixed;
  z-index: 40;
  min-width: 240px;
  max-width: min(320px, calc(100vw - 16px));
  padding: 14px 16px;
  border-radius: 14px;
  background: #161e28;
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: var(--ink);
  pointer-events: none;
}
.day-pop[hidden] { display: none; }
.day-pop h3 { font-size: 1rem; margin-bottom: 6px; text-transform: capitalize; }
.day-pop ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.day-pop li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.day-level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
@media (max-width: 820px) {
  header, .hero, .grid { grid-template-columns: 1fr; display: grid; }
  .meta { text-align: left; }
  .stats-grid, .year-cal { grid-template-columns: 1fr 1fr; }
}
