/* AstroRadix — Premium-Look: Nachthimmel, Gold, Creme. Edel, ruhig, kein Kitsch. */
:root {
  --night-0: #0c1018;
  --night-1: #121a2b;
  --night-2: #080b12;
  --card: rgba(22, 29, 45, 0.72);
  --card-solid: #161d2d;
  --cream: #f0e9dd;
  --muted: #98a1b5;
  --gold: #d7b56a;
  --gold-2: #ecd79a;
  --gold-deep: #b8974f;
  --line: rgba(215, 181, 106, 0.16);
  --line-strong: rgba(215, 181, 106, 0.34);
  --fire: #e08a5b; --earth: #b3bd76; --air: #ddc98a; --water: #6fa8c9;
  --soft: #d9525f;
  --hard: #e08a5b;
  --harm: #7fb0c9;
  --radius: 18px;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  touch-action: pan-y;                 /* nur vertikal wischen (feedback_mobile_lock) */
  overflow-wrap: break-word;
  min-height: 100vh;
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.55;
  background: var(--night-0);
  -webkit-font-smoothing: antialiased;
}

/* Nachthimmel: tiefe Verläufe + goldener Schimmer oben + Vignette */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 50% -8%, rgba(215, 181, 106, 0.14), transparent 60%),
    radial-gradient(900px 700px at 84% 8%, rgba(111, 168, 201, 0.10), transparent 55%),
    radial-gradient(1200px 900px at 12% 100%, rgba(215, 181, 106, 0.06), transparent 55%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-0) 42%, var(--night-2) 100%);
}
.sky::after { /* feine Vignette */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 30%, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
}

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 22px; }

/* Hero — schrumpft auf den Inhalt; die Ringe sind eine eigene fixe Ebene
   (unabhaengig von der Hero-Hoehe), brauchen also kein 100vh mehr. */
.hero {
  position: relative;
  text-align: center; padding: 88px 22px 0;
  animation: rise 900ms cubic-bezier(.2, .7, .2, 1) both;
}
.hero-content { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; }

/* Pulsierende Ringe — fest hinter der ganzen Seite (nicht nur im Hero), 1:1 aus
   Signaturia.html uebernommen. Laufen so auch hinter der Formular-Karte weiter
   und scheinen durch deren Glas-Effekt (backdrop-filter) hindurch. */
.rings {
  position: fixed; inset: 0; z-index: -1;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  /* iOS-Safari-Falle: position:fixed + backdrop-filter (Karten-Glaseffekt) kann
     beim Scrollen einen "eingebrannten" Ausschnitt zeigen, der hart an der
     Kartenkante abbricht. Eigene GPU-Ebene erzwingen behebt das. Zusaetzlich
     Rand weich ausblenden statt scharfer Kreislinien bis an den Viewport-Rand. */
  transform: translateZ(0);
  will-change: transform;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 45%, transparent 80%);
  mask-image: radial-gradient(circle at 50% 40%, #000 45%, transparent 80%);
}
.ring {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  border: 1px solid rgba(215, 181, 106, 0.28);
  opacity: 0; animation: radiate 7s cubic-bezier(.2, .6, .35, 1) infinite;
}
.ring:nth-child(2) { animation-delay: 1.75s; }
.ring:nth-child(3) { animation-delay: 3.5s; }
.ring:nth-child(4) { animation-delay: 5.25s; }
@keyframes radiate {
  0% { transform: scale(.2); opacity: 0; }
  12% { opacity: .9; }
  100% { transform: scale(11); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; }
  .ring { opacity: .25; transform: scale(3); }
  .ring:nth-child(2) { transform: scale(6); }
  .ring:nth-child(3) { transform: scale(9); }
  .ring:nth-child(4) { transform: scale(11); }
}

.eyebrow {
  text-transform: uppercase; letter-spacing: .38em; font-size: .72rem; font-weight: 600;
  color: var(--gold); margin: 0 0 14px; padding-left: .38em;
}
.hero h1 {
  font-family: var(--serif); font-weight: 500; font-size: clamp(2.6rem, 7vw, 4.4rem);
  margin: 0; line-height: 1.25; padding-bottom: .05em; letter-spacing: .01em;
  background: linear-gradient(180deg, #fff7e8, var(--gold) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 1px 40px rgba(215, 181, 106, 0.18);
}
.hero .lede { color: var(--muted); font-size: 1.08rem; margin: 18px auto 0; max-width: 56ch; }
.hero .lede strong { color: var(--cream); font-weight: 600; }

/* Karten */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Formular — schwebt sanft, warmer Schein statt hartem Schatten */
.form-card {
  max-width: 640px; margin: 40px auto 0; padding: 30px 30px 42px;
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.48), 0 0 100px -24px rgba(215, 181, 106, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 900ms cubic-bezier(.2, .7, .2, 1) 120ms both,
    hover-float 6.5s ease-in-out 1020ms infinite;
}
@keyframes hover-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 560px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.field { display: flex; flex-direction: column; gap: 8px; position: relative; margin-top: 18px; min-width: 0; }
.grid .field:first-child, .grid .field { margin-top: 0; }
.field-place { margin-top: 18px; }
.field > span {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); font-weight: 600;
}
input {
  font: inherit; color: var(--cream);
  background: rgba(8, 11, 18, 0.6);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px;
  width: 100%; max-width: 100%; min-width: 0;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder { color: #6c7488; }
input:focus {
  outline: none; border-color: var(--gold);
  background: rgba(8, 11, 18, 0.85);
  box-shadow: 0 0 0 3px rgba(215, 181, 106, 0.16);
}
/* iOS/Safari: time-Input hat eine intrinsische Mindestbreite und schert sonst
   aus dem Grid aus — Appearance abschalten + Mindestbreite freigeben. */
input[type="date"], input[type="time"] { color-scheme: dark; }
input[type="time"] {
  -webkit-appearance: none; appearance: none;
  min-height: 52px;
  display: block;
}
input[type="time"]::-webkit-date-and-time-value { text-align: left; }

/* Ortsvorschläge — oeffnet standardmaessig nach unten; bei wenig Platz
   (z.B. Tastatur am Handy offen) schaltet app.js auf .above um. */
.suggest {
  list-style: none; margin: 8px 0 0; padding: 6px; position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: var(--card-solid); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5); max-height: 280px; overflow-y: auto;
}
.suggest.above {
  top: auto; bottom: 100%; margin: 0 0 8px;
}
.suggest li { padding: 11px 12px; border-radius: 9px; cursor: pointer; transition: background .12s; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: rgba(215, 181, 106, 0.12); }
.suggest .sub { color: var(--muted); font-size: .8rem; margin-top: 2px; }

/* Button */
.btn {
  display: block; width: 100%; margin-top: 26px; cursor: pointer;
  font: inherit; font-size: 1.02rem; font-weight: 600; letter-spacing: .02em; color: #241a09;
  border: none; border-radius: 12px; padding: 15px 22px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-deep));
  box-shadow: 0 12px 26px rgba(215, 181, 106, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .18s, filter .18s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(215, 181, 106, 0.34); filter: brightness(1.04); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: wait; filter: saturate(.7) brightness(.9); transform: none; }
.btn-label { position: relative; }

/* Hinweise */
.notice {
  margin-top: 20px; padding: 14px 16px; border-radius: 12px; font-size: .94rem;
  border: 1px solid var(--line); background: rgba(8, 11, 18, 0.5); color: var(--cream);
}
.notice.warn { border-color: rgba(215, 181, 106, 0.4); background: rgba(215, 181, 106, 0.08); }
.notice.err { border-color: rgba(217, 82, 95, 0.5); background: rgba(217, 82, 95, 0.1); }
.notice .pick {
  display: inline-block; margin: 10px 8px 0 0; padding: 9px 15px; border-radius: 999px;
  border: 1px solid rgba(215, 181, 106, 0.4); background: rgba(215, 181, 106, 0.08);
  color: var(--cream); cursor: pointer; font: inherit; transition: background .15s;
}
.notice .pick:hover { background: rgba(215, 181, 106, 0.18); }

/* Ergebnis */
#result { margin-top: 48px; }
.reveal { opacity: 0; transform: translateY(24px); }
.reveal.show { animation: rise 1100ms cubic-bezier(.2, .7, .2, 1) forwards; }
.result-head { text-align: center; margin-bottom: 18px; }
.result-head h2 { font-family: var(--serif); font-weight: 500; font-size: 2rem; margin: 0; color: var(--cream); }
.muted { color: var(--muted); }
.result-head .muted { font-size: .98rem; margin-top: 4px; }

/* Rad-Bühne mit Glow */
.wheel-stage { position: relative; display: flex; justify-content: center; margin: 8px 0 34px; }
.wheel-stage::before {
  content: ""; position: absolute; width: 62%; aspect-ratio: 1; top: 8%; border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 181, 106, 0.16), transparent 68%); filter: blur(20px); z-index: 0;
}
.wheel { position: relative; z-index: 1; width: 100%; display: flex; justify-content: center; }
.wheel svg { width: 100%; height: auto; max-width: 640px; }
.wheel .planet { transition: transform .18s; transform-box: fill-box; transform-origin: center; cursor: default; }
.wheel .planet:hover { transform: scale(1.28); }

/* Panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: 24px; }
.panel-wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .panels { grid-template-columns: 1fr; } }

h3 {
  font-family: var(--serif); font-weight: 500; font-size: 1.18rem; margin: 0 0 14px; color: var(--gold-2);
  letter-spacing: .01em;
}
/* Ergebnis-Listen als flexible Zeilen statt starrer Tabellenspalten — bricht
   auf jeder Bildschirmbreite sauber um, nie horizontaler Cutoff auf mobile. */
.tbl { width: 100%; font-size: .95rem; }
.tbl + .tbl { margin-top: 4px; }
.tbl .row { padding: 11px 2px; border-bottom: 1px solid var(--line); }
.tbl .row:last-child { border-bottom: none; }

.row-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.row-main .glyph { font-size: 1.2rem; width: 1.3em; color: var(--gold-2); flex: none; }
.row-main .nm { color: var(--cream); font-weight: 500; }
.row-main .r {
  color: var(--night-0); background: var(--gold); font-weight: 700; font-size: .68rem;
  border-radius: 5px; padding: 1px 5px; letter-spacing: .02em;
}
.row-sub {
  color: var(--muted); font-size: .86rem; margin-top: 3px;
  padding-left: calc(1.3em + 8px);
}
.tbl-2col .row-sub { padding-left: 0; }

.row-2col {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
}
.row-2col > span:first-child { color: var(--muted); flex: none; }
.tbl-houses .row { padding: 8px 2px; font-size: .9rem; }

.fire { color: var(--fire); } .earth { color: var(--earth); } .air { color: var(--air); } .water { color: var(--water); }

.asp-hard { color: var(--hard); font-weight: 600; }
.asp-soft { color: var(--harm); font-weight: 600; }
.asp-conj { color: var(--gold-2); font-weight: 600; }
.asp-quin { color: var(--earth); font-weight: 600; }

/* Rad: antippbar + Vergroesserungs-Modal */
.wheel-trigger {
  display: block; width: 100%; background: none; border: none; padding: 0; margin: 0;
  cursor: zoom-in; -webkit-tap-highlight-color: transparent;
}
.wheel-trigger:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 50%; }
.wheel-hint {
  text-align: center; color: var(--muted); font-size: .8rem; letter-spacing: .03em;
  margin: -22px 0 30px;
}
body.wheel-modal-offen { overflow: hidden; }
.wheel-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(6, 8, 12, 0.88);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.wheel-modal[hidden] { display: none; }
.wheel-modal-inner {
  width: 100%; max-width: 880px;
  /* Pinch-Zoom/Pan selbst gebaut (app.js) — Browser-Gesten hier komplett aus */
  touch-action: none;
  transform-origin: 0 0;
  cursor: grab;
}
.wheel-modal-inner:active { cursor: grabbing; }
.wheel-modal-inner svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.5)); }
.wheel-modal-close {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(22, 29, 45, 0.8);
  color: var(--cream); font-size: 1.1rem; cursor: pointer;
}
.wheel-modal-close:hover { background: rgba(22, 29, 45, 0.95); }

/* Datumsfeld: freie Texteingabe + eigener Kalender (Muster: 10_DEVK-Manager/antrag) */
.date-input-row { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 8px; align-items: stretch; }
.date-input-row input { width: 100%; min-width: 0; }
.date-picker-button {
  display: flex; align-items: center; justify-content: center;
  width: 52px; min-height: 52px; padding: 0; flex: none;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: rgba(215, 181, 106, 0.1); color: var(--gold-2); cursor: pointer;
  touch-action: manipulation; transition: background .15s, border-color .15s;
}
.date-picker-button:hover { background: rgba(215, 181, 106, 0.2); border-color: var(--gold); }
.date-picker-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.date-picker-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

body.date-picker-offen { overflow: hidden; }
.date-picker-overlay {
  position: fixed; inset: 0; z-index: 220;
  display: flex; align-items: center; justify-content: center; padding: 14px;
  background: rgba(6, 8, 12, 0.7); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.date-picker-overlay[hidden] { display: none; }
.date-picker-dialog {
  width: min(100%, 400px); max-height: calc(100dvh - 28px); overflow-y: auto;
  padding: 20px; border-radius: 18px;
  background: var(--card-solid); border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.date-picker-top { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 6px; }
.date-picker-title { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--gold-2); }
.date-picker-nav {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(215, 181, 106, 0.1); color: var(--gold-2);
  font-size: 30px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.date-picker-nav:hover { background: rgba(215, 181, 106, 0.2); }
.date-picker-selects { display: grid; grid-template-columns: 1.5fr 1fr; gap: 8px; margin: 14px 0; }
.date-picker-selects select {
  width: 100%; min-height: 46px; padding: 8px 10px; font: inherit; color: var(--cream);
  background: rgba(8, 11, 18, 0.6); border: 1px solid var(--line); border-radius: 10px;
}
.date-picker-weekdays, .date-picker-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.date-picker-weekdays span { padding: 6px 0; color: var(--muted); font-size: .78rem; font-weight: 700; text-align: center; }
.date-picker-day {
  min-width: 0; min-height: 42px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--cream); font: inherit; cursor: pointer; touch-action: manipulation;
}
.date-picker-day:hover:not(:disabled) { background: rgba(215, 181, 106, 0.14); }
.date-picker-day.ausserhalb { color: var(--muted); opacity: .5; }
.date-picker-day.heute { box-shadow: inset 0 0 0 2px var(--gold); }
.date-picker-day.ausgewaehlt { background: var(--gold); color: var(--night-0); font-weight: 700; box-shadow: none; }
.date-picker-day.gesperrt { color: var(--muted); opacity: .28; cursor: not-allowed; }
.date-picker-day:focus-visible, .date-picker-nav:focus-visible, .date-picker-actions button:focus-visible, .date-picker-selects select:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px;
}
.date-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; padding-bottom: env(safe-area-inset-bottom); }
.date-picker-actions button {
  min-height: 46px; padding: 10px 12px; border: 0; border-radius: 10px;
  background: rgba(215, 181, 106, 0.1); color: var(--gold-2); font: inherit; font-weight: 700; cursor: pointer;
}
.date-picker-actions button:last-child { background: var(--gold); color: var(--night-0); }
.date-picker-actions button:hover { filter: brightness(1.08); }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .hero, .form-card, .reveal.show { animation: none; }
  .reveal { opacity: 1; transform: none; }
}

/* Mobile-Politur: engerer Hero-Abstand, groessere Touch-Ziele, ruhigere Karten */
@media (max-width: 560px) {
  .hero { padding-top: 64px; }
  .hero h1 { letter-spacing: 0; }
  .form-card, .panel { padding: 22px 18px; }
  .btn { padding: 16px 22px; font-size: 1.05rem; }
  input, .date-picker-button, select { min-height: 48px; }
  .wheel-hint { margin-top: -16px; }
  .result-head h2 { font-size: 1.6rem; }
}
