/* Alfred — dunkel, ruhig, gross genug fuer den Daumen. */

:root {
  --grund: #0d0f13;
  --flaeche: #161a21;
  --flaeche-hoch: #1e242e;
  --rand: #2a313d;
  --schrift: #e8eaed;
  --leise: #98a1ae;
  --gold: #c8a24a;
  --gruen: #4ea87a;
  --rot: #d2624f;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--grund);
  color: var(--schrift);
  font-family: var(--font);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

.leise { color: var(--leise); font-size: 0.85rem; }
.fehler { color: var(--rot); font-size: 0.9rem; }
[hidden] { display: none !important; }

/* --- Anmeldung --- */

.tor {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 30%, #171c25 0%, var(--grund) 70%);
  z-index: 50;
}
.tor-box { width: min(360px, 100%); text-align: center; }
.tor-box h1 { margin: 0 0 4px; font-size: 2rem; letter-spacing: 0.04em; color: var(--gold); }
.tor-box form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

input, button {
  font-family: inherit;
  font-size: 1rem;
}
input {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  color: var(--schrift);
  border-radius: var(--radius);
  padding: 14px 16px;
  outline: none;
}
input:focus { border-color: var(--gold); }
button {
  background: var(--gold);
  color: #14171d;
  border: 0;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-weight: 600;
  cursor: pointer;
}
button:active { transform: translateY(1px); }
button.klein {
  background: transparent; color: var(--leise);
  border: 1px solid var(--rand); padding: 6px 12px; font-size: 0.8rem;
}

/* --- Geruest --- */

main {
  display: flex; flex-direction: column;
  height: 100dvh;
  max-width: 720px; margin: 0 auto;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--rand);
}
.marke { display: flex; align-items: center; gap: 10px; letter-spacing: 0.05em; }
.kopf-rechts { display: flex; align-items: center; gap: 12px; }

/* Der Punkt zeigt den Zustand: aus, hoert zu, denkt, spricht. */
.puls { width: 11px; height: 11px; border-radius: 50%; background: var(--rand); }
.puls[data-zustand="hoert"] { background: var(--gruen); animation: atmen 1.4s ease-in-out infinite; }
.puls[data-zustand="denkt"] { background: var(--gold); animation: atmen 0.7s ease-in-out infinite; }
.puls[data-zustand="spricht"] { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.puls[data-zustand="schlaeft"] { background: var(--rand); opacity: 0.4; }
@keyframes atmen { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.35; transform: scale(0.8); } }

/* --- Verlauf --- */

.verlauf {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.blase {
  padding: 12px 14px; border-radius: var(--radius);
  max-width: 85%; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.blase.ich { align-self: flex-end; background: var(--flaeche-hoch); }
.blase.alfred { align-self: flex-start; background: var(--flaeche); border: 1px solid var(--rand); }
.blase.alfred.spricht { border-color: var(--gold); }
.blase.system { align-self: center; background: transparent; color: var(--leise); font-size: 0.85rem; text-align: center; }
.werkzeug {
  align-self: flex-start; font-size: 0.8rem; color: var(--leise);
  border-left: 2px solid var(--gold); padding-left: 10px;
}

/* --- Freigaben --- */

.freigaben { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.freigabe {
  background: var(--flaeche-hoch); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 14px;
}
.freigabe h3 { margin: 0 0 6px; font-size: 0.95rem; }
.freigabe pre {
  margin: 6px 0; padding: 8px; background: #0f1319; border-radius: 8px;
  font-size: 0.78rem; overflow-x: auto; color: var(--leise);
}
.freigabe .knoepfe { display: flex; gap: 10px; margin-top: 10px; }
.freigabe .knoepfe button { flex: 1; padding: 10px; }
.freigabe .nein { background: transparent; color: var(--rot); border: 1px solid var(--rot); }

/* --- Fusszeile --- */

footer {
  border-top: 1px solid var(--rand);
  padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  background: var(--grund);
}
.hoerzeile {
  color: var(--leise); font-style: italic; font-size: 0.9rem;
  padding: 4px 2px 8px; min-height: 1.2em;
}
.eingabe { display: flex; gap: 10px; align-items: center; }
.eingabe input { flex: 1; }
.mikro {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--flaeche-hoch); color: var(--leise);
  border: 1px solid var(--rand); padding: 0;
}
.mikro[aria-pressed="true"] { background: var(--gold); color: #14171d; border-color: var(--gold); }
.mikro.redet { box-shadow: 0 0 0 4px rgba(200,162,74,0.25); }
.senden { width: 52px; flex: 0 0 52px; height: 52px; border-radius: 50%; font-size: 1.3rem; padding: 0; }
.messwert { margin: 8px 2px 0; font-size: 0.72rem; }

@media (prefers-reduced-motion: reduce) {
  .puls { animation: none !important; }
}
