/* CoreRex terminal — Coremedia HUD */
:root {
  --bg: #080d18;
  --ink: #eef2fb;
  --muted: #96a3c2;
  --faint: #5d6b8c;
  --line: rgba(238, 242, 251, 0.1);
  --ice: #84b2ff;
  --ice-dim: rgba(79, 141, 253, 0.16);
  --gold: #d4b07a;
  --card: rgba(8, 13, 24, 0.78);
  --danger: #ff6b6b;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; width: 100%; max-width: 100%;
  background: var(--bg); color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--ice); text-decoration: none; }
a:hover { color: #d6e4ff; }
::selection { background: rgba(79, 141, 253, 0.35); color: #fff; }

.grain {
  pointer-events: none; position: fixed; inset: 0; z-index: 8; opacity: 0.14;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.55'/></svg>");
}
.vignette {
  pointer-events: none; position: fixed; inset: 0; z-index: 7;
  background:
    radial-gradient(ellipse 80% 50% at 18% -8%, rgba(79,141,253,.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 92% 8%, rgba(212,176,122,.07), transparent 50%),
    radial-gradient(ellipse 70% 60% at 50% 48%, transparent 42%, rgba(8,13,24,.72) 100%);
}

#boot {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  background:
    radial-gradient(ellipse 50% 40% at 50% 28%, rgba(79,141,253,.16), transparent 60%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(212,176,122,.08), transparent 55%),
    #080d18;
}
#boot .logo { width: 72px; height: 72px; margin-bottom: 22px; filter: drop-shadow(0 12px 28px rgba(79,141,253,.35)); }
#boot .kicker {
  margin: 0 0 12px; font-family: var(--mono); font-size: 0.68rem; font-weight: 500;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold);
}
#boot h1 {
  margin: 0 0 10px; font-family: var(--display); font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 3.4rem); letter-spacing: -0.04em; line-height: 1.02;
}
#boot h1 span { color: var(--ice); }
#boot p { color: var(--muted); max-width: 44ch; line-height: 1.6; margin: 0 0 28px; font-size: 1.02rem; }
.cta {
  appearance: none; border: 0; cursor: pointer; padding: 14px 26px; border-radius: 999px;
  font-family: var(--display); font-weight: 700; font-size: 0.86rem; color: #00122b;
  background: linear-gradient(180deg, #d6e4ff 0%, #84b2ff 42%, #4f8dfd 100%);
  box-shadow: 0 10px 30px -12px rgba(79,141,253,.8);
}
.cta:hover { transform: translateY(-2px); }
.boot-creds {
  margin-top: 22px; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint);
}

.shell { height: 100%; display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; }
.top {
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 8px; z-index: 6;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  font-family: var(--display); font-weight: 700; font-size: 0.92rem;
  letter-spacing: 0.04em; color: var(--ink);
}
.brand svg { width: 34px; height: 34px; flex-shrink: 0; }
.brand span { color: var(--ice); }
.pill {
  font-family: var(--mono); font-weight: 600; font-size: 0.62rem; letter-spacing: 0.16em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 999px;
  border: 1px solid rgba(132,178,255,.4); color: var(--ice); background: var(--ice-dim);
}
.pill.live::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ice); margin-right: 7px; box-shadow: 0 0 8px var(--ice);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .35; } }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.icon-btn {
  appearance: none; width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(8,13,24,.78); color: var(--ice);
  display: grid; place-items: center;
}
.icon-btn:hover { border-color: var(--ice); }
.icon-btn[aria-pressed="true"] { color: var(--danger); border-color: rgba(255,107,107,.5); background: rgba(255,107,107,.08); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.vol { width: 72px; accent-color: #4f8dfd; }

.main {
  display: grid; grid-template-columns: minmax(220px, 280px) 1fr minmax(240px, 340px);
  gap: 10px; min-height: 0; min-width: 0; padding: 0 12px; position: relative; z-index: 5;
}
.panel, .stage, .left, .right, .bar, .top { min-width: 0; }
.panel {
  background: linear-gradient(180deg, rgba(15,23,43,.9), rgba(8,13,24,.92));
  border: 1px solid var(--line); border-radius: 22px; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px -40px rgba(0,0,0,.85);
  backdrop-filter: blur(18px);
}
.ph {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--gold); padding: 14px 16px 8px;
}
.log { flex: 1; overflow: auto; padding: 0 16px 12px; font-size: 0.78rem; line-height: 1.55; color: var(--muted); }
.log div { margin: 0 0 8px; }
.log time { color: var(--gold); font-family: var(--mono); font-size: 0.62rem; margin-right: 6px; }
.log .sys { color: var(--faint); }
.log .me { color: var(--ink); }
.log .rex { color: var(--ice); }
.tele { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 12px 14px; }
.tele > div { padding: 8px 10px; border-radius: 12px; background: rgba(8,13,24,.5); border: 1px solid var(--line); }
.tele b {
  display: block; font-family: var(--mono); font-size: 0.52rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 3px;
}
.tele span { font-family: var(--display); font-weight: 600; font-size: 0.82rem; }

.stage {
  position: relative; min-height: 0; overflow: hidden; border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 55% 50% at 50% 48%, rgba(79,141,253,.12), transparent 62%),
    linear-gradient(180deg, #0c1428, #080d18);
}
#globe { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#globe:active { cursor: grabbing; }
.orbit, .orbit-gold {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(58%, 420px); aspect-ratio: 1; pointer-events: none; border-radius: 50%;
}
.orbit { border: 1px dashed rgba(132,178,255,.32); animation: spin 48s linear infinite; }
.orbit-gold { width: min(66%, 480px); border: 1px dashed rgba(212,176,122,.28); animation: spin-rev 72s linear infinite; }
.stage.talking .orbit { border-style: solid; border-color: rgba(132,178,255,.75); animation: spin 12s linear infinite, pulse 1.1s ease-in-out infinite; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-rev { to { transform: translate(-50%, -50%) rotate(-360deg); } }
@keyframes pulse { 50% { transform: translate(-50%, -50%) scale(1.035) rotate(180deg); } }
.status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 2;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--gold); pointer-events: none; white-space: nowrap;
}
.scan-read {
  position: absolute; left: 50%; bottom: 42px; transform: translateX(-50%); z-index: 2;
  pointer-events: none; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.16em;
  color: var(--ice); background: rgba(8,13,24,.7); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 999px;
}
.eye-bar {
  position: absolute; left: 10px; top: 40px; z-index: 3;
  display: flex; flex-wrap: wrap; gap: 6px; pointer-events: auto;
}
.eye-chip {
  appearance: none; cursor: pointer; font-family: var(--mono); font-weight: 600; font-size: 0.58rem;
  letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(8,13,24,.72); color: var(--faint);
}
.eye-chip b { margin-left: 5px; font-weight: 600; }
.eye-chip.on { color: var(--ice); border-color: rgba(132,178,255,.55); background: var(--ice-dim); }
.eye-chip[data-layer="events"].on { color: #ffb4a8; border-color: rgba(255,122,89,.5); background: rgba(255,122,89,.12); }
.eye-card {
  position: absolute; right: 10px; top: 40px; z-index: 3; width: min(230px, calc(100% - 24px));
  padding: 10px 12px 12px; border-radius: 16px; background: rgba(8,13,24,.86);
  border: 1px solid var(--line); backdrop-filter: blur(14px);
}
.eye-card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ice); margin-bottom: 8px;
}
.eye-card-h button { appearance: none; cursor: pointer; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }
.eye-kv { grid-template-columns: 64px 1fr; font-size: 0.78rem; }
.slogan {
  position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; z-index: 2;
  font-family: var(--display); font-weight: 700; font-size: clamp(.68rem, 1.6vw, .86rem);
  letter-spacing: 0.12em; text-shadow: 0 8px 24px rgba(0,0,0,.55); pointer-events: none;
}
.slogan span { color: var(--ice); }

.rex-box {
  margin: 0 14px 10px; padding: 12px 14px; min-height: 96px; max-height: 46%;
  overflow: auto; flex: 0 1 auto; border-radius: 16px;
  background: rgba(8,13,24,.5); border: 1px solid var(--line); border-left: 2px solid var(--ice);
}
.rex-box p { margin: 0; color: var(--ink); line-height: 1.5; font-size: 0.92rem; overflow-wrap: anywhere; }
.rex-box .who {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ice); margin: 0 0 8px;
}
.intel { flex: 1; min-height: 0; overflow: auto; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.intel:empty::before {
  content: "Kein Ziel. Nenn einen Ort, oder tippe auf die Erde.";
  color: var(--faint); font-size: 0.84rem; line-height: 1.55;
}
.shot { flex: none; height: 148px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0a1020; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kv { display: grid; grid-template-columns: 88px 1fr; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.kv b {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); padding-top: 3px;
}
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.news a {
  display: block; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(8,13,24,.45); color: var(--ink); font-size: 0.8rem; line-height: 1.4;
}
.news a:hover { border-color: rgba(132,178,255,.5); background: var(--ice-dim); }

.bar { z-index: 6; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.bar-inner {
  display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 999px;
  background: rgba(8,13,24,.9); border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
#cmd {
  flex: 1; min-width: 0; appearance: none; border: 0; outline: none;
  background: transparent; padding: 10px 12px; font-size: 15px;
}
#cmd::placeholder { color: var(--faint); }
.go {
  appearance: none; border: 0; cursor: pointer; border-radius: 999px; padding: 10px 16px;
  font-family: var(--display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.04em;
  color: #00122b; background: linear-gradient(180deg, #d6e4ff, #84b2ff);
}
.hints { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 2px 0; }
.hints button {
  appearance: none; cursor: pointer; border-radius: 999px; padding: 6px 12px;
  border: 1px solid var(--line); background: rgba(15,23,43,.6); color: var(--muted); font-size: 0.72rem;
}
.hints button:hover { border-color: var(--ice); color: var(--ice); }

@media (max-width: 980px) {
  .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(240px, 42vh) minmax(0, 1fr); }
  .left { display: none; }
  .stage { min-height: 240px; border-radius: 20px; }
  .orbit { width: min(64%, 280px); }
  .orbit-gold { width: min(74%, 320px); }
  .scan-read { bottom: 32px; }
  .eye-card { top: auto; bottom: 52px; right: 8px; left: 8px; width: auto; }
  .vol { width: 56px; }
  .bar-inner { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; border-radius: 18px; }
  .slogan { letter-spacing: .06em; font-size: .62rem; }
}
@media (max-width: 520px) {
  .vol, .pill { display: none; }
  .icon-btn { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit, .orbit-gold, .stage.talking .orbit, .pill.live::before { animation: none; }
  .cta:hover { transform: none; }
}
