/* ----------  RESPONSIVE  ---------- */

@media (max-width: 53.75rem) {
  /* 860 px */
  /* ===== WRAPPED VIEW ===== */
  #welcomeStats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 48rem) {
  /* ===== GLOBAL LAYOUT ===== */
  /* ===== CONTENT SECTIONS ===== */
  /* ===== WRAPPED VIEW COMPONENTS ===== */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  #diversity-stats,
  #summary-stats {
    grid-template-columns: 1fr;
  }

  .top-list-container {
    grid-template-columns: 1fr;
    gap: var(--sp-md);
  }

  .top-item {
    height: auto;
    min-height: 4.5rem;
  }

  .top-item-compact {
    min-height: 3.75rem;
  }

  .rating-cards-horizontal {
    grid-template-columns: 1fr;
  }

  .horizontal-rating-bar-container {
    gap: var(--sp-sm);
  }

  .horizontal-rating-label {
    min-width: 3.125rem;
    font-size: var(--fs-xs);
  }

  .horizontal-rating-bar-wrapper {
    height: 1.5625rem;
  }

  .horizontal-rating-percentage {
    min-width: 2.5rem;
    font-size: var(--fs-xs);
  }

  .summary-highlights {
    gap: var(--sp-sm);
  }

  .highlight-card {
    padding: var(--sp-sm);
  }

  .highlight-value {
    font-size: var(--fs-2xl);
  }

  /* ===== NAVIGATION ===== */
  .navigation {
    bottom: var(--sp-sm);
  }

  .nav-btn {
    width: 3.125rem;
    height: 3.125rem;
    font-size: var(--fs-xl);
  }
}

@media (max-width: 30rem) {
  /* ===== HEADER ===== */
  .subtitle {
    font-size: var(--fs-base);
  }

  .login-view {
    padding: var(--sp-md) var(--sp-md) 3rem;
  }

  .form-section,
  .results-section,
  .error-section {
    padding: var(--sp-md);
  }

  .stat-card {
    padding: var(--sp-md);
  }

  .top-item .item-name,
  .top-item .item-detail,
  .top-item-compact .compact-name,
  .top-item-compact .compact-detail {
    max-width: 42vw;
  }

  .chart-segment:hover::after {
    display: none;
  }

  /* ===== WRAPPED VIEW COMPONENTS ===== */
  #welcomeStats {
    grid-template-columns: 1fr;
  }

  .horizontal-rating-bar-container {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-xs);
  }

  .horizontal-rating-label {
    text-align: left;
    min-width: auto;
  }

  .horizontal-rating-bar-wrapper {
    height: 1.25rem;
  }

  .horizontal-rating-percentage {
    text-align: left;
    min-width: auto;
  }

  .compact-name {
    font-size: var(--fs-sm);
  }

  .compact-detail {
    font-size: var(--fs-xs);
  }

  .compact-plays {
    font-size: var(--fs-xs);
    min-width: 3rem;
  }
}
