/* Amanis Weg, Look "Schatzkarte": Nachtblau, Gold, Pergament, Rosé. */
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap; src: url(fonts/cormorant-garamond-latin-500-italic.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }

:root {
  --night: #0F1A3A; --night-2: #16244D; --night-3: #1E2F61; --ink: #0B1330;
  --gold: #C9A24A; --gold-soft: rgba(201,162,74,.35); --paper: #F2E8CF; --paper-2: #E7DBBB; --rose: #E39AA0;
  --muted: rgba(242,232,207,.6);
  --serif: "Cormorant", "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--paper); font-family: var(--sans); font-size: 16px; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body { position: fixed; inset: 0; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#app { position: absolute; left: 0; right: 0; top: 0; height: var(--vh, 100dvh); display: flex; flex-direction: column;
  background: radial-gradient(120% 70% at 50% 0%, #1A2A5C 0%, var(--night) 60%); }

/* ---------- Bühne: Kokon, Einrichtung, Hinweise ---------- */
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--safe-t) + 24px) 28px calc(var(--safe-b) + 24px); gap: 18px; overflow-y: auto; }
.stage h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: .01em; margin: 0; color: var(--paper); }
.stage .line { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 25px; line-height: 1.25; margin: 0; color: var(--paper); }
.stage .small { font-size: 14px; color: var(--muted); margin: 0; line-height: 1.5; }
.brand { font-family: var(--serif); font-weight: 600; font-size: 15px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); margin: 0; }
.cocoon { width: 132px; height: 190px; filter: drop-shadow(0 0 26px rgba(201,162,74,.28)); animation: breathe 5.2s ease-in-out infinite; }
.cocoon.small-c { width: 96px; height: 138px; }
@keyframes breathe { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 22px rgba(201,162,74,.22)); } 50% { transform: scale(1.035); filter: drop-shadow(0 0 34px rgba(201,162,74,.4)); } }
.shake { animation: shake .42s ease; }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
.dots { display: flex; gap: 14px; justify-content: center; min-height: 16px; }
.dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--gold); transition: background .15s, transform .15s; }
.dots i.on { background: var(--gold); transform: scale(1.08); }
.hint { min-height: 22px; font-size: 15px; color: var(--rose); margin: 0; }
.pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 12px 22px; justify-content: center; }
.pad button { height: 60px; border-radius: 50%; font-family: var(--serif); font-size: 30px; font-weight: 500; color: var(--paper); border: 1px solid rgba(201,162,74,.28); background: rgba(255,255,255,.03); }
.pad button:active { background: var(--gold-soft); }
.pad button.ghost { border-color: transparent; background: none; font-family: var(--sans); font-size: 20px; color: var(--muted); }
.pad[aria-busy="true"] { opacity: .45; pointer-events: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px; border-radius: 26px; background: var(--gold); color: var(--ink); font-weight: 600; font-size: 16px; letter-spacing: .01em; }
.btn:active { transform: scale(.98); }
.btn.line-btn { background: none; color: var(--paper); border: 1px solid var(--gold-soft); }
.btn[disabled] { opacity: .5; }
.link { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; padding: 10px; }
.steps { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 12px; text-align: left; width: 100%; max-width: 330px; }
.steps li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 16px; background: rgba(242,232,207,.06); border: 1px solid rgba(201,162,74,.22); font-size: 15.5px; line-height: 1.35; }
.steps b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 19px; color: var(--ink); background: var(--gold); }
.steps svg { width: 18px; height: 18px; vertical-align: -3px; }
.info-btn { position: absolute; top: calc(var(--safe-t) + 12px); right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold-soft); color: var(--gold); font-family: var(--serif); font-style: italic; font-size: 20px; z-index: 3; }
.field { width: 100%; max-width: 330px; height: 52px; border-radius: 14px; border: 1px solid var(--gold-soft); background: rgba(255,255,255,.05); color: var(--paper); font: inherit; padding: 0 16px; }
.field::placeholder { color: var(--muted); }

/* ---------- Chat ---------- */
.top { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 10px) 14px 10px; background: rgba(15,26,58,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(201,162,74,.22); z-index: 2; }
.top .who { flex: 1; min-width: 0; }
.top .name { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.1; margin: 0; }
.top .sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; min-height: 15px; }
.top .sub.warn { color: var(--rose); }
.top .info-btn { position: static; flex: none; }
.pill { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--gold-soft); color: var(--gold); font-size: 13px; font-weight: 600; }
.bfly { flex: none; width: 34px; height: 34px; }
.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 4px; }
.empty { margin: auto; text-align: center; color: var(--muted); font-family: var(--serif); font-style: italic; font-size: 21px; padding: 20px; }
.day { align-self: center; margin: 12px 0 8px; font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.row { display: flex; flex-direction: column; max-width: 82%; align-self: flex-start; align-items: flex-start; }
.row.me { align-self: flex-end; align-items: flex-end; }
.row + .row.swap { margin-top: 8px; }
.bub { position: relative; padding: 9px 13px 8px; border-radius: 18px 18px 18px 6px; background: var(--paper); color: var(--ink); font-size: 16.5px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.me .bub { border-radius: 18px 18px 6px 18px; background: var(--night-3); color: var(--paper); border: 1px solid rgba(201,162,74,.3); }
.bub.photo { padding: 4px; }
.bub.photo img { display: block; max-width: min(64vw, 300px); max-height: 46vh; border-radius: 14px; background: rgba(0,0,0,.15); min-width: 120px; min-height: 90px; object-fit: cover; }
.bub.photo .cap { padding: 6px 8px 2px; }
.bub a { color: inherit; text-decoration: underline; }
.quote { display: block; margin: -2px -4px 6px; padding: 6px 9px; border-left: 3px solid var(--gold); border-radius: 8px; background: rgba(15,26,58,.08); font-size: 13.5px; line-height: 1.3; overflow: hidden; opacity: .85; }
.quote .qt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.me .quote { background: rgba(242,232,207,.09); }
.quote b { display: block; font-size: 12px; color: var(--gold); font-weight: 600; }
.bub .quote b { color: #8a6a1f; } .me .bub .quote b { color: var(--gold); }
.meta { display: flex; gap: 6px; align-items: center; margin: 3px 6px 0; font-size: 11px; color: var(--muted); min-height: 14px; }
.meta .fail { color: var(--rose); font-size: 13px; font-weight: 500; }
.reacts { display: flex; gap: 4px; margin: -7px 8px 0; z-index: 1; }
.reacts span { font-size: 15px; line-height: 1; padding: 4px 6px; border-radius: 12px; background: var(--night-2); border: 1px solid rgba(201,162,74,.35); }
.row.pending .bub { opacity: .62; } .row.failed .bub { opacity: .8; border: 1px dashed var(--rose); }

.reply-bar { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 12px; padding: 8px 10px 8px 12px; border-left: 3px solid var(--gold); border-radius: 10px; background: rgba(242,232,207,.08); font-size: 13.5px; }
.reply-bar div { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar b { color: var(--gold); font-weight: 600; display: block; font-size: 12px; }
.reply-bar button { width: 30px; height: 30px; font-size: 20px; color: var(--muted); }
.composer { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(var(--safe-b) + 8px); }
.composer textarea { flex: 1; min-height: 44px; max-height: 132px; resize: none; border-radius: 22px; border: 1px solid var(--gold-soft); background: rgba(255,255,255,.06); color: var(--paper); font: inherit; font-size: 16.5px; line-height: 1.35; padding: 10px 16px; }
.composer textarea::placeholder { color: var(--muted); }
.icon-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); border: 1px solid var(--gold-soft); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.send { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.icon-btn.send[disabled] { opacity: .4; }
.banner { flex: none; text-align: center; font-size: 13px; padding: 6px 12px; color: var(--ink); background: var(--rose); }

/* ---------- Blatt von unten, Bildansicht, Toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5,9,24,.62); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 520px; background: var(--night-2); border: 1px solid rgba(201,162,74,.3); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 14px 16px calc(var(--safe-b) + 16px); animation: up .2s ease; max-height: 86%; overflow-y: auto; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
.sheet h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 6px 4px 8px; }
.sheet p { margin: 6px 4px 12px; font-size: 15.5px; line-height: 1.5; color: var(--paper); }
.sheet p.dim { color: var(--muted); font-size: 14px; }
.emojis { display: flex; justify-content: space-between; padding: 4px 2px 12px; }
.emojis button { width: 46px; height: 46px; font-size: 26px; border-radius: 50%; }
.emojis button.on { background: var(--gold-soft); }
.act { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 52px; padding: 0 8px; font-size: 16.5px; border-top: 1px solid rgba(242,232,207,.08); text-align: left; }
.act.danger { color: var(--rose); }
.sheet .btn { width: 100%; margin-top: 8px; }
.viewer { position: fixed; inset: 0; z-index: 30; background: rgba(4,7,18,.96); display: grid; place-items: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer button { position: absolute; top: calc(var(--safe-t) + 10px); right: 14px; width: 44px; height: 44px; font-size: 28px; color: var(--paper); }
.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 84px); transform: translateX(-50%); z-index: 40; background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 20px; box-shadow: 0 6px 24px rgba(0,0,0,.4); animation: fade .15s ease; max-width: 86%; text-align: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 4px 4px 12px; font-size: 14.5px; }
.kv span { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { #app { max-width: 520px; left: 50%; transform: translateX(-50%); border-left: 1px solid rgba(201,162,74,.15); border-right: 1px solid rgba(201,162,74,.15); } }
[hidden] { display: none !important; }
