/* Темна тема (за замовчуванням для цієї сторінки) */
 :root {
     --accent-color: #fbbf24;
     --rank-bg: #334155;
     --text-muted: #94a3b8;
     --card-bg: #1e293b;
     --bg-color: #0f172a;
     --text-color: #f8fafc;
 }

 /* ✅ Світла тема */
 body:not(.dark-mode) {
     --accent-color: #d97706;
     --rank-bg: #e2e8f0;
     --text-muted: #64748b;
     --card-bg: #ffffff;
     --bg-color: #f5f7fa;
     --text-color: #17181c;
 }

 body:not(.dark-mode) .rank {
     color: #1e293b !important;
 }

 body:not(.dark-mode) .chart-card:hover {
     background: rgba(0, 0, 0, 0.04) !important;
 }

 body:not(.dark-mode) .chart-section {
     box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
     border: 1px solid #e2e8f0;
 }

 body {
     margin: 0;
     padding: 0;
     font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
     background-color: var(--bg-color);
     color: var(--text-color);
 }

 h1 {
     text-align: center;
     font-size: 2.5rem;
     color: var(--text-color);
 }

  .charts-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
      gap: 30px;
      margin: 20px auto 40px;
      width: 100%;
      align-items: stretch;
  }

  .chart-section {
      background: var(--bg-card);
      border-radius: 16px;
      padding: 20px;
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
      border: 1px solid #bdbdbd !important;
      display: flex;
      flex-direction: column;
      height: 100%;
  }

 .chart-section h2 {
     font-size: 1.5rem;
     margin-top: 0;
     margin-bottom: 20px;
     padding-bottom: 10px;
     border-bottom: 2px solid var(--rank-bg);
     text-align: center;
     color: var(--text-color);
 }

 .chart-list {
     display: flex;
     flex-direction: column;
     gap: 15px;
 }

 .chart-card {
     display: flex;
     align-items: center;
     background: rgba(255, 255, 255, 0.03);
     border-radius: 12px;
     padding: 10px;
     transition: transform 0.2s, background 0.2s;
 }

 .chart-card:hover {
     transform: translateX(5px);
     background: rgba(255, 255, 255, 0.08);
 }

 .rank {
     width: 30px;
     height: 30px;
     display: flex;
     align-items: center;
     justify-content: center;
     background: var(--rank-bg);
     color: white;
     font-weight: bold;
     border-radius: 50%;
     margin-right: 15px;
     flex-shrink: 0;
 }

 /* Золотий, срібний та бронзовий для перших трьох місць */
 .chart-card:nth-child(1) .rank { background: #fbbf24; color: #000; }
 .chart-card:nth-child(2) .rank { background: #cbd5e1; color: #000; }
 .chart-card:nth-child(3) .rank { background: #b45309; color: #fff; }

 .chart-photo {
     width: 60px;
     height: 60px;
     border-radius: 50%;
     object-fit: cover;
     object-position: top;
     margin-right: 15px;
     flex-shrink: 0;
     border: 2px solid var(--rank-bg);
 }

 .chart-info {
     display: flex;
     flex-direction: column;
     flex-grow: 1;
     min-width: 0;
 }

 .chart-name {
     font-weight: bold;
     font-size: 1.1rem;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
     margin-bottom: 5px;
     color: var(--text-color);
 }

 .chart-stat {
     font-size: 0.9rem;
     color: var(--text-muted);
 }

 .stat-highlight {
     color: var(--accent-color);
     font-weight: bold;
 }

 .loading {
     text-align: center;
     padding: 50px;
     font-size: 1.2rem;
     color: var(--text-muted);
 }