/* ================================================================
   Red River Poker — V14
   - Slider à gauche après "available" (gap)
   - Premier dot par défaut "All", pas de bouton Viewers
   - Slider caché sur mobile
   - Largeur "All" platform = lang
   - Bouton plein écran : agrandir uniquement, icône réduite ~50%,
     juste les 2 crochets diagonaux (pas de traits vers le centre)
   ================================================================ */

:root {
  --bg:           #0e1013;
  --bg-elevated: #181b20;
  --bg-hover:    #21252b;
  --border:      #2a2f36;
  --text:        #e8eaed;
  --text-muted:  #8b929c;
  --accent:      #d4a24c;

  --twitch:      #9146ff;
  --youtube:     #ff0033;
  --kick:        #53fc18;
  --goodgame:    #f5a623;

  --radius:      4px;
  --gap:         16px;
  --shell-pad:   24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- HEADER ----- */

.site-header {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 8px var(--shell-pad);
  border-bottom: 1px solid var(--border);
}

.site-header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--goodgame);
  white-space: nowrap;
}

.site-header .tagline {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ----- STATUS BAR ----- */

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  padding: 10px var(--shell-pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.status { margin: 0; font-size: 14px; color: var(--text-muted); }

#stream-count { color: var(--goodgame); font-weight: 600; }

.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

/* ----- BOUTONS FILTRE PLATEFORME (orange) ----- */

.filter {
  background: transparent;
  color: var(--goodgame);
  border: 1px solid var(--goodgame);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.12s ease;
}

.filter:hover { background: rgba(245, 166, 35, 0.12); }
.filter.active {
  background: var(--goodgame);
  color: var(--bg);
  font-weight: 600;
}

/* ----- VIEWER SLIDER ----- */

.viewer-filter {
  display: flex;
  align-items: center;
}

.viewer-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 260px;
  height: 30px;
}

.viewer-track::before {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.viewer-stop {
  position: relative;
  z-index: 1;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stop-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.stop-dot {
  width: 10px;
  height: 10px;
  background: var(--bg-elevated);
  border: 2px solid var(--goodgame);
  border-radius: 50%;
  transition: all 0.15s ease;
  display: block;
}

.viewer-stop:hover .stop-dot {
  background: rgba(245, 166, 35, 0.35);
}

.viewer-stop.active .stop-dot {
  background: var(--goodgame);
  width: 14px;
  height: 14px;
  margin-bottom: -2px;
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.22);
}

.viewer-stop.active .stop-label {
  color: var(--goodgame);
  font-weight: 700;
}

/* ----- LANG BAR ----- */

.lang-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px var(--shell-pad);
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.open-new-tab-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease;
}

.open-new-tab-toggle:hover { color: var(--text); }

.open-new-tab-toggle input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--goodgame);
  width: 14px;
  height: 14px;
  margin: 0;
}

.lang-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.lang-filter {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lang-filter:hover { background: var(--bg-hover); border-color: var(--goodgame); }
.lang-filter.active { background: var(--text); border-color: var(--text); }

.lang-filter img {
  width: 24px;
  height: auto;
  display: block;
  border-radius: 2px;
}

.lang-filter-all {
  padding: 4px 10px;
  font-size: 13px;
  color: var(--goodgame);
  border-color: var(--goodgame);
}

.lang-filter-all:hover {
  background: rgba(245, 166, 35, 0.12);
  border-color: var(--goodgame);
}

.lang-filter-all.active {
  color: var(--bg);
  background: var(--goodgame);
  border-color: var(--goodgame);
  font-weight: 600;
}

/* ----- GRID ----- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  padding: 12px var(--shell-pad) var(--shell-pad);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px;
  font-style: italic;
}

/* ----- CARDS ----- */

.card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.card-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  color: #fff;
}

.card-badge.twitch   { background: var(--twitch);  }
.card-badge.youtube  { background: var(--youtube); }
.card-badge.kick     { background: var(--kick);     color: #000; }
.card-badge.goodgame { background: var(--goodgame); color: #000; }

.card-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  background: #000;
  display: block;
  line-height: 0;
}

.card-flag img { display: block; width: 32px; height: auto; }

.card-viewers {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 2px;
}

.card-viewers::before { content: "● "; color: #ff4444; font-size: 10px; }

.card-body { padding: 10px 12px 12px; }

.card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}

.card-streamer { margin: 6px 0 0; font-size: 13px; color: var(--text-muted); }

/* ----- WATCH PAGE ----- */

.watch-page .site-header { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 14px var(--shell-pad); }
.watch-page .site-header h1 { font-size: 16px; color: var(--goodgame); font-weight: 500; }

.back-link { color: var(--text-muted); font-size: 14px; }
.back-link:hover { color: var(--accent); }

.watch-main { max-width: 1280px; margin: 0 auto; padding: var(--shell-pad); }

.player-wrapper {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.player-wrapper iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Quand le player-wrapper passe en plein écran */
.player-wrapper:fullscreen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
}
.player-wrapper:-webkit-full-screen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
}

.stream-info {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stream-info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.badge {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  color: #fff;
}

.badge.twitch   { background: var(--twitch);  }
.badge.youtube  { background: var(--youtube); }
.badge.kick     { background: var(--kick);     color: #000; }
.badge.goodgame { background: var(--goodgame); color: #000; }

.viewers { color: var(--text-muted); font-size: 13px; }
.viewers::before { content: "● "; color: #ff4444; font-size: 10px; }

.stream-title { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.stream-streamer { margin: 0; color: var(--text-muted); }
.error-msg { text-align: center; color: #ff7676; padding: 32px 16px; }

/* ----- BOUTON AGRANDIR (enlarge only, no exit) ----- */

.fullscreen-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--goodgame);
  color: var(--goodgame);
  border-radius: var(--radius);
  padding: 3px 5px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.fullscreen-btn:hover,
.fullscreen-btn:focus-visible {
  background: rgba(245, 166, 35, 0.15);
  outline: none;
}

.fullscreen-btn:active {
  background: var(--goodgame);
  color: var(--bg);
}

.fullscreen-btn svg {
  display: block;
  width: 11px;
  height: 11px;
}

/* ----- GEO NOTICE (watch page) ----- */

.geo-notice-standalone {
  padding: 10px var(--shell-pad);
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.85;
  margin: 0;
}

/* ----- FOOTER + PARTNER LINK ----- */

.site-footer {
  text-align: center;
  padding: 28px 24px;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

.site-footer p { margin: 0; }

.partner-link {
  color: var(--goodgame);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.partner-link:hover { opacity: 0.85; text-decoration: underline; }

.partner-info-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 4px;
  vertical-align: middle;
}

.partner-info-btn {
  background: transparent;
  border: 1.5px solid var(--goodgame);
  color: var(--goodgame);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.partner-info-btn:hover,
.partner-info-btn:focus {
  background: var(--goodgame);
  color: #000;
  outline: none;
}

.partner-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  background: #000;
  color: var(--text);
  border: 1px solid var(--goodgame);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  font-style: normal;
  text-align: left;
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.18);
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.partner-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--goodgame);
}

.partner-tooltip::before {
  content: "";
  position: absolute;
  top: calc(100% - 1px);
  left: 50%;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #000;
  z-index: 1;
}

.partner-info-wrapper:hover .partner-tooltip,
.partner-info-wrapper:focus-within .partner-tooltip {
  visibility: visible;
  opacity: 1;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  :root { --shell-pad: 14px; --gap: 12px; }

  .site-header { padding: 6px var(--shell-pad); gap: 10px; }
  .site-header h1      { font-size: 17px; }
  .site-header .tagline { font-size: 14px; }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    padding: 10px var(--shell-pad) var(--shell-pad);
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px var(--shell-pad);
    gap: 8px;
  }
  .viewer-filter { display: none; }
  .filters { margin-left: 0; justify-content: flex-start; }

  .lang-bar {
    flex-direction: column-reverse;
    align-items: flex-start;
    padding: 4px var(--shell-pad);
  }
  .lang-filters { justify-content: flex-start; }

  .partner-tooltip { width: 260px; font-size: 12px; }

  /* Bouton agrandir : un peu plus grand sur mobile pour la zone tactile,
     mais l'icône reste petite */
  .fullscreen-btn {
    padding: 5px 7px;
  }
  .fullscreen-btn svg {
    width: 13px;
    height: 13px;
  }
}

@media (max-width: 380px) {
  .site-header h1      { font-size: 15px; }
  .site-header .tagline { font-size: 13px; }
}

/* ---- Branding YouTube : icône officielle seule, fond solide ---- */
/* Conforme aux YouTube Branding Guidelines (section "YouTube Icon") */

.card-badge.youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;           /* clear space autour de l'icône */
  background: #000;       /* fond solide, comme exigé par YouTube */
}
.card-badge-logo { display: block; }

.badge.youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: #000;
}
.badge-logo { display: block; }
