* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: #3f4e7e; overflow: hidden;
  font-family: "Iowan Old Style", Palatino, Georgia, serif; color: #2b2f45; }
#sky { display: block; width: 100vw; height: 100vh; cursor: grab; }
#sky:active { cursor: grabbing; }

/* --- cream Rey frame: top bar + bottom controls --- */
#topbar, #controls {
  position: fixed; left: 0; right: 0; background: #f3ecd8; z-index: 2;
  border-color: rgba(43,47,69,.18);
}
#topbar {
  top: 0; display: flex; align-items: baseline; gap: 16px;
  padding: 10px 18px; border-bottom: 1px solid rgba(43,47,69,.18);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.brand { font-weight: 800; font-family: "Baloo 2", sans-serif; font-size: 17px; letter-spacing: .3px; color: #2b2f45; }
.brand::first-letter { color: #d9a520; }
#date { font-size: 16px; font-variant-numeric: tabular-nums; }
#age  { font-size: 12.5px; color: #6a6750; }
.spacer { flex: 1; }
#natal { font-family: "Baloo 2", sans-serif; }

#controls {
  bottom: 0; display: flex; flex-direction: column; gap: 9px;
  padding: 12px 18px 14px; border-top: 1px solid rgba(43,47,69,.18);
  box-shadow: 0 -2px 10px rgba(0,0,0,.18);
}
.row { display: flex; align-items: center; gap: 8px; }
#timeline { flex: 1; accent-color: #d9a520; height: 4px; }
#year { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; font-size: 15px; font-weight: 600; color: #b8860b; }

button, select {
  background: #fbf7ea; color: #2b2f45; border: 1px solid rgba(43,47,69,.28);
  border-radius: 7px; padding: 6px 11px; font-size: 13px; cursor: pointer; font-family: inherit;
}
button:hover, select:hover { background: #fff; border-color: rgba(43,47,69,.5); }
#play { min-width: 74px; font-weight: 600; }
#play:hover { background: #f6e7b8; }
.ghost { background: transparent; border-style: dashed; color: #8a7320; }
.speed { font-size: 12px; color: #6a6750; display: flex; align-items: center; gap: 6px; margin-left: 4px; }
.hint { font-size: 11.5px; color: #8c8970; margin-left: 10px; }

/* --- Mode B: natal form (modal) + readout (side panel) --- */
#natalForm {
  position: fixed; z-index: 4; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #f3ecd8; color: #2b2f45; border-radius: 12px; padding: 20px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); width: 340px;
}
#natalForm h3 { font-family: "Baloo 2", sans-serif; margin-bottom: 12px; font-size: 18px; }
#natalForm label { display: block; font-size: 12px; color: #6a6750; margin-bottom: 9px; }
#natalForm input { display: block; width: 100%; margin-top: 3px; padding: 6px 8px;
  border: 1px solid rgba(43,47,69,.3); border-radius: 6px; background: #fff; font: inherit; color: #2b2f45; }
.nf-place { display: flex; gap: 6px; margin-top: 3px; }
.nf-place input { flex: 1; }
#nf-find { white-space: nowrap; background: #f6e7b8; font-weight: 600; }
.nf-status { font-size: 11.5px; color: #6a6750; min-height: 15px; margin: 2px 0 8px; }
.nf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.nf-actions { display: flex; gap: 10px; margin-top: 8px; }
#nf-cast { background: #f6e7b8; font-weight: 600; font-family: "Baloo 2", sans-serif; }

#natalReadout {
  position: fixed; z-index: 3; top: 60px; right: 14px; width: 270px;
  background: rgba(243,236,216,.96); color: #2b2f45; border-radius: 11px;
  padding: 14px 16px 16px; box-shadow: 0 8px 28px rgba(0,0,0,.4);
  font-size: 13px; max-height: calc(100vh - 150px); overflow-y: auto;
}
#natalReadout h3 { font-family: "Baloo 2", sans-serif; font-size: 17px; margin-bottom: 2px; }
#natalReadout .sub { font-size: 11.5px; color: #6a6750; margin: 4px 0 10px; }
#natalReadout dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin-bottom: 10px; }
#natalReadout dt { font-weight: 600; color: #6a6750; }
#natalReadout dd { text-align: right; }
#natalReadout table { width: 100%; border-collapse: collapse; }
#natalReadout th { text-align: left; font-size: 10.5px; color: #8c8970; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid rgba(43,47,69,.18); padding-bottom: 3px; }
#natalReadout td { padding: 2px 0; font-variant-numeric: tabular-nums; }
#natalReadout td:last-child, #natalReadout th:last-child { text-align: right; }
#nr-close { position: absolute; top: 10px; right: 12px; font-size: 11px; padding: 3px 7px; }
.nr-jump { display: flex; gap: 8px; margin: 12px 0 4px; }
#nr-today { background: #f6e7b8; font-weight: 600; font-size: 12px; flex: 1; }
#nr-birth { font-size: 12px; }
.t-date { font-weight: 600; color: #6a6750; margin-bottom: 4px; }
.t-row { padding: 2px 0; font-size: 12.5px; }
.t-row b { color: #b8860b; padding: 0 1px; }
.t-orb { color: #8c8970; font-size: 11px; float: right; font-variant-numeric: tabular-nums; }
.t-none { color: #8c8970; font-size: 12px; font-style: italic; }
.dig { font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; padding: 1px 4px; border-radius: 4px; vertical-align: 1px; }
.dig-domicile, .dig-exalted { background: #d8ecd2; color: #3c6b3a; }
.dig-detriment, .dig-fall { background: #efd8d2; color: #8a4a3a; }
#nr-wheel { background: #f6e7b8; font-weight: 600; font-size: 12px; }

/* --- chart wheel overlay --- */
#wheelOverlay {
  position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(5,6,13,.55);
}
#wheelOverlay[hidden] { display: none; }   /* ID display: flex would otherwise override the hidden attribute */
.wheel-card {
  position: relative; background: #f3ecd8; border-radius: 14px; padding: 16px;
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
}
#wheel { display: block; width: 560px; height: 560px; max-width: 88vmin; max-height: 88vmin; }
#wheel-close { position: absolute; top: 12px; right: 14px; font-size: 12px; z-index: 1; }
