/* ============================================================
   mobile.css – Responsive Breakpoints für Arena Win Tracker
   ============================================================
   Bisher: max-width: 1900px, nur Desktop.
   Hier: Breakpoints für Tablet (≤1024px), Phone (≤640px),
   klein (≤400px) und Touch-Geräte.
*/

/* ====== Tablet (≤1024px) ====== */
@media (max-width: 1024px) {
  #app {
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px !important;
  }
  #mainRow {
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
  }
  #grid {
    max-height: none !important;
    grid-template-columns: repeat(6, 1fr) !important;
  }
  #rankingPanel {
    order: 2;
    max-height: 400px;
    overflow-y: auto;
  }
  #champDetail {
    order: 1;
  }
  .champ span:not(.winBadge):not(.champScoreLabel) {
    font-size: 10px !important;
  }
}

/* ====== Phone (≤640px) ====== */
@media (max-width: 640px) {
  header h1 {
    font-size: 18px;
  }
  .headerBtns button {
    font-size: 18px;
    padding: 6px 10px;
    margin-left: 4px;
  }
  #grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
  }
  .champ {
    aspect-ratio: 1 / 1.1;
  }
  .champ img {
    width: 48px !important;
    height: 48px !important;
  }
  .champ span:not(.winBadge):not(.champScoreLabel) {
    font-size: 9px !important;
    line-height: 1.1;
  }
  #summary {
    flex-wrap: wrap;
    gap: 8px;
  }
  #filterInput, #sortMode {
    width: 100%;
    flex-basis: 100%;
  }
  .checkboxLabel {
    width: 100%;
  }
  #playerViewBox {
    width: 95vw !important;
    max-width: 95vw !important;
  }
  #playerViewGrid {
    grid-template-columns: repeat(4, 1fr) !important;
  }

  /* Settings als Bottom-Sheet statt Top-Section */
  #settingsPanel:not(.hidden),
  #friendsPanel:not(.hidden) {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-height: 75vh;
    overflow-y: auto;
    border-top: 1px solid var(--awt-border);
    border-radius: 12px 12px 0 0;
    padding: 16px !important;
    box-shadow: 0 -4px 20px var(--awt-shadow);
    z-index: 100;
  }

  /* Trio-Detailansicht: nebeneinander → untereinander */
  #champDetail .synergyRow,
  #champDetail .buildRow,
  #champDetail .dbTwoCol {
    flex-direction: column !important;
  }

  /* Tooltips: auf Mobile fullscreen-ähnlich */
  #champTooltip {
    position: fixed !important;
    max-width: 90vw !important;
    font-size: 12px !important;
  }

  /* Top-30-Trios: kompakter */
  #top30Trio ul {
    padding-left: 8px !important;
  }

  /* Header: etwas mehr Platz */
  header {
    padding: 4px 0 !important;
  }
}

/* ====== Sehr klein (≤400px) - alte/small phones ====== */
@media (max-width: 400px) {
  #grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .champ img {
    width: 40px !important;
    height: 40px !important;
  }
  header h1 {
    font-size: 16px;
  }
  .headerBtns button {
    font-size: 16px;
    padding: 4px 8px;
  }
}

/* ====== Touch-Gerät: Hover-Effekte reduzieren ====== */
@media (hover: none) and (pointer: coarse) {
  .champ:hover {
    transform: none !important;
    background: var(--awt-tile-bg) !important;
  }
  .champ:active {
    background: var(--awt-tile-bg-hover) !important;
  }
}

/* ====== Print-Styles (falls jemand seine Stats drucken will) ====== */
@media print {
  #settingsPanel, #friendsPanel, #rankingPanel,
  #playerViewOverlay, #champTooltip, #kaltstartLoader,
  #toastContainer, .headerBtns, #filterInput, #sortMode,
  #onlyMissing + span, .seasonProgress {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .champ {
    break-inside: avoid;
    border: 1px solid #ccc !important;
  }
}

/* ====== Reduzierte Bewegung (Accessibility) ====== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #manualSyncBtn:hover {
    transform: none !important;
  }
}
