/* MOONLIGHT WORLD — Lunar Cycle
   Self-contained glass component. Uses the site's existing Purple Glass tokens. */
.lunar-section { padding-top: clamp(34px, 4vw, 56px); }
.lunar-panel {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(18px, 2.6vw, 34px);
  border-radius: 32px;
  border: 1px solid rgba(218, 202, 255, .15);
  background:
    radial-gradient(ellipse at 82% 10%, rgba(150, 111, 255, .12), transparent 34%),
    linear-gradient(145deg, rgba(28, 19, 48, .82), rgba(12, 9, 24, .88));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .3), 0 0 48px rgba(151, 111, 255, .08);
  -webkit-backdrop-filter: blur(26px);
  backdrop-filter: blur(26px);
}
.lunar-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 300px;
  aspect-ratio: 1;
  top: -210px;
  right: 8%;
  border-radius: 50%;
  background: rgba(160, 125, 255, .08);
  filter: blur(42px);
  pointer-events: none;
}
.lunar-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.lunar-kicker {
  display: block;
  color: #bda7e8;
  font-size: 9px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .2em;
}
.lunar-panel-head h2 {
  margin: 7px 0 0;
  color: #fbf9ff;
  font: 800 clamp(22px, 2.4vw, 31px)/1.1 var(--font-sans);
  letter-spacing: -.045em;
}
.lunar-panel-head h2 em {
  color: #cbb8f5;
  font-family: var(--font-display);
  font-weight: 500;
}
.lunar-today-label {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(218, 202, 255, .15);
  border-radius: 999px;
  color: #d9cdef;
  background: rgba(255, 255, 255, .035);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .09em;
  white-space: nowrap;
}
.lunar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(275px, .72fr);
  gap: 16px;
  align-items: stretch;
}
.lunar-calendar-card,
.lunar-detail-card {
  min-width: 0;
  border: 1px solid rgba(218, 202, 255, .12);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.lunar-calendar-card { padding: clamp(12px, 1.7vw, 20px); }
.lunar-calendar-toolbar {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}
.lunar-calendar-toolbar h3 {
  margin: 0;
  color: #f7f2ff;
  text-align: center;
  font: 700 15px/1.2 var(--font-sans);
  letter-spacing: .015em;
}
.lunar-month-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(218, 202, 255, .16);
  border-radius: 12px;
  color: #e8ddff;
  background: rgba(255,255,255,.045);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.lunar-month-button:hover { transform: translateY(-1px); border-color: rgba(205,181,255,.42); background: rgba(167,139,250,.14); }
.lunar-month-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lunar-weekdays,
.lunar-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.lunar-weekdays { gap: 5px; margin-bottom: 7px; }
.lunar-weekdays span {
  padding: 4px 0;
  color: #8f829f;
  text-align: center;
  font-size: 8px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .12em;
}
.lunar-calendar-grid { gap: 5px; }
.lunar-day {
  position: relative;
  min-width: 0;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 2px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #e9e2f4;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, opacity .18s ease;
}
.lunar-day:hover { transform: translateY(-1px); border-color: rgba(204,181,255,.22); background: rgba(167,139,250,.09); }
.lunar-day.is-outside { opacity: .32; }
.lunar-day.is-today { border-color: rgba(202,174,255,.42); background: rgba(164,128,238,.105); }
.lunar-day.is-selected { border-color: rgba(221,202,255,.7); background: linear-gradient(145deg, rgba(159,124,232,.23), rgba(116,85,181,.14)); box-shadow: 0 0 20px rgba(155,126,228,.12), inset 0 0 0 1px rgba(255,255,255,.035); }
.lunar-day-number { color: #e9e1f4; font-size: 10px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.lunar-day.is-today .lunar-day-number { color: #dfccff; }
.lunar-day-moon { display: block; width: 25px; height: 25px; filter: drop-shadow(0 0 7px rgba(193,165,255,.14)); }
.lunar-day-phase { display: none; }
.lunar-detail-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 18px 17px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 17%, rgba(160,125,255,.14), transparent 42%),
    linear-gradient(155deg, rgba(34,24,56,.8), rgba(17,12,31,.78));
}
.lunar-main-moon {
  width: min(190px, 78%);
  margin: 0 auto 7px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 12px 28px rgba(0,0,0,.32));
}
.lunar-main-moon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lunar-phase-title { margin-top: 1px; }
.lunar-phase-title h3 {
  margin: 6px 0 4px;
  color: #fff;
  font: 750 clamp(16px, 1.5vw, 19px)/1.2 var(--font-sans);
  letter-spacing: -.025em;
}
.lunar-phase-date { margin: 0; color: #a99abf; font-size: 10px; letter-spacing: .025em; }
.lunar-phase-description { max-width: 240px; margin: 8px auto 0; color: #9c8eaf; font-size: 9px; line-height: 1.45; }
.lunar-illumination { width: 100%; margin-top: 17px; text-align: left; }
.lunar-illumination-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.lunar-illumination-line span { color: #a99abf; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.lunar-illumination-line strong { color: #e6d8ff; font-size: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.lunar-progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); box-shadow: inset 0 1px 2px rgba(0,0,0,.2); }
.lunar-progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8062d7, #c8bbff 75%, #f0e7ff); box-shadow: 0 0 14px rgba(191,163,255,.45); transition: width .35s ease; }
.lunar-stats { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
.lunar-stat { padding: 9px 8px; border: 1px solid rgba(218,202,255,.09); border-radius: 12px; background: rgba(255,255,255,.026); text-align: center; }
.lunar-stat span { display: block; color: #9284a7; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
.lunar-stat strong { display: block; margin-top: 5px; color: #e6dcf6; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lunar-events { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; text-align: left; }
.lunar-event { min-width: 0; padding: 9px 10px; border-radius: 12px; background: rgba(9,7,18,.28); }
.lunar-event span { display: block; color: #9687aa; font-size: 7px; font-weight: 800; letter-spacing: .12em; }
.lunar-event strong { display: block; margin-top: 5px; color: #e2d5f6; font-size: 10px; font-weight: 650; line-height: 1.3; }
.lunar-today-button {
  margin-top: 13px;
  padding: 8px 12px;
  border: 1px solid rgba(205,184,255,.18);
  border-radius: 999px;
  color: #cfc0e5;
  background: rgba(255,255,255,.035);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .13em;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.lunar-today-button:hover { border-color: rgba(210,190,255,.4); color: white; background: rgba(167,139,250,.12); }
.lunar-footnote { margin: 14px 2px 0; color: #7f738f; font-size: 8px; line-height: 1.5; text-align: right; }
.lunar-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 960px) {
  .lunar-layout { grid-template-columns: minmax(0, 1fr) minmax(245px, .76fr); gap: 12px; }
  .lunar-day { min-height: 56px; }
  .lunar-day-moon { width: 22px; height: 22px; }
  .lunar-detail-card { padding-inline: 14px; }
  .lunar-main-moon { width: min(165px, 78%); }
}
@media (max-width: 760px) {
  .lunar-section { padding-top: 32px; }
  .lunar-panel { padding: 15px 12px; border-radius: 23px; }
  .lunar-panel-head { align-items: start; margin-bottom: 15px; gap: 8px; }
  .lunar-kicker { font-size: 8px; }
  .lunar-panel-head h2 { font-size: 22px; }
  .lunar-today-label { padding: 7px 8px; font-size: 7px; letter-spacing: .04em; }
  .lunar-layout { grid-template-columns: 1fr; gap: 10px; }
  .lunar-calendar-card { padding: 11px 8px 10px; border-radius: 17px; }
  .lunar-calendar-toolbar { grid-template-columns: 34px 1fr 34px; gap: 7px; margin-bottom: 11px; }
  .lunar-month-button { width: 32px; height: 32px; border-radius: 10px; }
  .lunar-calendar-toolbar h3 { font-size: 13px; }
  .lunar-weekdays { gap: 3px; margin-bottom: 5px; }
  .lunar-weekdays span { font-size: 7px; letter-spacing: .06em; }
  .lunar-calendar-grid { gap: 3px; }
  .lunar-day { min-height: 49px; gap: 2px; padding: 4px 1px; border-radius: 9px; }
  .lunar-day-number { font-size: 9px; }
  .lunar-day-moon { width: 20px; height: 20px; }
  .lunar-detail-card { display: grid; grid-template-columns: 104px minmax(0,1fr); grid-template-areas: "moon title" "moon illum" "stats stats" "events events" "today today"; align-items: center; gap: 0 12px; padding: 12px; border-radius: 17px; text-align: left; }
  .lunar-main-moon { grid-area: moon; width: 104px; margin: 0; }
  .lunar-phase-title { grid-area: title; align-self: end; }
  .lunar-phase-title h3 { font-size: 16px; }
  .lunar-phase-date { font-size: 9px; }
  .lunar-phase-description { margin-top: 6px; font-size: 8px; }
  .lunar-phase-title .lunar-kicker { font-size: 7px; }
  .lunar-illumination { grid-area: illum; align-self: start; margin-top: 10px; }
  .lunar-illumination-line { margin-bottom: 6px; }
  .lunar-illumination-line span { font-size: 7px; }
  .lunar-illumination-line strong { font-size: 11px; }
  .lunar-stats { grid-area: stats; margin-top: 10px; }
  .lunar-events { grid-area: events; margin-top: 7px; }
  .lunar-today-button { grid-area: today; justify-self: center; margin-top: 10px; }
  .lunar-footnote { margin-top: 9px; font-size: 7px; text-align: center; }
}
@media (max-width: 380px) {
  .lunar-panel-head h2 { font-size: 19px; }
  .lunar-today-label { font-size: 6px; }
  .lunar-day { min-height: 45px; }
  .lunar-day-moon { width: 17px; height: 17px; }
  .lunar-detail-card { grid-template-columns: 88px minmax(0,1fr); gap: 0 9px; }
  .lunar-main-moon { width: 88px; }
  .lunar-phase-title h3 { font-size: 14px; }
  .lunar-event { padding: 8px; }
  .lunar-event strong { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .lunar-day, .lunar-progress-fill, .lunar-month-button, .lunar-today-button { transition: none !important; }
}
