* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0d0d1f;
  --card: #16162e;
  --card-border: #2a2a4a;
  --text: #e8e8ff;
  --muted: #8a8ab0;
  --gold: #f5d47a;
  --accent: #a78bfa;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.65;
}

/* Starfield */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff8 50%, transparent 50%),
    radial-gradient(1px 1px at 60% 70%, #fff6 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 80% 20%, #fff9 50%, transparent 50%),
    radial-gradient(1px 1px at 35% 80%, #fff5 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 55%, #fff7 50%, transparent 50%),
    radial-gradient(1px 1px at 10% 60%, #fff6 50%, transparent 50%),
    radial-gradient(1px 1px at 50% 10%, #fff8 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 70% 90%, #fff6 50%, transparent 50%);
  background-size: 550px 550px;
  z-index: 0;
}

.site-header {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
  position: relative;
  z-index: 1;
}

.site-header h1 {
  font-size: 2.4rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  font-weight: normal;
}

.tagline {
  color: var(--muted);
  font-style: italic;
  margin-top: 0.5rem;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.card h2 {
  color: var(--gold);
  font-weight: normal;
  font-size: 1.45rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.6rem;
}

/* Form */
.form-card {
  max-width: 460px;
  margin: 0 auto 2rem;
}

.field {
  margin-bottom: 1.25rem;
  position: relative;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--gold);
  font-size: 0.95rem;
}

.field input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  color-scheme: dark;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.place-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 8px;
  list-style: none;
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
}

.place-results li {
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-size: 0.92rem;
}

.place-results li:hover {
  background: var(--accent);
  color: #fff;
}

#submit-btn {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, #7c5cbf, #a78bfa);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

#submit-btn:hover:not(:disabled) {
  opacity: 0.88;
}

#submit-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.error {
  color: #ff8a8a;
  margin-top: 0.75rem;
  font-size: 0.92rem;
}

/* Chart wheel */
.chart-card {
  text-align: center;
}

.chart-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.wheel-wrap svg {
  width: 100%;
  max-width: 560px;
  height: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 5px;
  vertical-align: middle;
  border-radius: 2px;
}

/* Reading sections */
.reading-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--card-border);
}

.reading-item:last-child {
  border-bottom: none;
}

.reading-item h3 {
  color: var(--text);
  font-weight: normal;
  font-size: 1.15rem;
}

.reading-item .subtitle {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.reading-item p {
  color: #c9c9e8;
  font-size: 0.97rem;
}

/* Balance bars */
.balance-bars {
  margin: 1rem 0;
}

.bar-row {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.bar-cell {
  display: grid;
  grid-template-columns: 80px 1fr 24px;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.bar-track {
  background: var(--bg);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.bar-fill {
  background: linear-gradient(90deg, #7c5cbf, var(--gold));
  height: 100%;
  border-radius: 4px;
}

.mc-line {
  color: #c9c9e8;
  font-size: 0.95rem;
  border-top: 1px solid var(--card-border);
  padding-top: 0.9rem;
}

/* Forecasts */
.forecast-intro {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 1rem;
}

.forecast-year {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--card-border);
}

.forecast-year:last-child {
  border-bottom: none;
}

.forecast-year h3 {
  color: var(--gold);
  font-weight: normal;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.forecast-year .age {
  color: var(--muted);
  font-size: 0.9rem;
}

.forecast-year p {
  color: #c9c9e8;
  font-size: 0.96rem;
  margin-bottom: 0.6rem;
}

.disclaimer {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
  margin-top: 2rem;
}

@media (max-width: 600px) {
  .site-header h1 {
    font-size: 1.8rem;
  }

  .card {
    padding: 1.25rem;
  }
}

/* AI narrative */
.narrative-card {
  border-color: var(--accent);
  background: linear-gradient(135deg, #16162e, #1e1440);
}

.narrative-card h2 {
  border-bottom-color: var(--accent);
}

.narrative-card p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text);
  font-style: italic;
}
