/* ===========================================================
   Twisco x Justice League — Tombola "طاقة الأبطال"
   =========================================================== */

@font-face {
  font-family: 'Omnes';
  src: url('../fonts/Omnes-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Omnes';
  src: url('../fonts/Omnes-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Omnes';
  src: url('../fonts/Omnes-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Omnes';
  src: url('../fonts/Omnes-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #e1261d;
  --red-dark: #c41f18;
  --purple: #7a1197;
  --purple-dark: #470a5c;
  --yellow: #eed401;
  --yellow-dark: #cdb600;
  --white: #ffffff;
  --ink: #2b0b33;
  --container-width: 1200px;
  --radius: 14px;
  --font: 'Omnes', 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --nav-font: 'Omnes', 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --nav-color: #6a2375;
  --header-border: #005da6;
  --step-grad-top: #6b0f89;
  --step-grad-bottom: #e015fa;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--red);
  background-image: url('../images/background-page.png');
  background-repeat: repeat;
  color: var(--white);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
}

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

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 16px 40px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease, filter .3s ease;
}
.btn:hover { transform: translateY(-4px) scale(1.03); filter: brightness(1.05); }
.btn:active { transform: translateY(3px) scale(.97); transition-duration: .12s; filter: brightness(.97); }

.btn-white {
  background: var(--white);
  color: var(--purple);
  box-shadow: 0 8px 0 rgba(0,0,0,.15);
}

.btn-yellow {
  background: var(--yellow);
  color: var(--purple-dark);
  box-shadow: 0 6px 0 var(--yellow-dark);
  width: 100%;
  font-size: 1.3rem;
  padding: 18px 20px;
}
.btn-yellow:hover { background: #f5e23a; }

/* ---------- Header ---------- */
.site-header {
  background: transparent;
  position: sticky;
  top: 16px;
  z-index: 100;
  padding: 16px 24px 0;
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--white);
  border: 4px solid var(--header-border);
  border-radius: 50px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
  padding: 10px 32px;
  min-height: 64px;
}

.main-nav {
  order: 1;
  padding-inline-end: 22px;
  margin-inline-end: 6px;
}
.header-brand { order: 2; direction: ltr; display: flex; align-items: center; gap: 90px; }

.logo { height: 40px; width: auto; }

.logo-link {
  display: inline-block;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
}
.logo-link:hover { transform: scale(1.06) rotate(-2deg); }
.logo-link:active { transform: scale(.94); transition-duration: .12s; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
}

.main-nav li {
  padding: 0 14px;
}
.main-nav li:first-child { padding-inline-start: 0; }
.main-nav li:last-child { padding-inline-end: 0; }

.main-nav a {
  position: relative;
  text-decoration: none;
  color: var(--nav-color);
  font-family: var(--nav-font);
  font-weight: 900;
  font-size: .95rem;
  transition: color .3s ease;
}
.main-nav a::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--purple);
  transition: width .3s ease;
}
.main-nav a:hover { color: var(--purple); }
.main-nav a:hover::after { width: 100%; }
.main-nav a:active { transform: scale(.95); display: inline-block; }

/* Sous-menu déroulant "قواعد المشاركة" : choix du règlement AR / FR
   (s'ouvre au survol, au focus clavier ou au clic/toucher) */
.nav-dropdown { position: relative; }
.rules-trigger {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--nav-color);
  font-family: var(--nav-font);
  font-weight: 900;
  font-size: .95rem;
  transition: color .3s ease;
}
.nav-dropdown:hover .rules-trigger,
.nav-dropdown.open .rules-trigger { color: var(--purple); }
.rules-trigger .caret { font-size: .75em; display: inline-block; transition: transform .25s ease; }
.nav-dropdown:hover .caret,
.nav-dropdown.open .caret { transform: rotate(180deg); }

/* wrapper avec padding-top : pas de "trou" entre le bouton et le menu, le survol reste actif */
.rules-menu-wrap {
  display: none;
  position: absolute;
  top: 100%;
  right: 50%;
  transform: translateX(50%);
  padding-top: 14px;
  z-index: 50;
}
.nav-dropdown:hover .rules-menu-wrap,
.nav-dropdown:focus-within .rules-menu-wrap,
.nav-dropdown.open .rules-menu-wrap { display: block; }

.rules-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 8px;
  min-width: 130px;
  background: var(--white);
  border: 3px solid var(--header-border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.rules-menu li,
.rules-menu li:first-child,
.rules-menu li:last-child { padding: 0; }
.rules-menu a {
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  text-align: center;
  white-space: nowrap;
}
.rules-menu a::after { display: none; }
.rules-menu a:hover { background: rgba(106,35,117,.1); }

.header-social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.follow-label {
  font-family: var(--nav-font);
  font-weight: 900;
  font-size: .9rem;
  color: var(--nav-color);
  margin-inline-start: 4px;
}

.social-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--nav-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), background-color .3s ease;
}
.social-icon svg { width: 16px; height: 16px; fill: var(--white); transition: fill .3s ease; }
.social-icon:hover { transform: scale(1.15) rotate(-8deg); background: var(--yellow); }
.social-icon:hover svg { fill: var(--purple-dark); }
.social-icon:active { transform: scale(.9) rotate(0deg); transition-duration: .12s; }

.mobile-social { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform .2s ease;
}
.nav-toggle:hover { transform: scale(1.1); }
.nav-toggle:active { transform: scale(.9); }
.nav-toggle span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: #6a2375;
  transition: background-color .3s ease;
}
.nav-toggle:hover span,
.nav-toggle:active span,
.nav-toggle.active span { background: var(--yellow); }

/* ---------- Hero ---------- */
.hero {
  padding: 40px 0 30px;
  background-image: url('../images/background-page.png'), radial-gradient(circle at 30% 30%, #ff4d3d 0%, var(--red) 55%);
  background-repeat: repeat, no-repeat;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 20px;
}

.hero-art { order: 2; }
.hero-copy { order: 1; text-align: center; }
.hero-art img { transition: transform .4s cubic-bezier(.34,1.56,.64,1); }
.hero-art img:hover { transform: scale(1.03) translateY(-6px); }

.hero-logo-lockup {
  margin: 0 auto;
  max-width: 460px;
  width: 100%;
}

.hero-tombola-title {
  margin: 4px auto 20px;
  max-width: 420px;
  width: 100%;
}

.hero-text-svg {
  display: block;
  max-width: 480px;
  width: 100%;
  margin: 0 auto 24px;
}

/* ---------- Promo ---------- */
.promo { padding: 10px 0 40px; }

.promo-grid {
  display: flex;
  justify-content: center;
  align-items: center;
}

.badge-img {
  margin: 0 auto;
  max-width: 500px;
  width: 100%;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.badge-img:hover { transform: scale(1.04) translateY(-6px); }

/* ---------- Steps ---------- */
.steps { padding-bottom: 50px; }

.steps-banner {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 10px;
}

/* Le design des cartes d'étapes (steps-cards, step-card-frame, step-card...)
   vit désormais dans le <style> inline de index.html. */

/* ---------- Lineup ---------- */
.lineup { padding-bottom: 20px; text-align: center; }

.lineup-heading {
  margin: 0 auto 10px;
  max-width: 620px;
  width: 100%;
}

.lineup-characters {
  margin: 0 auto;
  max-width: 640px;
  width: 100%;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.lineup-characters:hover { transform: scale(1.03) translateY(-6px); }

/* ---------- Form ---------- */
.entry-section { padding: 40px 0 60px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: center;
}

.form-decor { text-align: center; }
.form-decor img:first-child {
  position: relative;
  z-index: 1;
  max-width: 480px;
  width: 100%;
  height: auto;
  margin: 0 auto -100px;
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
}
.form-decor img:first-child:hover { transform: scale(1.04) translateY(-6px); }

.form-30bags-heading {
  position: relative;
  z-index: 2;
  margin: 10px auto 0;
  max-width: 440px;
  width: 100%;
}

.form-heading-img {
  max-width: 340px;
  width: 100%;
  margin: 0 auto 20px;
}

.form-subtext {
  text-align: center;
  font-weight: 700;
  font-size: 1.05rem;
  margin: -8px auto 20px;
  max-width: 420px;
}

.form-row { margin-bottom: 16px; }
.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  font-size: .95rem;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: none;
  font-family: var(--font);
  font-size: .95rem;
  background: var(--white);
  color: var(--ink);
  transition: box-shadow .3s ease, transform .2s ease;
}

.field select {
  padding-left: 32px;
}
.field input:hover,
.field select:hover {
  box-shadow: 0 0 0 2px rgba(122,17,151,.25);
}
.field input:focus,
.field select:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--yellow);
  transform: translateY(-1px);
}

.field input::placeholder { color: #999; }

.field input[type="file"] {
  padding: 10px;
  background: var(--white);
}

.checkbox-row { margin: 20px 0; }

/* ---------- Hero picker ---------- */
.hero-picker-field { text-align: center; }
.hero-picker-field label { text-align: right; display: block; }

.hero-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.hero-picker-track {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  height: 130px;
  width: 250px;
}

.hero-picker-img {
  flex: 0 0 auto;
  height: 85px;
  width: auto;
  object-fit: contain;
  filter: grayscale(85%) brightness(1.15);
  opacity: .55;
  transform: scale(.85);
  cursor: pointer;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), filter .35s ease, opacity .35s ease;
}
.hero-picker-img:hover { opacity: .8; }

.hero-picker-img.hero-picker-center {
  height: 130px;
  filter: none;
  opacity: 1;
  transform: scale(1.05);
  cursor: default;
}

.hero-picker-arrow {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  color: var(--purple);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), background .3s ease;
}
.hero-picker-arrow:hover { transform: scale(1.12); background: var(--yellow); }
.hero-picker-arrow:active { transform: scale(.9); transition-duration: .12s; }
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}
.checkbox-label input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.checkbox-text { flex: 1; line-height: 1.6; }
.checkbox-label:hover input { transform: scale(1.2); }
.checkbox-label:active input { transform: scale(.9); }
.rules-link { color: var(--purple); font-weight: 800; text-decoration: underline; }
.rules-link:hover { color: var(--purple-dark); }
.rules-lang-alt { font-size: .82rem; opacity: .85; }
.rules-lang-alt a { color: var(--purple); text-decoration: underline; }

.btn-submit { margin-top: 6px; }

.form-note {
  margin-top: 14px;
  text-align: center;
  font-weight: 700;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 10px;
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--red-dark);
  background-image: url('../images/background-page.png');
  background-repeat: repeat;
  padding: 30px 0;
  text-align: center;
}

.footer-logos-copyright {
  margin: 0 auto 18px;
  max-width: 500px;
  width: 100%;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 14px;
}
.footer-social .social-icon { background: rgba(255,255,255,.15); }

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-art img { margin: 0 auto; }
  .form-grid { grid-template-columns: 1fr; }
  .form-decor { order: 0; }

  .main-nav, .header-social { display: none; }
  .nav-toggle { display: flex; }
  .header-brand { gap: 16px; order: 0; }
  .nav-toggle { order: 2; }

  .main-nav.open {
    display: block;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    left: 0;
    background: var(--white);
    border: 4px solid var(--header-border);
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    padding: 16px 24px;
  }
  .main-nav.open ul { flex-direction: column; gap: 16px; }
  /* mobile : le sous-menu est toujours déplié dans le menu ouvert */
  .main-nav.open .rules-menu-wrap {
    display: block;
    position: static;
    transform: none;
    padding-top: 8px;
  }
  .main-nav.open .rules-menu {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }
  .main-nav.open .rules-menu { gap: 0; }
  .main-nav.open .rules-menu a { padding: 6px 14px 6px 0; text-align: start; }
  .main-nav.open .rules-trigger .caret { display: none; }

  .main-nav.open .mobile-social {
    display: flex;
    direction: ltr;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(106,35,117,.2);
  }
}

@media (max-width: 720px) {
  .form-row.two-col { grid-template-columns: 1fr; }
  .form-row.three-col { grid-template-columns: 1fr; }
  .hero-text { font-size: 1rem; }
  .btn { padding: 14px 30px; font-size: 1rem; }

  .hero-art { margin-top: 22px; }

  .form-decor img:first-child { margin: 0 auto -60px; }
}
