/* Min'fun — ajustements mobile/tablette uniquement. Le rendu desktop reste inchangé. */

@media (max-width: 900px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  * { box-sizing: border-box; }

  /* Contenu général */
  .container {
    width: calc(100% - 28px) !important;
    max-width: 700px !important;
    margin: 22px auto !important;
    padding: 30px 22px 26px !important;
  }
  .page-content { overflow: visible !important; }
  img, video, iframe { max-width: 100%; height: auto; }
  p, li, dd, dt { overflow-wrap: anywhere; }
  .button-main, .hero-btn { max-width: 100%; white-space: normal; text-align: center; }
  input, textarea, select { max-width: 100%; }

  /* Hero */
  .hero {
    min-height: 320px !important;
    padding: 76px 20px 26px !important;
  }
  .hero-tight { min-height: 260px !important; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.7rem) !important; line-height: 1.08 !important; }
  .hero .desc { max-width: 620px; font-size: 1.05rem !important; padding: 0 8px; }
  .hero-logo { width: 88px !important; height: 88px !important; }

  /* Footer */
  footer { padding: 0 18px 20px !important; line-height: 1.5; }
}

@media (max-width: 700px) {
  /* Navigation mobile */
  header .desktop-nav, header nav.desktop-nav { display: none !important; }
  header { min-height: 0; background: transparent; box-shadow: none; backdrop-filter: none; }

  .mobile-nav-toggle {
    top: max(14px, env(safe-area-inset-top)) !important;
    left: max(14px, env(safe-area-inset-left)) !important;
    width: 46px;
    height: 46px;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    border-radius: 12px !important;
    font-size: 1.45rem !important;
  }
  .mobile-nav-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
  }
  .mobile-nav {
    width: min(84vw, 330px) !important;
    max-width: 330px !important;
    height: 100dvh !important;
    padding: calc(70px + env(safe-area-inset-top)) 18px 24px !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    overflow-y: auto;
    gap: 4px !important;
  }
  .mobile-nav a {
    width: 100%;
    margin: 0 !important;
    padding: 13px 14px !important;
    text-align: left !important;
    font-size: 1.05rem !important;
  }

  /* Contenu */
  .container {
    width: calc(100% - 22px) !important;
    margin: 14px auto 20px !important;
    padding: 24px 16px 22px !important;
    border-radius: 16px !important;
  }
  .container:hover { transform: none !important; }
  .section-title {
    display: block !important;
    width: fit-content;
    max-width: 100%;
    margin: 24px auto 12px !important;
    font-size: 1.18rem !important;
  }
  .plugins-list {
    width: 100%;
    max-width: none !important;
    padding: 0 2px !important;
  }
  .plugins-list li {
    margin: 12px 0 !important;
    padding-left: 18px !important;
    font-size: 1rem !important;
  }
  .plugins-list li:hover { transform: none !important; }

  .button-main, .hero-btn {
    width: 100%;
    max-width: 360px;
    padding: 12px 16px !important;
    font-size: 1rem !important;
  }
  .button-main:hover, .button-main:focus-visible { transform: none !important; filter: none !important; }

  .ip-hero, .ip {
    max-width: 100%;
    font-size: .96rem !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Formulaire */
  form label { margin-left: 0 !important; }
  input, textarea {
    width: 100% !important;
    min-width: 0;
    font-size: 16px !important; /* évite le zoom automatique sur iPhone */
  }
  form button { width: 100%; min-height: 44px; }

  /* Launcher */
  .launcher-page-simple {
    width: calc(100% - 28px) !important;
    padding: 84px 0 46px !important;
  }
  .launcher-page-simple h1 { font-size: clamp(2rem, 10vw, 2.7rem) !important; line-height: 1.08; }
  .launcher-intro { font-size: .98rem; line-height: 1.6 !important; margin-bottom: 20px !important; }
  .launcher-box-simple { padding: 20px 16px !important; border-radius: 13px !important; }
  .launcher-download-row { display: block !important; }
  .launcher-version { margin-bottom: 16px; }
  .launcher-download-simple {
    width: 100% !important;
    min-height: 46px;
    padding: 13px 16px !important;
  }
  .launcher-info-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
  .launcher-facts div { align-items: flex-start; }
  .launcher-facts dt, .launcher-facts dd { width: 50%; }
  .launcher-facts dd { overflow-wrap: normal; word-break: normal; }

  /* Règlement */
  .rules-page {
    width: calc(100% - 24px) !important;
    padding: 84px 0 46px !important;
  }
  .rules-header { margin-bottom: 20px !important; }
  .rules-header h1 { font-size: clamp(2rem, 10vw, 2.7rem) !important; }
  .rules-notice { padding: 12px 13px !important; font-size: .95rem; }
  .rules-layout { display: block !important; }
  .rules-toc {
    position: static !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px !important;
    margin: 0 0 14px;
    padding: 0 0 12px !important;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .rules-toc strong { display: none !important; }
  .rules-toc a {
    flex: 0 0 auto;
    padding: 8px 10px !important;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    background: rgba(255,255,255,.03);
    white-space: nowrap;
    font-size: .84rem !important;
  }
  .rules-content { padding: 2px 15px !important; border-radius: 12px !important; }
  .rule-section { padding: 22px 0 !important; scroll-margin-top: 78px !important; }
  .rule-section h2 { font-size: 1.25rem !important; line-height: 1.25; }
  .rule-group h3 { font-size: 1rem !important; }
  .rule-list { padding-left: 19px !important; }
  .rule-list li { margin-bottom: 10px; font-size: .96rem !important; line-height: 1.55 !important; }
  .rules-final { padding: 14px !important; }
}

@media (max-width: 380px) {
  .container { width: calc(100% - 16px) !important; padding-left: 13px !important; padding-right: 13px !important; }
  .hero { padding-left: 14px !important; padding-right: 14px !important; }
  .hero h1 { font-size: 1.9rem !important; }
  .launcher-page-simple, .rules-page { width: calc(100% - 18px) !important; }
  .launcher-box-simple { padding: 17px 13px !important; }
  .rules-content { padding-left: 12px !important; padding-right: 12px !important; }
  .launcher-facts div { display: block !important; }
  .launcher-facts dt, .launcher-facts dd { width: auto; text-align: left !important; }
  .launcher-facts dd { margin-top: 3px !important; }
}

@media (hover: none) and (pointer: coarse) {
  .hero-logo:hover,
  .container:hover,
  .section-title:hover,
  .plugins-list li:hover,
  .button-main:hover,
  .launcher-download-simple:hover { transform: none !important; }
}
