/* public/css/jarvis.css — J.A.R.V.I.S. Schüler-Hub · HUD-Look v3 */

/* ── SCHRIFTEN (lokal, kein Google-Abruf) ── */
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(../fonts/nunito-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 400; font-display: swap; src: url(../fonts/nunito-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(../fonts/nunito-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 600; font-display: swap; src: url(../fonts/nunito-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(../fonts/nunito-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(../fonts/nunito-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Orbitron'; font-weight: 600; font-display: swap; src: url(../fonts/orbitron-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Orbitron'; font-weight: 800; font-display: swap; src: url(../fonts/orbitron-latin-800-normal.woff2) format('woff2'); }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url(../fonts/rajdhani-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Rajdhani'; font-weight: 600; font-display: swap; src: url(../fonts/rajdhani-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url(../fonts/rajdhani-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Rajdhani'; font-weight: 700; font-display: swap; src: url(../fonts/rajdhani-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ── TOKENS ── */
:root {
  --cyan: #00e5ff;
  --cyan-2: #7df3ff;
  --cyan-line: rgba(0, 229, 255, 0.4);
  --cyan-soft: rgba(0, 229, 255, 0.08);
  --gold: #ffb347;
  --gold-txt: #ffd18a;
  --ink: #f2fbfd;
  --body: #eef8fb;
  --muted: #c2e9f2;
  --bg: #01070f;
  --panel: rgba(2, 18, 32, 0.8);
  --ok: #34f5a0;
  --err: #ff8a8a;
  --f-hud: 'Nunito', system-ui, sans-serif;
  --f-brand: 'Orbitron', 'Rajdhani', sans-serif;
  --f-body: 'Nunito', system-ui, sans-serif;
  --speed: 1;
  --chamfer: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(0, 110, 170, 0.45) 0%, rgba(1, 7, 15, 0) 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 170, 60, 0.05) 0%, rgba(1, 7, 15, 0) 72%),
    linear-gradient(rgba(0, 229, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.045) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 24px 24px, 24px 24px;
  color: var(--ink);
  font-family: var(--f-body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.working { --speed: 0.2; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gold { color: var(--gold); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Keine Scanlines über dem Inhalt: auf skalierten Bildschirmen wirken sie wie durchgestrichene Schrift */
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.vignette { background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.45) 100%); }

/* Eckklammern (gold) */
.br { position: absolute; width: 16px; height: 16px; border: 0 solid var(--gold); pointer-events: none; filter: drop-shadow(0 0 4px rgba(255, 179, 71, 0.8)); z-index: 2; }
.br.tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.br.tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.br.bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.br.brr { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.panel {
  position: relative;
  border: 1px solid rgba(0, 229, 255, 0.32);
  background: var(--panel);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.1), inset 0 0 30px rgba(0, 229, 255, 0.04);
}

/* ── LAYOUT ── */
#app { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
#stage { position: relative; min-height: 0; }
#view-hub, #view-chat { height: 100%; }

/* ── HUD-LEISTE ── */
#hud-top {
  position: relative; z-index: 10;
  height: 56px; display: flex; align-items: center; gap: 14px;
  padding: 0 12px 0 8px;
  padding-top: env(safe-area-inset-top);
  background: linear-gradient(180deg, rgba(0, 40, 60, 0.88), rgba(1, 7, 15, 0.92));
  border-bottom: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.25);
  font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.2px;
  overflow: hidden;
}
#hud-top > button, #clock { flex-shrink: 0; }
body.in-chat .hub-label { display: none; }
@media (max-width: 1180px) { #st-time { display: none !important; } }
.logo-btn { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px; border: 0; background: transparent; }
.brand { font-family: var(--f-brand); font-weight: 800; letter-spacing: 5px; font-size: 15px; color: var(--cyan); text-shadow: 0 0 12px rgba(0, 229, 255, 0.9); }
.hub-label { color: var(--gold); font-size: 13px; letter-spacing: 0.2px; }
.stat { display: flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; min-width: 0; overflow: hidden; }
.stat b { color: #fff; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
#st-online.off .dot { background: var(--err); box-shadow: 0 0 10px var(--err); }
#st-online.off { color: var(--err); }
.grow { flex: 1; }
#clock { font-family: var(--f-brand); font-size: 13px; color: var(--cyan); letter-spacing: 2px; text-shadow: 0 0 8px rgba(0, 229, 255, 0.7); font-variant-numeric: tabular-nums; }
body:not(.in-chat) .chat-only { display: none !important; }

.btn-gold, .btn-hud, .btn-icon {
  height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 14px; font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.2px;
}
.btn-gold { border: 1px solid var(--gold); background: rgba(255, 179, 71, 0.12); color: var(--gold-txt); box-shadow: 0 0 12px rgba(255, 179, 71, 0.35); }
.btn-hud { border: 1px solid rgba(0, 229, 255, 0.55); background: rgba(0, 229, 255, 0.08); color: #fff; }
.btn-hud svg, .btn-icon svg { color: var(--cyan); }
.btn-hud:hover, .btn-icon:hover { background: rgba(0, 229, 255, 0.18); box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }
.btn-icon { width: 44px; padding: 0; border: 1px solid rgba(0, 229, 255, 0.55); background: rgba(0, 229, 255, 0.08); box-shadow: 0 0 10px rgba(0, 229, 255, 0.25); }
.btn-hud.wide { width: 100%; }

#hud-bottom {
  position: relative; z-index: 10;
  min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 4px 12px calc(4px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 229, 255, 0.3); background: rgba(1, 7, 15, 0.9);
  font-family: var(--f-hud); font-size: 14px; font-weight: 600; letter-spacing: 0.2px; color: #bfe9f3; text-align: center;
}
body.in-chat #hud-bottom { display: none; }

/* ── REAKTOR ── */
.reactor { position: relative; width: var(--rs, 400px); height: var(--rs, 400px); flex-shrink: 0; }
.reactor .rg { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.reactor .spin { animation: spin calc(var(--d, 40s) * var(--speed)) linear infinite; }
.reactor .rev { animation-direction: reverse; }
@keyframes spin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.97); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); } }
.m2 { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
.m5 { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)); }
.m10 { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px)); mask: radial-gradient(farthest-side, transparent calc(100% - 11px), #000 calc(100% - 10px)); }
.m16 { -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 17px), #000 calc(100% - 16px)); mask: radial-gradient(farthest-side, transparent calc(100% - 17px), #000 calc(100% - 16px)); }
.glow { filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.9)); }
.goldglow { filter: drop-shadow(0 0 6px rgba(255, 179, 71, 0.9)); }
.r-ticks { width: 100%; height: 100%; background: repeating-conic-gradient(rgba(0, 229, 255, 0.75) 0 0.8deg, transparent 0.8deg 5deg); --d: 140s; }
.r-gold1 { width: 96%; height: 96%; background: conic-gradient(from 210deg, var(--gold) 0 64deg, transparent 64deg 180deg, var(--gold) 180deg 244deg, transparent 244deg 360deg); --d: 60s; }
.r-seg1 { width: 88%; height: 88%; background: repeating-conic-gradient(var(--cyan) 0 30deg, transparent 30deg 36deg); --d: 45s; }
.r-dash { width: 79%; height: 79%; border: 1px dashed rgba(0, 229, 255, 0.45); }
.r-seg2 { width: 69%; height: 69%; background: repeating-conic-gradient(from 5deg, rgba(140, 248, 255, 0.95) 0 9deg, transparent 9deg 30deg); --d: 26s; }
.r-solid { width: 55%; height: 55%; border: 2px solid rgba(0, 229, 255, 0.6); box-shadow: 0 0 26px rgba(0, 229, 255, 0.45), inset 0 0 26px rgba(0, 229, 255, 0.35); }
.r-gold2 { width: 47%; height: 47%; background: conic-gradient(from 300deg, rgba(255, 179, 71, 0.95) 0 100deg, transparent 100deg 360deg); --d: 14s; }
.r-seg3 { width: 40%; height: 40%; background: repeating-conic-gradient(rgba(200, 255, 255, 0.9) 0 20deg, transparent 20deg 30deg); --d: 10s; }
.r-corering { width: 29%; height: 29%; border: 3px solid rgba(190, 252, 255, 0.9); box-shadow: 0 0 34px rgba(0, 229, 255, 0.9), inset 0 0 22px rgba(0, 229, 255, 0.7); }
.r-core { width: 25%; height: 25%; background: radial-gradient(circle, #fff 0%, #b8fbff 18%, #00d9f5 42%, rgba(0, 229, 255, 0) 72%); box-shadow: 0 0 90px 30px rgba(0, 229, 255, 0.45); animation: pulse calc(3s * var(--speed)) ease-in-out infinite; }

.reactor.mini { --rs: 30px; }
.reactor.mini .r-core { box-shadow: 0 0 12px rgba(0, 229, 255, 0.9); width: 42%; height: 42%; }
.reactor.bg { position: absolute; --rs: 440px; right: -110px; top: 40px; opacity: 0.32; pointer-events: none; z-index: 0; }
body.working .reactor.bg { opacity: 0.55; }

/* ── START-HUB ── */
#view-hub { display: flex; flex-direction: column; padding: 14px 24px 18px; }
.hub-meta {
  display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; margin-bottom: 10px;
  font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.2px; color: rgba(0, 229, 255, 0.85);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(0, 229, 255, 0.6), rgba(0, 229, 255, 0) 35%, rgba(0, 229, 255, 0) 65%, rgba(0, 229, 255, 0.6)) 1;
}
.hub-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(220px, 260px) 1fr minmax(220px, 260px); align-items: center; gap: 24px; }
.hub-col { display: flex; flex-direction: column; gap: clamp(10px, 1.8vh, 14px); }
.hub-center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.reactor.big { --rs: min(48vh, 34vw, 430px); }
.hub-ring-label { position: absolute; left: 50%; transform: translateX(-50%); font-family: var(--f-hud); font-weight: 700; font-size: 12px; letter-spacing: 0.2px; white-space: nowrap; }
.hub-ring-label.top { top: -26px; color: var(--gold-txt); }
.hub-ring-label.bottom { bottom: -26px; color: var(--muted); }
.hub-title { margin: 40px 0 0; font-family: var(--f-brand); font-size: clamp(18px, 2.4vw, 24px); font-weight: 800; letter-spacing: 6px; color: #fff; text-shadow: 0 0 16px rgba(0, 229, 255, 0.95), 0 0 4px var(--cyan); text-align: center; }
.hub-sub { margin: 6px 0 0; font-size: 16px; color: #bfe9f3; text-align: center; }

/* Agenten-Kachel (abgeschrägt) */
.tile { position: relative; display: block; width: 100%; height: clamp(80px, 13.5vh, 104px); padding: 0; border: 0; background: transparent; text-align: left; color: #fff; }
.tile-frame { position: absolute; inset: 0; clip-path: var(--chamfer); background: linear-gradient(135deg, var(--cyan), rgba(0, 229, 255, 0.25)); transition: background 0.15s; }
.tile-inner { position: absolute; inset: 1px; clip-path: var(--chamfer); background: linear-gradient(135deg, rgba(0, 60, 90, 0.95), rgba(2, 14, 26, 0.95)); display: flex; align-items: center; gap: 14px; padding: 0 18px; }
.right .tile-frame { background: linear-gradient(225deg, var(--cyan), rgba(0, 229, 255, 0.25)); }
.right .tile-inner { background: linear-gradient(225deg, rgba(0, 60, 90, 0.95), rgba(2, 14, 26, 0.95)); }
.tile:hover .tile-frame, .tile:focus-visible .tile-frame { background: linear-gradient(135deg, var(--gold), var(--cyan)); }
.tile:hover { filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.45)); }
.tile:focus-visible { outline: none; filter: drop-shadow(0 0 8px rgba(255, 179, 71, 0.9)); }
.tile-ico { font-size: 30px; line-height: 1; }
.tile-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-name { font-family: var(--f-hud); font-size: 19px; font-weight: 800; letter-spacing: 0.2px; }
.tile-sub { font-size: 14px; color: var(--muted); }
.tile-num { position: absolute; right: 26px; top: 10px; font-family: var(--f-brand); font-size: 10px; color: var(--gold); }
.tile-badge { position: absolute; right: 22px; bottom: 12px; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--gold); color: var(--gold-txt); font-family: var(--f-hud); font-size: 13px; display: flex; align-items: center; justify-content: center; }
/* Leuchtlinien zum Reaktor */
.hub-col .tile::after { content: ''; position: absolute; top: 50%; height: 2px; width: var(--ln, 30px); box-shadow: 0 0 8px rgba(0, 229, 255, 0.6); pointer-events: none; }
.hub-col.left .tile::after { left: 100%; background: linear-gradient(90deg, rgba(0, 229, 255, 0.9), rgba(0, 229, 255, 0)); }
.hub-col.right .tile::after { right: 100%; background: linear-gradient(270deg, rgba(0, 229, 255, 0.9), rgba(0, 229, 255, 0)); }
.hub-col .tile:nth-child(1), .hub-col .tile:nth-child(4) { --ln: 72px; }
.hub-col .tile:nth-child(2), .hub-col .tile:nth-child(3) { --ln: 28px; }

/* ── CHAT-ANSICHT ── */
#view-chat { display: flex; gap: 12px; padding: 12px; }
#agent-nav { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.nav-title { font-family: var(--f-brand); font-size: 11px; letter-spacing: 3px; color: rgba(0, 229, 255, 0.75); padding: 4px 8px 8px; }
#agent-list { display: flex; flex-direction: column; gap: 4px; }
.nav-btn { position: relative; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; background: transparent; font-family: var(--f-hud); font-size: 16px; font-weight: 700; letter-spacing: 0.2px; text-align: left; color: var(--ink); }
.nav-btn:hover { background: rgba(0, 229, 255, 0.08); }
.nav-btn.active { border-color: var(--cyan); background: linear-gradient(90deg, rgba(0, 229, 255, 0.22), rgba(0, 229, 255, 0.04)); color: #fff; box-shadow: 0 0 14px rgba(0, 229, 255, 0.25); }
.nav-ico { font-size: 20px; }
.nav-badge { margin-left: auto; min-width: 22px; padding: 1px 6px; border: 1px solid var(--gold); font-size: 12px; color: var(--gold-txt); text-align: center; }
.nav-btn.active .nav-badge { display: none; }
.nav-btn.active::after { content: ''; margin-left: auto; width: 8px; height: 8px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.nav-hint { margin-top: auto; font-size: 13px; line-height: 1.45; color: var(--muted); padding: 0 8px 4px; }
.nav-more { display: none; }

#chat-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow: hidden; }
#chat-panel > *:not(.reactor):not(.br):not(.scanbeam) { position: relative; z-index: 1; }
.scanbeam { position: absolute; left: 0; right: 0; top: 0; height: 80px; pointer-events: none; z-index: 0; opacity: 0; background: linear-gradient(180deg, rgba(0, 229, 255, 0) 0%, rgba(0, 229, 255, 0.10) 70%, rgba(125, 243, 255, 0.5) 100%); }
body.working .scanbeam { opacity: 1; animation: beam 1.6s linear infinite; }
@keyframes beam { from { transform: translateY(-80px); } to { transform: translateY(100vh); } }

#chat-history { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 2px 4px 8px 2px; scrollbar-width: thin; scrollbar-color: rgba(0, 229, 255, 0.3) transparent; overscroll-behavior: contain; }

.msg-user { align-self: flex-end; max-width: 75%; padding: 10px 16px; border: 1px solid rgba(90, 170, 255, 0.6); background: rgba(20, 70, 140, 0.55); color: #fff; font-size: 16px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.msg-user .who { font-family: var(--f-hud); font-weight: 700; letter-spacing: 0.2px; color: #9cc8ff; margin-right: 8px; }

.msg-agent { position: relative; align-self: flex-start; width: 100%; max-width: 640px; border: 1px solid rgba(0, 229, 255, 0.4); background: rgba(2, 24, 40, 0.94); box-shadow: 0 0 22px rgba(0, 229, 255, 0.14); animation: fadeIn 0.25s ease; }
.msg-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid rgba(0, 229, 255, 0.3); background: linear-gradient(90deg, rgba(0, 229, 255, 0.18), rgba(0, 229, 255, 0.02)); font-family: var(--f-hud); font-size: 14px; font-weight: 700; letter-spacing: 0.2px; color: var(--cyan); }
.msg-head .t { margin-left: auto; color: var(--gold-txt); font-size: 13px; }
.msg-body { padding: 14px 18px 16px; font-size: 17px; line-height: 1.65; color: var(--body); overflow-wrap: anywhere; }
.msg-body strong { color: #fff; }
.msg-body em { color: var(--cyan-2); font-style: normal; }
.msg-body ul { margin: 6px 0; padding-left: 22px; }
.msg-body table { border-collapse: collapse; margin: 8px 0; }
.msg-body td, .msg-body th { border: 1px solid rgba(0, 229, 255, 0.3); padding: 4px 8px; }
.msg-body hr { border: 0; border-top: 1px solid rgba(0, 229, 255, 0.3); margin: 8px 0; }
.msg-body a { color: var(--cyan-2); }
.msg-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.act { height: 40px; padding: 0 14px; border: 1px solid rgba(0, 229, 255, 0.45); background: transparent; color: var(--ink); font-family: var(--f-hud); font-size: 15px; font-weight: 700; letter-spacing: 0.2px; display: inline-flex; align-items: center; gap: 8px; }
.act svg { width: 16px; height: 16px; color: var(--cyan); }
.act:hover { background: rgba(0, 229, 255, 0.12); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.followups { display: flex; flex-direction: column; gap: 8px; max-width: 640px; width: 100%; }
.fu-title { font-family: var(--f-hud); font-size: 13px; font-weight: 700; letter-spacing: 0.2px; color: var(--muted); }
.chip { min-height: 46px; padding: 8px 16px 8px 14px; border: 1px solid rgba(0, 229, 255, 0.5); background: rgba(0, 229, 255, 0.06); color: #fff; font-size: 15px; font-weight: 700; text-align: left; box-shadow: 0 0 12px rgba(0, 229, 255, 0.12); }
.chip::before { content: '›'; color: var(--cyan); margin-right: 10px; }
.chip:hover { background: rgba(0, 229, 255, 0.16); border-color: var(--cyan); }
.chip.area::before { content: '◆'; color: var(--gold); }
.ans { min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 6px 14px; border: 1px solid rgba(0, 229, 255, 0.45); background: rgba(0, 229, 255, 0.06); color: #fff; font-size: 16px; font-weight: 700; text-align: left; box-shadow: 0 0 12px rgba(0, 229, 255, 0.1); }
.ans:hover { background: rgba(0, 229, 255, 0.16); border-color: var(--cyan); }
.ans .key { flex-shrink: 0; width: 30px; height: 30px; border: 1px solid var(--cyan); color: var(--cyan); display: flex; align-items: center; justify-content: center; font-family: var(--f-brand); font-size: 13px; font-weight: 800; box-shadow: 0 0 8px rgba(0, 229, 255, 0.4); }

.msg-typing { align-self: flex-start; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid rgba(0, 229, 255, 0.4); background: rgba(2, 24, 40, 0.9); font-family: var(--f-hud); font-weight: 700; letter-spacing: 0.2px; color: var(--cyan); }
.msg-typing i { width: 6px; height: 6px; background: var(--cyan); box-shadow: 0 0 6px var(--cyan); animation: blink 1.2s infinite; }
.msg-typing i:nth-child(3) { animation-delay: 0.2s; } .msg-typing i:nth-child(4) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

.msg-error { align-self: stretch; max-width: 640px; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border: 1px solid rgba(255, 110, 110, 0.6); background: rgba(90, 15, 20, 0.6); box-shadow: 0 0 14px rgba(255, 90, 90, 0.2); }
.msg-error .txt { flex: 1; font-size: 15px; line-height: 1.4; color: #ffd9d9; }
.msg-error .tag { font-family: var(--f-hud); font-weight: 700; letter-spacing: 0.2px; color: var(--err); margin-right: 6px; }
.msg-error button { height: 44px; padding: 0 14px; border: 1px solid #ffb3b3; background: rgba(255, 140, 140, 0.18); color: #fff; font-family: var(--f-hud); font-weight: 700; font-size: 15px; letter-spacing: 0.2px; }

/* Quiz-Punkte */
#score-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border: 1px solid rgba(253, 230, 138, 0.55); background: rgba(253, 230, 138, 0.07); box-shadow: 0 0 14px rgba(253, 230, 138, 0.15); font-family: var(--f-hud); font-weight: 700; letter-spacing: 0.2px; color: #fde68a; }
#score-val { font-family: var(--f-brand); font-size: 17px; font-weight: 800; text-shadow: 0 0 8px rgba(253, 230, 138, 0.6); }
.score-segs { flex: 1; display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.score-segs i { height: 10px; background: rgba(253, 230, 138, 0.18); }
.score-segs i.on { background: #fde68a; box-shadow: 0 0 6px #fde68a; }
#score-bar.pop { animation: pop 0.4s ease; }
@keyframes pop { 50% { box-shadow: 0 0 26px rgba(253, 230, 138, 0.7); } }

/* Eingabe */
#input-row { display: flex; gap: 10px; align-items: center; margin: 0; }
.input-wrap { position: relative; flex: 1; min-width: 0; }
#q { width: 100%; height: 52px; padding: 0 16px; border: 1px solid rgba(0, 229, 255, 0.4); border-radius: 0; background: rgba(1, 8, 16, 0.9); color: var(--ink); font-size: 16px; }
#q::placeholder { color: rgba(191, 233, 243, 0.55); }
#q:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 14px rgba(0, 229, 255, 0.35); }
#send-btn { width: 72px; height: 52px; flex-shrink: 0; border: 1px solid var(--cyan-2); background: linear-gradient(180deg, #2ff0ff, #00b8d9); box-shadow: 0 0 18px rgba(0, 229, 255, 0.6); display: flex; align-items: center; justify-content: center; }
#send-btn svg { width: 22px; height: 22px; fill: #012230; stroke: none; }
#send-btn:disabled, #q:disabled { opacity: 0.5; cursor: not-allowed; }
.disclaimer { font-family: var(--f-hud); font-size: 14px; font-weight: 600; letter-spacing: 0.2px; color: #bfe9f3; text-align: center; }

/* ── EINSTELLUNGEN ── */
.backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 4, 10, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.drawer { position: fixed; z-index: 61; top: 64px; right: 12px; width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 76px); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 18px; background: #03121f; border: 1px solid rgba(0, 229, 255, 0.5); box-shadow: 0 0 30px rgba(0, 229, 255, 0.2), inset 0 0 40px rgba(0, 229, 255, 0.05); animation: fadeIn 0.2s ease; }
.drawer-head { display: flex; align-items: center; }
.drawer-head h2 { margin: 0; flex: 1; font-family: var(--f-brand); font-size: 15px; font-weight: 800; letter-spacing: 0.2px; color: var(--cyan); }
.set-group { display: flex; flex-direction: column; gap: 8px; }
.set-lbl { font-family: var(--f-hud); font-size: 14px; font-weight: 700; letter-spacing: 0.2px; color: var(--muted); }
.set-lbl.gold { color: var(--gold); }
.set-info { margin: 0; font-size: 14px; line-height: 1.45; color: #cfe6ee; }
.set-sep { height: 1px; background: linear-gradient(90deg, rgba(0, 229, 255, 0), rgba(0, 229, 255, 0.5), rgba(0, 229, 255, 0)); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.seg button { height: 44px; border: 1px solid rgba(0, 229, 255, 0.35); background: transparent; font-family: var(--f-hud); font-weight: 700; font-size: 16px; letter-spacing: 0.2px; }
.seg button[aria-pressed="true"] { border-color: var(--cyan); background: rgba(0, 229, 255, 0.2); color: #fff; box-shadow: 0 0 12px rgba(0, 229, 255, 0.3); }
.drawer select { height: 44px; padding: 0 12px; border: 1px solid rgba(0, 229, 255, 0.4); border-radius: 0; background: rgba(1, 8, 16, 0.9); color: var(--ink); font-size: 15px; min-width: 0; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; font-weight: 600; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { position: relative; width: 46px; height: 26px; flex-shrink: 0; border: 1px solid rgba(0, 229, 255, 0.5); background: rgba(1, 8, 16, 0.9); }
.toggle-ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: rgba(0, 229, 255, 0.4); transition: left 0.15s; }
.toggle input:checked + .toggle-ui { border-color: var(--cyan); background: rgba(0, 229, 255, 0.25); box-shadow: 0 0 10px rgba(0, 229, 255, 0.35); }
.toggle input:checked + .toggle-ui::after { left: 23px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--gold); outline-offset: 2px; }
.row { display: flex; gap: 8px; }
.row select:first-child { flex: 1; }
.qr-row { align-items: center; gap: 14px; }
.qr-box { width: 112px; height: 112px; flex-shrink: 0; background: #fff; padding: 6px; box-shadow: 0 0 18px rgba(0, 229, 255, 0.4); }
.qr-box svg { width: 100%; height: 100%; display: block; stroke: none; }
.qr-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.link-text { font-family: var(--f-hud); font-size: 14px; color: var(--muted); word-break: break-all; }

.overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 4, 10, 0.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.qr-big-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.qr-box.big { width: min(70vh, 80vw); height: min(70vh, 80vw); padding: 16px; }

/* Klasse wählen */
.cycle-box { position: relative; width: min(480px, 100%); padding: 32px 28px 26px; text-align: center; background: rgba(2, 18, 32, 0.96); border: 1px solid rgba(0, 229, 255, 0.5); box-shadow: 0 0 40px rgba(0, 229, 255, 0.2), inset 0 0 30px rgba(0, 229, 255, 0.04); }
.cycle-title { font-family: var(--f-hud); font-size: 13px; font-weight: 700; letter-spacing: 0.2px; color: var(--gold); margin-bottom: 8px; }
.cycle-heading { margin: 0 0 6px; font-family: var(--f-brand); font-size: 20px; font-weight: 800; letter-spacing: 2px; color: #fff; text-shadow: 0 0 12px rgba(0, 229, 255, 0.8); }
.cycle-sub { margin: 0 0 24px; font-size: 15px; color: #bfe9f3; }
.cycle-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cycle-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 10px 16px; border: 1px solid rgba(0, 229, 255, 0.45); background: rgba(0, 229, 255, 0.06); }
.cycle-btn:hover, .cycle-btn[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 179, 71, 0.1); box-shadow: 0 0 16px rgba(255, 179, 71, 0.35); }
.cb-num { font-family: var(--f-brand); font-size: 28px; font-weight: 800; color: var(--cyan); text-shadow: 0 0 10px rgba(0, 229, 255, 0.8); }
.cb-label { font-size: 15px; font-weight: 700; color: #fff; }
.cb-age { font-size: 13px; color: var(--muted); }

/* ── TABLET HOCHKANT / HANDY ── */
@media (max-width: 899px) {
  .hide-md { display: none !important; }
  #view-hub { overflow-y: auto; padding: 12px 12px 20px; }
  .hub-meta { display: none; }
  .hub-grid { display: flex; flex-direction: column; gap: 14px; }
  .hub-center { order: -1; padding-top: 30px; }
  .reactor.big { --rs: min(56vw, 34vh, 300px); }
  .hub-title { margin-top: 34px; }
  .hub-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .tile { height: 92px; }
  .tile-inner { flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; padding: 0 14px; }
  .tile-ico { font-size: 24px; }
  .tile-name { font-size: 16px; }
  .tile-sub { display: none; }
  .hub-col .tile::after { display: none; }

  #view-chat { flex-direction: column; gap: 8px; padding: 8px; }
  #agent-nav { width: auto; flex-direction: row; padding: 8px; }
  #agent-nav .br, .nav-title, .nav-hint { display: none; }
  #agent-list { flex-direction: row; overflow-x: auto; scrollbar-width: none; padding-right: 40px; }
  #agent-list::-webkit-scrollbar { display: none; }
  .nav-btn { flex-direction: column; justify-content: center; gap: 2px; min-width: 76px; height: 58px; padding: 0 6px; font-size: 12px; letter-spacing: 0.2px; border-color: rgba(0, 229, 255, 0.25); }
  .nav-ico { font-size: 18px; }
  .nav-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; padding: 0 4px; font-size: 11px; }
  .nav-btn.active::after { display: none; }
  .nav-more { display: flex; position: absolute; right: 0; top: 0; bottom: 0; width: 56px; align-items: center; justify-content: flex-end; padding-right: 6px; pointer-events: none; background: linear-gradient(90deg, rgba(2, 18, 32, 0), #021220 70%); color: var(--cyan); }
  #chat-panel { padding: 10px; }
  .reactor.bg { --rs: 320px; right: -120px; }
  .msg-body { font-size: 16px; padding: 12px 14px 14px; }
  .msg-user { max-width: 88%; }
  #send-btn { width: 60px; }
}
@media (max-width: 560px) {
  .hide-sm { display: none !important; }
  #hud-top { gap: 8px; padding-right: 8px; }
  .brand { font-size: 12px; letter-spacing: 3px; }
  .btn-gold { padding: 0 12px; }
  #newchat-btn { width: 44px; padding: 0; }
  #st-online-txt { display: none; }
  .disclaimer { font-size: 12px; }
}

/* ── BEWEGUNG REDUZIEREN ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body.working .scanbeam { opacity: 0; }
}

/* ── HILFE-KNOPF (immer sichtbar) ── */
.btn-help { height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid #ff8a8a; background: rgba(255, 110, 110, 0.16); color: #fff; font-family: var(--f-hud); font-weight: 800; font-size: 15px; box-shadow: 0 0 12px rgba(255, 110, 110, 0.35); }
.btn-help:hover { background: rgba(255, 110, 110, 0.28); }
@media (max-width: 560px) { .btn-help { width: 44px; padding: 0; justify-content: center; } }

/* ── HILFE-PANEL ── */
.help-drawer { width: min(440px, calc(100vw - 24px)); gap: 14px; }
.help-intro { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.45; color: #fff; }
.help-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.help-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid rgba(0, 229, 255, 0.3); background: rgba(0, 229, 255, 0.05); font-size: 15px; line-height: 1.45; color: var(--ink); }
.help-steps b { color: #fff; font-size: 16px; }
.hs-ico { font-size: 24px; line-height: 1.1; }
.help-brave { margin: 0; padding: 10px 12px; border-left: 3px solid var(--gold); background: rgba(255, 179, 71, 0.1); color: var(--gold-txt); font-weight: 700; font-size: 15px; }
.help-call { display: flex; gap: 14px; align-items: center; min-height: 56px; padding: 10px 12px; border: 1px solid rgba(52, 245, 160, 0.55); background: rgba(10, 70, 50, 0.45); color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.4; }
.help-call b { color: #fff; font-size: 15px; }
.help-call:hover { background: rgba(10, 90, 60, 0.6); }
.hc-num { flex-shrink: 0; min-width: 104px; font-family: var(--f-brand); font-size: 17px; font-weight: 800; color: var(--ok); }
.help-danger { margin: 0; padding: 10px 12px; border: 1px solid rgba(255, 110, 110, 0.6); background: rgba(90, 15, 20, 0.55); color: #ffd9d9; font-weight: 700; font-size: 15px; }
.help-ai { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* ── ONLINE-HELD: Kachel im Hub ── */
.held-tile { margin-top: 16px; min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 8px 22px; border: 1px solid var(--gold); background: linear-gradient(135deg, rgba(255, 179, 71, 0.22), rgba(2, 14, 26, 0.9)); color: #fff; text-align: left; box-shadow: 0 0 18px rgba(255, 179, 71, 0.35); clip-path: var(--chamfer); }
.held-tile:hover { background: linear-gradient(135deg, rgba(255, 179, 71, 0.35), rgba(2, 14, 26, 0.9)); }
.held-tile .tile-name { font-size: 18px; }
.held-tile .tile-sub { color: var(--gold-txt); }
.held-ico { font-size: 30px; }
.nav-btn.nav-held { border-color: rgba(255, 179, 71, 0.55); }
.nav-btn.nav-held.active { border-color: var(--gold); background: linear-gradient(90deg, rgba(255, 179, 71, 0.25), rgba(255, 179, 71, 0.04)); box-shadow: 0 0 14px rgba(255, 179, 71, 0.3); }

/* Statischer Agent: keine Eingabe */
body.static-agent #input-row, body.static-agent .disclaimer { display: none; }

/* ── ONLINE-HELD: Quiz ── */
.held-card { position: relative; width: 100%; max-width: 680px; align-self: center; padding: 20px 22px; border: 1px solid rgba(255, 179, 71, 0.5); background: rgba(2, 24, 40, 0.95); box-shadow: 0 0 22px rgba(255, 179, 71, 0.12); display: flex; flex-direction: column; gap: 14px; }
.held-intro, .held-result { align-items: center; text-align: center; }
.held-shield { font-size: 52px; line-height: 1; filter: drop-shadow(0 0 12px rgba(255, 179, 71, 0.7)); }
.held-title { margin: 0; font-family: var(--f-brand); font-size: 22px; font-weight: 800; letter-spacing: 3px; color: #fff; text-shadow: 0 0 12px rgba(0, 229, 255, 0.8); }
.held-text { margin: 0; font-size: 17px; line-height: 1.55; color: var(--body); }
.held-big { margin: 0; font-size: 22px; font-weight: 800; color: var(--gold-txt); }
.held-note { margin: 0; font-size: 13px; color: var(--muted); }
.held-main { min-height: 52px; padding: 0 28px; border: 1px solid var(--cyan-2); background: linear-gradient(180deg, #2ff0ff, #00b8d9); color: #012230; font-family: var(--f-hud); font-weight: 800; font-size: 17px; box-shadow: 0 0 18px rgba(0, 229, 255, 0.5); align-self: center; }
.held-card:not(.held-intro):not(.held-result) .held-main { align-self: flex-end; }
.held-helpbtn { align-self: center; }
.held-progress { width: 100%; max-width: 680px; align-self: center; display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--gold-txt); }
.held-segs { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.held-segs i.done { background: #fde68a; box-shadow: 0 0 6px #fde68a; }
.held-segs i.now { background: rgba(0, 229, 255, 0.8); box-shadow: 0 0 6px var(--cyan); }
.held-pts { white-space: nowrap; }
.held-q { margin: 0; font-size: 19px; font-weight: 800; line-height: 1.45; color: #fff; }
.held-answers { display: flex; flex-direction: column; gap: 10px; }
.held-ans { min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 8px 14px; border: 1px solid rgba(0, 229, 255, 0.45); background: rgba(0, 229, 255, 0.06); color: #fff; font-size: 16px; font-weight: 700; line-height: 1.4; text-align: left; }
.held-ans:not(:disabled):hover { background: rgba(0, 229, 255, 0.16); border-color: var(--cyan); }
.held-ans .key { flex-shrink: 0; width: 30px; height: 30px; border: 1px solid var(--cyan); color: var(--cyan); display: flex; align-items: center; justify-content: center; font-family: var(--f-brand); font-size: 13px; font-weight: 800; }
.held-ans:disabled { cursor: default; }
.held-ans.is-right { border-color: var(--ok); background: rgba(10, 90, 60, 0.6); }
.held-ans.is-right .key { border-color: var(--ok); color: var(--ok); }
.held-ans.is-wrong { border-color: #ff8a8a; background: rgba(110, 20, 25, 0.6); }
.held-ans.is-wrong .key { border-color: #ff8a8a; color: #ff8a8a; }
.held-ans.is-dim { opacity: 0.45; }
.held-fb { padding: 12px 14px; font-size: 16px; line-height: 1.55; color: var(--body); }
.held-fb.ok { border: 1px solid rgba(52, 245, 160, 0.6); background: rgba(10, 70, 50, 0.55); }
.held-fb.ok > b { color: var(--ok); }
.held-fb.no { border: 1px solid rgba(255, 138, 138, 0.6); background: rgba(90, 15, 20, 0.55); }
.held-fb.no > b { color: #ff9d9d; }
.held-better { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, 0.15); }
.held-better b { color: var(--ok); }
.held-promise { width: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.chip.chip-on { border-color: var(--gold); background: rgba(255, 179, 71, 0.2); }
.held-done { margin: 4px 0 0; font-size: 16px; line-height: 1.5; color: var(--body); }
