:root {
  --bg-color: #0d0d0f;
  --bg-secondary: #141417;
  --accent: #ff414d;
  --text: #f5f5f5;
  --text-muted: rgba(245, 245, 245, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  --success: #3dd598;
  --info: #c01919;
  --hero-image: linear-gradient(135deg, rgba(12, 12, 16, 0.95) 0%, rgba(21, 21, 30, 0.85) 55%, rgba(255, 65, 77, 0.35) 100%);
}

[data-theme="light"] {
  --bg-color: #f4f6fb;
  --bg-secondary: #ffffff;
  --accent: #ff414d;
  --text: #1f1f25;
  --text-muted: rgba(31, 31, 37, 0.65);
  --card-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 20px 40px rgba(15, 15, 25, 0.1);
  --success: #1fad75;
  --info: #2a7ae4;
  --hero-image: linear-gradient(135deg, rgba(255, 255, 255, 0.85) 0%, rgba(210, 213, 226, 0.9) 50%, rgba(255, 65, 77, 0.2) 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-color);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

.auth-notifications {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(90vw, 360px);
  pointer-events: none;
}

.auth-notification {
  position: relative;
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-top: 3px solid var(--info);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
  font-size: 0.75rem;
  line-height: 1.4;
  transform: translate3d(0, -120%, 0);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s ease;
}

.auth-notification.is-visible {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.auth-notification.is-exiting {
  transform: translate3d(0, -120%, 0);
  opacity: 0;
}

.auth-notification--success {
  border-top-color: var(--success);
}

.auth-notification--info {
  border-top-color: var(--info);
}

.auth-notification--error {
  border-top-color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .auth-notification {
    transition-duration: 0.001ms;
  }
}

html.kaz-preloader--skip body {
  overflow: auto;
}

body.is-preloading {
  overflow: hidden;
}

html.kaz-preloader--skip .preloader {
  display: none;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg-color);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader__stage {
  position: relative;
  width: 100%;
  height: 100%;
}

.preloader__logo-wrapper {
  --offset-x: 0px;
  --offset-y: 0px;
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(140px, 28vw, 220px);
  transform: translate(calc(-50% + var(--offset-x)), calc(-50% + var(--offset-y)));
}

.preloader__logo-wrapper.is-sliding {
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.preloader__logo-image {
  display: block;
  width: 100%;
  height: auto;
  animation: preloader-spin 1.4s ease forwards;
  animation-play-state: paused;
}

.preloader__logo-image.is-active {
  animation-play-state: running;
}

.preloader.is-sliding {
  pointer-events: none;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes preloader-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .preloader__logo-image {
    animation-duration: 0.001ms;
    animation-iteration-count: 1;
  }

  .preloader__logo-wrapper.is-sliding {
    transition-duration: 0.001ms;
  }
}

img {
  display: block;
  max-width: 100%;
}

.top-bar {
  width: 100%;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(13, 13, 15, 0.95) 0%, rgba(13, 13, 15, 0.3) 100%);
  backdrop-filter: blur(18px);
}

.top-bar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

[data-theme="light"] .top-bar {
  background: linear-gradient(180deg, rgba(244, 246, 251, 0.95) 0%, rgba(244, 246, 251, 0.6) 100%);
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-image {
  display: block;
  height: 48px;
  width: auto;
  will-change: transform;
}

@keyframes logo-spiral-clockwise {
  0% {
    transform: rotate(0deg) scale(1);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes logo-spiral-counter {
  0% {
    transform: rotate(0deg) scale(1);
  }

  100% {
    transform: rotate(-360deg) scale(1);
  }
}

.logo-image.is-spiraling-in {
  animation: logo-spiral-clockwise 0.8s ease forwards;
}

.logo-image.is-spiraling-out {
  animation: logo-spiral-counter 0.8s ease forwards;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.main-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: color 0.2s ease;
}

.twitch-auth {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.twitch-auth:not(.is-authenticated) .twitch-auth__profile {
  display: none !important;
}

.twitch-auth.is-authenticated .twitch-auth__trigger {
  display: none !important;
}

.twitch-auth__icon svg {
  width: 22px;
  height: 22px;
  display: block;
  transform: translateX(1px);
  transform-origin: center;
}

.twitch-auth__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.twitch-auth__profile {
  position: relative;
}

.twitch-auth__profile--enter {
  animation: twitch-profile-slide-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.twitch-auth__profile--exit {
  animation: twitch-profile-slide-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) reverse both;
}

.twitch-auth__avatar--spiral {
  animation: twitch-avatar-spiral 0.65s cubic-bezier(0.65, 0, 0.35, 1) both;
}

.twitch-auth__avatar--spiral-exit {
  animation: twitch-avatar-spiral 0.65s cubic-bezier(0.65, 0, 0.35, 1) reverse both;
}

.twitch-auth__name--slide {
  animation: twitch-name-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.twitch-auth__name--slide-exit {
  animation: twitch-name-slide-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) reverse both;
}

[data-theme="light"] .twitch-auth__avatar {
  border-color: rgba(0, 0, 0, 0.12);
}

.twitch-auth__name {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.twitch-auth__name-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: inherit;
  font: inherit;
}

[data-theme="light"] .twitch-auth__name-badge {
  background: rgba(0, 0, 0, 0.04);
}

.twitch-auth__logout {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.twitch-auth__logout-icon {
  width: 18px;
  height: 18px;
  display: block;
  transform: translateX(1px);
  transform-origin: center;
}

.twitch-auth__logout:hover,
.twitch-auth__logout:focus {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

[data-theme="light"] .twitch-auth__logout {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .twitch-auth__logout:hover,
[data-theme="light"] .twitch-auth__logout:focus {
  background: rgba(0, 0, 0, 0.1);
}

.twitch-auth--compact {
  position: relative;
}

.twitch-auth--compact .twitch-auth__trigger {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.twitch-auth--compact .twitch-auth__trigger:hover,
.twitch-auth--compact .twitch-auth__trigger:focus {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.twitch-auth--compact .twitch-auth__trigger[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.twitch-auth--compact .twitch-auth__profile {
  background: rgba(13, 13, 15, 0.92);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 8px 12px 8px 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

@keyframes twitch-profile-slide-in {
  0% {
    opacity: 0;
    transform: translateX(22px) scale(0.96);
  }

  60% {
    opacity: 1;
    transform: translateX(-6px) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes twitch-avatar-spiral {
  0% {
    transform: translateX(-26px) rotate(-540deg) scale(0.35);
    opacity: 0;
  }

  55% {
    opacity: 1;
    transform: translateX(6px) rotate(24deg) scale(1.08);
  }

  100% {
    opacity: 1;
    transform: translateX(0) rotate(0deg) scale(1);
  }
}

@keyframes twitch-name-slide-in {
  0% {
    opacity: 0;
    transform: translateX(16px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .twitch-auth__profile--enter,
  .twitch-auth__profile--exit,
  .twitch-auth__avatar--spiral,
  .twitch-auth__avatar--spiral-exit,
  .twitch-auth__name--slide,
  .twitch-auth__name--slide-exit {
    animation: none !important;
  }
}

[data-theme="light"] .twitch-auth--compact .twitch-auth__profile {
  background: rgba(244, 246, 251, 0.95);
}

.twitch-auth--panel {
  width: auto;
  pointer-events: auto;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.twitch-auth--panel .twitch-auth__trigger {
  width: auto;
  justify-content: center;
}

.twitch-auth--panel .twitch-auth__profile {
  display: flex;
  align-items: center;
  gap: 14px;
  width: auto;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: rgba(13, 13, 15, 0.82);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  justify-content: center;
}

[data-theme="light"] .twitch-auth--panel .twitch-auth__profile {
  background: rgba(244, 246, 251, 0.92);
}

.twitch-auth__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 auto;
  align-items: center;
  text-align: center;
}

.twitch-auth__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  display: none;
}

.twitch-auth.is-authenticated .twitch-auth__label {
  display: block;
}

.main-nav a.active {
  color: var(--text);
  position: relative;
}

.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--text);
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  margin-left: auto;
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .theme-toggle {
  background: rgba(0, 0, 0, 0.04);
}

.theme-toggle .icon {
  z-index: 1;
  width: 24px;
  height: 24px;
  display: none;
  position: relative;
}

.theme-toggle .icon-sun {
  display: block;
}

.theme-toggle .icon-sun circle,
.theme-toggle .icon-sun path {
  transition: stroke 0.2s ease;
}

.theme-toggle .icon-moon path {
  transition: fill 0.2s ease;
}

.theme-toggle.is-light .icon-sun {
  display: none;
}

.theme-toggle.is-light .icon-moon {
  display: block;
}

.page {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  padding: 32px 48px 64px;
}

.hero {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: var(--bg-secondary);
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-shadow: var(--shadow);
}

.hero--livestream {
  padding: 0;
  background: #000;
  min-height: auto;
  display: block;
}

.hero--livestream .stream-wrapper {
  padding-top: 0;
  aspect-ratio: 16 / 9;
  border-radius: inherit;
}

.hero--livestream .stream-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}


.hero-title {
  font-size: clamp(2.8rem, 4vw, 4rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-subtitle {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 6px 20px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 65, 77, 0.25);
  backdrop-filter: blur(6px);
}

[data-theme="light"] .hero-subtitle {
  color: var(--text);
  background: rgba(255, 65, 77, 0.18);
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: none;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 65, 77, 0.4);
}

.btn--twitch {
  background: #9146ff;
  box-shadow: 0 10px 30px rgba(145, 70, 255, 0.35);
}

.btn--twitch:hover,
.btn--twitch:focus {
  box-shadow: 0 12px 36px rgba(145, 70, 255, 0.45);
  background: #772ce8;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
  box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.08);
}

.youtube.secondary .btn-secondary {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.9), rgba(124, 77, 255, 0.7));
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px rgba(124, 77, 255, 0.35);
}

.youtube.secondary .btn-secondary:hover,
.youtube.secondary .btn-secondary:focus {
  background: #7c4dff;
  box-shadow: 0 12px 36px rgba(124, 77, 255, 0.45);
}

.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.hero-image {
  position: absolute;
  inset: 0;
  background: var(--hero-image);
  z-index: -1;
}

.hero-image::after {
  content: "Ajoutez ici votre visuel principal";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .hero-image::after {
  color: rgba(0, 0, 0, 0.25);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--bg-secondary);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card h2,
.card h3 {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card .subtitle {
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.livestream {
  background: linear-gradient(135deg, rgba(255, 65, 77, 0.95), rgba(30, 30, 40, 0.85));
  color: #fff;
}

.stream-wrapper {
  position: relative;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.stream-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.youtube {
  padding: 0;
  overflow: hidden;
}

.youtube .thumbnail {
  height: 160px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35));
}

.youtube.primary .thumbnail {
  background: url("img/YoutubePrincipal.jpg") center / cover no-repeat;
}

.youtube.primary .thumbnail::after {
  content: "";
  display: none;
}

.youtube.secondary .thumbnail {
  background: url("img/YoutubeSecondaire.jpg") center / cover no-repeat;
}

.youtube.secondary .thumbnail::after {
  content: "";
  display: none;
}

.youtube .thumbnail::after {
  content: "Miniature à ajouter";
  display: grid;
  place-items: center;
  height: 100%;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
}

[data-theme="light"] .youtube .thumbnail {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.18));
}

[data-theme="light"] .youtube .thumbnail::after {
  color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .youtube.primary .thumbnail {
  background: url("img/YoutubePrincipal.jpg") center / cover no-repeat;
}

[data-theme="light"] .youtube.primary .thumbnail::after {
  content: "";
  display: none;
}

[data-theme="light"] .youtube.secondary .thumbnail {
  background: url("img/YoutubeSecondaire.jpg") center / cover no-repeat;
}

[data-theme="light"] .youtube.secondary .thumbnail::after {
  content: "";
  display: none;
}

.youtube .card-content {
  padding: 24px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stream-page {
  flex: 1;
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 32px;
  padding: 32px 48px 64px;
}

.stream-media {
  background: var(--bg-secondary);
  border-radius: 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
}

.stream-media__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stream-media__player {
  position: relative;
  padding-top: 56.25%;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
  background: #000;
}

.stream-media__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.stream-media__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--card-border);
}

.stream-media__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chip:hover,
.chip:focus {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.stream-media__footer .stream-media__cta {
  display: flex;
  gap: 10px;
}

.stream-media__footer .btn {
  min-width: 120px;
  padding: 10px 24px;
  font-size: 0.8rem;
  text-align: center;
}

.chip.is-active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
}

body.theatre-mode {
  overflow: hidden;
}

body.theatre-mode .top-bar,
body.theatre-mode .footer {
  display: none;
}

body.theatre-mode .stream-page {
  position: fixed;
  inset: 0;
  padding: 24px 32px;
  background: var(--bg-color);
  grid-template-columns: 2.6fr 1fr;
  gap: 24px;
  z-index: 50;
}

body.theatre-mode .stream-media,
body.theatre-mode .stream-chat {
  height: 100%;
}

body.theatre-mode .stream-media {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 24px;
}

body.theatre-mode .stream-media__player {
  padding-top: 0;
  height: 100%;
  min-height: 0;
}

body.theatre-mode .stream-media__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

body.theatre-mode .stream-media__footer {
  padding: 12px 20px;
  gap: 12px;
}

body.theatre-mode .stream-media__footer .btn {
  min-width: 0;
  padding: 10px 20px;
  font-size: 0.75rem;
}

body.theatre-mode .stream-media__footer .chip {
  padding: 8px 18px;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

body.theatre-mode .stream-chat__card {
  height: 100%;
}

body.theatre-mode .stream-chat .stream-chat__embed {
  flex: 1;
  min-height: 0;
}

.stream-chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}


.stream-chat__card {
  background: var(--bg-secondary);
  border-radius: 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.stream-chat__toolbar {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.stream-chat__toolbar .twitch-auth {
  pointer-events: auto;
}

.stream-chat__embed {
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-color);
  position: relative;
  min-height: 0px;
  height: 100%;
}

.stream-chat__embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.stream-chat__embed.is-locked {
  border: 1px dashed var(--card-border);
}

.stream-chat__lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px;
  text-align: center;
  background: linear-gradient(180deg, rgba(12, 12, 16, 0.9) 0%, rgba(12, 12, 16, 0.96) 100%);
  color: var(--text-muted);
  border-radius: inherit;
  backdrop-filter: blur(8px);
  z-index: 1;
}

.stream-chat__lock[hidden] {
  display: none;
}

[data-theme="light"] .stream-chat__lock {
  background: linear-gradient(180deg, rgba(244, 246, 251, 0.9) 0%, rgba(244, 246, 251, 0.96) 100%);
}

.stream-chat__lock-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.stream-chat__lock-text {
  max-width: 320px;
  line-height: 1.5;
  font-size: 0.95rem;
}

.stream-chat__lock-button {
  margin-top: 4px;
  min-width: 190px;
}

.footer {
  margin-top: auto;
  padding: 48px 48px 32px;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: linear-gradient(180deg, rgba(12, 12, 16, 0) 0%, rgba(12, 12, 16, 0.95) 35%, rgba(12, 12, 16, 1) 100%);
  border-top: 1px solid var(--card-border);
}

[data-theme="light"] .footer {
  background: linear-gradient(180deg, rgba(244, 246, 251, 0) 0%, rgba(244, 246, 251, 0.9) 40%, rgba(244, 246, 251, 1) 100%);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer__column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text);
}

.footer__links {
  list-style: none;
  display: grid;
  gap: 8px;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}

.footer__links a:hover,
.footer__links a:focus {
  color: var(--text);
}

.footer__links--social a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer__icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.footer__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

[data-theme="light"] .footer__icon {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.footer__links--social a:hover .footer__icon,
.footer__links--social a:focus .footer__icon {
  background: var(--accent);
  color: #fff;
}

.footer__copyright {
  text-align: right;
  font-size: 0.75rem;
}

@media (max-width: 1100px) {
  .page {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar .card {
    flex: 1 1 280px;
  }

  .stream-page {
    grid-template-columns: 1fr;
  }

  .stream-chat {
    order: -1;
  }
}

@media (max-width: 768px) {
  .top-bar {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 24px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .page {
    padding: 24px;
  }

  .hero {
    min-height: 420px;
  }

  .stream-page {
    padding: 24px;
  }

  .stream-media {
    padding: 0;
  }

  .stream-media__footer {
    padding: 16px 20px 20px;
  }

  .stream-media__actions,
  .stream-media__cta {
    justify-content: center;
  }

  .footer {
    padding: 32px 24px 24px;
  }

  .footer__grid {
    gap: 24px;
  }

  .footer__copyright {
    text-align: center;
  }
}

@media (max-width: 520px) {
  .main-nav {
    justify-content: center;
  }

  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .stream-media__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-input {
    flex-direction: column;
    align-items: stretch;
  }
}

.videos-page {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(280px, 1fr);
  gap: 32px;
  padding: 32px 48px 72px;
}

.videos-live {
  display: block;
  padding: 0;
  border-radius: 32px;
  border: 0;
  background: none;
  box-shadow: none;
}

.videos-live__player {
  position: relative;
  border-radius: 32px;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  width: 100%;
}

.videos-live__player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.stream-media__footer--youtube {
  margin-top: 16px;
  padding: 0;
  align-items: center;
}

.stream-media__actions--youtube {
  gap: 8px;
}

.yt-tab {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.yt-tab:hover,
.yt-tab:focus-visible {
  background: rgba(255, 65, 77, 0.22);
  border-color: rgba(255, 65, 77, 0.45);
  outline: none;
}

.yt-tab.is-active {
  background: #e71022;
  border-color: #e71022;
  color: #fff;
}

[data-theme="light"] .yt-tab {
  background: rgba(0, 0, 0, 0.04);
}

.videos-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.videos-collection {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-radius: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.videos-collection--primary {
  background: linear-gradient(135deg, rgba(255, 65, 77, 0.22), rgba(255, 65, 77, 0.05));
}

[data-theme="light"] .videos-collection--primary {
  background: linear-gradient(135deg, rgba(255, 65, 77, 0.18), rgba(255, 255, 255, 0.9));
}

.videos-collection--secondary {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.22), rgba(124, 77, 255, 0.05));
}

[data-theme="light"] .videos-collection--secondary {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.16), rgba(255, 255, 255, 0.92));
}

.videos-collection__header {
  display: grid;
  gap: 6px;
}

.videos-collection__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-weight: 600;
  color: var(--accent);
}

.videos-collection__label--secondary {
  color: var(--text-muted);
}

.videos-collection__header h2 {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.videos-collection__list {
  list-style: none;
  display: grid;
  gap: 16px;
  max-height: min(70vh, 640px);
  overflow-y: auto;
  padding-right: 6px;
  scroll-behavior: smooth;
}

.videos-collection__list::-webkit-scrollbar {
  width: 8px;
}

.videos-collection__list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

[data-theme="light"] .videos-collection__list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
}

.videos-collection__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

[data-theme="light"] .videos-collection__placeholder {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

.videos-collection__cta {
  display: flex;
  justify-content: flex-end;
}

.videos-collection__cta .btn {
  padding-inline: 20px;
}

.video-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.video-card:hover,
.video-card:focus {
  transform: translateY(-2px);
  background: rgba(255, 65, 77, 0.12);
  border-color: rgba(255, 65, 77, 0.4);
}

.video-card.is-active {
  transform: translateY(0);
  background: rgba(255, 65, 77, 0.18);
  border-color: rgba(255, 65, 77, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 65, 77, 0.4);
}

[data-theme="light"] .video-card.is-active {
  background: rgba(255, 65, 77, 0.2);
  border-color: rgba(255, 65, 77, 0.55);
}

[data-theme="light"] .video-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .video-card:hover,
[data-theme="light"] .video-card:focus {
  background: rgba(255, 65, 77, 0.16);
  border-color: rgba(255, 65, 77, 0.4);
}

.video-card img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  border-radius: 14px;
}

.video-card__content {
  display: grid;
  gap: 6px;
  align-content: center;
}

.video-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.video-card__meta {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.video-card__meta--publish {
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 0.8rem;
}

body.theatre-mode .videos-page {
  position: fixed;
  inset: 0;
  padding: 24px 32px;
  background: var(--bg-color);
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 24px;
  z-index: 50;
}

body.theatre-mode .videos-live,
body.theatre-mode .videos-sidebar {
  height: 100%;
}

body.theatre-mode .videos-live {
  height: 100%;
}

body.theatre-mode .videos-live__player {
  aspect-ratio: auto;
  height: 100%;
}

body.theatre-mode .videos-live__player iframe {
  position: absolute;
}

body.theatre-mode .videos-sidebar {
  overflow-y: auto;
  padding-right: 8px;
}

@media (max-width: 1200px) {
  .videos-page {
    grid-template-columns: 1fr;
  }

  .videos-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .videos-collection {
    flex: 1 1 320px;
  }
}

@media (max-width: 768px) {
  .videos-page {
    padding: 24px;
  }

  .video-card {
    grid-template-columns: 110px 1fr;
  }
}

@media (max-width: 540px) {
  .video-card {
    grid-template-columns: 1fr;
  }

  .video-card img {
    height: 160px;
  }
}
