:root {
  color-scheme: dark;
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #071427;
  color: #f8fafc;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 15%, rgb(212 175 55 / 18%), transparent 24rem),
    radial-gradient(circle at 15% 80%, rgb(22 163 74 / 16%), transparent 22rem),
    #071427;
}

.shell {
  width: min(100%, 44rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  align-content: start;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand__mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  background: #22c55e;
  color: #04130a;
}

.brand__accent {
  color: #4ade80;
}

.hero {
  text-align: center;
}

.eyebrow {
  margin: 0 0 1rem;
  color: #d4af37;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.orbit {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  margin: 0 auto 1.25rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(212 175 55 / 45%);
  border-radius: 50%;
  box-shadow: 0 0 4rem rgb(212 175 55 / 12%);
}

.orbit::before {
  content: "";
  position: absolute;
  inset: 1rem;
  border: 1px dashed rgb(255 255 255 / 20%);
  border-radius: 50%;
}

.orbit__core {
  color: #f5c842;
  font-size: 2.5rem;
}

.orbit__moon {
  position: absolute;
  top: 0.35rem;
  right: 1.15rem;
  color: #f8fafc;
  font-size: 0.8rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 10vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero__copy {
  max-width: 34rem;
  margin: 0 auto 1.5rem;
  color: #b8c5d8;
  line-height: 1.7;
}

.fortune-questions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin: -0.5rem auto 1.5rem;
}

.fortune-questions span {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgb(212 175 55 / 30%);
  border-radius: 999px;
  color: #f7df91;
  background: rgb(212 175 55 / 8%);
  font-size: 0.78rem;
  font-weight: 700;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 1rem;
  background: rgb(255 255 255 / 6%);
  text-align: left;
}

.status-card__dot {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 1rem #4ade80;
}

.status-card strong,
.status-card span,
.schedule article span {
  display: block;
}

.status-card span,
.schedule article span {
  margin-top: 0.2rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.schedule {
  padding: 1.25rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 1.25rem;
  background: rgb(4 12 25 / 75%);
}

.profile-card {
  padding: 1.25rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 1.25rem;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 7%), transparent 45%),
    rgb(4 12 25 / 88%);
  box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 18%);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading .eyebrow {
  margin-bottom: 0.45rem;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  letter-spacing: -0.04em;
}

.step-badge {
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem;
  border: 1px solid rgb(212 175 55 / 40%);
  border-radius: 999px;
  color: #f5d36f;
  background: rgb(212 175 55 / 10%);
  font-size: 0.72rem;
  font-weight: 800;
}

.profile-card__intro {
  margin: 0.9rem 0 1.5rem;
  color: #a9b8cc;
  font-size: 0.9rem;
  line-height: 1.65;
}

#birth-profile-form {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.field {
  min-width: 0;
}

.field label {
  display: block;
  margin-bottom: 0.45rem;
  color: #dbe5f2;
  font-size: 0.85rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 0.8rem;
  outline: none;
  background: rgb(2 8 19 / 72%);
  color: #f8fafc;
  font: inherit;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input:focus,
.field select:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgb(212 175 55 / 14%);
}

.field input:disabled {
  color: #64748b;
  background: rgb(15 23 42 / 65%);
  cursor: not-allowed;
}

.field__hint,
.field__error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.45;
}

.field__hint {
  color: #72839a;
}

.field__error {
  min-height: 1em;
  color: #fda4af;
}

.unknown-time {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem;
  border: 1px solid rgb(255 255 255 / 11%);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 4%);
  cursor: pointer;
}

.unknown-time input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  accent-color: #d4af37;
}

.unknown-time strong,
.unknown-time small {
  display: block;
}

.unknown-time small {
  margin-top: 0.2rem;
  color: #8494a9;
  line-height: 1.4;
}

.accuracy-warning {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.85rem;
  border: 1px solid rgb(245 196 66 / 28%);
  border-radius: 0.9rem;
  background: rgb(245 196 66 / 9%);
  color: #f8dfa0;
}

.accuracy-warning[hidden] {
  display: none;
}

.accuracy-warning > span {
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d4af37;
  color: #1b1503;
  font-weight: 900;
}

.accuracy-warning p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.form-status {
  min-height: 1.25rem;
  color: #a9b8cc;
  font-size: 0.82rem;
  line-height: 1.5;
}

.form-status[data-state="error"] {
  color: #fda4af;
}

.form-status[data-state="success"] {
  color: #86efac;
}

.primary-button {
  min-height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #e4c65c, #b8911f);
  color: #151003;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0.9rem 2rem rgb(212 175 55 / 16%);
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.fortune-preview {
  padding: 1.25rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 1.25rem;
  background: rgb(4 12 25 / 88%);
  overflow: hidden;
}

.fixture-badge,
.count-badge {
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.fixture-badge {
  color: #93c5fd;
  background: rgb(59 130 246 / 12%);
}

.count-badge {
  color: #86efac;
  background: rgb(34 197 94 / 12%);
}

.app-nav {
  margin: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0.3rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 0.85rem;
  background: rgb(2 8 19 / 70%);
}

.app-nav__button {
  min-width: 0;
  padding: 0.65rem 0.4rem;
  border: 0;
  border-radius: 0.65rem;
  background: transparent;
  color: #7f90a7;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.app-nav__button.is-active {
  color: #f5d36f;
  background: rgb(212 175 55 / 13%);
}

.app-view[hidden],
.app-nav[hidden],
.engine-panel[hidden],
.locked-view[hidden],
#active-fortune-content[hidden] {
  display: none;
}

.reading-hero {
  padding: 1.25rem;
  border: 1px solid rgb(212 175 55 / 20%);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 90% 15%, rgb(212 175 55 / 16%), transparent 12rem),
    linear-gradient(145deg, #0d1d34, #07111f);
}

.reading-hero__date,
.view-heading > div > span,
.detail-heading > span {
  color: #d4af37;
  font-size: 0.75rem;
  font-weight: 800;
}

.reading-hero h3,
.view-heading h3,
.detail-heading h3,
.locked-view h3 {
  margin: 0.45rem 0;
  font-size: clamp(1.45rem, 7vw, 2rem);
  letter-spacing: -0.035em;
}

.reading-hero p,
.detail-heading p,
.locked-view > p:not(.eyebrow) {
  margin-bottom: 1rem;
  color: #9aabc0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.engine-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.engine-chips span {
  padding: 0.35rem 0.65rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  color: #dbe5f2;
  background: rgb(255 255 255 / 5%);
  font-size: 0.72rem;
  font-weight: 750;
}

.insight-grid {
  margin: 0.9rem 0;
  display: grid;
  gap: 0.75rem;
}

.insight {
  padding: 0.9rem;
  border-radius: 0.85rem;
}

.insight span,
.insight strong {
  display: block;
}

.insight span {
  margin-bottom: 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
}

.insight strong {
  font-size: 0.9rem;
  line-height: 1.45;
}

.insight--good {
  border: 1px solid rgb(34 197 94 / 22%);
  background: rgb(34 197 94 / 8%);
}

.insight--good span {
  color: #86efac;
}

.insight--caution {
  border: 1px solid rgb(251 191 36 / 22%);
  background: rgb(251 191 36 / 8%);
}

.insight--caution span {
  color: #fcd34d;
}

.fixture-note {
  margin: 0.8rem 0;
  color: #64748b;
  font-size: 0.72rem;
  text-align: center;
}

.secondary-button,
.text-button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.secondary-button {
  width: 100%;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 1px solid rgb(212 175 55 / 35%);
  border-radius: 0.85rem;
  color: #f5d36f;
  font-weight: 850;
}

.text-button {
  padding: 0.3rem 0;
  color: #8fa0b6;
  font-size: 0.8rem;
  font-weight: 750;
}

.view-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-heading h3 {
  margin-bottom: 0;
}

.history-list {
  display: grid;
  gap: 0.7rem;
}

.history-item {
  width: 100%;
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 4%);
  color: #f8fafc;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.history-item__date {
  color: #d4af37;
  font-size: 0.78rem;
  font-weight: 850;
}

.history-item__copy {
  min-width: 0;
}

.history-item__copy strong,
.history-item__copy small {
  display: block;
}

.history-item__copy strong {
  overflow: hidden;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item__copy small {
  margin-top: 0.25rem;
  color: #74859b;
  font-size: 0.72rem;
}

.detail-heading {
  margin: 1rem 0;
}

.engine-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.engine-tabs button {
  min-width: 0;
  padding: 0.65rem 0.2rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 0.7rem;
  background: rgb(255 255 255 / 4%);
  color: #8596aa;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.engine-tabs button[aria-selected="true"] {
  border-color: rgb(212 175 55 / 45%);
  color: #f5d36f;
  background: rgb(212 175 55 / 12%);
}

.engine-panel {
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 4%);
}

.engine-panel__source {
  color: #7dd3fc;
  font-size: 0.7rem;
  font-weight: 800;
}

.engine-panel h4 {
  margin: 0.45rem 0 0.8rem;
  font-size: 1rem;
}

.engine-panel p {
  margin: 0.55rem 0;
  color: #a9b8cc;
  font-size: 0.82rem;
  line-height: 1.55;
}

.engine-panel strong {
  color: #e5edf7;
}

.locked-view {
  padding: 2rem 1rem 1rem;
  text-align: center;
}

.locked-view__icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgb(212 175 55 / 32%);
  border-radius: 50%;
  color: #d4af37;
  background: rgb(212 175 55 / 8%);
  font-size: 2rem;
}

.locked-view .primary-button {
  text-decoration: none;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 0.9rem;
  background: rgb(255 255 255 / 4%);
  cursor: pointer;
}

.settings-toggle strong,
.settings-toggle small {
  display: block;
}

.settings-toggle strong {
  font-size: 0.88rem;
}

.settings-toggle small {
  margin-top: 0.3rem;
  color: #7f90a7;
  font-size: 0.72rem;
  line-height: 1.45;
}

.settings-toggle input {
  width: 2.65rem;
  height: 1.4rem;
  flex: 0 0 auto;
  accent-color: #22c55e;
}

.settings-info {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 0.9rem;
  background: rgb(2 8 19 / 55%);
}

.settings-info span,
.settings-info strong {
  display: block;
}

.settings-info span {
  color: #7f90a7;
  font-size: 0.72rem;
}

.settings-info strong {
  margin-top: 0.25rem;
  color: #86efac;
  font-size: 0.85rem;
}

.settings-info p {
  margin: 0.9rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgb(255 255 255 / 8%);
  color: #8494a9;
  font-size: 0.76rem;
  line-height: 1.55;
}

.settings-info a {
  color: #f5d36f;
}

.danger-zone {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgb(248 113 113 / 28%);
  border-radius: 0.9rem;
  background: rgb(69 10 10 / 22%);
}

.danger-zone > span,
.danger-zone label {
  color: #fca5a5;
  font-size: 0.72rem;
}

.danger-zone h4 {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

.danger-zone p {
  color: #a9b4c3;
  font-size: 0.76rem;
  line-height: 1.55;
}

.danger-zone label {
  display: block;
  margin-bottom: 0.45rem;
}

.danger-zone input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border: 1px solid rgb(248 113 113 / 35%);
  border-radius: 0.65rem;
  color: #f8fafc;
  background: rgb(2 8 19 / 70%);
}

.danger-zone button {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid rgb(248 113 113 / 50%);
  border-radius: 0.65rem;
  color: #fecaca;
  background: rgb(127 29 29 / 55%);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-zone button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.schedule h2 {
  font-size: 1rem;
  color: #d4af37;
}

.schedule article {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid rgb(255 255 255 / 8%);
  text-align: left;
}

.schedule time {
  color: #4ade80;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 8%);
  color: #64748b;
  font-size: 0.75rem;
}

@media (min-width: 48rem) {
  .shell {
    padding: 2rem;
  }

  .status-card,
  .schedule,
  .profile-card,
  .fortune-preview {
    padding: 1.5rem;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* NgernGru launch bridge: loading overlay + error card */
.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% 30%, rgb(212 175 55 / 14%), transparent 22rem),
    rgb(7 20 39 / 92%);
  backdrop-filter: blur(6px);
}

.launch-overlay__card {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  text-align: center;
  color: #f8fafc;
}

.launch-overlay__card strong {
  font-size: 1.15rem;
  font-weight: 800;
}

.launch-overlay__card span {
  color: rgb(248 250 252 / 72%);
  font-size: 0.95rem;
}

.launch-overlay__spinner {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 0.28rem solid rgb(212 175 55 / 25%);
  border-top-color: #e4c65c;
  animation: launch-spin 0.9s linear infinite;
}

@keyframes launch-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .launch-overlay__spinner {
    animation-duration: 2.4s;
  }
}

.launch-error {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% 30%, rgb(212 175 55 / 12%), transparent 22rem),
    rgb(7 20 39 / 95%);
}

.launch-error__card {
  width: min(100%, 30rem);
  display: grid;
  justify-items: center;
  gap: 0.9rem;
  text-align: center;
  padding: 2rem 1.5rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 1.2rem;
  background: rgb(15 30 54 / 88%);
  box-shadow: 0 1.5rem 3rem rgb(0 0 0 / 35%);
}

.launch-error__icon {
  font-size: 2rem;
  color: #e4c65c;
}

.launch-error__card h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
}

.launch-error__card p {
  margin: 0;
  color: rgb(248 250 252 / 78%);
  line-height: 1.6;
}

.launch-error__card .primary-button {
  width: 100%;
  margin-top: 0.4rem;
  text-decoration: none;
}
