/* ============================================
   futanarigames.com - Template v2.0
   UI direction: cinematic dark with an editorial voice.
   Signature: pink-to-violet gradient, // section markers,
   leaderboard Top 10, review snippets on hover.
   ============================================ */

:root {
  --bg: #0b0b10;
  --bg-elevated: #16161e;
  --bg-card: #14141b;
  --accent: #f0308a;
  --accent-dark: #c21f6d;
  --text: #f5f4f7;
  --text-muted: #9a97a5;
  --line: #232330;
  --radius: 10px;
  --grad: linear-gradient(115deg, #f0308a, #8b3df0);
}

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

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 480px at 78% -140px, rgba(139,61,240,.14), transparent 65%),
    radial-gradient(700px 380px at 12% -120px, rgba(240,48,138,.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 24px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

/* ---------- Header : logo + nav horizontale ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(to bottom, rgba(11,11,16,.95) 60%, rgba(11,11,16,.78));
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  flex: 0 0 auto;
}
.logo .accent {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  flex: 0 0 auto;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 4px;
  white-space: nowrap;
}
.main-nav a.active, .main-nav a:hover { color: var(--text); }
.main-nav a.active { background: rgba(255,255,255,.07); }

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

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  display: grid; place-items: center;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.08); }

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

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 10px;
}
.section-head { position: relative; }
.section-head h1, .section-head h2 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.section-head h1::before, .section-head h2::before {
  content: "//";
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  margin-right: 8px;
  letter-spacing: -0.08em;
}
.see-all { font-size: .75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.see-all:hover { color: var(--accent); }

/* ---------- Hero cinematique (pleine largeur) ---------- */
.hero {
  position: relative;
  min-height: 58vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero-backdrop img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 25%;
}
.hero-backdrop::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 4%, rgba(11,11,16,.55) 40%, rgba(11,11,16,.15)),
    linear-gradient(100deg, rgba(11,11,16,.85), transparent 60%);
}
.hero-body { padding: 24px 16px 34px; max-width: 640px; }
.hero-tag {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 2px solid;
  border-image: var(--grad) 1;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 10px;
}
.hero-body h2, .hero-body h1 {
  font-size: clamp(1.9rem, 6vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-wrap: balance;
  text-shadow: 0 2px 24px rgba(0,0,0,.55);
}
.hero-body p {
  color: #d9d7e0;
  font-size: .95rem;
  line-height: 1.5;
  margin-top: 12px;
  max-width: 46ch;
  text-shadow: 0 1px 12px rgba(0,0,0,.6);
}
.hero-actions { display: flex; gap: 10px; margin-top: 18px; }

.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: .95rem;
  padding: 12px 26px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transform: skewX(-6deg);
  transition: transform .1s, filter .15s;
}
.btn-play:hover { filter: brightness(1.12); }
.btn-play:active { transform: skewX(-6deg) scale(.97); }

.btn-secondary {
  background: rgba(255,255,255,.14);
  transform: skewX(-6deg);
  border: none;
  color: var(--text);
  padding: 12px 22px;
  border-radius: 4px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
}
.btn-secondary:hover { background: rgba(255,255,255,.22); }

/* ---------- Rangees horizontales, cartes 16/9 ---------- */
.carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 16px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 66vw;
  max-width: 300px;
  scroll-snap-align: start;
  position: relative;
}
@media (min-width: 600px) { .card { flex-basis: 260px; } }

.card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover .card-cover {
  transform: scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,.6), 0 0 0 1px rgba(240,48,138,.55);
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82), transparent 55%);
}
.card-title {
  position: absolute;
  left: 10px; right: 10px; bottom: 8px;
  z-index: 1;
  font-size: .84rem;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-meta {
  position: absolute;
  top: 8px; left: 10px;
  z-index: 1;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  background: rgba(0,0,0,.55);
  border-left: 3px solid var(--accent);
  padding: 3px 8px;
  border-radius: 0 3px 3px 0;
}
.card-blurb {
  position: absolute;
  left: 10px; right: 10px; bottom: 30px;
  z-index: 1;
  font-size: .72rem;
  line-height: 1.4;
  color: #d9d7e0;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  display: none;
}
@media (pointer: fine) {
  .card-blurb { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .card:hover .card-blurb { opacity: 1; transform: none; }
  .card:hover .card-cover::after { background: linear-gradient(to top, rgba(0,0,0,.94) 30%, rgba(0,0,0,.25)); }
}

/* ---------- Top 10 : classement avec pastille numerotee ---------- */
.top-row .card { flex-basis: 70vw; max-width: 310px; }
@media (min-width: 600px) { .top-row .card { flex-basis: 280px; } }
.top-num {
  position: absolute;
  top: -6px; left: 10px;
  z-index: 3;
  min-width: 30px;
  height: 34px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  background: var(--grad);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
}
.top-row .card-meta { display: none; }
.top-row .card-title { padding-left: 34px; }

/* ---------- Grille (pages categorie) ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 16px;
}
@media (min-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.grid .card { flex: none; max-width: none; width: 100%; }

/* ---------- Page jeu : banniere cinematique ---------- */
.game-hero {
  position: relative;
  min-height: 54vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
}
.game-hero .hero-body { padding-bottom: 26px; }
.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: #cfccd9;
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.game-meta span + span::before { content: "·"; margin-right: 14px; color: var(--text-muted); }
.game-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.game-actions .icon-btn { background: rgba(255,255,255,.12); }

/* Player */
.player-wrap {
  margin: 20px 16px 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: .9rem;
  border: 1px solid var(--line);
  cursor: pointer;
  max-width: 960px;
}
@media (min-width: 992px) { .player-wrap { margin-left: auto; margin-right: auto; } }
.player-wrap iframe { width: 100%; height: 100%; border: 0; }

.prose {
  padding: 0 16px;
  color: #c4c1cf;
  font-size: .95rem;
  line-height: 1.65;
  max-width: 720px;
}
@media (min-width: 992px) { .prose { margin-left: auto; margin-right: auto; } }
.prose h1, .prose h2 { color: var(--text); letter-spacing: -0.01em; }
.prose h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.prose p + p { margin-top: 12px; }
.prose a { color: var(--accent); font-weight: 600; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 0;
  font-size: .78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.breadcrumb a { color: var(--text-muted); flex: 0 0 auto; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { opacity: .5; flex: 0 0 auto; }
.breadcrumb .current { overflow: hidden; text-overflow: ellipsis; color: var(--text); }

/* ---------- FAQ ---------- */
.faq { padding: 0 16px; max-width: 720px; }
@media (min-width: 992px) { .faq { margin-left: auto; margin-right: auto; } }
.faq .section-head { padding: 0; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
.faq summary { font-weight: 700; cursor: pointer; font-size: .92rem; list-style: none; position: relative; padding-right: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 0; color: var(--accent); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: 8px; color: var(--text-muted); font-size: .88rem; line-height: 1.55; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 48px;
  padding: 26px 16px 20px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.6;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; }
.site-footer a { color: var(--text-muted); font-weight: 600; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Age gate ---------- */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5,5,9,.94);
  display: grid;
  place-items: center;
  padding: 24px;
}
.age-gate-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 24px;
  max-width: 380px;
  text-align: center;
}
.age-gate-box h2 { font-size: 1.25rem; margin-bottom: 10px; letter-spacing: -0.01em; }
.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; }
.hidden { display: none !important; }

/* ---------- Recherche ---------- */
.search-bar {
  margin: 20px 16px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 4px;
  padding: 12px 14px;
  max-width: 720px;
}
@media (min-width: 992px) { .search-bar { margin-left: auto; margin-right: auto; } }
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
}

.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(4, 1fr); } }
.browse-tile {
  border-radius: var(--radius);
  padding: 16px 14px;
  aspect-ratio: 16 / 7;
  font-weight: 800;
  font-size: .95rem;
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: flex-end;
  border: 1px solid rgba(255,255,255,.08);
}
.browse-tile .deco {
  position: absolute;
  right: -14px; top: -10px;
  width: 70px; height: 70px;
  border-radius: 10px;
  transform: rotate(22deg);
  background: rgba(0,0,0,.3);
}

/* Etat vide */
.empty-state {
  text-align: center;
  padding: 56px 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; }

/* ---------- 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: 6px;
  padding: 8px 12px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  display: none;
}
.player-shell.playing .fullscreen-btn { display: block; }
.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;
  max-width: none;
}
.player-shell.fs-fallback .fullscreen-btn { right: 12px; top: 12px; }
body.fs-lock { overflow: hidden; }

.player-shell.fs-fallback.rotated .player-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100dvh;
  height: 100dvw;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: top left;
}
.player-shell.fs-fallback.rotated .fullscreen-btn {
  top: auto;
  bottom: 12px;
  right: 12px;
}

/* ---------- Navigation des carrousels sur desktop ---------- */
.carousel-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.carousel-nav.prev { left: 6px; }
.carousel-nav.next { right: 6px; }
.carousel-shell { position: relative; }
@media (pointer: fine) {
  .carousel-shell:hover .carousel-nav { display: flex; }
  .carousel-nav[disabled] { opacity: .3; cursor: default; }
  .carousel { cursor: grab; }
  .carousel.dragging { cursor: grabbing; scroll-snap-type: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card:hover .card-cover { transform: none; }
  .btn-play, .card-cover { transition: none; }
}

@media (min-width: 768px) {
  .hero { min-height: 74vh; }
  .game-hero { min-height: 60vh; }
}

/* ---------- Screenshots d'articles : carrousel + lightbox ---------- */
.shots { align-items: center; margin: 18px -16px; }
.shots img {
  flex: 0 0 auto;
  height: 220px;
  width: auto;
  max-width: 84vw;
  object-fit: cover;
  border-radius: var(--radius);
  scroll-snap-align: start;
  cursor: zoom-in;
  border: 1px solid rgba(255,255,255,.06);
}
@media (min-width: 768px) { .shots img { height: 260px; } }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(5,5,9,.96);
  display: grid;
  place-items: center;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 92vh;
  width: auto; height: auto;
  border-radius: 8px;
  box-shadow: 0 20px 80px rgba(0,0,0,.8);
}

/* ============================================
   Mobile-first : tab bar fixe + header epure
   ============================================ */
.tab-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(13,13,19,.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,.06);
}
.tab-bar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;
  font-size: .66rem;
  font-weight: 600;
  color: var(--text-muted);
}
.tab-bar svg { width: 23px; height: 23px; }
.tab-bar a.active { color: var(--text); }
.tab-bar a.active svg { stroke: url(#tabgrad); stroke: var(--accent); }
.tab-bar a.active::after {
  content: "";
  width: 16px; height: 3px;
  border-radius: 2px;
  background: var(--grad);
  margin-top: 1px;
}

/* Sur mobile : header reduit au logo, tab bar visible */
@media (max-width: 767px) {
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .main-nav, .header-actions { display: none; }
  .site-header { justify-content: center; height: 50px; }
  .logo { font-size: 1.25rem; }
  .site-footer { padding-bottom: 8px; }
}
/* Sur desktop : pas de tab bar, nav du header */
@media (min-width: 768px) {
  .tab-bar { display: none; }
}

/* ---------- Page genres : grandes tuiles visuelles ---------- */
.genre-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 16px;
}
@media (min-width: 600px) { .genre-grid { grid-template-columns: repeat(2, 1fr); } }
.genre-tile {
  min-height: 92px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.08);
}
.genre-tile:active { transform: scale(.98); }
.genre-name { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.genre-count { font-size: .75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* Hero video : remplit le backdrop comme l'image */
.hero-backdrop video {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

/* ---------- Hero rotatif : slides empiles + points ---------- */
.hero { display: block; }
.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transition: opacity .7s ease;
  pointer-events: none;
}
.hero-slide.active {
  position: relative;
  min-height: inherit;
  opacity: 1;
  pointer-events: auto;
}
.hero { min-height: 58vh; }
@media (min-width: 768px) { .hero { min-height: 74vh; } }
.hero-dots {
  position: absolute;
  right: 16px;
  bottom: 18px;
  display: flex;
  gap: 8px;
  z-index: 3;
}
.hero-dot {
  width: 10px; height: 10px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.3);
  cursor: pointer;
}
.hero-dot::after { content: ""; position: absolute; inset: -8px; }
.hero-dot { position: relative; }
.hero-dot.active { background: var(--grad); transform: scale(1.25); }
