/* =================================================================
   DAS HIMMLISCHE URTEIL · From Heaven Bad Ragaz
   Mobile-first. Warm, dunkel, hochwertig, mit Gold/Beige-Akzenten.
   ================================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Warmer, dunkler Hintergrund (kein steriles Schwarz) */
  --bg:        #160f0c;
  --bg-soft:   #20171210;
  --panel:     #221913;
  --panel-2:   #2b201833;

  /* Gold / Beige Akzente */
  --gold:      #c9a25b;
  --gold-soft: #e3c489;
  --beige:     #e9ddc8;
  --beige-dim: #b8a98f;

  /* Text */
  --ink:       #f3ead9;
  --ink-dim:   #b9a98e;
  --line:      #3a2c2155;

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      460px;

  /* Keine externen Web-Fonts (DSGVO). System-Serif für Headlines, System-Sans für Text. */
  --serif: Georgia, "Times New Roman", "Hoefler Text", serif;
  --sans:  system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Warmer Glow im Hintergrund für Tiefe & Stimmung */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% -10%, #3a271a 0%, transparent 55%),
    radial-gradient(90% 60% at 80% 110%, #2a1c12 0%, transparent 60%),
    var(--bg);
}

/* ---------- App Shell ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 6vw, 34px) clamp(18px, 5vw, 26px) 20px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- Screen-Wechsel ---------- */
.screen { display: none; flex: 1; animation: fade .45s ease both; }
.screen.is-active { display: flex; flex-direction: column; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Start-Screen ---------- */
.kicker {
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: auto;
  padding-top: 6px;
}

.seal {
  font-size: 40px;
  color: var(--gold);
  margin: 24px 0 6px;
  line-height: 1;
  filter: drop-shadow(0 2px 10px #00000060);
}

.hook {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 11vw, 50px);
  line-height: 1.04;
  letter-spacing: -0.5px;
  color: var(--ink);
  text-wrap: balance;
}

.sub {
  margin-top: 18px;
  color: var(--ink-dim);
  font-size: 16px;
  max-width: 36ch;
}

#screen-start .btn-primary { margin-top: 28px; }

.micro {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--beige-dim);
  letter-spacing: .02em;
}

/* ---------- Titel / Navigation ---------- */
.title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(28px, 8vw, 38px);
  letter-spacing: -0.3px;
  margin-bottom: 22px;
}

.back {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--beige-dim);
  font-family: var(--sans);
  font-size: 14px;
  padding: 6px 0;
  margin-bottom: 8px;
  cursor: pointer;
}
.back:hover { color: var(--gold); }

/* ---------- Formular ---------- */
.field { display: block; margin-bottom: 20px; border: none; }

.label {
  display: block;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 9px;
}

input[type="text"], select {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px; /* >=16px verhindert Zoom auf iOS */
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder { color: #8a7a64; }

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #c9a25b22;
}

/* Eigener Dropdown-Pfeil */
select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 20px) center, calc(100% - 14px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

/* Ton-Chips (Radio-Buttons als Pills) */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-dim);
  font-size: 14px;
  transition: all .18s ease;
}
.chip input:checked + span {
  border-color: var(--gold);
  background: linear-gradient(180deg, #c9a25b, #a9823f);
  color: #1a120b;
  font-weight: 600;
}
.chip input:focus-visible + span { box-shadow: 0 0 0 3px #c9a25b33; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 16px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform .12s ease, filter .2s ease, background .2s;
}
.btn:active { transform: scale(.985); }

.btn-primary {
  background: linear-gradient(180deg, #efd9a6, #c9a25b);
  color: #1a120b;
  box-shadow: 0 10px 30px -12px #c9a25b80;
}
.btn-primary:hover { filter: brightness(1.05); }

.btn-gold {
  background: transparent;
  color: var(--gold-soft);
  border-color: var(--gold);
}
.btn-gold:hover { background: #c9a25b14; }

.btn-ghost {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); }

.btn-text {
  background: none;
  color: var(--beige-dim);
  font-weight: 500;
}
.btn-text:hover { color: var(--gold); }

/* ---------- Ergebnis: Urteils-Karte ---------- */
.verdict-card {
  position: relative;
  background:
    linear-gradient(180deg, #2a1f17, #1d1510);
  border: 1px solid #4a382866;
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  margin-bottom: 22px;
  box-shadow: 0 24px 60px -28px #000, inset 0 1px 0 #ffffff0a;
  overflow: hidden;
}
/* Goldener Innenrahmen, wie ein Siegelpapier */
.verdict-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #c9a25b3a;
  border-radius: 12px;
  pointer-events: none;
}

.verdict-head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.verdict-seal { font-size: 22px; color: var(--gold); }
.verdict-court {
  font-size: 12px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.verdict-case {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--beige-dim);
  text-align: center;
  margin-bottom: 14px;
}

.verdict-body {
  font-family: var(--serif);
  font-size: clamp(21px, 6.2vw, 26px);
  line-height: 1.34;
  color: var(--ink);
  text-align: center;
  text-wrap: pretty;
}

.verdict-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid #4a382855;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--beige-dim);
}

/* ---------- Share-Textblöcke ---------- */
.share-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  margin-bottom: 12px;
}
.share-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.share-tag {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.copy {
  background: none;
  border: 1px solid var(--line);
  color: var(--beige-dim);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .18s;
}
.copy:hover { border-color: var(--gold); color: var(--gold); }
.copy.done { border-color: var(--gold); color: var(--gold); }

.share-text {
  font-size: 14.5px;
  color: var(--ink-dim);
  white-space: pre-wrap;
  line-height: 1.55;
}

/* ---------- Aktionen ---------- */
.actions { display: flex; flex-direction: column; gap: 11px; margin-top: 18px; }

/* ---------- Empfänger-Modus (über geteilten Link geöffnet) ----------
   Der Empfänger soll sein Urteil sehen und nur reservieren oder
   zurück verurteilen – kein Weiterleiten des fremden Urteils. */
.recipient-intro { display: none; }

body.is-recipient .recipient-intro {
  display: block;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--gold-soft);
  margin: 4px 0 16px;
}
/* Creator-Aktionen ausblenden: Weiterleiten, Share-Bild, Teil-Texte, „ändern“ */
body.is-recipient #screen-result .back,
body.is-recipient #btn-whatsapp,
body.is-recipient #btn-image,
body.is-recipient .share-block { display: none; }

/* „Zurück verurteilen“ als klare Aktion hervorheben */
body.is-recipient #btn-again {
  background: linear-gradient(180deg, #efd9a6, #c9a25b);
  color: #1a120b;
  font-weight: 600;
  box-shadow: 0 10px 30px -12px #c9a25b80;
}

/* ---------- Footer ---------- */
.footer {
  max-width: var(--maxw);
  margin: 28px auto 0;
  padding: 18px 22px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--beige-dim);
  border-top: 1px solid var(--line);
}
.footer a { color: var(--beige-dim); text-decoration: none; }
.footer a:hover { color: var(--gold); }
.footer .dot { margin: 0 6px; opacity: .5; }
.footer-note { margin-top: 10px; font-size: 11px; opacity: .7; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Canvas für Share-Bild bleibt unsichtbar im Layout */
#share-canvas { position: fixed; left: -9999px; top: 0; }

/* ---------- Etwas grössere Screens ---------- */
@media (min-width: 520px) {
  .app { padding-top: 44px; }
  .actions { margin-top: 22px; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .btn:active { transform: none; }
}
