/* ============================================
   juego-porno.com - Template v0.1
   Inspiration UI : Spotify mobile (dark + accent rouge)
   ============================================ */

:root {
  --bg: #121212;
  --bg-elevated: #1c1c1e;
  --bg-card: #181818;
  --bg-card-hover: #242424;
  --accent: #e6194b;
  --accent-dark: #b81f3c;
  --text: #ffffff;
  --text-muted: #a7a7a7;
  --chip-bg: #2a2a2a;
  --radius: 12px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { padding: 0 16px; max-width: 1100px; margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(18,18,18,.98), rgba(18,18,18,.92));
  backdrop-filter: blur(12px);
  padding: 12px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo .accent { color: var(--accent); }

.header-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--chip-bg);
  color: var(--text);
  font-size: 1.1rem;
  display: grid; place-items: center;
  cursor: pointer;
}

/* ---------- Chips (filtres categories) ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 16px 12px;
  scrollbar-width: none;
  position: sticky;
  top: 60px;
  z-index: 40;
  background: var(--bg);
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text);
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}
.chip.active { background: var(--accent); color: #fff; font-weight: 700; }

/* ---------- Sections ---------- */
.section { margin-top: 24px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.see-all { font-size: .8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* ---------- Hero (jeu mis en avant) ---------- */
.hero {
  margin: 8px 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #3a1e28, #121212 70%);
}
.hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(45deg, #202020, #202020 12px, #262626 12px, #262626 24px);
}
.hero-body { padding: 16px; }
.hero-tag {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.hero-body h2 { font-size: 1.4rem; margin-bottom: 6px; }
.hero-body p { color: var(--text-muted); font-size: .9rem; line-height: 1.45; }

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  padding: 12px 24px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .1s;
}
.btn-play:active { transform: scale(.96); }

/* ---------- Carrousels horizontaux ---------- */
.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 16px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 140px;
  scroll-snap-align: start;
}
.card.card-lg { flex-basis: 170px; }

.card-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #202020, #202020 10px, #2a2a2a 10px, #2a2a2a 20px);
  position: relative;
  overflow: hidden;
}
.card-cover.portrait { aspect-ratio: 3 / 4; }

.card-cover .play-overlay {
  position: absolute;
  right: 8px; bottom: 8px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-size: .8rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.5);
}

.card-title {
  margin-top: 8px;
  font-size: .85rem;
  font-weight: 600;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-meta { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Grille (pages categorie / nouveautes) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 12px;
  padding: 0 16px;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(5, 1fr); } }

/* ---------- Tuiles raccourcis (style "Good morning" Spotify) ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.tile {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card-hover);
  border-radius: 8px;
  overflow: hidden;
  min-height: 56px;
  font-size: .8rem;
  font-weight: 700;
}
.tile-thumb {
  width: 56px; height: 56px;
  flex: 0 0 56px;
  background: repeating-linear-gradient(45deg, #3a1e28, #3a1e28 8px, #45232e 8px, #45232e 16px);
}

/* ---------- Page jeu ---------- */
.game-hero {
  padding: 24px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(to bottom, #3a1e28, var(--bg) 85%);
}
.game-cover {
  width: 200px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #202020, #202020 12px, #2a2a2a 12px, #2a2a2a 24px);
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.game-hero h1 { font-size: 1.6rem; margin-top: 16px; letter-spacing: -0.02em; }
.game-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: .85rem;
}
.game-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 8px;
}

/* Player iframe */
.player-wrap {
  margin: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: .9rem;
  border: 1px solid #2a2a2a;
}
.player-wrap iframe { width: 100%; height: 100%; border: 0; }

.prose {
  padding: 0 16px;
  color: var(--text-muted);
  font-size: .95rem;
  line-height: 1.6;
}
.prose h2 { color: var(--text); font-size: 1.15rem; margin: 20px 0 8px; }
.prose p + p { margin-top: 10px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; }
.tag {
  background: var(--chip-bg);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .8rem;
  color: var(--text);
}

/* ---------- Breadcrumb / SEO ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px 0;
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}
.breadcrumb a {
  color: var(--text);
  font-weight: 600;
  flex: 0 0 auto;
}
.breadcrumb .sep {
  color: var(--text-muted);
  opacity: .6;
  flex: 0 0 auto;
}
.breadcrumb .current {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- FAQ (page jeu / categorie) ---------- */
.faq { padding: 0 16px; }
.faq details {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.faq summary { font-weight: 600; cursor: pointer; font-size: .92rem; }
.faq details p { margin-top: 8px; color: var(--text-muted); font-size: .88rem; line-height: 1.5; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 24px 16px;
  border-top: 1px solid #242424;
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.6;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.site-footer a { color: var(--text); }

/* ---------- Bottom nav (style Spotify) ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: linear-gradient(to top, rgba(10,10,10,.98), rgba(10,10,10,.88));
  backdrop-filter: blur(16px);
  display: flex;
  z-index: 60;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .65rem;
  color: var(--text-muted);
  font-weight: 500;
}
.bottom-nav a.active { color: var(--text); }
.bottom-nav a .ico { font-size: 1.25rem; line-height: 1; }

/* ---------- Age gate ---------- */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.92);
  display: grid;
  place-items: center;
  padding: 24px;
}
.age-gate-box {
  background: var(--bg-elevated);
  border-radius: 16px;
  padding: 28px 22px;
  max-width: 380px;
  text-align: center;
}
.age-gate-box h2 { font-size: 1.3rem; margin-bottom: 10px; }
.age-gate-box p { color: var(--text-muted); font-size: .9rem; line-height: 1.5; margin-bottom: 18px; }
.age-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-secondary {
  background: transparent;
  border: 1px solid #3a3a3a;
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.hidden { display: none !important; }

/* ---------- Page recherche ---------- */
.search-bar {
  margin: 8px 16px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: #121212;
  border-radius: 8px;
  padding: 12px 14px;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  background: transparent;
  color: #121212;
}

/* Tuiles "Explorar todo" style Spotify Browse */
.browse-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}
@media (min-width: 600px) { .browse-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .browse-grid { grid-template-columns: repeat(4, 1fr); } }

.browse-tile {
  border-radius: 10px;
  padding: 14px;
  aspect-ratio: 2 / 1;
  font-weight: 800;
  font-size: .95rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.browse-tile .deco {
  position: absolute;
  right: -14px; bottom: -8px;
  width: 64px; height: 64px;
  border-radius: 8px;
  transform: rotate(22deg);
  background: rgba(0,0,0,.28);
}

/* Etat vide (favoris, recherche sans resultat) */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .big { font-size: 2.4rem; margin-bottom: 12px; }
.empty-state h2 { color: var(--text); font-size: 1.2rem; margin-bottom: 8px; }
.empty-state p { font-size: .9rem; line-height: 1.5; max-width: 320px; margin: 0 auto 18px; }

/* ---------- Leer mas (texte replie, contenu complet dans le DOM) ---------- */
.readmore-body {
  max-height: 0;
  overflow: hidden;
}
.readmore.open .readmore-body { max-height: none; }
.readmore-fade { position: relative; }
.readmore:not(.open) .readmore-fade::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.readmore-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  background: none;
  border: 1px solid #3a3a3a;
  color: var(--text);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.readmore.open .readmore-btn .more-label { display: none; }
.readmore:not(.open) .readmore-btn .less-label { display: none; }

/* Les images de carrousel gardent leur ratio quel que soit l'ecran */
.carousel img.card, .carousel img.card-lg { height: auto; object-fit: cover; }

/* ---------- Plein ecran du player ---------- */
.player-shell { position: relative; }
.fullscreen-btn {
  position: absolute;
  right: 26px;
  top: 26px;
  z-index: 5;
  background: rgba(0,0,0,.6);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
}
.player-shell.playing .fullscreen-btn { display: block; }
/* Plein ecran CSS de secours (iOS) */
.player-shell.fs-fallback {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
}
.player-shell.fs-fallback .player-wrap {
  margin: 0;
  border-radius: 0;
  border: none;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}
.player-shell.fs-fallback .fullscreen-btn { right: 12px; top: 12px; }
body.fs-lock { overflow: hidden; }
