@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=Zen+Old+Mincho:wght@500;600&display=swap');

:root {
  --bg: #0b1224;
  --panel: #0f1a30;
  --panel-strong: #0b1326;
  --text: #e8edf7;
  --muted: #9eb4d5;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #f6d95f;
  --accent-2: #7ac8f5;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --pill-day: #f6d95f;
  --pill-night: #2a3c7c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(120% 100% at 80% 0%, #13315c, #0b1224 60%, #0b0f1c);
  font-family: 'Space Grotesk', 'Zen Old Mincho', sans-serif;
  min-height: 100vh;
  font-size: 16px;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  background: linear-gradient(135deg, rgba(33, 54, 94, 0.65), rgba(14, 21, 38, 0.9));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

.hero__text h1 {
  margin: 0 0 8px;
  font-family: 'Zen Old Mincho', 'Space Grotesk', serif;
  font-size: 2.1rem;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 0.8rem;
  margin: 0 0 8px;
}

.lede {
  color: var(--muted);
  margin: 0 0 12px;
  line-height: 1.6;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
}

.hero__stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.stat--primary {
  background: linear-gradient(135deg, rgba(246, 217, 95, 0.16), rgba(42, 60, 124, 0.18));
}

.stat__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat__value {
  font-size: clamp(1.4rem, 1.2rem + 0.6vw, 1.9rem);
  font-weight: 600;
}

.stat__hint {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.panel__header h2,
.panel__header h3 {
  margin: 4px 0;
}

.label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0;
}

.muted {
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.5;
}

.coords {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--muted);
  font-size: 0.9rem;
  gap: 4px;
}

.map-wrap {
  position: relative;
  height: clamp(280px, 40vw, 460px);
  margin-top: 12px;
  border-radius: 16px;
  overflow: hidden;
}

.map {
  position: absolute;
  inset: 0;
}

.map-overlay {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.map-overlay span {
  color: var(--muted);
  font-size: 0.85rem;
}

.map-overlay strong {
  font-size: 1rem;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
}

.field span {
  color: var(--muted);
  font-size: 0.9rem;
}

.field input[type='date'],
.field input[type='time'],
.field input[type='number'],
.field input[type='color'] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
}

.field input[type='color'] {
  padding: 6px 8px;
  height: 42px;
}

.inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.switch {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.color-pair {
  flex-direction: row;
  justify-content: space-between;
}

.color-pair div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-pair div:first-child {
  margin-right: 10px;
}

.ghost {
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
}

.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.times {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.times span {
  color: var(--muted);
  font-size: 0.9rem;
}

.times strong {
  font-size: 1.05rem;
}

.timeline {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.legend {
  display: flex;
  gap: 8px;
}

.pill {
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}

.pill-day {
  background: rgba(246, 217, 95, 0.2);
  color: #f6d95f;
}

.pill-night {
  background: rgba(42, 60, 124, 0.25);
  color: #9fb4ff;
}

.ganzhi-bar {
  position: relative;
  display: flex;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.segment {
  flex-grow: 1;
  min-width: 2px;
  transition: opacity 0.2s;
}

.segment:hover {
  opacity: 0.9;
}

.segment.active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.progress-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f8fafc;
  opacity: 0.8;
  pointer-events: none;
}

.temporal-hours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.temporal-hours span {
  color: var(--muted);
  font-size: 0.9rem;
}

.temporal-hours strong {
  font-size: 1.1rem;
}

.chip,
.pill {
  font-family: 'Space Grotesk', 'Zen Old Mincho', sans-serif;
}

.calendar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.cal-actions .toggle,
.cal-actions .nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cal-actions span {
  color: var(--muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.cal-cell {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-cell--blank {
  background: transparent;
  border: none;
}

.cal-cell.is-today {
  box-shadow: 0 0 0 2px rgba(246, 217, 95, 0.4);
}

.cal-date {
  font-weight: 600;
  color: var(--text);
}

.cal-ganzhi {
  font-size: 1rem;
}

.cal-sun {
  color: var(--muted);
  font-size: 0.9rem;
}

.cal-week-row {
  display: flex;
  justify-content: space-between;
}

.cal-sun + .cal-sun {
  margin-top: 2px;
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .map-wrap {
    height: clamp(260px, 45vw, 340px);
  }
  .panel {
    padding: 16px;
  }
}

@media (max-width: 600px) {
  .shell {
    padding: 20px 12px 32px;
  }
  .controls-grid {
    grid-template-columns: 1fr;
  }
  .inline {
    flex-direction: column;
    align-items: flex-start;
  }
  .color-pair {
    flex-direction: column;
  }
  .hero__text h1 {
    font-size: 1.7rem;
  }
  .map-overlay {
    right: 8px;
    bottom: 8px;
    padding: 10px;
  }
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 420px) {
  .map-wrap {
    height: 240px;
  }
  .panel__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .cal-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
.cal-actions {
  width: 100%;
  justify-content: space-between;
  }
}

.footer {
  margin: 20px auto 12px;
  max-width: 1200px;
  padding: 0 20px;
  color: var(--muted);
  text-align: right;
  font-size: 0.85rem;
}

.footer a {
  color: var(--muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text);
}
