:root {
  /* Background */
  --bg: #1a1a1b;

  /* Text */
  --text: #eef0f4;
  --text-2: #c7ccd6;
  --muted: #aab1bd;
  --heading: #9c9ea2;

  /* Twitch Brand */
  --twitch: #9146FF;
  --twitch-2: #B69CFF;
  --twitch-rgb: 145, 70, 255;
  --twitch-2-rgb: 182, 156, 255;

  /* Focus ring */
  --focus: rgba(255,123,144,0.46);

  /* Sidebar */
  --sidebar-w: 280px;
  --sidebar-w-collapsed: 80px;
}

/* -------- Base -------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  background: #101011;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* -------- Layout -------- */
.tbp {
  min-height: 100vh;
  position: relative;
  display: flex;
  padding: 0;
  isolation: isolate;
}

/* Hintergrund: modern, „premium", ohne Text-Overload */
.tbp__bg {
  position: fixed !important;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 700px at 18% 22%, rgba(var(--twitch-rgb), 0.26), transparent 55%),
    radial-gradient(900px 600px at 82% 28%, rgba(255,147,164,0.12), transparent 60%),
    radial-gradient(800px 520px at 50% 100%, rgba(74,184,226,0.08), transparent 55%),
    linear-gradient(180deg, #141415, var(--bg) 55%, #101011);
}

/* Subtiles Grid + Noise für Tiefe */
.tbp__grid {
  position: fixed !important;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background:
    linear-gradient(to right, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(520px 420px at 50% 36%, #000 58%, transparent 100%);
  pointer-events: none;
}

.tbp__noise {
  position: fixed !important;
  inset: 0;
  z-index: -1;
  opacity: 0.08;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Floating accent shapes */
.tbp__orb {
  position: fixed !important;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
  transform: translate3d(0,0,0);
  animation: tbpFloat 8s ease-in-out infinite;
}

.tbp__orb--a {
  width: 360px; height: 360px;
  left: -120px; top: 14%;
  background: radial-gradient(circle at 35% 35%, rgba(var(--twitch-rgb), 0.95), rgba(var(--twitch-rgb), 0.08) 60%, transparent 68%);
  animation-duration: 9s;
}

.tbp__orb--b {
  width: 320px; height: 320px;
  right: -140px; top: 18%;
  background: radial-gradient(circle at 45% 45%, rgba(var(--twitch-2-rgb), 0.55), rgba(var(--twitch-2-rgb), 0.06) 60%, transparent 70%);
  animation-duration: 11s;
  animation-delay: -2s;
}

.tbp__orb--c {
  width: 420px; height: 420px;
  left: 50%; bottom: -220px;
  translate: -50% 0;
  background: radial-gradient(circle at 50% 40%, rgba(74,184,226,0.25), rgba(74,184,226,0.04) 62%, transparent 72%);
  animation-duration: 10s;
  animation-delay: -4s;
}

@keyframes tbpFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-18px) scale(1.02); }
}

/* -------- Sidebar -------- */
.tbp-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 280px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 10;
  transition: width 300ms ease;
}

.tbp-sidebar--collapsed {
  flex-basis: 80px;
  width: var(--sidebar-w-collapsed);
}

.tbp-sidebar__inner {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  border-right: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.35) inset,
    40px 0 120px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* -------- Header -------- */
.tbp-sidebar__header {
  padding: clamp(18px, 3vw, 24px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 68px;
}

/* ✅ Collapsed: oben/unten genau wie links/rechts */
.tbp-sidebar--collapsed .tbp-sidebar__header {
  padding: 18px !important;
  min-height: 0 !important;
  height: auto !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

.tbp-sidebar__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

/* ✅ Collapsed: nur Logo, Text raus aus Layout */
.tbp-sidebar--collapsed .tbp-sidebar__brand {
  width: 100% !important;
  justify-content: center !important;
  align-items: flex-start !important;
  gap: 0 !important;
  flex-direction: row !important;
}

.tbp-sidebar__mark {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 58%),
    linear-gradient(180deg, rgba(var(--twitch-rgb), 0.72), rgba(var(--twitch-rgb), 0.22));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 16px 40px rgba(var(--twitch-rgb), 0.18),
    0 0 0 1px rgba(0,0,0,0.35) inset;
  flex-shrink: 0;
}

.navBrandLogo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.navBrandLogo img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  max-height: 60px;
}

/* ✅ Collapsed: Logo-Größe passend zu padding 10px */
.tbp-sidebar--collapsed .navBrandLogo img {
  max-height: 42px !important;
}

.tbp-sidebar__brand-text {
  min-width: 0;
  text-align: center;
}

.tbp-sidebar__brand-text strong,
.navSiteTitle {
  display: block;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--heading);
  white-space: normal;
  word-wrap: break-word;
  overflow: hidden;
  text-align: center;
}

/* Normalzustand: Text animiert aus */
.tbp-sidebar__brand-text {
  transition: opacity 200ms ease 100ms, width 200ms ease 100ms;
}

/* Collapsed: Text komplett weg, damit keine „unsichtbare Höhe“ bleibt */
.tbp-sidebar--collapsed .tbp-sidebar__brand-text,
.tbp-sidebar--collapsed .navSiteTitle {
  display: none !important;
}

/* -------- Toggle Button (Lasche) -------- */
.tbp-sidebar__toggle {
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
  width: 24px;
  height: 64px;
  padding: 0;
  border: none;
  border-radius: 0 12px 12px 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.12);
  border-left: none;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 300ms ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 30;
  box-shadow:
    4px 0 12px rgba(0,0,0,0.3),
    0 0 0 1px rgba(0,0,0,0.2) inset;
}

.tbp-sidebar__toggle:hover {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  color: var(--text);
  box-shadow:
    6px 0 16px rgba(0,0,0,0.4),
    0 0 0 1px rgba(0,0,0,0.2) inset;
}

.tbp-sidebar__toggle:active {
  transform: translateY(-50%) scale(0.98);
}

.tbp-sidebar__toggle:focus-visible {
  box-shadow:
    4px 0 12px rgba(0,0,0,0.3),
    0 0 0 3px var(--focus),
    0 0 0 1px rgba(0,0,0,0.2) inset;
}

.tbp-sidebar__toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: transform 300ms ease;
}

.tbp-sidebar--collapsed .tbp-sidebar__toggle svg {
  transform: rotate(180deg);
}

/* -------- Navigation -------- */
.tbp-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

/* Collapsed: Menü näher an die Trennlinie */
.tbp-sidebar--collapsed .tbp-sidebar__nav {
  padding-top: 0 !important;
  padding-bottom: 6px !important;
  margin-top: 0 !important;
}

.tbp-sidebar__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tbp-sidebar__item {
  margin: 0;
  padding: 0;
}

.tbp-sidebar__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, padding 200ms ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.tbp-sidebar__link > span:not(.tbp-sidebar__icon) {
  white-space: nowrap;
  transition: opacity 200ms ease, width 200ms ease;
}

.tbp-sidebar--collapsed .tbp-sidebar__link {
  justify-content: center;
  padding: 14px 12px;
}

.tbp-sidebar--collapsed .tbp-sidebar__link > span:not(.tbp-sidebar__icon) {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.tbp-sidebar__link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.tbp-sidebar__link:focus-visible {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 3px var(--focus);
}

.tbp-sidebar__link:active {
  transform: translateX(2px);
}

.tbp-sidebar__icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
  transition: width 300ms ease, height 300ms ease, opacity 160ms ease;
}

.tbp-sidebar__link:hover .tbp-sidebar__icon,
.tbp-sidebar__link:focus-visible .tbp-sidebar__icon {
  opacity: 1;
}

.tbp-sidebar--collapsed .tbp-sidebar__icon {
  width: 28px;
  height: 28px;
  opacity: 0.9;
}

/* -------- Settings Section (Bottom) -------- */
.tbp-sidebar__settings {
  margin-top: auto;
  padding: 12px 0;
  flex-shrink: 0;
}

.tbp-sidebar--collapsed .tbp-sidebar__settings {
  padding-top: 6px;
  padding-bottom: 6px;
}

.tbp-sidebar__user-block {
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: opacity 200ms ease, height 200ms ease, padding 200ms ease;
  font-size: 12px;
}

.tbp-sidebar__user-block * {
  font-size: inherit;
}

.tbp-sidebar--collapsed .tbp-sidebar__user-block {
  display: none;
}

.tbp-sidebar__details {
  margin: 0;
}

.tbp-sidebar__summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background 160ms ease, color 160ms ease, padding 200ms ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
}

.tbp-sidebar__summary > span:not(.tbp-sidebar__icon):not(.tbp-sidebar__chevron) {
  white-space: nowrap;
  transition: opacity 200ms ease, width 200ms ease;
}

.tbp-sidebar--collapsed .tbp-sidebar__summary {
  justify-content: center;
  padding: 14px 12px;
  gap: 0;
}

.tbp-sidebar--collapsed .tbp-sidebar__summary > span:not(.tbp-sidebar__icon):not(.tbp-sidebar__chevron) {
  opacity: 0;
  width: 0;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.tbp-sidebar--collapsed .tbp-sidebar__summary .tbp-sidebar__icon {
  width: 28px;
  height: 28px;
  opacity: 0.9;
}

.tbp-sidebar__summary::-webkit-details-marker {
  display: none;
}

.tbp-sidebar__summary:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

.tbp-sidebar__summary:focus-visible {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 3px var(--focus);
}

.tbp-sidebar__summary .tbp-sidebar__icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
}

.tbp-sidebar__summary:hover .tbp-sidebar__icon {
  opacity: 1;
}

.tbp-sidebar__chevron {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.6;
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 200ms ease, opacity 200ms ease;
  transform: rotate(180deg);
}

.tbp-sidebar__details[open] .tbp-sidebar__chevron {
  transform: rotate(0deg);
}

.tbp-sidebar--collapsed .tbp-sidebar__chevron {
  opacity: 0;
  width: 0;
  overflow: hidden;
  margin-left: 0;
  display: none;
}

.tbp-sidebar--collapsed .tbp-sidebar__details {
  pointer-events: none;
}

.tbp-sidebar--collapsed .tbp-sidebar__details[open] {
  pointer-events: auto;
}

.tbp-sidebar--collapsed .tbp-sidebar__submenu {
  display: none;
}

/* -------- Submenu -------- */
.tbp-sidebar__submenu {
  list-style: none;
  margin: 0;
  padding: 4px 0 8px 0;
  background: rgba(0,0,0,0.2);
}

.tbp-sidebar__subitem {
  margin: 0;
  padding: 0;
}

.tbp-sidebar__sublink {
  display: block;
  padding: 10px 20px 10px 52px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease, padding-left 160ms ease;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.tbp-sidebar__sublink:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding-left: 56px;
}

.tbp-sidebar__sublink:focus-visible {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 0 0 3px var(--focus);
}

/* Scrollbar Styling */
.tbp-sidebar__nav::-webkit-scrollbar {
  width: 6px;
}

.tbp-sidebar__nav::-webkit-scrollbar-track {
  background: transparent;
}

.tbp-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.tbp-sidebar__nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}

.loggedInAs {
  color: var(--font-white);
}

/* Motion reduction */
@media (prefers-reduced-motion: reduce) {
  .tbp__orb { animation: none; }
  .tbp-sidebar__link,
  .tbp-sidebar__summary,
  .tbp-sidebar__sublink {
    transition: none;
  }
  .tbp-sidebar__chevron {
    transition: none;
  }
}

