/* ==========================================================================
   minimax.schenkel.io – gemeinsames Design-System
   Alle Testseiten nutzen diese Klassen. Seitenspezifisches CSS gehört in
   assets/css/<seite>.css.
   ========================================================================== */

:root {
  --topbar-h: 56px;
  --panel-w: 330px;
  --radius: 14px;
  --radius-sm: 9px;

  --bg: #0a0c11;
  --bg-2: #0f1219;
  --surface: #141821;
  --surface-2: #1c212c;
  --surface-3: #252b38;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .17);
  --text: #e7ebf3;
  --muted: #98a3b9;
  --accent: #5eead4;
  --accent-2: #818cf8;
  --accent-3: #f472b6;
  --danger: #f87171;
  --warn: #fbbf24;
  --shadow: 0 12px 34px rgba(0, 0, 0, .38);
  --glass: rgba(16, 19, 27, .74);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f3f5fa;
  --bg-2: #e9edf5;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e3e8f1;
  --line: rgba(15, 23, 42, .11);
  --line-2: rgba(15, 23, 42, .22);
  --text: #121722;
  --muted: #5a667c;
  --accent: #0d9488;
  --accent-2: #6366f1;
  --accent-3: #db2777;
  --danger: #dc2626;
  --warn: #b45309;
  --shadow: 0 12px 34px rgba(15, 23, 42, .12);
  --glass: rgba(255, 255, 255, .8);
  color-scheme: light;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body.scroll { overflow: auto; }

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.25rem; letter-spacing: -.01em; }
h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }
h3 { font-size: .95rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, .mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- Topbar ------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  flex: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #06121a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2) 70%, var(--accent-3));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 6px 16px rgba(94, 234, 212, .22);
}

.brand-text small { color: var(--muted); font-weight: 500; }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 550;
  font-size: 13px;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link .glyph { font-size: 12px; opacity: .8; }
.nav-link.active {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--line-2);
  box-shadow: 0 0 0 1px rgba(94, 234, 212, .12) inset;
}
.nav-link.active .glyph { color: var(--accent); opacity: 1; }

.topbar-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }

/* ---------- Layout: Bühne + Panel ---------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  height: calc(100dvh - var(--topbar-h));
  min-height: 0;
}
.layout.wide { --panel-w: 400px; }
.layout.nopanel { grid-template-columns: minmax(0, 1fr); }
.layout.nopanel .panel { display: none; }

body.panel-collapsed .layout { grid-template-columns: minmax(0, 1fr); }
body.panel-collapsed .panel { display: none; }

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(129, 140, 248, .10), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(94, 234, 212, .07), transparent 60%),
    var(--bg-2);
}
.stage > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }

.panel {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 28px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-3) transparent;
}

.panel-head { display: flex; flex-direction: column; gap: 4px; }
.panel-head p { color: var(--muted); font-size: .86rem; }

.group { display: flex; flex-direction: column; gap: 10px; }
.group + .group { padding-top: 16px; border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 10px;
}
.row > label, .row > .label { color: var(--muted); font-size: .86rem; }
.row.stack { grid-template-columns: minmax(0, 1fr); gap: 6px; }

.value { font-family: var(--mono); font-size: .8rem; color: var(--text); text-align: right; }

.field { display: flex; flex-direction: column; gap: 5px; }

/* ---------- Formularelemente --------------------------------------------- */

input, select, textarea, button { font: inherit; color: inherit; }

input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; margin: 0; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .14);
}
textarea { resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; tab-size: 2; }

input[type="color"] {
  width: 100%;
  height: 32px;
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.switch span { color: var(--muted); font-size: .86rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(16px); background: var(--accent); }

/* ---------- Buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-weight: 550;
  font-size: 13px;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn.primary {
  color: #06121a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 auto; }

.seg {
  display: flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg.wrap { flex-wrap: wrap; }
.seg button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seg.wrap button { flex: 1 1 28%; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 550;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active {
  color: #06121a;
  background: var(--accent);
  border-color: transparent;
  font-weight: 700;
}

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-2) inset;
  padding: 0;
}
.swatch.active { border-color: var(--text); }

/* ---------- Anzeigen ----------------------------------------------------- */

.note { color: var(--muted); font-size: .8rem; line-height: 1.45; }

.kbd, kbd {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  background: var(--surface-2);
  font: 600 11px/1.6 var(--mono);
  color: var(--text);
  text-align: center;
}

.hints { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .8rem; }
.hints span { display: inline-flex; align-items: center; gap: 5px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
.stat {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat b { font: 700 15px/1.2 var(--mono); }
.stat span { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.badge.violet { color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); border-color: color-mix(in srgb, var(--accent-2) 35%, transparent); }
.badge.pink { color: var(--accent-3); background: color-mix(in srgb, var(--accent-3) 14%, transparent); border-color: color-mix(in srgb, var(--accent-3) 35%, transparent); }

/* ---------- Overlays in der Bühne ---------------------------------------- */

.stage-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.stage-hud > * { pointer-events: auto; }
.stage-hud .spacer { flex: 1 1 auto; pointer-events: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.pill b { color: var(--text); font-family: var(--mono); font-weight: 700; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.stage-hint {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 5;
  max-width: calc(100% - 24px);
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  pointer-events: none;
}

.stage-toast {
  position: absolute;
  left: 50%;
  top: 56px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s;
}
.stage-toast.show { opacity: 1; }

.dropzone {
  position: absolute;
  inset: 12px;
  z-index: 7;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
}

/* ---------- Inhaltsseiten (Hub) ------------------------------------------ */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero { display: flex; flex-direction: column; gap: 10px; padding: 8px 0 4px; }
.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -.03em; line-height: 1.1; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--muted); max-width: 68ch; font-size: 1rem; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-2);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c1, var(--accent)), var(--c2, var(--accent-2)));
  opacity: .85;
}
.card-top { display: flex; align-items: center; gap: 12px; }
.card-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c1, var(--accent)) 26%, transparent), color-mix(in srgb, var(--c2, var(--accent-2)) 26%, transparent));
  border: 1px solid var(--line);
}
.card h3 { font-size: 1.05rem; }
.card p { color: var(--muted); font-size: .9rem; flex: 1 1 auto; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  padding: 2px 8px;
  border-radius: 999px;
  font: 600 11px/1.6 var(--mono);
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.card-go { color: var(--accent); font-weight: 700; font-size: .86rem; white-space: nowrap; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.footer { color: var(--muted); font-size: .82rem; text-align: center; padding-top: 8px; }

/* ---------- Responsiv ---------------------------------------------------- */

@media (max-width: 900px) {
  body { overflow: auto; }
  .layout, .layout.wide {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .stage { height: min(64dvh, 560px); }
  .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .brand-text small { display: none; }
}

@media (max-width: 520px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .value { text-align: left; }
  .page { padding: 20px 14px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .001ms !important; }
}
