@font-face {
  font-family: 'Michroma';
  src: url('/fonts/michroma.woff2') format('woff2');
  font-display: swap;
}

:root {
  --grund: #06080b;
  --tinte: #e8f5fa;
  --matt: rgba(232, 245, 250, 0.72);
  --leise: rgba(232, 245, 250, 0.55);  /* ~5,7:1 auf dem Grund (0,38 waren 3,2:1, zu wenig) */
  --linie: rgba(127, 227, 255, 0.18);
  --akzent: #7fe3ff;
  --bernstein: #ffb547;
  --rot: #ff7a6e;
  --breit: 'Michroma', 'Segoe UI Variable Display', system-ui, sans-serif;
  --text: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(ellipse 60% 50% at 50% 40%, color-mix(in srgb, var(--akzent) 7%, transparent), transparent 70%),
    var(--grund);
  color: var(--tinte);
  font: 15px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--akzent); outline-offset: 3px; }

.label {
  font: 11px/1.25 var(--breit);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--leise);
  margin: 0;
}
.leise { color: var(--leise); }
.klein { font-size: 13px; }
.fehler { color: var(--rot); min-height: 1.4em; font-size: 13px; }

#kern {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.8s ease;
}

/* ---------- Login ---------- */
#login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  position: relative;
  z-index: 1;
  text-align: center;
}
#login .wortmarke { margin-top: 38vh; }
.wortmarke {
  font: 26px/1 var(--breit);
  letter-spacing: 0.32em;
  color: var(--tinte);
}
.haupt {
  border: 1px solid var(--akzent);
  background: color-mix(in srgb, var(--akzent) 10%, transparent);
  padding: 12px 22px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  min-width: 260px;
}
.haupt:hover { background: color-mix(in srgb, var(--akzent) 18%, transparent); }
#codeForm { display: grid; gap: 8px; justify-items: start; width: 260px; }
.zeile { display: flex; width: 100%; border-bottom: 1px solid var(--linie); }
.zeile input { flex: 1; background: none; border: 0; padding: 8px 0; outline: none; min-width: 0; }
.zeile button { background: none; border: 0; color: var(--akzent); padding: 8px 0 8px 12px; }

/* ---------- HUD ---------- */
#hud {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr minmax(230px, 320px);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "kopf kopf kopf" "links mitte rechts" "eingabe eingabe eingabe";
  min-height: 100vh;
  min-height: 100dvh;
  padding: 22px 28px 18px;
  gap: 18px 36px;
}
.kopf { grid-area: kopf; display: flex; justify-content: space-between; align-items: flex-start; }
.uhr { font: 34px/1 var(--breit); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; }
.uhr #sek { font-size: 13px; color: var(--leise); margin-left: 6px; vertical-align: top; }
#datum { margin-top: 8px; }
.gruss { margin-top: 10px; color: var(--matt); min-height: 1.4em; }
.kopf .rechts { display: flex; gap: 18px; align-items: flex-start; position: relative; }
.wetter { text-align: right; display: grid; gap: 6px; }
#wTemp { font: 22px/1 var(--breit); }
.grad { font: 300 0.85em/1 var(--text); vertical-align: top; margin-left: 1px; }
.symbol { background: none; border: 0; font-size: 22px; line-height: 1; padding: 2px 6px; color: var(--matt); }
.menu {
  position: absolute; right: 0; top: 34px; z-index: 5;
  display: grid; min-width: 220px;
  background: #0b0f14; border-top: 1px solid var(--akzent);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.menu button { background: none; border: 0; text-align: left; padding: 11px 14px; color: var(--matt); }
.menu button:hover { color: var(--tinte); background: rgba(127, 227, 255, 0.06); }

.mitte { grid-area: mitte; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.kernflaeche {
  width: min(52vh, 40vw, 560px);
  aspect-ratio: 1;
  background: none;
  border: 0;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.phase {
  font: 11px/1 var(--breit);
  letter-spacing: 0.4em;
  color: var(--akzent);
  margin-top: 6px;
  transition: color 0.3s;
}
body.p-handelt .phase, body.p-wartet .phase { color: var(--bernstein); }
body.p-fehler .phase { color: var(--rot); }
.untertitel { max-width: 640px; width: 100%; text-align: center; margin-top: 18px; min-height: 5.5em; }
.du { color: var(--leise); margin: 0 0 8px; font-size: 14px; min-height: 1.3em; }
.jarvis { margin: 0; font-size: 19px; line-height: 1.45; text-wrap: balance; }

.links { grid-area: links; }
.rechts-spalte { grid-area: rechts; }
.links, .rechts-spalte { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.block { position: relative; padding-top: 12px; }
.block::before {
  content: '';
  position: absolute; left: 0; top: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, var(--linie), transparent 85%);
}
.block h2 { margin-bottom: 10px; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.liste li { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.liste li > span { overflow-wrap: anywhere; }
.liste .done > span { color: var(--leise); text-decoration: line-through; text-decoration-color: var(--linie); }
.haken {
  flex: none; width: 13px; height: 13px; margin-top: 3px; padding: 0;
  border: 1px solid var(--akzent); background: none; border-radius: 1px;
}
.done .haken { background: var(--akzent); border-color: var(--akzent); }
#goals li { font-size: 16px; }
.zeiten time { font: 11px/1.6 var(--breit); color: var(--leise); flex: none; width: 46px; letter-spacing: 0.04em; }
.zeiten .ziel > span { color: var(--tinte); }
.zeiten .jetzt time { color: var(--akzent); }
.zeiten .jetzt > span { color: var(--tinte); }
#monat { margin: 10px 0 0; }

.spur { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.spur li { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: baseline; color: var(--matt); }
.spur li::before { content: ''; width: 6px; height: 6px; background: var(--leise); transform: translateY(-1px); }
.spur li.laeuft::before { background: var(--bernstein); animation: puls 1s ease-in-out infinite; }
.spur li.ok::before { background: var(--akzent); }
.spur li.fehler::before { background: var(--rot); }
.spur li.leer { display: block; }
.spur li.leer::before { display: none; }
.spur small { display: block; color: var(--leise); overflow-wrap: anywhere; }

.mission { display: grid !important; gap: 3px; }
.mission .titel { font-size: 15px; }
.mission.vorschlag .titel { color: var(--bernstein); }
#auftraege li { display: grid; gap: 4px; font-size: 13px; }
#auftraege .status { font: 11px/1.2 var(--breit); letter-spacing: 0.14em; text-transform: uppercase; color: var(--leise); }
#auftraege .laeuft .status, #auftraege .bestaetigen .status { color: var(--bernstein); }
#auftraege .fertig .status { color: var(--akzent); }
#auftraege .fehler .status { color: var(--rot); }
#auftraege .ergebnis { color: var(--leise); }
.knoepfe { display: flex; gap: 14px; }
.knoepfe button { background: none; border: 0; padding: 2px 0; color: var(--akzent); font-size: 13px; }
.knoepfe button.nein { color: var(--leise); }

.werte { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.werte dt { color: var(--leise); }
.werte dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.werte .warn { color: var(--bernstein); }

/* ---------- Eingabe ---------- */
.eingabe {
  grid-area: eingabe;
  justify-self: center;
  width: min(720px, 100%);
  display: flex; align-items: center; gap: 14px;
  border-top: 1px solid var(--linie);
  padding-top: 12px;
}
.eingabe input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 10px 0; }
.eingabe input::placeholder { color: var(--leise); }
.senden { background: none; border: 0; color: var(--akzent); font-size: 18px; padding: 6px 4px; }
.mikro {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--linie); background: none; border-radius: 50%;
}
.mikro span { width: 10px; height: 10px; background: var(--matt); border-radius: 50%; transition: transform 0.2s, background 0.2s; }
.mikro[aria-pressed="true"] { border-color: var(--akzent); }
.mikro[aria-pressed="true"] span { background: var(--akzent); transform: scale(1.4); }
body.p-hoert .mikro[aria-pressed="true"] span { animation: puls 1.6s ease-in-out infinite; }

.hinweis {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); z-index: 6;
  background: #0b0f14; border-left: 2px solid var(--akzent); padding: 12px 16px; max-width: min(92vw, 520px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center;
}
.hinweis > span { flex: 1 1 220px; }
.hinweis button { background: none; border: 0; color: var(--akzent); padding: 0; white-space: nowrap; }

@keyframes puls { 50% { opacity: 0.35; } }

/* ---------- Hochfahren ---------- */
.boot { position: fixed; inset: 0; background: var(--grund); z-index: 9; pointer-events: none; opacity: 0; transition: opacity 0.9s ease; }
body.zu .boot { opacity: 1; }
#hud > * { transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
body.hochfahren #hud > * { opacity: 0; transform: translateY(8px); }
body.hochfahren #hud > .mitte { transform: scale(0.96); }
body.hochfahren #kern { opacity: 0; }
#hud > .kopf { transition-delay: 0.15s; }
#hud > .links { transition-delay: 0.45s; }
#hud > .rechts-spalte { transition-delay: 0.6s; }
#hud > .eingabe { transition-delay: 0.75s; }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  #hud {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: "kopf" "mitte" "links" "rechts" "eingabe";
    padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
    gap: 24px;
  }
  .uhr { font-size: 26px; }
  #wMeta { display: none; }
  .kernflaeche { width: min(72vw, 360px); }
  .jarvis { font-size: 17px; }
  .untertitel { min-height: 3em; }
  .eingabe {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 4; width: 100%;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(transparent, var(--grund) 30%);
    border-top: 0;
  }
  .eingabe input { border-bottom: 1px solid var(--linie); }
  .hinweis { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
