@media (max-width: 768px) {

  /* NAVBAR */
  .navbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,10,20,0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    z-index: 998;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    font-size: 1.1rem;
    padding: 0.85rem 2.5rem;
    width: 100%;
    text-align: center;
    border-radius: 12px;
  }
  .nav-right { margin-left: auto; gap: 0.5rem; }
  .btn-logout { display: none; }
  .nav-avatar { display: none; }

  .nav-hamburger {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 999;
    margin-left: 0.5rem;
  }
  .nav-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
  }
  .nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-hamburger.open span:nth-child(2) { opacity: 0; }
  .nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* BOTTOM NAV pour mobile */
  .bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    text-decoration: none;
    color: var(--text2);
    font-size: 0.65rem;
    padding: 0.3rem 0;
    transition: color 0.2s;
  }
  .bottom-nav a.active { color: var(--primary-light); }
  .bottom-nav a svg { width: 22px; height: 22px; }
  body { padding-bottom: 65px; }

  /* HERO BAR */
  .hero-bar {
    padding: 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
  .hero-bar-right { justify-content: center; }
  .quick-stat { min-width: 75px; padding: 0.5rem 0.75rem; }
  .quick-stat .val { font-size: 1.1rem; }

  /* PROGRESS */
  .progress-section { padding: 0.75rem 1rem; }

  /* CONTAINER */
  .container { padding: 1rem; }

  /* GRILLES */
  .missions-grid { grid-template-columns: 1fr; }
  .rewards-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* PROFILE */
  .profile-header { flex-direction: column; text-align: center; padding: 1.25rem; }
  .stats-row { justify-content: center; }
  .page { padding: 0 1rem; margin: 1rem auto; }

  /* ADMIN */
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 1rem; }

  /* MODAL */
  .modal-box {
    padding: 1.25rem;
    margin: 0.5rem;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
  }
  .modal-footer { flex-direction: column; }
  .modal-footer button { width: 100%; }

  /* SECTION HEADER */
  .section-header { flex-direction: column; align-items: flex-start; }
  .filter-tabs { width: 100%; }
  .filter-tab { flex: 1; text-align: center; }

  /* HERO LANDING */
  .hero { padding: 5rem 1rem 2rem; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-buttons { flex-direction: column; width: 100%; }
  .btn-hero { width: 100%; text-align: center; }

  /* LANDING REWARDS */
  .rewards-grid { grid-template-columns: repeat(2, 1fr); }
  .showcase-grid { grid-template-columns: 1fr; }

  /* CTA */
  .cta { margin: 0 0.5rem 3rem; padding: 2rem 1rem; }

  /* FORM */
  .form-row { grid-template-columns: 1fr; }
  .ref-stats { grid-template-columns: repeat(2, 1fr); }
  .code-display { font-size: 0.9rem; letter-spacing: 2px; }

  /* ORDERS */
  .order-item { flex-direction: column; gap: 0.5rem; }

  /* TABLE */
  table { font-size: 0.78rem; }
  th, td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 480px) {
  .coins-badge { font-size: 0.8rem; padding: 0.3rem 0.6rem; }
  .nav-logo { font-size: 1.1rem; }
}

/* Desktop : cache le bottom nav et hamburger */
@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
  .nav-hamburger { display: none !important; }
}

@media (hover: none) {
  .card:hover { transform: none; }
  .reward-card-landing:hover { transform: none; }
  .btn-hero-primary:hover { transform: none; }
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
