/* ════════════════════════════════════════════════════════════════════
   TypeArena — HOME PAGE REDESIGN
   Красивая главная страница с градиентами и статистикой
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
  #page-home {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  /* ─────── HERO SECTION ─────── */
  .home-hero {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.2), rgba(167, 113, 247, 0.1));
    border: 2px solid rgba(88, 166, 255, 0.2);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
  }

  .home-hero-greeting {
    font-size: 1rem;
    color: var(--text2);
    font-weight: 600;
    margin-bottom: 8px;
  }

  .home-hero-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
  }

  .home-hero-level {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 700;
  }

  .home-hero-streak {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(255, 200, 50, 0.2);
    border: 1px solid rgba(255, 200, 50, 0.4);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffc832;
  }

  /* ─────── QUICK STATS ─────── */
  .home-quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .home-stat-mini {
    padding: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
  }

  .home-stat-mini-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }

  .home-stat-mini-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
  }

  .home-stat-mini-label {
    font-size: 0.65rem;
    color: var(--text2);
    font-weight: 600;
    margin-top: 2px;
  }

  /* ─────── QUICK ACTIONS ─────── */
  .home-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .home-action-btn {
    padding: 12px;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(88, 166, 255, 0.05));
    border: 2px solid rgba(88, 166, 255, 0.2);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
  }

  .home-action-btn:active {
    transform: scale(0.95);
    border-color: var(--accent);
  }

  .home-action-btn-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
  }

  .home-action-btn-text {
    display: block;
    font-size: 0.8rem;
  }

  /* ─────── RECENT MODES ─────── */
  .home-recent-section {
    margin-top: 8px;
  }

  .home-section-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .home-recent-modes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .home-mode-card {
    padding: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
  }

  .home-mode-card:active {
    transform: scale(0.95);
    border-color: var(--accent);
  }

  .home-mode-icon {
    font-size: 1.6rem;
    margin-bottom: 4px;
  }

  .home-mode-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
  }

  /* ─────── ACHIEVEMENTS PREVIEW ─────── */
  .home-achievements-preview {
    margin-top: 8px;
  }

  .home-achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .ach-badge {
    width: 50px;
    height: 50px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .ach-badge:active {
    transform: scale(0.9);
  }

  .ach-badge.locked {
    opacity: 0.3;
    filter: grayscale(100%);
  }

  /* ─────── LEADERBOARD PREVIEW ─────── */
  .home-leaderboard-preview {
    margin-top: 8px;
    padding: 12px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .home-leaderboard-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 4px;
  }

  .home-lb-rank {
    font-weight: 800;
    font-size: 1rem;
    color: var(--accent);
    min-width: 24px;
  }

  .home-lb-rank.top-1 { color: #ffd700; font-size: 1.2rem; }
  .home-lb-rank.top-2 { color: #c0c0c0; font-size: 1.1rem; }
  .home-lb-rank.top-3 { color: #cd7f32; }

  .home-lb-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
  }

  .home-lb-score {
    font-size: 0.8rem;
    color: var(--text2);
    font-weight: 700;
  }

  /* ─────── PROMO BANNER ─────── */
  .home-promo {
    background: linear-gradient(135deg, rgba(255, 200, 50, 0.2), rgba(255, 150, 50, 0.1));
    border: 2px solid rgba(255, 200, 50, 0.3);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    margin-top: 8px;
  }

  .home-promo-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffc832;
    margin-bottom: 4px;
  }

  .home-promo-desc {
    font-size: 0.8rem;
    color: var(--text2);
    margin-bottom: 8px;
    line-height: 1.4;
  }

  .home-promo-btn {
    width: 100%;
    padding: 8px;
    background: linear-gradient(135deg, #ffc832, #ffb300);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
  }

  .home-promo-btn:active {
    transform: scale(0.98);
  }

  /* ─────── DAILY CHALLENGE IMPROVED ─────── */
  .daily-challenge {
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(255, 200, 50, 0.1);
  }

  body[data-graphics="high"] .daily-challenge {
    box-shadow: 0 4px 16px rgba(255, 200, 50, 0.15);
  }

  /* ─────── RESPONSIVE FOR EXTRA SMALL ─────── */
  @media (max-width: 480px) {
    .home-quick-stats {
      grid-template-columns: 1fr;
    }

    .home-recent-modes {
      grid-template-columns: repeat(2, 1fr);
    }

    .home-achievements-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  /* ─────── ANIMATIONS ─────── */
  .home-stat-mini,
  .home-action-btn,
  .home-mode-card,
  .ach-badge,
  .home-leaderboard-item {
    animation: fadeInUp 0.4s ease-out forwards;
  }

  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .home-stat-mini:nth-child(1) { animation-delay: 0.1s; }
  .home-stat-mini:nth-child(2) { animation-delay: 0.15s; }
  .home-stat-mini:nth-child(3) { animation-delay: 0.2s; }
  .home-stat-mini:nth-child(4) { animation-delay: 0.25s; }

  .home-action-btn:nth-child(1) { animation-delay: 0.3s; }
  .home-action-btn:nth-child(2) { animation-delay: 0.35s; }
  .home-action-btn:nth-child(3) { animation-delay: 0.4s; }
  .home-action-btn:nth-child(4) { animation-delay: 0.45s; }
}
