/*
Theme Name: Twitch OnePage
Theme URI: https://example.com/
Author: Codex
Description: Theme WordPress minimal en une seule page avec logo et lecteur Twitch.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: twitch-onepage
*/

:root {
  --bg: #0b0b14;
  --panel: #151524;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f5f7fb;
  --muted: #a7b0c0;
  --accent: #9147ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top, rgba(145, 71, 255, 0.16), transparent 36%),
    linear-gradient(180deg, #090910 0%, var(--bg) 100%);
  color: var(--text);
}

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

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 18px 40px;
}

.site-header {
  width: min(100%, 1100px);
  display: flex;
  justify-content: center;
  padding-bottom: 24px;
}

.branding {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.custom-logo-link,
.site-title-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.custom-logo {
  max-width: min(280px, 70vw);
  width: auto;
  height: auto;
}

.site-title-link {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0;
}

.video-section {
  width: min(100%, 1100px);
}

.viewer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(8, 8, 14, 0.64);
  backdrop-filter: blur(14px);
}

.viewer-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.viewer-control-label {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.viewer-control-hint {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.viewer-segmented {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  gap: 4px;
}

.viewer-segmented-button,
.viewer-select {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
}

.viewer-segmented-button {
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

.viewer-segmented-button.is-active {
  background: linear-gradient(180deg, rgba(145, 71, 255, 0.34) 0%, rgba(145, 71, 255, 0.2) 100%);
  border-color: rgba(145, 71, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.viewer-select {
  min-width: 190px;
  padding: 0 12px;
  border-color: var(--panel-border);
  background: rgba(21, 21, 36, 0.92);
}

.viewer-fullscreen-toggle {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(145, 71, 255, 0.45);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(145, 71, 255, 0.2) 0%, rgba(145, 71, 255, 0.12) 100%);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.viewer-fullscreen-toggle[aria-pressed="true"] {
  background: rgba(145, 71, 255, 0.28);
  border-color: rgba(145, 71, 255, 0.7);
}

.video-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.video-frame {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(145, 71, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.01) 100%),
    var(--panel);
}

.video-viewport {
  overflow: hidden;
  position: relative;
}

.video-viewport.is-multiview-layout .video-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  transform: none !important;
  transition: none;
  padding: 16px;
}

.video-track {
  display: flex;
  width: 100%;
  transform: translateX(0);
  transition: transform 0.45s ease;
  will-change: transform;
}

.video-panel {
  flex: 0 0 100%;
  min-width: 100%;
  opacity: 0.74;
  transition: opacity 0.35s ease;
}

.video-panel.is-active {
  opacity: 1;
}

.video-viewport[data-stream-order="secondary-first"] .video-panel[data-stream-role="secondary"] {
  order: -1;
}

.video-viewport[data-stream-order="secondary-first"] .video-panel[data-stream-role="primary"] {
  order: 1;
}

.video-viewport.is-multiview-layout .video-panel {
  min-width: 0;
  opacity: 1;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  background: #0a0a12;
  cursor: pointer;
  transition: transform 0.28s ease, opacity 0.28s ease, filter 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.video-viewport.is-multiview-layout .video-panel .video-embed {
  aspect-ratio: 16 / 9;
}

.video-viewport.is-multiview-layout .video-panel.is-focused {
  grid-column: auto;
  grid-row: auto;
  border-color: rgba(145, 71, 255, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(145, 71, 255, 0.25),
    0 18px 42px rgba(0, 0, 0, 0.26);
}

.video-panel-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.72);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.video-panel-label {
  padding: 12px 16px;
  border-top: 1px solid var(--panel-border);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.02);
}

.multiview-rail-heading {
  display: none;
}

.video-panel-meta {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.video-panel-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10, 10, 18, 0.8);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.video-panel-live-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff4d6d;
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.85);
}

.video-panel-meta-title {
  max-width: min(70%, 460px);
  font-size: clamp(1rem, 1.3vw, 1.3rem);
  line-height: 1.15;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.95);
}

.twitch-player-slot,
.twitch-player-slot iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.next-stream-link {
  min-width: 64px;
  height: 72px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid rgba(145, 71, 255, 0.45);
  background:
    linear-gradient(180deg, rgba(145, 71, 255, 0.22) 0%, rgba(145, 71, 255, 0.12) 100%),
    rgba(7, 7, 12, 0.8);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.next-stream-link:hover,
.next-stream-link:focus-visible {
  transform: translateX(2px);
  background: rgba(145, 71, 255, 0.24);
  border-color: rgba(145, 71, 255, 0.7);
}

.viewer-fullscreen-exit {
  display: none;
}

.next-stream-icon {
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
}

.next-stream-text {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.video-stage[data-stage-display-mode="toggle"] .video-focus-button,
.video-stage[data-stage-display-mode="toggle"] .video-panel-label,
.video-stage[data-stage-display-mode="toggle"] .video-panel-badge,
.video-stage[data-stage-display-mode="toggle"] .video-panel-meta {
  display: none;
}

.video-stage[data-stage-display-mode="multiview"] .video-caption {
  display: none;
}

.video-stage[data-stage-display-mode="multiview"] .multiview-rail-heading {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 300px;
  max-width: calc(100% - 32px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
  pointer-events: none;
}

.multiview-rail-kicker {
  color: rgba(167, 176, 192, 0.84);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
}

.multiview-rail-title {
  color: #f5f7fb;
  font-size: 1rem;
  font-weight: 800;
  text-align: left;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel-label {
  background: #11111b;
  color: #d7dbeb;
  min-height: 54px;
  display: flex;
  align-items: center;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel-actions {
  top: auto;
  right: 10px;
  bottom: 10px;
}

.video-stage[data-stage-display-mode="multiview"] .video-focus-button {
  min-width: 88px;
  padding: 7px 10px;
  font-size: 0.82rem;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-focused .video-focus-button {
  display: none;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized {
  grid-column: auto;
  grid-row: auto;
  opacity: 1;
  filter: none;
  transform: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.015) 100%),
    #0a0a12;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized .video-embed {
  aspect-ratio: 16 / 9;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized .video-panel-label {
  padding: 10px 12px;
  font-size: 0.88rem;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized .video-panel-badge {
  padding: 5px 8px;
  font-size: 0.76rem;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized:hover {
  border-color: rgba(145, 71, 255, 0.38);
  transform: translateY(-2px);
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized .video-panel-meta {
  left: 12px;
  right: 12px;
  bottom: 12px;
  gap: 6px;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized .video-panel-meta-title {
  max-width: 100%;
  font-size: 0.96rem;
}

.video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized .video-panel-live-pill {
  padding: 5px 8px;
  font-size: 0.68rem;
}

.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
}

.video-fullscreen-hitarea {
  display: none;
}

.video-panel-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100% - 24px);
}

.video-focus-button {
  min-width: 96px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(11, 11, 20, 0.72);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.video-focus-button:hover,
.video-focus-button:focus-visible {
  background: rgba(145, 71, 255, 0.28);
  border-color: rgba(145, 71, 255, 0.7);
  transform: translateY(-1px);
}

.video-focus-button[aria-pressed="true"] {
  background: rgba(145, 71, 255, 0.34);
  border-color: rgba(145, 71, 255, 0.75);
}

.video-section:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  padding: 0;
  background: #000;
  overflow: hidden;
}

.video-section:fullscreen .viewer-controls {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.video-section:fullscreen .video-stage {
  min-height: 100vh;
}

.video-section:fullscreen .video-frame {
  min-height: 100vh;
  height: 100vh;
}

.video-section:fullscreen .video-embed {
  min-height: 100vh;
}

.video-section:fullscreen .video-viewport.is-multiview-layout .video-track {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2px;
  padding: 0;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] {
  grid-template-columns: 1fr;
  gap: 0;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-frame,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-viewport,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-track {
  height: 100vh;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .next-stream-link,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .multiview-rail-heading,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel-badge,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel-meta,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel-label,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel-actions {
  display: none;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-fullscreen-hitarea {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 6;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-frame {
  background: #000;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel {
  border: 0;
  border-radius: 0;
  background: #000;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel .video-embed,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .twitch-player-slot,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .twitch-player-slot iframe,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-embed iframe {
  height: 100%;
  min-height: 100vh;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel.is-focused,
.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized {
  grid-row: 1;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel.is-focused {
  box-shadow: none;
}

.video-section:fullscreen .video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized {
  transform: none;
}

.video-section:fullscreen .viewer-fullscreen-exit {
  position: absolute;
  left: 20px;
  bottom: 20px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.video-section:fullscreen .viewer-fullscreen-exit:hover,
.video-section:fullscreen .viewer-fullscreen-exit:focus-visible {
  background: rgba(0, 0, 0, 0.72);
  border-color: rgba(255, 255, 255, 0.32);
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="0"] .video-track {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="1"] .video-track {
  grid-template-columns: minmax(0, 0.6fr) minmax(0, 1.4fr);
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="0"] .video-panel[data-stream-panel="0"] {
  grid-column: 1;
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="0"] .video-panel[data-stream-panel="1"] {
  grid-column: 2;
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="1"] .video-panel[data-stream-panel="0"] {
  grid-column: 1;
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="1"] .video-panel[data-stream-panel="1"] {
  grid-column: 2;
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="0"] .video-panel[data-stream-panel="0"],
.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="1"] .video-panel[data-stream-panel="1"] {
  box-shadow: none;
}

.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="0"] .video-panel[data-stream-panel="1"],
.video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="1"] .video-panel[data-stream-panel="0"] {
  opacity: 1;
  filter: none;
}

.video-embed iframe,
.video-embed .video-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-embed iframe {
  border: 0;
}

.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

.video-caption {
  padding: 14px 18px;
  border-top: 1px solid var(--panel-border);
  color: var(--muted);
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 640px) {
  .site-shell {
    padding-top: 22px;
    padding-bottom: 24px;
  }

  .site-header {
    padding-bottom: 18px;
  }

  .video-caption {
    font-size: 0.9rem;
  }

  .video-stage {
    grid-template-columns: 1fr;
  }

  .viewer-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .viewer-select,
  .viewer-segmented {
    width: 100%;
  }

  .viewer-segmented-button {
    flex: 1 1 0;
  }

  .video-viewport.is-multiview-layout .video-track {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .video-stage[data-stage-display-mode="multiview"] .video-panel.is-focused,
  .video-stage[data-stage-display-mode="multiview"] .video-panel.is-minimized {
    grid-column: auto;
    grid-row: auto;
  }

  .video-stage[data-stage-display-mode="multiview"] .multiview-rail-heading {
    display: none;
  }

  .video-panel-meta-title {
    max-width: 100%;
    font-size: 1rem;
  }

  .video-section:fullscreen .video-viewport.is-multiview-layout .video-track,
  .video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="0"] .video-track,
  .video-section:fullscreen .video-viewport.is-multiview-layout[data-focus-index="1"] .video-track {
    grid-template-columns: 1fr;
    height: 100vh;
  }

  .next-stream-link {
    width: 100%;
    min-width: 0;
  }
}
