/* ARIA – Ambient-HUD. Dark Luxury: Rosegold, Champagner, Violett auf tiefem Grund. */
:root {
  --bg: #05040a;
  --glass-border: rgba(255, 255, 255, 0.1);
  --border-warm: rgba(232, 180, 160, 0.3);
  --text: #f4efe9;
  --muted: #a49eae;
  --faint: #6f6979;
  --rose: #e3a993;
  --rose-deep: #c4806c;
  --champagne: #f3e3c3;
  --violet: #9b7bff;
  --ok: #8fd6b0;
  --danger: #e98b8b;
  --radius: 22px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1100px 760px at 50% 45%, #140f22 0%, var(--bg) 70%);
  color: var(--text);
  font: 400 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

#sphere { position: fixed; inset: 0; z-index: 0; }
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

.glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.wordmark {
  font: 500 30px/1 var(--font-display); letter-spacing: .34em; padding-left: .34em;
  background: linear-gradient(100deg, var(--champagne), var(--rose) 45%, #c9b6ff 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* --- HUD-Rahmen ----------------------------------------------------------- */
.hud { position: fixed; inset: 0; z-index: 2; pointer-events: none; animation: fade-in 1.2s ease both; }
.hud > * { pointer-events: auto; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hud-top {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start;
  padding: max(22px, env(safe-area-inset-top)) 28px 0;
}
.brand { display: flex; flex-direction: column; gap: 6px; }
.hud-meta { display: flex; align-items: flex-start; gap: 22px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
#clock-time { font: 400 26px/1 var(--font-display); color: var(--champagne); letter-spacing: .06em; }
#clock-date { font-size: 11px; color: var(--faint); letter-spacing: .14em; text-transform: uppercase; }
.indicators { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.indicators li { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.indicators .dot { width: 6px; height: 6px; border-radius: 50%; background: #4b4655; }
.indicators li[data-on="true"] { color: var(--muted); }
.indicators li[data-on="true"] .dot { background: var(--ok); box-shadow: 0 0 10px rgba(143, 214, 176, .7); }
.indicators li[data-on="call"] .dot { background: var(--rose); box-shadow: 0 0 10px rgba(227, 169, 147, .9); animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--glass-border); background: rgba(255, 255, 255, .03); color: var(--muted);
  transition: color .3s, border-color .3s, transform .25s, background .3s;
}
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.icon-btn:hover { color: var(--text); border-color: var(--border-warm); transform: translateY(-1px); }
.icon-btn--soft { width: 48px; height: 48px; backdrop-filter: blur(16px); }
.icon-btn:focus-visible, .mic:focus-visible, .btn:focus-visible, input:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

/* --- Untere Steuerung ------------------------------------------------------- */
.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
  padding: 0 20px max(30px, env(safe-area-inset-bottom));
}
.caption {
  margin: 0; font: 500 26px/1.2 var(--font-display); color: var(--champagne); letter-spacing: .02em;
  transition: opacity .4s; min-height: 1.2em;
}
.subcaption { margin: 6px 0 22px; font-size: 12.5px; color: var(--faint); letter-spacing: .04em; min-height: 1.5em; }
.controls { display: inline-grid; grid-template-columns: 48px auto 48px; align-items: center; gap: 22px; }
.controls-spacer { width: 48px; }
/* Feste Spalten: das Mikrofon bleibt mittig, auch wenn der Hörer-Button ausgeblendet ist */
#call-phone { grid-column: 1; }
.controls .mic { grid-column: 2; }
.controls-spacer { grid-column: 3; }

.mic {
  --level: 0;
  position: relative; width: 78px; height: 78px; border-radius: 50%; cursor: pointer; display: grid; place-items: center;
  border: 1px solid var(--border-warm); color: #1d1217;
  background: radial-gradient(circle at 35% 30%, #fff6e8, var(--champagne) 30%, var(--rose) 70%, var(--rose-deep));
  box-shadow: 0 0 0 calc(var(--level) * 18px) rgba(227, 169, 147, .12), 0 18px 50px -12px rgba(227, 169, 147, .65);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .15s, background .4s;
}
.mic:hover { transform: translateY(-2px) scale(1.03); }
.mic:active { transform: scale(.97); }
.mic:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.mic svg { width: 28px; height: 28px; fill: currentColor; }
.mic .end-icon { display: none; }
.mic-ring { position: absolute; inset: -9px; border-radius: 50%; border: 1px solid rgba(243, 227, 195, .25); opacity: 0; }
.mic[aria-pressed="true"] { background: radial-gradient(circle at 35% 30%, #ffd9d9, #f1a3a3 45%, #c86370); color: #23090d; }
.mic[aria-pressed="true"] .mic-icon { display: none; }
.mic[aria-pressed="true"] .end-icon { display: block; }
.mic[aria-pressed="true"] .mic-ring { animation: pulse-ring 1.8s ease-out infinite; }
.mic.is-connecting .mic-ring { animation: pulse-ring .9s ease-out infinite; }
@keyframes pulse-ring { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.5); opacity: 0; } }

/* --- Pop-up-Karten -------------------------------------------------------- */
.cards {
  /* Zwischen Kopfzeile und Steuerung – bei vielen Karten scrollbar statt über den Rand */
  position: absolute; top: 96px; bottom: 196px; right: 28px; /* unten frei für Beschriftung und Mikrofon */
  width: min(360px, calc(100vw - 40px)); display: flex; flex-direction: column; justify-content: safe center; gap: 16px;
  overflow-y: auto; scrollbar-width: none; pointer-events: none;
}
.cards::-webkit-scrollbar { display: none; }
.card {
  pointer-events: auto; position: relative; overflow: hidden; padding: 18px 20px 20px; cursor: pointer;
  animation: card-in .7s cubic-bezier(.2, .8, .2, 1) both;
}
.card:hover .card-timer span { animation-play-state: paused; }
.card.is-leaving { animation: card-out .6s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes card-in { from { opacity: 0; transform: translateX(36px) scale(.96); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes card-out { to { opacity: 0; transform: translateX(28px) scale(.97); filter: blur(8px); } }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.card-kind { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--rose); }
.card-source { font-size: 10.5px; color: var(--faint); letter-spacing: .06em; }
.card-title { margin: 0 0 12px; font: 500 22px/1.2 var(--font-display); color: var(--champagne); }
.card-big { font: 500 40px/1 var(--font-display); color: var(--text); margin: 2px 0 4px; }
.card-sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.card-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .035); }
.card-list .accent { color: var(--champagne); white-space: nowrap; }
.card-list .when { color: var(--rose); white-space: nowrap; font-size: 12.5px; }
.card-list--plain li { display: block; }
.card-empty { color: var(--faint); font-size: 13.5px; margin: 0; }
.card-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .04); }
.card-timer span {
  display: block; height: 100%; transform-origin: left;
  background: linear-gradient(90deg, var(--violet), var(--rose), var(--champagne));
  animation: timer var(--ttl, 20s) linear forwards;
}
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* --- Anmeldung ------------------------------------------------------------ */
.login { position: fixed; inset: 0; z-index: 3; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(360px, 100%); padding: 36px 28px 26px; text-align: center; display: grid; gap: 14px; animation: card-in .9s cubic-bezier(.2, .8, .2, 1) both; }
.login-card .wordmark { font-size: 40px; margin: 0; }
.login-card p { margin: 0 0 4px; }
input {
  width: 100%; border-radius: 14px; border: 1px solid var(--glass-border); background: rgba(0, 0, 0, .3);
  color: var(--text); font: 400 15px/1.4 var(--font-ui); padding: 13px 15px; transition: border-color .3s;
}
input:focus { border-color: var(--border-warm); }
input::placeholder { color: var(--faint); }
.btn {
  border: 0; border-radius: 999px; padding: 13px 20px; cursor: pointer; font: 600 14px/1 var(--font-ui); color: #1a1016;
  transition: transform .25s, box-shadow .3s;
}
.btn--primary { background: linear-gradient(120deg, var(--champagne), var(--rose) 55%, #d79bc0); box-shadow: 0 10px 30px -10px rgba(227, 169, 147, .6); }
.btn--primary:hover { transform: translateY(-1px); }
.form-error { color: #f0a3a3; font-size: 13px; min-height: 1.2em; margin: 0; }

/* --- Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%); z-index: 4;
  padding: 11px 18px; border-radius: 999px; font-size: 13.5px; max-width: calc(100% - 32px);
  background: rgba(20, 16, 28, .88); border: 1px solid var(--border-warm); box-shadow: var(--shadow);
  backdrop-filter: blur(16px); animation: card-in .5s cubic-bezier(.2, .8, .2, 1) both;
}

/* --- Responsiv ------------------------------------------------------------ */
@media (max-width: 860px) {
  .hud-top { padding: max(16px, env(safe-area-inset-top)) 16px 0; }
  .wordmark { font-size: 24px; }
  .indicators { display: none; }
  .hud-meta { gap: 12px; align-items: center; }
  #clock-time { font-size: 20px; }
  #clock-date { display: none; }
  .cards {
    top: calc(max(16px, env(safe-area-inset-top)) + 58px); bottom: auto; right: 50%; transform: translateX(50%);
    justify-content: flex-start;
    width: calc(100vw - 32px); max-height: calc(100vh - 360px); overflow: hidden; gap: 10px;
  }
  .card:nth-child(n+3) { display: none; }
  .card { padding: 14px 16px 16px; }
  .card-big { font-size: 32px; }
  .card-list li:nth-child(n+3) { display: none; }
  .caption { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .card-timer span { animation-duration: var(--ttl, 20s) !important; }
}
