/* ------------------------------------------------------------------ */
/*  TLAP 2.0 - Live-Demo                                               */
/*                                                                     */
/*  Die Farben, Radien und Schriften sind aus der echten App           */
/*  uebernommen (tlap/src/app/globals.css), damit die Demo genauso     */
/*  aussieht wie die Web-App. Wer dort Tokens aendert, aendert sie     */
/*  hier mit.                                                          */
/* ------------------------------------------------------------------ */

:root {
  color-scheme: dark;

  /* Flaechen */
  --bg: #0f1115;
  --bg-sidebar: #0b0d11;
  --card: #14171e;
  --card-inner: #10131a;
  --elev: #171a21;
  --elev-2: #1b1f28;

  /* Linien */
  --border-sidebar: #1a1e27;
  --border: #20242e;
  --border-2: #262b36;
  --border-3: #2a2f3b;
  --border-4: #313845;

  /* Text */
  --text: #f1f3f7;
  --text-soft: #b6bdcb;
  --text-mid: #9aa2b2;
  --text-dim: #8a93a6;
  --text-muted: #737c90;
  --text-faint: #5a6275;
  --text-ghost: #4d5567;

  /* Akzente */
  --red: #e5231b;
  --green: #2fbf71;
  --blue: #3e7bfa;
  --gold: #f0a92b;
  --purple: #9b7dff;

  --red-text: #ff5a4d;
  --on-accent: #ffffff;
  --gold-flaeche: #f0a92b;
  --nav-aktiv: #ffffff;

  --tint: rgba(255, 255, 255, 0.1);
  --tint-weak: rgba(255, 255, 255, 0.04);
  --tint-strong: rgba(255, 255, 255, 0.18);
  --tint-border: rgba(255, 255, 255, 0.14);
  --sunken: rgba(0, 0, 0, 0.22);
  --scrim: rgba(8, 9, 12, 0.68);
  --hover-overlay: rgba(255, 255, 255, 0.05);

  --shadow-card: none;
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.55);

  /* Serienfarben der Spieleranalyse */
  --serie-1: #e5231b;
  --serie-2: #2fbf71;
  --serie-3: #f0a92b;
  --serie-4: #4da3ff;
  --serie-5: #b07cff;

  --font-display-stack: "Rajdhani", system-ui, sans-serif;
  --font-body-stack: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg: #f2f4f7;
  --bg-sidebar: #ffffff;
  --card: #ffffff;
  --card-inner: #f6f7f9;
  --elev: #f2f4f7;
  --elev-2: #e9ecf1;

  --border-sidebar: #e4e8ee;
  --border: #e2e6ec;
  --border-2: #dbe0e8;
  --border-3: #d0d7e1;
  --border-4: #c2cad7;

  --text: #14171d;
  --text-soft: #363d4b;
  --text-mid: #474f5e;
  --text-dim: #566070;
  --text-muted: #646c7b;
  --text-faint: #6d7585;
  --text-ghost: #868e9c;

  --red: #e5231b;
  --green: #0e7343;
  --blue: #2563eb;
  --gold: #855b00;
  --purple: #6b3fd4;

  --red-text: #c81a12;
  --nav-aktiv: #8f1009;

  --tint: rgba(0, 0, 0, 0.06);
  --tint-weak: rgba(0, 0, 0, 0.05);
  --tint-strong: rgba(0, 0, 0, 0.11);
  --tint-border: rgba(0, 0, 0, 0.1);
  --sunken: rgba(0, 0, 0, 0.05);
  --scrim: rgba(20, 23, 29, 0.45);
  --hover-overlay: rgba(0, 0, 0, 0.045);

  --shadow-card:
    0 1px 2px rgba(16, 20, 28, 0.06), 0 1px 3px rgba(16, 20, 28, 0.05);
  --shadow-pop: 0 12px 32px rgba(16, 20, 28, 0.14);
  --shadow-modal: 0 24px 60px rgba(16, 20, 28, 0.22);

  --serie-1: #d11c14;
  --serie-2: #0f8f52;
  --serie-3: #855b00;
  --serie-4: #1f6fd0;
  --serie-5: #6b3fd4;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-body-stack);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

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

button {
  cursor: pointer;
}

/* ---------------------------- Rahmen ------------------------------ */

.rahmen {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.kopf {
  flex-shrink: 0;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 12px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-sidebar);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 20;
}

.kopf-titel {
  font-family: var(--font-display-stack);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  /* Im schmalen Telefonrahmen bleibt fuer den Titel wenig Platz. Ohne
     diese drei Zeilen laeuft er sichtbar unter die Kopfknoepfe. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kopf-unter {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kopf-knopf {
  width: 38px;
  height: 38px;
  background: var(--elev);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  position: relative;
}

.kopf-knopf:hover {
  background: var(--elev-2);
}

.inhalt {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 24px;
  scrollbar-width: none;
}

.inhalt::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* --------------------------- Tab-Leiste --------------------------- */

.tabs {
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-sidebar);
  display: flex;
  align-items: flex-start;
  padding: 8px 6px calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 20;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.2px;
}

.tab[data-aktiv="1"] {
  color: var(--red);
  font-weight: 700;
}

.tab-punkt {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  border-radius: 20px;
  font-size: 8.5px;
  font-weight: 700;
  font-family: var(--font-display-stack);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----------------------------- Menue ------------------------------ */

.schirm {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  z-index: 60;
  animation: einblenden 0.18s ease;
}

.menue {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 86%;
  max-width: 310px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 61;
  animation: menueRein 0.24s ease;
}

.menue-liste {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px 20px;
  scrollbar-width: none;
}

.menue-liste::-webkit-scrollbar {
  width: 0;
}

.menue-gruppe {
  font-family: var(--font-display-stack);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-ghost);
  padding: 14px 10px 6px;
}

.menue-punkt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 10px;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.menue-punkt:hover {
  background: var(--hover-overlay);
  color: var(--text);
}

.menue-punkt[data-aktiv="1"] {
  background: var(--red);
  color: var(--nav-aktiv);
  font-weight: 700;
}

:root[data-theme="light"] .menue-punkt[data-aktiv="1"] {
  background: rgba(229, 35, 27, 0.12);
}

/* ---------------------------- Bausteine --------------------------- */

.karte {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.karte-innen {
  background: var(--card-inner);
  border: 1px solid var(--border-2);
  border-radius: 12px;
}

.abschnitt {
  margin-bottom: 14px;
}

.titel {
  font-family: var(--font-display-stack);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text);
}

.etikett {
  font-family: var(--font-display-stack);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.wert-gross {
  font-family: var(--font-display-stack);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}

.knopf-primaer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--red);
  border: 1px solid var(--red);
  color: #fff;
  border-radius: 9px;
  padding: 9px 16px;
  box-shadow: 0 8px 18px -10px rgba(229, 35, 27, 0.7);
  font-family: var(--font-display-stack);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.knopf-geist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-4);
  color: var(--text-mid);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.knopf-geist:hover {
  background: var(--hover-overlay);
  color: var(--text);
}

.knopf-geist[data-aktiv="1"] {
  border-color: var(--red);
  color: var(--red-text);
}

.feld {
  background: var(--card-inner);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  width: 100%;
}

.feld:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(229, 35, 27, 0.22);
}

.plakette {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-display-stack);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 6px;
}

.reiter {
  display: flex;
  gap: 6px;
  background: var(--card-inner);
  border: 1px solid var(--border-2);
  border-radius: 11px;
  padding: 4px;
}

.reiter button {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 6px;
  font-size: 12px;
  font-weight: 700;
}

.reiter button[data-aktiv="1"] {
  background: var(--elev-2);
  color: var(--text);
}

:root[data-theme="light"] .reiter button[data-aktiv="1"] {
  background: #fff;
  box-shadow: var(--shadow-card);
}

.trenner {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
}

.balken {
  height: 6px;
  border-radius: 99px;
  background: var(--elev-2);
  overflow: hidden;
}

.balken > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--red);
  transition: width 0.4s ease;
}

.avatar {
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display-stack);
  font-weight: 700;
  flex-shrink: 0;
}

.zeile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hinweis-demo {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--card-inner);
  border: 1px dashed var(--border-3);
  border-radius: 10px;
  padding: 9px 11px;
}

/* ---------------------------- Dialog ------------------------------ */

.dialog-schirm {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(3px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: einblenden 0.16s ease;
}

.dialog {
  width: 100%;
  max-width: 460px;
  max-height: 84%;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
  padding: 18px;
  animation: hochrutschen 0.2s ease;
  scrollbar-width: none;
}

.dialog::-webkit-scrollbar {
  width: 0;
}

/* -------------------------- Hinweiswolke -------------------------- */

/* Umgekehrte Farben wie bei einer Systemmeldung: dunkle Flaeche im
   hellen Thema, helle im dunklen - so ist sie ueber jedem Inhalt
   lesbar. */
.wolke {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--text);
  color: var(--bg);
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: var(--shadow-modal);
  animation: hochrutschen 0.2s ease;
  max-width: 84%;
  text-align: center;
}

@keyframes einblenden {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes hochrutschen {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes menueRein {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes pulsieren {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Ab Tablettbreite darf die Demo etwas mehr Luft haben. */
@media (min-width: 620px) {
  .rahmen {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* Schmaler Telefonrahmen (Demo auf der Webseite, ca. 308px): Kopfknoepfe
   und Titel etwas kleiner, sonst bleiben fuer den Titel nur ~84px und
   "DASHBOARD" wird zu "DASHB..." gekuerzt. */
@media (max-width: 360px) {
  .kopf {
    gap: 7px;
    padding-left: 13px;
    padding-right: 13px;
  }
  .kopf-titel {
    font-size: 16px;
    letter-spacing: 0.2px;
  }
  .kopf-knopf {
    width: 33px;
    height: 33px;
    border-radius: 9px;
  }
}
