/* =========================================================
   Kommentatoren-Check – Handy & Tablet
   Wird nach styles.css und app.css geladen.
   ========================================================= */

a, button { -webkit-tap-highlight-color: transparent; }

/* Navigation unten und Menü-Sheet gibt es nur auf kleinen Bildschirmen */
.bottom-nav, .sheet-backdrop, .mobile-sheet { display: none; }

/* Kein „Hochspringen“ von Karten auf Touch-Geräten */
@media (hover: none) {
  .c-card:hover, .sport-tile:hover, .podium-card:hover { transform: none; }
}

/* ---------- Tablet & Handy ---------- */
@media (max-width: 860px) {
  /* Kopfzeile: nur Logo + Farbschema, alles andere in der unteren Leiste */
  .topbar-inner { height: 58px; }
  #nav .nav-links, #nav #dd-user, #nav #login, #nav #register { display: none; }
  /* ☰-Menü oben rechts – öffnet dasselbe Menü wie „Konto“ unten */
  #nav .menu-btn { display: grid; }
  #nav { gap: 8px; }

  /* Schnellzugriff im Menü */
  .sheet-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
  .sheet-tile {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    min-height: 76px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); font-size: .8rem; font-weight: 600; text-align: center;
  }
  .sheet-tile svg { color: var(--muted); }
  .sheet-tile:hover { color: var(--text); }
  .sheet-tile.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
  .sheet-tile.active svg { color: var(--accent); }

  /* Navigationsleiste unten */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(11, 18, 32, .94);
    backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .bn-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 60px; padding: 6px 0; border: none; background: none; cursor: pointer;
    color: var(--hero-muted); font: inherit; font-size: .7rem; font-weight: 600; letter-spacing: .01em;
  }
  .bn-item:hover { color: var(--hero-text); }
  .bn-item.active { color: var(--lime); }
  .bn-item svg { width: 22px; height: 22px; }
  .bn-avatar { position: relative; display: block; }
  .bn-avatar .avatar-xs { width: 24px; height: 24px; font-size: .75rem; }
  .bn-item.active .bn-avatar .avatar-xs { box-shadow: 0 0 0 2px var(--lime); }
  .bn-dot { position: absolute; top: -2px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; border: 2px solid #0b1220; }

  /* Menü, das von unten hereinfährt */
  .sheet-backdrop {
    display: block; position: fixed; inset: 0; z-index: 45;
    background: rgba(5, 9, 16, .55); opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.menu-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .mobile-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 46;
    max-height: 86vh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--surface); color: var(--text);
    border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
    padding: 6px 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .3s cubic-bezier(.2, .9, .3, 1);
  }
  body.menu-open .mobile-sheet { transform: none; }
  .sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 8px auto 16px; }
  .sheet-user { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
  .sheet-user small { display: block; color: var(--muted); font-size: .8rem; }
  .sheet-link {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 4px;
    border: none; border-bottom: 1px solid var(--border); background: none; cursor: pointer;
    color: var(--text); font: inherit; font-size: .98rem; font-weight: 600; text-align: left;
  }
  .sheet-link:hover { color: var(--text); background: var(--surface-2); }
  .sheet-link svg { color: var(--muted); flex-shrink: 0; }
  .sheet-link.danger { color: var(--danger); border-bottom: none; }
  .sheet-link.danger svg { color: var(--danger); }
  .sheet-intro { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
  .sheet-actions { display: grid; gap: 8px; margin-bottom: 6px; }
  .sheet-actions .btn { min-height: 48px; font-size: 1rem; }
  .sheet-sep { height: 12px; }
  .sheet-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
  .mm-sports { display: flex; flex-wrap: wrap; gap: 8px; }
  .mm-sports a {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .88rem; font-weight: 600;
  }
  .sheet-legal { display: flex; gap: 18px; flex-wrap: wrap; font-size: .88rem; padding: 4px 4px 10px; }
  .sheet-legal a { color: var(--muted); }

  /* Meldungen oberhalb der unteren Leiste */
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); }

  /* Größere Tippflächen */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .chip { min-height: 38px; }
  .act { min-height: 38px; padding: 8px 12px; }
  .seg-btn { min-height: 40px; }

  /* Eingaben mit 16px – verhindert automatisches Hineinzoomen auf dem iPhone */
  input, select, textarea { font-size: 16px; }
  .select-sm { font-size: 15px; min-height: 38px; }

  /* Verwaltungstabellen werden zu Karten */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .table tr:last-child { border-bottom: none; }
  .table td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 16px; border: none; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: left; flex-shrink: 0; }
  .table td:first-child { display: block; text-align: left; font-size: 1rem; padding-bottom: 8px; }
  .table td:first-child::before { display: none; }
  .table td.actions { justify-content: flex-end; padding-top: 10px; }
  .table td.actions::before { display: none; }
  .table-card { overflow: visible; }
}

/* ---------- Handy ---------- */
@media (max-width: 560px) {
  body { font-size: 15px; }
  .logo-text { font-size: 1.12rem; }
  .logo-mark { width: 32px; height: 32px; }

  /* Kopfbereiche kompakter */
  .hero { padding: 34px 0 84px; }
  .hero-home { padding-bottom: 36px; }
  .hero h1 { font-size: 2.3rem; margin: 16px 0 12px; }
  .hero p.lead { font-size: 1rem; margin-bottom: 22px; }
  .hero-sm { padding: 30px 0 84px; }
  .hero-sm h1 { font-size: 2.2rem; }
  .eyebrow { font-size: .7rem; }
  .stat-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-top: 28px; }
  .stat-strip .num { font-size: 2rem; }
  .hero-search { margin-top: 0; }
  .hero-search input { min-width: 0; }

  .section { margin-top: 34px; }
  .section-first { margin-top: 28px; }
  .section-head { margin-bottom: 14px; }
  .section-head h2, .h-display { font-size: 1.6rem; }
  .card { padding: 18px; border-radius: 14px; }
  .grid { gap: 12px; }

  /* Filterleiste: Suche über volle Breite, Auswahlfelder zu zweit */
  .toolbar { padding: 12px; border-radius: 14px; }
  .toolbar-row:not(.toolbar-row-2) { grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar-row:not(.toolbar-row-2) .search { grid-column: 1 / -1; }
  .toolbar-row:not(.toolbar-row-2) #f-sort { grid-column: 1 / -1; }
  .toolbar select { padding: 10px 32px 10px 12px; background-position: right 10px center; }
  .chips { margin-left: -12px; margin-right: -12px; padding: 0 12px 2px; scroll-padding: 12px; }

  /* Podium & Karten */
  .podium-card { padding: 18px; }
  .podium-card .rank { font-size: 5rem; top: -8px; }
  .podium-card .p-name { font-size: 1.4rem; margin-top: 10px; }
  .c-card { gap: 14px; }
  .c-card .avatar { width: 46px; height: 46px; font-size: 1.2rem; }
  .score { min-width: 46px; height: 46px; font-size: 1.4rem; }
  .score.sm { min-width: 42px; height: 32px; font-size: 1.15rem; }
  .rank-row .name { white-space: normal; }

  /* Kommentator-Seite: Avatar links, Note rechts, Name darunter */
  .detail-hero { padding: 22px 0 88px; }
  .back { margin-bottom: 18px; }
  .detail-head:has(#ring) { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
  .detail-head:has(#ring) #ring { grid-column: 2; grid-row: 1; justify-self: end; }
  .detail-head:has(#ring) .who { grid-column: 1 / -1; min-width: 0; }
  .detail-head { gap: 16px; }
  .detail-head:not(:has(#ring)) { flex-direction: column; align-items: flex-start; gap: 14px; }
  .detail-head:not(:has(#ring)) .who { min-width: 0; width: 100%; }
  .detail-head h1 { font-size: 2.3rem; margin-bottom: 10px; }
  .avatar-lg { width: 76px; height: 76px; font-size: 2rem; border-radius: 20px; }
  .ring-wrap, .ring-wrap svg { width: 104px; height: 104px; }
  .ring-center .big { font-size: 2.3rem; }
  .ring-center .sub { font-size: .6rem; max-width: 76px; margin: 2px auto 0; line-height: 1.2; }
  .pills { gap: 6px; }
  .pill { font-size: .78rem; padding: 5px 10px; }
  .tabs-bar { margin-top: -62px; }
  .tab { padding: 9px 12px; font-size: .86rem; }
  .detail-grid { gap: 14px; }
  .stack { gap: 14px; }
  .card-title { margin-bottom: 14px; flex-wrap: wrap; }

  /* Bewertungsformular: große Sterne über die ganze Breite */
  .rate-row { flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 0; }
  .star-input { justify-content: space-between; max-width: 300px; }
  .star-input button { padding: 4px; }
  .star-input button svg { width: 36px; height: 36px; }
  .live-avg { margin: 10px 0 16px; }
  .seg { gap: 6px; }

  /* Bewertungen: Kategorien als ordentliches 4er-Raster */
  .review { padding: 18px 0; }
  .cat-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .cat-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: .66rem; text-align: center; }
  .cat-chip b { margin: 0; font-size: 1rem; }
  .review-actions { gap: 2px; margin-left: -8px; }
  .guest-line { font-size: .8rem; }

  /* Profil */
  .profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; margin-top: 16px; }
  .profile-stats .num { font-size: 1.6rem; }
  .profile-stats .lbl { font-size: .72rem; line-height: 1.25; }

  /* Fenster (Anmelden, Registrieren …) als Blatt von unten */
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal-wide {
    max-width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; border-bottom: none;
    padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
    animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1);
  }
  .modal-head h2 { font-size: 1.7rem; }
  .pick-grid { grid-template-columns: 1fr 1fr; }

  /* Verwaltung */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 16px; }
  .kpi .num { font-size: 2rem; }
  .inline-form .btn { width: 100%; }

  /* Rechtstexte & Einstellungen */
  .prose { padding: 20px; }
  .account-card { margin-top: 24px; padding: 24px 20px; }

  .footer { margin-top: 48px; padding: 22px 0; }
  .footer-inner { flex-direction: column; gap: 14px; }
}

@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
