/* ==========================================================================
   FAMILIES / CINEMATIC 2026
   Une couche visuelle premium, pensée pour rester fluide sur mobile.
   ========================================================================== */

@property --beam-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --asphalt: #030604;
  --asphalt-2: #070c08;
  --panel: rgba(13, 21, 15, .78);
  --panel-2: rgba(20, 31, 22, .9);
  --line: rgba(178, 255, 187, .13);
  --green: #63ff72;
  --green-deep: #16a83a;
  --green-soft: #baffc0;
  --money: #f0c75e;
  --bone: #f3f7f0;
  --smoke: #9eaaa0;
  --smoke-2: #647067;
  --cinema-ease: cubic-bezier(.16, 1, .3, 1);
  --shadow-xl: 0 36px 100px rgba(0, 0, 0, .58);
}

html {
  background: #020403;
  scrollbar-color: rgba(99, 255, 114, .55) #050806;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(circle at var(--spot-x, 50%) var(--spot-y, 30%), rgba(55, 255, 87, .065), transparent 28rem),
    linear-gradient(145deg, #020403 0%, #071009 48%, #020403 100%);
  font-feature-settings: "ss01", "cv02";
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 116;
  pointer-events: none;
  opacity: .19;
  background-image:
    repeating-radial-gradient(circle at 18% 32%, rgba(255, 255, 255, .16) 0 .45px, transparent .7px 3px),
    repeating-radial-gradient(circle at 73% 61%, rgba(99, 255, 114, .11) 0 .4px, transparent .7px 4px);
  background-size: 7px 9px, 11px 13px;
  mix-blend-mode: soft-light;
}

.site-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 400;
  width: 100%;
  height: 2px;
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  background: linear-gradient(90deg, transparent, var(--green), #d8ffd8);
  box-shadow: 0 0 20px rgba(99, 255, 114, .8);
  pointer-events: none;
}

.ambient-orb {
  position: fixed;
  z-index: -1;
  width: min(42vw, 650px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .095;
  pointer-events: none;
  animation: orbDrift 18s var(--cinema-ease) infinite alternate;
}

.ambient-orb.one { top: -18%; left: -12%; background: #2fff58; }
.ambient-orb.two { right: -16%; bottom: -28%; background: #d4af37; animation-delay: -8s; }

@keyframes orbDrift {
  to { transform: translate3d(10vw, 8vh, 0) scale(1.14); }
}

/* Navigation flottante */
header.nav {
  top: 16px;
  left: 50%;
  right: auto;
  width: min(calc(100% - 32px), 1460px);
  transform: translateX(-50%);
  padding: 10px 12px 10px 18px;
  border: 1px solid rgba(255, 255, 255, .095);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(8, 14, 9, .77), rgba(4, 7, 5, .58));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(22px) saturate(1.45);
}

header.nav.scrolled {
  top: 8px;
  border-color: rgba(99, 255, 114, .17);
  background: rgba(5, 9, 6, .88);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .42), 0 0 0 1px rgba(99, 255, 114, .03);
}

.brand {
  letter-spacing: 1.4px;
}

.brand .dot {
  position: relative;
  background: #86ff91;
}

.brand .dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(99, 255, 114, .45);
  border-radius: inherit;
  animation: brandPulse 2.2s ease-out infinite;
}

@keyframes brandPulse {
  to { opacity: 0; transform: scale(1.8); }
}

nav.links {
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .024);
}

nav.links a {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 10.5px;
  letter-spacing: 1.2px;
}

nav.links a::after { display: none; }

nav.links a:hover,
nav.links a.active {
  color: #edfff0;
  background: rgba(99, 255, 114, .09);
  box-shadow: inset 0 0 0 1px rgba(99, 255, 114, .1);
}

.cart-btn,
.auth-btn {
  min-height: 42px;
  border-radius: 11px;
}

.auth-btn {
  position: relative;
  overflow: hidden;
  padding-inline: 18px;
  color: #061108;
  border-color: transparent;
  background: linear-gradient(135deg, #8cff96, #35d951);
  box-shadow: 0 10px 30px rgba(70, 224, 82, .18);
}

.auth-btn::after,
.btn-primary::after {
  content: "";
  position: absolute;
  inset: -100% auto -100% -35%;
  width: 30%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transition: left .7s var(--cinema-ease);
}

.auth-btn:hover::after,
.btn-primary:hover::after { left: 120%; }

/* Hero cinématique */
.hero {
  min-height: 100svh;
  isolation: isolate;
  background: #020503;
}

.hero::before {
  inset: -2%;
  background:
    linear-gradient(90deg, rgba(2, 5, 3, .96) 0%, rgba(2, 5, 3, .64) 42%, rgba(2, 5, 3, .16) 74%, rgba(2, 5, 3, .62) 100%),
    linear-gradient(0deg, #020503 0%, transparent 35%, rgba(2, 5, 3, .24) 100%),
    url("hero-families.webp") center 36% / cover no-repeat;
  filter: saturate(.86) contrast(1.09);
  transform: translate3d(var(--hx, 0), var(--hy, 0), 0) scale(1.09);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(99, 255, 114, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 255, 114, .035) 1px, transparent 1px),
    radial-gradient(circle at 74% 44%, rgba(99, 255, 114, .13), transparent 24%);
  background-size: 72px 72px, 72px 72px, auto;
  mask-image: linear-gradient(to bottom, transparent 4%, #000 32%, transparent 94%);
  opacity: .52;
}

.hero-inner {
  z-index: 3;
  padding-bottom: clamp(90px, 12vh, 150px);
}

.hero-tag {
  width: fit-content;
  padding: 9px 14px;
  border: 1px solid rgba(167, 255, 176, .2);
  border-radius: 999px;
  color: #c9ffd0;
  background: rgba(8, 19, 10, .45);
  box-shadow: inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
}

.hero h1 {
  position: relative;
  max-width: 980px;
  margin-top: 22px;
  font-size: clamp(104px, 17vw, 260px);
  letter-spacing: -3px;
  color: #f4f8f1;
  text-shadow: 0 5px 0 rgba(0, 0, 0, .45), 0 24px 80px rgba(0, 0, 0, .58);
  filter: drop-shadow(0 0 42px rgba(99, 255, 114, .08));
}

.hero h1::before {
  content: attr(data-shadow);
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: translate(5px, 3px);
  color: transparent;
  -webkit-text-stroke: 1px rgba(99, 255, 114, .28);
  filter: blur(.3px);
}

.hero h1 .on-top {
  right: 1.5%;
  bottom: 4%;
  padding: .05em .22em;
  border: 1px solid rgba(99, 255, 114, .32);
  border-radius: .08em;
  color: #07100a;
  background: linear-gradient(135deg, #a5ffad, #4ee864);
  box-shadow: 0 10px 36px rgba(45, 215, 74, .22);
  transform: rotate(-3.5deg);
}

.hero-sub {
  width: fit-content;
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: rgba(3, 7, 4, .38);
  backdrop-filter: blur(12px);
}

.btn {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  min-height: 52px;
  padding-inline: 24px;
  transition: transform .35s var(--cinema-ease), box-shadow .35s, border-color .35s, background .35s;
}

.btn:hover { transform: translateY(-3px); }

.btn-primary {
  color: #061008;
  background: linear-gradient(135deg, #9bffa4 0%, #46e052 55%, #21b83e 100%);
  box-shadow: 0 14px 38px rgba(41, 214, 71, .22), inset 0 1px rgba(255, 255, 255, .42);
}

.btn-primary:hover { box-shadow: 0 20px 55px rgba(41, 214, 71, .32); }

.btn-ghost {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(4, 9, 6, .38);
  backdrop-filter: blur(12px);
}

.scroll-hint {
  right: 28px;
  bottom: 38px;
  padding: 12px 8px;
  border-radius: 999px;
  background: rgba(5, 11, 7, .45);
  backdrop-filter: blur(10px);
}

/* Pages et panneaux */
.section {
  min-height: calc(100svh - 80px);
  padding: clamp(132px, 15vh, 174px) 0 110px;
  isolation: isolate;
  background:
    radial-gradient(circle at 88% 6%, rgba(99, 255, 114, .08), transparent 25rem),
    linear-gradient(150deg, rgba(3, 6, 4, .96), rgba(7, 13, 8, .94));
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 68%, rgba(99, 255, 114, .025) 68% 68.2%, transparent 68.2%),
    radial-gradient(circle at 10% 100%, rgba(218, 180, 74, .04), transparent 28rem);
}

.eyebrow {
  padding: 7px 10px;
  border: 1px solid rgba(99, 255, 114, .14);
  border-radius: 999px;
  background: rgba(99, 255, 114, .04);
}

.eyebrow::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
}

.sec-title {
  max-width: 1050px;
  font-size: clamp(62px, 8.8vw, 126px);
  letter-spacing: -.018em;
  text-wrap: balance;
  text-shadow: 0 16px 60px rgba(0, 0, 0, .48);
}

.lead {
  max-width: 720px;
  font-size: clamp(16px, 1.5vw, 20px);
  text-wrap: pretty;
}

.wm {
  top: 4%;
  font-size: clamp(120px, 19vw, 300px);
  letter-spacing: .04em;
  -webkit-text-stroke-color: rgba(99, 255, 114, .055);
  opacity: .85;
}

.histoire-text,
.histoire-timeline,
.leader-card,
.recruit-form,
.track-box,
.gate,
.bank-chart-box,
.bank-tx-box,
.ledger,
.estim {
  border-color: rgba(255, 255, 255, .08);
  background: linear-gradient(145deg, rgba(19, 29, 21, .72), rgba(7, 12, 8, .74));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .045);
  backdrop-filter: blur(18px);
}

.rank,
.item,
.ann-card,
.tcard,
.bank-card,
.ocard {
  --beam-angle: 0deg;
  border-color: transparent;
  background:
    linear-gradient(145deg, rgba(20, 31, 22, .94), rgba(7, 12, 8, .96)) padding-box,
    conic-gradient(from var(--beam-angle), rgba(99, 255, 114, .06), rgba(99, 255, 114, .45), rgba(240, 199, 94, .15), rgba(99, 255, 114, .06)) border-box;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .045);
  animation: beamOrbit 9s linear infinite;
}

@keyframes beamOrbit { to { --beam-angle: 360deg; } }

.rank:hover,
.item:hover,
.ann-card:hover,
.tcard:hover,
.bank-card:hover,
.ocard:hover {
  box-shadow: var(--shadow-xl), 0 0 36px rgba(99, 255, 114, .06);
}

.item .i-media {
  background:
    radial-gradient(circle at 50% 60%, rgba(99, 255, 114, .13), transparent 48%),
    linear-gradient(160deg, rgba(255, 255, 255, .025), transparent);
}

.cat-tabs,
.dash-tabs,
.seg {
  width: fit-content;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(7, 12, 8, .7);
  box-shadow: inset 0 1px rgba(255, 255, 255, .04);
  backdrop-filter: blur(14px);
}

.cat-tab,
.dash-tab,
.seg button {
  border: 0 !important;
  border-radius: 10px !important;
}

.cat-tab.active,
.dash-tab.active {
  color: #071008;
  background: linear-gradient(135deg, #a4ffad, #45dd59);
  box-shadow: 0 8px 26px rgba(70, 224, 82, .18);
}

input,
textarea,
select {
  border-color: rgba(255, 255, 255, .1) !important;
  border-radius: 12px !important;
  background: rgba(3, 7, 4, .62) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(99, 255, 114, .56) !important;
  box-shadow: 0 0 0 4px rgba(99, 255, 114, .07);
}

.overlay {
  background: rgba(1, 3, 2, .76);
  backdrop-filter: blur(20px) saturate(.8);
}

.modal,
.cart-drawer {
  border-color: rgba(99, 255, 114, .15);
  background: linear-gradient(145deg, rgba(17, 27, 19, .97), rgba(4, 8, 5, .98));
  box-shadow: 0 40px 130px rgba(0, 0, 0, .7);
}

.map-viewport,
.carousel {
  border-color: rgba(99, 255, 114, .15);
  box-shadow: 0 38px 100px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .025);
}

.strip {
  border-color: rgba(99, 255, 114, .1);
  background: linear-gradient(90deg, rgba(4, 8, 5, .97), rgba(12, 23, 14, .97), rgba(4, 8, 5, .97));
}

.strip .stat {
  position: relative;
}

.strip .stat + .stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 1px;
  background: linear-gradient(transparent, rgba(99, 255, 114, .25), transparent);
}

/* Contrôle musical YouTube */
.soundtrack-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 11px 8px 9px;
  border: 1px solid rgba(99, 255, 114, .18);
  border-radius: 18px;
  color: var(--bone);
  background: linear-gradient(135deg, rgba(12, 22, 14, .88), rgba(3, 7, 4, .91));
  box-shadow: 0 22px 70px rgba(0, 0, 0, .5), inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(20px) saturate(1.4);
  transform: translateY(90px);
  opacity: 0;
  transition: transform .7s var(--cinema-ease), opacity .7s;
}

.soundtrack-dock.ready {
  transform: none;
  opacity: 1;
}

.sound-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 0;
  border-radius: 13px;
  color: #061008;
  background: linear-gradient(135deg, #a0ffaa, #44dc58);
  box-shadow: 0 8px 26px rgba(70, 224, 82, .2);
}

.sound-toggle::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(99, 255, 114, .3);
  border-radius: 17px;
  opacity: 0;
}

.soundtrack-dock:not(.playing) .sound-toggle::after {
  animation: soundInvite 2s ease-out infinite;
}

@keyframes soundInvite {
  45% { opacity: 1; }
  to { opacity: 0; transform: scale(1.25); }
}

.sound-icon {
  width: 15px;
  height: 15px;
  border-left: 5px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transform: translateX(2px);
}

.playing .sound-icon {
  width: 13px;
  height: 14px;
  border: 0;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
  transform: none;
}

.sound-copy {
  min-width: 112px;
  line-height: 1.1;
}

.sound-copy b {
  display: block;
  font-size: 11px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}

.sound-copy span {
  display: block;
  margin-top: 5px;
  font: 9px/1 'Space Mono', monospace;
  color: var(--smoke);
  letter-spacing: .7px;
}

.sound-waves {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
}

.sound-waves i {
  width: 2px;
  height: 5px;
  border-radius: 2px;
  background: var(--green);
}

.playing .sound-waves i {
  animation: soundWave .8s ease-in-out infinite alternate;
}

.sound-waves i:nth-child(2) { animation-delay: -.2s; }
.sound-waves i:nth-child(3) { animation-delay: -.4s; }
.sound-waves i:nth-child(4) { animation-delay: -.1s; }

@keyframes soundWave { to { height: 21px; } }

.sound-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  border-left: 1px solid rgba(99, 255, 114, .12);
}

.sound-mute {
  border: 0;
  background: none;
  font-size: 15px;
  line-height: 1;
  padding: 4px 2px;
  cursor: pointer;
  opacity: .8;
  transition: opacity .2s, transform .2s;
}

.sound-mute:hover { opacity: 1; transform: scale(1.12); }
.soundtrack-dock.muted .sound-mute { opacity: .5; }
.soundtrack-dock.muted .sound-waves i { animation: none !important; height: 5px; background: var(--smoke-2); }

/* Barre de volume dessinée à la main : même rendu sur Chrome, Firefox et Safari */
.sound-volume {
  --vol: 42%;
  width: 66px;
  height: 18px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none;
}

.sound-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green) var(--vol), rgba(255, 255, 255, .16) var(--vol));
}

.sound-volume::-moz-range-track {
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .16);
}

.sound-volume::-moz-range-progress {
  height: 4px;
  border-radius: 4px;
  background: var(--green);
}

.sound-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border: 0;
  border-radius: 50%;
  background: #eafff0;
  box-shadow: 0 0 0 3px rgba(70, 224, 82, .28);
  transition: box-shadow .18s, transform .18s;
}

.sound-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: #eafff0;
  box-shadow: 0 0 0 3px rgba(70, 224, 82, .28);
}

.sound-volume:hover::-webkit-slider-thumb,
.sound-volume:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgba(70, 224, 82, .34); transform: scale(1.1); }
.sound-volume:focus-visible { outline: none; }

.soundtrack-dock.loading .sound-toggle { animation: soundPulse 1.1s ease-in-out infinite; }
@keyframes soundPulse { 50% { opacity: .55; } }

.youtube-frame,
#familiesYtFrame {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  left: -100px !important;
  bottom: -100px !important;
  border: 0;
  opacity: .001;
  pointer-events: none;
}

.page-index {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 999px;
  font: 9px/1 'Space Mono', monospace;
  letter-spacing: 1.2px;
  color: var(--smoke);
  background: rgba(4, 8, 5, .55);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.page-index b { color: var(--green); }

@media (max-width: 1180px) {
  header.nav { padding-inline: 14px; }
  nav.links {
    top: 68px;
    right: 0;
    border: 1px solid rgba(99, 255, 114, .15);
    background: rgba(4, 8, 5, .96);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .58);
    backdrop-filter: blur(22px);
  }
  nav.links a { width: 100%; }
}

@media (max-width: 720px) {
  header.nav {
    top: 9px;
    width: calc(100% - 18px);
    border-radius: 15px;
  }
  .brand small { display: none; }
  .auth-btn .lbl { display: none; }
  .auth-btn { width: 42px; padding: 0; justify-content: center; }
  .hero::before {
    background:
      linear-gradient(0deg, #020503 0%, rgba(2, 5, 3, .3) 46%, rgba(2, 5, 3, .52) 100%),
      linear-gradient(90deg, rgba(2, 5, 3, .76), rgba(2, 5, 3, .12)),
      url("hero-families.webp") 63% center / cover no-repeat;
  }
  .hero-inner { padding-bottom: 100px; }
  .hero h1 {
    font-size: clamp(84px, 27vw, 138px);
    letter-spacing: -2px;
  }
  .hero h1 .on-top { right: 0; bottom: 0; }
  .hero-sub { align-items: flex-start; }
  .hero-sub .sep { display: none; }
  .btn-row .btn { width: 100%; justify-content: center; }
  .section { padding-top: 116px; }
  .sec-title { font-size: clamp(56px, 17vw, 86px); }
  .strip .stat + .stat::before { display: none; }
  /* Sur mobile le dock est réduit, mais garde le mute ET le volume :
     un appui sur les ondes le déplie. */
  .soundtrack-dock {
    right: 10px;
    bottom: 10px;
    min-height: 52px;
    padding: 6px;
    gap: 6px;
    border-radius: 16px;
  }
  .sound-copy { display: none; }
  .sound-vol-wrap { padding-left: 2px; gap: 3px; }
  .sound-volume { width: 54px; }
  .soundtrack-dock .sound-waves { display: none; }
  .page-index { left: 10px; bottom: 12px; }
}

@media (max-width: 400px) {
  .sound-volume { width: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .ambient-orb,
  .brand .dot::after,
  .rank,
  .item,
  .ann-card,
  .tcard,
  .bank-card,
  .ocard,
  .soundtrack-dock:not(.playing) .sound-toggle::after,
  .playing .sound-waves i {
    animation: none !important;
  }
  .hero::before { transform: none !important; }
}
