:root {
  --bg: #0a0a0d;
  --panel: #111114;
  --ink: #f4f3ef;
  --dim: #7b7b82;
  --dimmer: #4a4a50;
  --blue: #3d8bd6;
  --gray-moon: #5b5b62;
  --line: rgba(255, 255, 255, 0.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
svg { display: block; }

.phone {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg);
  padding: 32px 28px 40px;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
}

.view { flex: 1; display: none; flex-direction: column; }
.view.active { display: flex; }
#view-day { justify-content: center; }
#view-year { justify-content: center; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.wordmark {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.info-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--dim);
  color: var(--dim);
  display: flex; align-items: center; justify-content: center;
  font-family: Georgia, serif; font-style: italic; font-size: 13px;
  cursor: pointer;
  background: none;
}
.lang-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.lang-toggle button {
  background: none;
  border: none;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.lang-toggle button.active {
  color: var(--blue);
  background: rgba(61, 139, 214, 0.12);
}
.lang-toggle button + button {
  border-left: 1px solid var(--line);
}

.tabs {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 26px;
}
.tab {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  color: var(--dim);
  cursor: pointer;
  background: none; border: none;
  padding: 0;
  transition: color .2s;
}
.tab.active { color: var(--blue); }

/* ---------- DAY VIEW ---------- */
.phase-name {
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  color: var(--blue);
  font-size: 20px;
  margin-bottom: 26px;
}
.moon-wrap { display: flex; justify-content: center; margin-bottom: 48px; }
.moon-wrap svg { width: min(70vw, 340px); height: min(70vw, 340px); }
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 8px;
  margin-top: auto;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 70px;
}
.stat-icon { width: 34px; height: 34px; }
.stat-label {
  font-size: 10.5px;
  color: var(--dim);
  text-align: center;
  line-height: 1.35;
}
.stat-label b { color: var(--ink); font-weight: 600; display: block; font-size: 11px; }

/* ---------- MONTH VIEW ---------- */
.month-title {
  text-align: center;
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--blue);
  font-size: 19px;
  margin-bottom: 2px;
}
.month-subtitle {
  text-align: center;
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}
.ring-wrap { display: flex; justify-content: center; margin-bottom: 40px; }
.explainer { padding: 0 6px; max-width: 420px; margin: 0 auto; }
.explainer h4 {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--blue);
  font-weight: 400;
  font-size: 14px;
  margin: 0 0 8px;
}
.explainer p.lead { color: var(--dim); font-size: 12px; margin: 0 0 10px; }
.explainer ul { margin: 0; padding-left: 16px; color: var(--ink); font-size: 12.5px; line-height: 1.7; }
.explainer li { margin-bottom: 2px; }

/* ---------- YEAR VIEW ---------- */
.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px 16px;
  padding: 0 10px;
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}
.year-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.year-label { font-size: 11.5px; color: var(--dim); text-align: center; }
.year-cell.current .year-label { color: var(--blue); }
.doot-cell { justify-content: center; }
.doot-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); margin: 22px auto; }

/* ---------- INFO PANEL ---------- */
.info-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.info-overlay.active { display: flex; }
.info-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  max-width: 420px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}
.info-panel h3 {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--blue);
  font-weight: 400;
  font-size: 17px;
  margin: 0 0 12px;
}
.info-panel p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 14px;
}
.info-panel a { color: var(--blue); }
.info-close {
  display: block;
  margin-left: auto;
  background: none;
  border: 1px solid var(--dim);
  color: var(--dim);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}
