/* Giga Pulse – Design-Grundlagen
   Farben: offizielle A1-Palette (Primary + Accent), Schriften wie im Giga-Academy-Pulse-Check. */

:root {
  /* A1 Primary – Rot */
  --red-pale: #FDC9C4;   /* Red -3 */
  --red-soft: #FA8A80;   /* Red -2 */
  --red-hi: #FF372D;     /* Red -1 */
  --red: #EB140A;        /* Red */
  --red-deep: #B90A05;   /* Red +1 */
  --red-dark: #820000;   /* Red +2 */
  --red-ink: #460000;    /* Red +3 */

  /* A1 Primary – Graustufen */
  --grey-1: #F2F2F2;
  --grey-2: #BCBCBC;
  --grey-3: #999999;
  --grey-4: #4F4F4F;
  --grey-5: #333333;

  /* A1 Accent – nur für Datenkategorien */
  --orange: #FFBF00;     /* Orange 1 */
  --blue: #7A8EFF;       /* Blue 3 */

  --bg: #000000;
  --panel: #16161b;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.12);
  --border: #2a2a31;
  --border-strong: #3d3d46;
  --text: #f4f4f6;
  --muted: #9a9aa6;
  --faint: #66666f;
  --good: #3ddc84;
  --bad: var(--red-hi);

  --grad: linear-gradient(120deg, var(--red-deep) 0%, var(--red) 50%, var(--red-hi) 100%);
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 24px 70px -24px rgba(0, 0, 0, 0.9);
  --glow: 0 18px 50px -14px rgba(235, 20, 10, 0.75);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-varsity: 'Graduate', 'Sora', serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--red); color: #fff; }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* --- Hintergrund: Bühnenlicht in A1-Rot --------------------------------- */

.aurora {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 115%, rgba(130, 0, 0, 0.45), transparent 70%);
}
.aurora i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.22;
  animation: drift 28s var(--ease) infinite alternate;
}
.aurora i:nth-child(1) { background: var(--red); top: -32vmax; left: -20vmax; }
.aurora i:nth-child(2) { background: var(--red-dark); bottom: -34vmax; right: -22vmax; animation-delay: -9s; opacity: 0.4; }
.aurora i:nth-child(3) { background: var(--grey-5); top: 25%; left: 40%; width: 45vmax; height: 45vmax; animation-delay: -17s; opacity: 0.35; }
.aurora::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(6vmax, 4vmax) scale(1.1); }
  100% { transform: translate(-4vmax, 7vmax) scale(0.95); }
}

/* --- Marke --------------------------------------------------------------- */

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wordmark { display: inline-flex; align-items: baseline; gap: 9px; white-space: nowrap; line-height: 1; }
.wordmark b {
  font-family: var(--font-varsity);
  font-weight: 400;
  font-size: 24px;
  color: var(--red);
  -webkit-text-stroke: 1.5px #fff;
  paint-order: stroke fill;
  letter-spacing: 0.04em;
}
.wordmark i { font-style: normal; font-weight: 600; font-size: 14px; letter-spacing: 0.3em; color: var(--grey-1); }
.live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(235, 20, 10, 0.16);
  color: var(--red-hi);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.live-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--red-hi); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Varsity-Schrift: rot mit weißer Kontur, wie das Logo */
.varsity {
  font-family: var(--font-varsity);
  font-weight: 400;
  color: var(--red);
  -webkit-text-stroke: 0.045em #fff;
  paint-order: stroke fill;
  letter-spacing: 0.04em;
}
.accent-text { color: var(--red); }

.kicker-mono {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

/* --- Buttons & Felder ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s, opacity 0.2s, box-shadow 0.3s;
}
.btn:hover { background: #1f1f26; border-color: var(--border-strong); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .field:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 2px; }

.btn-primary {
  border: 0;
  background: var(--red);
  color: #fff;
  box-shadow: var(--glow);
}
.btn-primary:hover { background: var(--red-hi); box-shadow: 0 22px 60px -14px rgba(235, 20, 10, 0.95); }
.btn-lg { height: 56px; padding: 0 28px; font-size: 17px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-danger { color: var(--red-soft); }
.btn-danger:hover { background: rgba(235, 20, 10, 0.12); border-color: rgba(235, 20, 10, 0.45); }

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background 0.2s, color 0.2s, transform 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; background: transparent; }
.icon-btn.on { background: var(--surface-3); color: var(--text); border-color: var(--border); }
.icon-btn .icon { width: 20px; height: 20px; }

.badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.badge:empty, .badge[data-n='0'] { display: none; }

.field {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0c0c0f;
  font-size: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: var(--red); background: rgba(235, 20, 10, 0.06); }
textarea.field { height: auto; min-height: 96px; padding: 14px 16px; resize: vertical; line-height: 1.45; }
select.field { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.card {
  background: linear-gradient(160deg, #1b1b21, #111115);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-hi);
  box-shadow: 0 0 0 0 rgba(255, 55, 45, 0.6);
  animation: ping 2s infinite;
}
.live-dot.off { background: var(--grey-4); animation: none; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 55, 45, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255, 55, 45, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 55, 45, 0); }
}

/* --- Toasts --------------------------------------------------------------- */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(22, 22, 27, 0.97);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: toast-in 0.35s var(--spring);
}
.toast.error { border-color: rgba(235, 20, 10, 0.6); color: var(--red-pale); }
.toast.out { animation: toast-out 0.25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* --- Hilfsklassen --------------------------------------------------------- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* --- Schalter ------------------------------------------------------------- */

.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 999px; background: var(--grey-5); border: 1px solid var(--border-strong); transition: background 0.2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--spring); }
.switch input:checked + .track { background: var(--orange); border-color: var(--orange); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 2px solid var(--red-hi); outline-offset: 2px; }
.switch b { display: block; font-size: 15px; }
.switch small { display: block; color: var(--muted); font-size: 13px; }
