/* Gaming.vn — Responsive breakpoints
   Desktop → Tablet (≤1024) → Mobile (≤720) → Small mobile (≤420) */

/* ====== TABLET ≤ 1024 ====== */
@media (max-width: 1024px) {
  :root { --container: 100%; --gap: 12px; --gap-lg: 20px; }

  /* Header */
  .header-inner { height: 60px; gap: 14px; }
  .logo { font-size: 22px; }
  .logo-mark { width: 26px; height: 26px; margin-right: 8px; }
  .nav { display: none; }
  .header-actions .btn-ghost { display: none; }

  /* Topbar - simplify */
  .topbar-inner > div:first-child > span:not(.date) { display: none; }
  .ticker { display: none; }

  /* Hero */
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .hero-title { font-size: 28px; }
  .hero-body { padding: 20px; }
  .hero-body.small { padding: 14px; }
  .hero-body.small .hero-title { font-size: 17px; }

  /* Sidebar collapses */
  .container > div[style*="grid-template-columns: 1fr 320px"],
  .container > div[style*="grid-template-columns: 1fr 340px"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .post-body { grid-template-columns: 1fr !important; gap: 32px !important; }
  .tourney-body { grid-template-columns: 1fr !important; }

  /* Archive grid */
  .archive-grid { grid-template-columns: repeat(2, 1fr); }

  /* Videos */
  section > div[style*="repeat(4, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }
  section > div[style*="repeat(3, 1fr)"] { grid-template-columns: repeat(2, 1fr) !important; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

  /* Tournament hero */
  .tourney-top { flex-direction: column; align-items: flex-start; gap: 20px; }
  .tourney-title { font-size: 42px; }
  .tourney-stats { grid-template-columns: repeat(2, 1fr); }

  /* Archive hero */
  .archive-hero h1 { font-size: 52px; }

  /* Post */
  .post-title { font-size: 38px; }
}

/* ====== MOBILE ≤ 720 ====== */
@media (max-width: 720px) {
  body { font-size: 13px; }

  /* Hamburger */
  .hamburger { display: inline-flex !important; }
  .mobile-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    display: flex; flex-direction: column;
    padding: 8px 14px 16px;
    max-height: 70vh; overflow-y: auto;
  }
  .mobile-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
    font-family: var(--f-head); font-weight: 600;
    font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--ink-2);
  }
  .mobile-nav a span:first-child { flex: 1; }
  .mobile-nav a.active { color: var(--accent); }
  .mobile-nav a svg:last-child { color: var(--ink-4); }

  /* Header - hamburger */
  .header-inner { height: 56px; }
  .logo { font-size: 20px; }
  .header-actions .btn-primary { height: 32px; padding: 0 10px; font-size: 11px; }
  .header-actions .btn-primary span { display: none; }

  /* Topbar - compact */
  .topbar { font-size: 10px; }
  .topbar-inner { height: 28px; }
  .topbar .date { font-size: 10px; }
  .topbar .socials { gap: 10px; }

  /* Match strip - horizontal scroll only */
  .match-strip-inner { height: auto; }
  .strip-label {
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 0; font-size: 12px; justify-content: center;
    width: 100%;
  }
  .match-strip-inner { flex-direction: column; }
  .match-rail { width: 100%; }
  .match-card { min-width: 240px; padding: 10px 14px; }
  .match-team .name { font-size: 13px; }

  /* Container padding */
  .container { padding: 0 14px; }

  /* Hero */
  .hero { padding: 16px 0; }
  .hero-grid { gap: 12px; }
  .hero-side { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .hero-main { aspect-ratio: 16/11; border-radius: var(--radius); }
  .hero-sec { aspect-ratio: 16/10; border-radius: var(--radius); }
  .hero-title { font-size: 22px; }
  .hero-body { padding: 16px; }
  .hero-body.small .hero-title { font-size: 16px; }
  .hero-excerpt { font-size: 13px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-meta { gap: 8px; font-size: 10px; flex-wrap: wrap; }

  /* Trending bar */
  .ticker-track { animation-duration: 30s; }

  /* Section head */
  .sec-head { margin-bottom: 14px; }
  .sec-title { font-size: 18px; }
  .sec-title .count { display: none; }

  /* Horizontal cards → stacked */
  .card-h { grid-template-columns: 120px 1fr; gap: 12px; padding-bottom: 14px; }
  .card-h .title { font-size: 14px; }
  .card-h .excerpt { display: none; }
  .card-h .meta { font-size: 9px; gap: 6px; }

  .card-v .title { font-size: 15px; }

  /* Archive grid */
  .archive-grid { grid-template-columns: 1fr; gap: 20px; }

  /* Videos */
  section > div[style*="repeat(4, 1fr)"],
  section > div[style*="repeat(3, 1fr)"],
  section > div[style*="repeat(2, 1fr)"] {
    grid-template-columns: 1fr !important;
  }

  /* Livestream grid - keep 2 cols */
  .container > div:not(.hero-grid) > div[style*="grid-template-columns: repeat(4, 1fr)"][style*="gap: 20px"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  /* Filter bar */
  .filter-bar {
    flex-direction: column; align-items: flex-start; gap: 10px;
    padding: 12px 0;
  }
  .filter-tabs { overflow-x: auto; width: 100%; scrollbar-width: none; }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .ftab { flex-shrink: 0; font-size: 11px; padding: 0 10px; height: 30px; }
  .filter-meta { font-size: 10px; }

  /* Archive hero */
  .archive-hero { padding: 28px 0; }
  .archive-hero h1 { font-size: 38px; }
  .archive-hero .desc { font-size: 13px; }
  .archive-hero > .container > div[style*="gap: 32px"] {
    gap: 20px !important; flex-wrap: wrap;
  }

  /* Post */
  .post-hero { padding: 20px 0 24px; }
  .post-title { font-size: 26px; margin: 10px 0 12px; }
  .post-lead { font-size: 15px; }
  .post-byline { gap: 10px; flex-wrap: wrap; }
  .post-byline > div:last-child { width: 100%; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .post-body { padding: 24px 0; gap: 24px !important; }
  .post-content p { font-size: 15px; }
  .post-content h2 { font-size: 22px; margin: 24px 0 10px; }
  .post-content h3 { font-size: 17px; }
  .post-content blockquote { font-size: 18px; padding-left: 14px; }
  .share-rail { flex-wrap: wrap; gap: 6px; }
  .share-btn { font-size: 9px; padding: 0 8px; height: 28px; }

  /* Tournament */
  .tourney-hero { padding: 24px 0 28px; }
  .tourney-badge { width: 80px; height: 80px; font-size: 36px; }
  .tourney-title { font-size: 28px; }
  .tourney-sub { font-size: 13px; }
  .tourney-meta { flex-wrap: wrap; gap: 10px; font-size: 10px; }
  .tourney-stats { grid-template-columns: 1fr 1fr; }
  .tstat { padding: 14px; }
  .tstat .val { font-size: 22px; }
  .tourney-top > div:last-child { width: 100%; flex-direction: row; }
  .tourney-top > div:last-child button { flex: 1; }

  /* Tournament tabs - scrollable */
  div[style*="border-bottom: 1px solid var(--line)"][style*="position: sticky"][style*="top: 72px"] { top: 56px !important; }
  div[style*="border-bottom: 1px solid var(--line)"][style*="position: sticky"] > .container {
    overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap !important;
  }
  div[style*="border-bottom: 1px solid var(--line)"][style*="position: sticky"] > .container::-webkit-scrollbar { display: none; }
  div[style*="border-bottom: 1px solid var(--line)"][style*="position: sticky"] button {
    flex-shrink: 0; padding: 14px 12px !important; font-size: 12px !important;
  }

  /* Schedule row */
  .sched-row {
    grid-template-columns: 1fr;
    gap: 10px; padding: 12px;
  }
  .sched-teams { font-size: 14px; justify-content: space-between; }
  .sched-action .btn-ghost { font-size: 11px; }

  /* Standings - make scrollable */
  .standings { font-size: 11px; min-width: 560px; }
  section > .standings, div > .standings {
    display: block; overflow-x: auto;
  }

  /* Bracket - scroll */
  .bracket { grid-auto-columns: 180px; gap: 20px; }

  /* Newsletter */
  section[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important; gap: 20px !important; padding: 24px !important;
  }
  section[style*="grid-template-columns: 1fr 1fr"] h2 { font-size: 24px; }

  /* Footer */
  .footer { padding: 32px 0 20px; margin-top: 40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; padding-bottom: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Ad slots */
  .ad-970 { height: 100px; }

  /* Page nav */
  .page-nav {
    top: auto; bottom: 14px; left: 14px; right: 14px;
    transform: none; overflow-x: auto; justify-content: flex-start;
    scrollbar-width: none;
    padding: 3px;
  }
  .page-nav::-webkit-scrollbar { display: none; }
  .page-nav button { flex-shrink: 0; font-size: 9px; padding: 0 10px; height: 28px; }

  /* Tweaks panel */
  .tweaks-panel {
    left: 14px; right: 14px; bottom: 60px;
    width: auto;
  }

  /* Streamer page */
  section[style*="height: 280px"] { height: 160px !important; }
  .container[style*="margin-top: -80px"] { margin-top: -60px !important; }
  .container[style*="margin-top: -80px"] > div { flex-direction: column !important; align-items: flex-start !important; gap: 16px !important; }
  .container[style*="margin-top: -80px"] > div > div:first-child {
    width: 100px !important; height: 100px !important; font-size: 48px !important;
    border-width: 4px !important;
  }
  .container[style*="margin-top: -80px"] h1 { font-size: 32px !important; }
  .container[style*="margin-top: -80px"] > div > div:last-child { width: 100%; padding-bottom: 0 !important; }
  .container[style*="margin-top: -80px"] > div > div:last-child button { flex: 1; }

  /* Author page header */
  .archive-hero > .container > div[style*="gap: 28px"][style*="align-items: flex-end"] {
    flex-direction: column; align-items: flex-start !important; gap: 16px !important;
  }
  .archive-hero > .container > div[style*="gap: 28px"] > div:first-child {
    width: 88px !important; height: 88px !important; font-size: 36px !important;
  }
}

/* ====== SMALL MOBILE ≤ 420 ====== */
@media (max-width: 420px) {
  .logo .tld { font-size: 11px; }
  .btn-primary { font-size: 10px; }
  .card-h { grid-template-columns: 96px 1fr; gap: 10px; }
  .card-h .thumb { aspect-ratio: 4/3; }
  .card-h .title { font-size: 13px; -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-title { font-size: 19px; }
  .post-title { font-size: 22px; }
  .tourney-title { font-size: 24px; }
  .archive-hero h1 { font-size: 30px; }

  /* Stats row inside tourney/archive hero */
  .archive-hero > .container > div[style*="display: flex"][style*="gap: 32px"],
  .archive-hero > .container > div[style*="gap: 24px"] {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px !important;
  }
}

/* Touch tweaks */
@media (hover: none) {
  .card-h:hover .title,
  .card-v:hover .title,
  .hero-main:hover .hero-title { color: inherit; }
}
