/* Centralized Responsive Overrides for TGG Website */

@media (max-width: 768px) {
  :root {
    --text-base: 14px;
    --radius: 12px;
  }

  /* Compact Dashboard Hero */
  .dash-hero {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1rem;
    margin-bottom: 1.25rem;
    gap: 1rem;
  }

  .dash-hero-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .dash-hero-name {
    font-size: 1.35rem;
  }

  .dash-hero-sub {
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
  }

  .dash-hero-sub span[aria-hidden="true"] {
    display: none;
  }

  /* Optimized Stats Grid */
  .profile-stats-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.5rem !important; /* Reduced gap to fit 3 items */
    padding: 0 0.5rem;
    flex-direction: row !important;
  }

  .profile-stat {
    background: var(--bg-elevated);
    padding: 0.75rem 0.25rem; /* Reduced padding */
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px; /* Slightly reduced height */
    text-align: center;
  }

  .profile-stat-value {
    font-size: 1rem !important; /* Reduced from 1.25rem to fit */
    margin-bottom: 0.2rem;
    word-break: break-all; /* Prevent overflow on large numbers like XP */
  }

  .profile-stat-label {
    font-size: 0.65rem !important;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .profile-main-legends-wrap {
    grid-column: span 3; /* Span 3 to match new grid */
    margin-top: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* Make Main Legend Icons Bigger on Mobile */
  .profile-main-legend img,
  .profile-main-legend-fallback {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  /* Compact Tabs */
  .profile-tabs {
    gap: 0.5rem;
    padding: 0 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .profile-tab {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
  }

  /* Ranked Scaling */
  .ranked-badge-img {
    max-width: 100px !important;
    height: auto !important;
    margin: 0 auto;
  }

  .ranked-stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
    font-size: 0.8rem !important;
  }

  .ranked-header {
    flex-direction: column !important;
    text-align: center;
    gap: 0.5rem;
  }


  /* Global Tables */
  .table-responsive {
    margin: 0 -1rem;
    padding: 0 1rem;
    width: calc(100% + 2rem);
  }

  /* Bento Block Adjustments */
  .dash-block {
    padding: 1rem;
    margin-bottom: 1rem;
  }

  .dash-block-title {
    font-size: 0.8rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
  }

}
