/* ============================================================
   WIWITV — style.css
   Layout + composants. Les tokens sont dans tokens.css,
   les effets glitch/scanlines dans effects.css.
   ============================================================ */

body {
  background: var(--void);
  color: var(--text-hi);
  font-family: var(--font-body);
  font-size: var(--step-0);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
}

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------- Header / nav ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(6, 6, 10, 0.82);
  backdrop-filter: blur(6px);
  border-bottom: var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.1rem;
}

.logo {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.logo span {
  color: var(--magenta);
}

.channel-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.2rem);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.channel-nav a {
  display: inline-flex;
  gap: 0.5em;
  color: var(--text-mid);
  transition: color 0.15s;
}

.channel-nav a .ch-num {
  color: var(--cyan);
}

.channel-nav a:hover,
.channel-nav a[aria-current="page"] {
  color: var(--text-hi);
}

.channel-nav a[aria-current="page"] .ch-num {
  color: var(--magenta);
}

.nav-toggle {
  display: none;
  font-family: var(--font-mono);
  border: var(--border);
  padding: 0.4em 0.7em;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: block;
  }

  .channel-nav {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--void);
    border-bottom: var(--border);
    flex-direction: column;
    padding: 1rem var(--gutter) 1.4rem;
    gap: 1rem;
    display: none;
  }

  .channel-nav.open {
    display: flex;
  }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding-block: clamp(4rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem);
  overflow: hidden;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--amber);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  margin-bottom: 1.2rem;
}

.hero-eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: var(--amber);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-4);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 14ch;
}

.hero p.lede {
  margin-top: 1.6rem;
  max-width: 46ch;
  color: var(--text-mid);
  font-size: var(--step-1);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2.4rem;
}

/* ---------------- Boutons ---------------- */
.btn {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85em 1.6em;
  border: 1px solid var(--text-hi);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  transition: transform 0.12s var(--ease-glitch), background 0.15s, color 0.15s;
}

.btn:hover,
.btn:focus-visible {
  transform: translate(-2px, -2px);
}

.btn-primary {
  background: var(--text-hi);
  color: var(--void);
  border-color: var(--text-hi);
}

.btn-primary:hover {
  background: var(--magenta);
  border-color: var(--magenta);
  color: var(--text-hi);
}

.btn-ghost {
  color: var(--text-hi);
  border-color: rgba(241, 238, 249, 0.35);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ---------------- Sections communes ---------------- */
.section {
  padding-block: clamp(3rem, 7vw, 5.5rem);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.4rem;
  border-bottom: var(--border);
  padding-bottom: 1.2rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  text-transform: uppercase;
  line-height: 1;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
  letter-spacing: 0.08em;
}

/* ---------------- Cartes guides ---------------- */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
}

.guide-card {
  background: var(--panel);
  border: var(--border);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition: transform 0.15s var(--ease-glitch), border-color 0.15s;
}

.guide-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
}

.guide-thumb {
  aspect-ratio: 16/9;
  background: var(--panel-raised);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide-thumb .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  color: var(--text-hi);
  background: linear-gradient(0deg, rgba(6, 6, 10, 0.7), rgba(6, 6, 10, 0));
}

.guide-meta {
  display: flex;
  gap: 0.8em;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
  text-transform: uppercase;
}

.guide-meta .badge-diff {
  color: var(--amber);
}

.guide-card h3 {
  font-size: var(--step-0);
  font-weight: 700;
  line-height: 1.3;
}

.guide-card p {
  color: var(--text-mid);
  font-size: var(--step--1);
}

.guide-card a.watch {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--cyan);
  letter-spacing: 0.05em;
}

.guide-card a.watch:hover {
  color: var(--magenta);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.8rem;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.filter-bar button {
  text-transform: capitalize !important;
}

.filter-bar button {
  border: 1px solid rgba(241, 238, 249, 0.25);
  padding: 0.5em 1em;
  color: var(--text-mid);
  letter-spacing: 0.04em;
}

.filter-bar button:hover {
  border-color: var(--cyan);
  color: var(--text-hi);
}

.filter-bar button[aria-pressed="true"] {
  background: var(--text-hi);
  color: var(--void);
  border-color: var(--text-hi);
}

/* ---------------- Jeux / roadmap / vote ---------------- */
.now-playing {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 2rem;
  padding: 1.6rem;
  background: var(--panel);
  align-items: center;
}

.now-playing .cover {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--panel-raised);
}

.now-playing .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-playing .status {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: 0.6rem;
}

.now-playing .status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.now-playing h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  text-transform: uppercase;
}

.now-playing p {
  color: var(--text-mid);
  margin-top: 0.5rem;
  max-width: 55ch;
}

@media (max-width: 640px) {
  .now-playing {
    grid-template-columns: 1fr;
  }

  .now-playing .cover {
    max-width: 220px;
  }
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.game-card {
  background: var(--panel);
  border: var(--border);
  display: flex;
  flex-direction: column;
}

.game-card .cover {
  aspect-ratio: 16/9;
  background: var(--panel-raised);
  overflow: hidden;
}

.game-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card .body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}

.game-card h4 {
  font-size: var(--step-0);
}

.game-card .devs {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
}

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 0.6rem;
}

.vote-count {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  color: var(--cyan);
}

.vote-count small {
  display: block;
  font-size: var(--step--1);
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.vote-btn {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 0.6em 1em;
  letter-spacing: 0.05em;
}

.vote-btn:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--void);
}

.vote-btn[aria-pressed="true"] {
  background: var(--magenta);
  border-color: var(--magenta);
  color: var(--text-hi);
}

.suggest-form {
  background: var(--panel);
  border: var(--border);
  padding: 1.6rem;
  display: grid;
  gap: 1rem;
  max-width: 560px;
}

.suggest-form label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  color: var(--text-dim);
  display: block;
  margin-bottom: 0.4em;
}

.suggest-form input,
.suggest-form textarea {
  width: 100%;
  background: var(--void);
  border: var(--border);
  color: var(--text-hi);
  padding: 0.7em 0.9em;
  font-family: var(--font-body);
}

.suggest-form input:focus,
.suggest-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
}

.form-msg {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  min-height: 1.4em;
}

.form-msg[data-state="ok"] {
  color: var(--success);
}

.form-msg[data-state="err"] {
  color: var(--danger);
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: var(--border);
  padding-block: 2.4rem;
  margin-top: 4rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  justify-content: space-between;
  align-items: center;
}

.social-links {
  display: flex;
  gap: 1.2rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: var(--step--1);
}

.social-links a:hover {
  color: var(--magenta);
}

.footer-note {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

/* ---------------- Utilitaires ---------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* barre de période : même look que filter-bar */
.range-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.range-bar button {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  border: 1px solid rgba(241, 238, 249, 0.25);
  padding: 0.5em 1em;
  color: var(--text-mid);
  letter-spacing: 0.04em;
}

.range-bar button:hover {
  border-color: var(--cyan);
  color: var(--text-hi);
}

.range-bar button[aria-pressed="true"] {
  background: var(--text-hi);
  color: var(--void);
  border-color: var(--text-hi);
}

.range-bar span.range-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.4em;
}

/* ---------------- Modal lecteur vidéo ---------------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.video-modal.is-open {
  display: flex;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 10, 0.88);
  backdrop-filter: blur(3px);
}

.video-modal__panel {
  position: relative;
  z-index: 1;
  background: var(--panel);
  max-width: 860px;
  width: 100%;
  overflow: hidden;
}

.video-modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: var(--step-0);
  color: var(--text-hi);
  background: var(--void);
  border: var(--border);
  width: 2.2em;
  height: 2.2em;
}

.video-modal__close:hover {
  color: var(--magenta);
  border-color: var(--magenta);
}

.video-modal__player {
  aspect-ratio: 16/9;
  background: #000;
}

.video-modal__player iframe {
  width: 100%;
  height: 100%;
}

.video-modal__body {
  padding: 1.4rem clamp(1.2rem, 3vw, 1.8rem);
}

.video-modal__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 0.8rem;
}

.guide-thumb {
  cursor: pointer;
}

.guide-thumb .play {
  transition: background 0.15s;
}

.guide-thumb:hover .play {
  background: linear-gradient(0deg, rgba(46, 242, 255, 0.35), rgba(0, 0, 0, 0));
}

/* ---------------- Menu latéral avec progression (guides.html) ---------------- */
.edge-nav {
  position: fixed;
  top: 50%;
  right: 1.4rem;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  max-height: 55vh;
}

.edge-nav__link {
  color: var(--text-dim);
  white-space: nowrap;
  padding: 0.4em 0;
  transition: color 0.2s, text-shadow 0.2s;
}

.edge-nav__link:hover {
  color: var(--text-hi);
}

.edge-nav__link.is-active {
  color: var(--text-hi);
  text-shadow: 0 0 8px var(--cyan), 0 0 18px var(--cyan);
}

.edge-nav__track {
  position: relative;
  width: 1px;
  flex: 1;
  min-height: 160px;
  margin: 0.8rem 0;
  background-image: linear-gradient(var(--text-dim) 50%, transparent 50%);
  background-size: 1px 9px;
  background-repeat: repeat-y;
  opacity: 0.45;
}

.edge-nav__dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta), 0 0 18px var(--magenta);
  transform: translate(-50%, -50%);
}

@media (max-width: 1400px) {
  .edge-nav {
    display: none;
  }
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.filters-row .filter-bar,
.filters-row .range-bar {
  margin-bottom: 0;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 4px;
}

.social-icon svg {
  display: block;
}

.live-badge {
  opacity: .5;
  pointer-events: none;
}

.live-badge.is-live {
  opacity: 1;
  pointer-events: auto;
  animation: live-pulse 1.4s ease-in-out infinite;
}

.live-badge.is-live .dot {
  background: #ff2d55;
  box-shadow: 0 0 6px #ff2d55;
}

@keyframes live-pulse {

  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.6);
  }
}

.live-viewers {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-dim);
  margin-left: 0.3em;
}

.live-badge.is-live .live-viewers {
  display: inline;
}

.live-viewers::before {
  content: "· ";
}