/* =============================================================================
   L’KORA Fantasy - site vitrine
   Palette tirée du logo : pelouse de nuit, rouge Atlas, or zellige, craie.
   ============================================================================= */

:root {
  --night: #04150e;          /* fond le plus sombre */
  --pitch: #072a1d;          /* vert « stade de nuit » */
  --grass: #0f5132;          /* pelouse */
  --grass-light: #1b6b45;
  --red: #c1272d;            /* rouge Atlas (drapeau) */
  --gold: #d4a24c;           /* or zellige */
  --gold-light: #f0cd84;
  --chalk: #eef3ec;          /* craie, fond clair froid */
  --ink: #0d2318;            /* texte sur fond clair */
  --muted: #4f6a5c;
  --line: rgba(238, 243, 236, 0.18);

  --font-display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ar: "Noto Kufi Arabic", "Segoe UI", Tahoma, sans-serif;

  --wrap: 1160px;
  --radius-lg: 22px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--chalk);
}

html[lang="ar"] body {
  font-family: var(--font-ar);
  line-height: 1.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold-light);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(var(--wrap), 100% - 2.5rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -60px;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--gold);
  color: var(--night);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* ------------------------------------------------------------------ boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-gold {
  background: var(--gold);
  color: var(--night);
}

.btn-gold:hover {
  background: var(--gold-light);
}

.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.store-buttons-center {
  justify-content: center;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 56px;
  padding: 0.55rem 1.25rem 0.55rem 1rem;
  border-radius: 14px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.store-btn:hover {
  border-color: var(--gold);
  background: #0b0b0b;
}

.store-btn svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  flex-shrink: 0;
}

.store-btn span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.store-btn small {
  font-size: 0.72rem;
  opacity: 0.8;
}

.store-btn strong {
  font-size: 1.15rem;
  font-weight: 600;
  font-family: var(--font-body);
}

.store-btn.is-soon {
  opacity: 0.55;
  cursor: default;
}

/* ------------------------------------------------------------------ en-tête */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(4, 21, 14, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  color: var(--chalk);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
}

.main-nav {
  display: flex;
  gap: 1.6rem;
  margin-inline-start: auto;
}

.main-nav a {
  text-decoration: none;
  font-weight: 500;
  opacity: 0.85;
  padding-block: 0.4rem;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover {
  opacity: 1;
  border-bottom-color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  min-height: 40px;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--chalk);
  font: 600 0.95rem var(--font-ar);
  cursor: pointer;
}

html[lang="ar"] .lang-toggle {
  font-family: var(--font-body);
}

.lang-toggle:hover {
  border-color: var(--gold);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--chalk);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------- hero */
.hero {
  position: relative;
  color: var(--chalk);
  background:
    radial-gradient(1200px 600px at 75% 30%, rgba(27, 107, 69, 0.55), transparent 60%),
    linear-gradient(180deg, var(--pitch), var(--night));
  overflow: hidden;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem);
}

/* motif zellige discret : étoiles à 8 branches */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23f0cd84' stroke-width='1.2'%3E%3Crect x='38' y='38' width='44' height='44'/%3E%3Crect x='38' y='38' width='44' height='44' transform='rotate(45 60 60)'/%3E%3Ccircle cx='60' cy='60' r='9'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-logo {
  width: clamp(150px, 17vw, 210px);
  margin-bottom: 1rem;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.45));
}

.hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.4rem, 4.6vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

html[lang="ar"] .hero-title {
  font-family: var(--font-ar);
  font-weight: 800;
  line-height: 1.3;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
}

.hero-lead {
  max-width: 34rem;
  margin: 0 0 2rem;
  font-size: 1.15rem;
  color: rgba(238, 243, 236, 0.86);
}

/* ------------------------------------------------- démo du terrain (hero) */
.pitch-demo {
  background: rgba(4, 21, 14, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.demo-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.demo-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(238, 243, 236, 0.9);
  max-width: 18rem;
}

.demo-budget {
  text-align: end;
  font-size: 0.8rem;
  color: rgba(238, 243, 236, 0.7);
  white-space: nowrap;
}

.demo-budget strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  line-height: 1;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
  direction: ltr;
}

.demo-budget strong.is-negative {
  color: #ff7a7f;
}

.pitch {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 0.6rem;
  min-height: 430px;
  padding: 1.4rem 0.4rem;
  border-radius: 16px;
  overflow: hidden;
  background: repeating-linear-gradient(180deg, var(--grass) 0 52px, var(--grass-light) 52px 104px);
}

.pitch-lines {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  pointer-events: none;
}

.pitch-lines span {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.55);
}

.pl-center {
  left: 0;
  right: 0;
  top: 50%;
  border-width: 2px 0 0 !important;
}

.pl-circle {
  width: 96px;
  height: 96px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.pl-box {
  left: 26%;
  right: 26%;
  height: 58px;
}

.pl-box-top {
  top: -2px;
}

.pl-box-bottom {
  bottom: -2px;
}

.pitch-row {
  position: relative;
  display: flex;
  justify-content: space-evenly;
  gap: 0.25rem;
  direction: ltr; /* le terrain garde la même disposition en arabe */
}

.slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 84px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 12px;
  font: inherit;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.slot:hover {
  background: rgba(0, 0, 0, 0.12);
}

.slot:active {
  transform: scale(0.94);
}

.slot svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

.slot .jersey-num {
  font: 800 15px var(--font-display);
}

.slot-name {
  max-width: 82px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(4, 21, 14, 0.82);
}

.slot-opp {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0 6px;
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
}

.demo-note {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  color: rgba(238, 243, 236, 0.6);
}

/* Moment d'animation unique : les maillots se posent sur le terrain au chargement */
@media (prefers-reduced-motion: no-preference) {
  .pitch.is-ready .slot {
    animation: slot-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(var(--i) * 70ms + 150ms);
  }

  @keyframes slot-in {
    from {
      opacity: 0;
      transform: translateY(-14px) scale(0.85);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .slot.is-swapped svg {
    animation: swap 0.35s ease;
  }

  @keyframes swap {
    50% {
      transform: rotateY(90deg);
    }
  }
}

/* ----------------------------------------------------------------- sections */
.section {
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section-title {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.2vw, 3.2rem);
  line-height: 1;
  text-wrap: balance;
}

html[lang="ar"] .section-title {
  font-family: var(--font-ar);
  line-height: 1.35;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
}

.section-lead {
  max-width: 38rem;
  margin: 0;
  font-size: 1.12rem;
  color: var(--muted);
}

/* Comment jouer : vraie séquence, d'où la numérotation */
.steps {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  counter-reset: none;
}

.step {
  position: relative;
  padding-top: 1.2rem;
  border-top: 3px solid var(--grass);
}

.step-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 4rem;
  line-height: 0.9;
  color: var(--red);
  margin-bottom: 0.6rem;
}

.step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

.step p {
  margin: 0;
  color: var(--muted);
  max-width: 34ch;
}

/* Règles : tableau d'affichage de stade */
.rules {
  background: var(--pitch);
  color: var(--chalk);
}

.rules .section-lead {
  color: rgba(238, 243, 236, 0.75);
}

.rules-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.scoreboard {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #020c08;
  border: 2px solid #1d3a2c;
  border-radius: 14px;
  overflow: hidden;
}

.scoreboard div {
  padding: 1.3rem 1.4rem;
  border: 1px solid #10261c;
}

.scoreboard dt {
  font-size: 0.9rem;
  color: rgba(238, 243, 236, 0.72);
}

.scoreboard dd {
  margin: 0.2rem 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(240, 205, 132, 0.35);
  font-variant-numeric: tabular-nums;
}

/* Ligues */
.leagues-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.league-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: 0 24px 50px rgba(13, 35, 24, 0.14);
  border-top: 6px solid var(--red);
  max-width: 420px;
  transform: rotate(-2deg);
}

html[dir="rtl"] .league-card {
  transform: rotate(2deg);
}

.league-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.league-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.league-code {
  font: 800 1rem var(--font-display);
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  background: var(--chalk);
  color: var(--grass);
  direction: ltr;
}

.league-table {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.league-table li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid #e3ebe5;
}

.league-table li::before {
  content: counter(rank);
  width: 1.6rem;
  font: 800 1.2rem var(--font-display);
  color: var(--muted);
}

.league-table li span {
  flex: 1;
}

.league-table li b {
  font: 800 1.3rem var(--font-display);
  color: var(--grass);
}

.league-table li.me {
  background: #fdf4e3;
  border-radius: 8px;
}

.checks {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.checks li {
  position: relative;
  padding-inline-start: 2rem;
  font-weight: 500;
}

.checks li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.35em;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: var(--grass) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z' fill='%23fff'/%3E%3C/svg%3E") center / 75% no-repeat;
}

/* Téléchargement */
.download {
  text-align: center;
  color: var(--chalk);
  background:
    radial-gradient(700px 360px at 50% 0%, rgba(193, 39, 45, 0.28), transparent 70%),
    linear-gradient(180deg, var(--grass), var(--pitch));
}

.download-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download-emblem {
  width: 132px;
  margin-bottom: 1.2rem;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.download .section-lead {
  color: rgba(238, 243, 236, 0.82);
  margin-bottom: 2rem;
}

.soon-note {
  margin: 1.2rem 0 0;
  font-weight: 600;
  color: var(--gold-light);
}

/* FAQ */
.faq-inner {
  max-width: 820px;
}

.faq details {
  border-bottom: 1px solid #cfdcd3;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  font-weight: 700;
  font-size: 1.1rem;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border-right: 2.5px solid var(--grass);
  border-bottom: 2.5px solid var(--grass);
  transform: rotate(45deg) translateY(-4px);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.faq details p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  max-width: 64ch;
}

/* Pied de page */
.site-footer {
  background: var(--night);
  color: rgba(238, 243, 236, 0.75);
  padding: 3rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem 2rem;
  align-items: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.footer-brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.footer-brand p {
  margin: 0;
  color: var(--chalk);
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
}

.footer-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-links a:hover {
  color: var(--gold-light);
}

.footer-legal,
.footer-copy {
  margin: 0;
  font-size: 0.85rem;
}

.footer-legal {
  grid-column: 1 / -1;
  max-width: 70ch;
}

/* --------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .hero-grid,
  .rules-grid,
  .leagues-grid {
    grid-template-columns: 1fr;
  }

  .league-card {
    margin-inline: auto;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: var(--night);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-toggle {
    display: block;
  }

  .header-actions {
    margin-inline-start: auto;
  }
}

@media (max-width: 560px) {
  .header-cta {
    display: none;
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .pitch {
    min-height: 380px;
    padding-inline: 0;
  }

  .slot {
    width: 64px;
  }

  .slot svg {
    width: 44px;
    height: 44px;
  }

  .slot-name {
    max-width: 62px;
    font-size: 0.66rem;
  }

  .demo-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .demo-budget {
    text-align: start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}

/* Page de confidentialité */
.legal-inner {
  max-width: 760px;
}

.legal-updated {
  color: var(--muted);
  margin: 0 0 2rem;
}

.legal-page h2 {
  margin: 2.2rem 0 0.6rem;
  font-size: 1.3rem;
}

.legal-page p,
.legal-page li {
  max-width: 68ch;
}

.legal-page ul {
  padding-inline-start: 1.2rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
}
