/* ══════════════════════════════════════════════════════
   LIT-GAMES — mobile.css  v8
   Nur für Mobile / Touch. Desktop (>768px) unberührt.
   ══════════════════════════════════════════════════════ */

/* ── 1. Kein custom cursor auf Touch ─────────────────── */
@media (pointer: coarse) {
  *, *::before, *::after { cursor: auto !important; }
}

/* ── 2. Zoom-Fix + kein horizontaler Scroll ──────────── */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  input, button, select, textarea, a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}

/* ── 3. Hero ─────────────────────────────────────────── */
@media (max-width: 480px) {
  .hero-title   { font-size: clamp(54px, 18vw, 88px) !important; letter-spacing: 2px; }
  .hero-sub     { font-size: 15px; margin-top: 12px; }
  .hero-ip      { margin-top: 24px; padding: 10px 18px; }
  .ip-text      { font-size: 14px; }
  .hero-content { padding: 0 16px; }
  .hero-stats   { flex-direction: column; gap: 0; margin-top: 28px; }
  .stat-divider { width: 36px; height: 1px; margin: 6px 0; }
  .stat-pill    { padding: 6px 0; }
  .stat-num     { font-size: 34px; }
}

/* ── 4. Header ───────────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger     { margin-left: auto; order: 99; }
  .header-status { display: none !important; }
  .player-badge  { display: none !important; }
  .theme-toggle  { order: 98; padding: 5px 10px !important; }
  .theme-toggle span:not(.toggle-icon) { display: none; }
  .header-right  { margin-left: auto; gap: 8px; }
  .nav           { margin-left: 0 !important; }
}
@media (max-width: 400px) {
  .header-inner { padding: 0 12px !important; gap: 6px !important; }
  .logo         { font-size: 18px !important; }
}

/* ── 5. Nav Fullscreen Overlay ───────────────────────── */
@media (max-width: 768px) {

  /* Geschlossen: unsichtbar aber im DOM (für Transition) */
  .nav {
    display: flex !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.22s ease, visibility 0.22s ease !important;

    position: fixed !important;
    top: 0 !important; left: 0 !important;
    right: 0 !important; bottom: 0 !important;
    width: 100% !important;
    /* dvh = dynamic viewport height, berücksichtigt iOS-Adressleiste */
    height: 100vh !important;
    height: 100dvh !important;

    background: rgba(8, 8, 8, 0.97) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: none !important;

    flex-direction: column !important;
    /* space-evenly: Items verteilen sich gleichmäßig über die volle Höhe */
    justify-content: space-evenly !important;
    align-items: center !important;
    padding: calc(var(--header-h)) 32px 16px !important;
    gap: 0 !important;
    z-index: 200 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  body.light .nav {
    background: rgba(220, 235, 250, 0.98) !important;
  }

  /* Offen */
  .nav.open {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Links — kompakt damit alle 5 + X-Button ohne Scrollen passen */
  .nav .nav-link {
    padding: 10px 24px !important;
    font-size: 18px !important;
    font-family: var(--font-display) !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    width: 100% !important;
    max-width: 280px !important;
    text-align: center !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: var(--radius) !important;
    border: 1px solid transparent !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s !important;
    flex-shrink: 0 !important;
  }
  .nav .nav-link:active,
  .nav .nav-link.active {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: var(--accent-1) !important;
  }
  body.light .nav .nav-link:active,
  body.light .nav .nav-link.active {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
  }

  /* Trennlinie zwischen Links und X-Button */
  .nav-divider {
    display: block;
    width: 100%;
    max-width: 280px;
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 8px 0 6px;
    flex-shrink: 0;
  }
  body.light .nav-divider {
    background: rgba(0,0,0,0.12);
  }

  /* X-Button — im normalen Flow direkt nach Trennlinie */
  .nav-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin-bottom: 0;
  }
  body.light .nav-close-btn {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.15);
    color: rgba(0,0,0,0.5);
  }
  .nav-close-btn:active {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.5);
    color: var(--accent-1);
  }
}

/* Desktop: X und Divider nie zeigen */
@media (min-width: 769px) {
  .nav-close-btn { display: none !important; }
  .nav-divider   { display: none !important; }
}

/* ── 6. Discord iframe ausblenden ────────────────────── */
@media (max-width: 768px) {
  .discord-widget-wrap { display: none !important; }
}
@media (min-width: 769px) {
  .discord-widget-wrap { display: block; }
}

/* ── 7. Projekt-Cards Carousel ───────────────────────── */
@media (max-width: 768px) {
  .projects-section { overflow: hidden; }

  #projectsLayout {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 14px !important;
    padding: 4px 16px 16px !important;
    margin: 0 !important;
    scrollbar-width: none !important;
    grid-template-columns: unset !important;
    align-items: stretch;
    box-sizing: border-box !important;
    width: 100% !important;
  }
  #projectsLayout::-webkit-scrollbar { display: none; }
  #projectsLayout > .proj-card {
    flex-shrink: 0 !important;
    width: 80vw !important;
    max-width: 300px !important;
    scroll-snap-align: start !important;
  }
  #projectsLayout > .proj-card--featured {
    flex-direction: column !important;
    width: 84vw !important;
    max-width: 320px !important;
  }
  #projectsLayout > .proj-card--featured .proj-card-image {
    width: 100% !important; min-height: 150px !important;
  }
  .projects-section-header {
    flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 16px;
  }
  .projects-section-header::after {
    content: 'swipe f\00FCr mehr \2192';
    display: block; font-size: 11px; font-family: var(--font-mono);
    color: var(--text-dim); letter-spacing: 1px; margin-top: 2px;
  }
  .projects-section .section-inner { padding-left: 0 !important; padding-right: 0 !important; }
}

/* ── 8. About Slider Touch ───────────────────────────── */
@media (max-width: 768px) {
  .slider-wrap  { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
  .slider-track { will-change: transform; }
  .slider-arrow { min-width: 44px !important; min-height: 44px !important; font-size: 24px !important; }
  .slider-dot   { width: 12px !important; height: 12px !important; margin: 0 4px !important; }
}

/* ── 9. Section Padding ──────────────────────────────── */
@media (max-width: 560px) {
  .section-inner { padding: 48px 16px !important; }
}

/* ── 10. Sticky Status-Bar ───────────────────────────── */
.mobile-status-bar { display: none; }

@media (max-width: 768px) {
  .mobile-status-bar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: rgba(11,11,11,0.93); border-top: 1px solid var(--border);
    padding: 8px 20px; align-items: center; justify-content: space-between;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  body.light .mobile-status-bar { background: rgba(228,239,250,0.95); }
  .mobile-status-bar-left {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  }
  .mobile-status-bar-right { display: flex; align-items: center; gap: 20px; }
  .mob-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
  .mob-stat-num {
    font-family: var(--font-display); font-size: 16px; line-height: 1;
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
  }
  .mob-stat-label {
    font-family: var(--font-mono); font-size: 9px;
    letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
  }
  .footer { padding-bottom: 56px !important; }
}

/* ── 11. IP Copy Touch ───────────────────────────────── */
@media (pointer: coarse) {
  .hero-ip { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .hero-ip:active { transform: scale(0.97) !important; border-color: var(--accent-1) !important; }
}

/* ── 12. Footer Mobile ───────────────────────────────── */
@media (max-width: 560px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-right { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; width: 100%; }
}

/* ── 13. iPhone Safe Area ────────────────────────────── */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 768px) {
    .mobile-status-bar { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
    .footer            { padding-bottom: calc(56px + env(safe-area-inset-bottom)) !important; }
  }
}
