/* ==========================================================================
   Breakpoints. Mobile styles live in the base files; these adapt upward
   and handle the narrow end where the desktop nav has to collapse.
   ========================================================================== */

/* --- Tablet and below --------------------------------------------------- */
/* The brand and the nav links have fixed widths, so the search field absorbs
   every pixel of squeeze — it collapses to an unusable ~80px stub between
   960px and 1120px. Below 1120 there is genuinely not room for brand + seven
   links + search + two buttons, so the search is the thing that gives way;
   country lookup still lives on /countries/. */
@media (max-width: 1120px) {
  .search { display: none; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }

  .nav-toggle { display: inline-flex; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .footer-brand { grid-column: 1 / -1; }
}

/* --- Mobile ------------------------------------------------------------- */
@media (max-width: 640px) {
  .section { padding-block: 40px; }

  .hero { padding-block: 40px 32px; }

  .hero .btn-row .btn { width: 100%; }

  .hero-stats { gap: 20px; }
  .hero-stat strong { font-size: 1.375rem; }

  .brand-full { display: none; }
  .brand-short { display: inline; }

  .daily {
    padding: 24px 20px;
    text-align: center;
  }

  .daily .btn { width: 100%; }
  .daily-body { flex-basis: 100%; }
  .streak { justify-content: center; }

  .game-grid,
  .card-grid { grid-template-columns: 1fr; }

  .game-card { min-height: 0; }

  .country-list { grid-template-columns: 1fr; }

  /* One fact per row wastes most of a phone screen; these are short values. */
  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .fact { padding: 12px 14px; }
  .fact dd { font-size: .9375rem; }
  .fact dt { font-size: .6875rem; }

  .scoreboard { gap: 20px; padding: 14px; }
  .scoreboard .value { font-size: 1.5rem; }

  .question-visual { min-height: 150px; padding: 18px; }

  /* A taller map means bigger countries to tap. The viewBox follows the
     container's aspect (see js/worldmap.js), so nothing is letterboxed. */
  .world-map { aspect-ratio: 1 / 1; }
  .shape-svg { height: 240px; }

  .answer { font-size: 1rem; padding: 14px 16px; }

  .results-score { font-size: 3.25rem; }

  /* Continent is the least useful column in a flag/capital lookup and is on
     every country page anyway. Dropping it lets these tables fit a phone
     without sideways scrolling at all. */
  .col-optional { display: none; }

  /* nowrap keeps columns as wide as their longest name, which pushes these
     tables off screen. Wrapping lets the lookup tables fit outright; numbers
     contain no spaces so they never break mid-figure. */
  th, td {
    padding: 10px 12px;
    white-space: normal;
  }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { justify-content: center; text-align: center; }

  .landlocked-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Small phones ------------------------------------------------------- */
@media (max-width: 380px) {
  .wrap { padding-inline: 16px; }
  .streak-day { width: 34px; }
  .streak-day .dot { width: 28px; height: 28px; }
}

/* --- Large screens ------------------------------------------------------ */
@media (min-width: 1400px) {
  :root { --wrap: 1240px; }
}

/* --- Print -------------------------------------------------------------- */
@media print {
  .site-header,
  .site-footer,
  .ad-container,
  .nav-drawer { display: none !important; }

  body { background: #fff; color: #000; }
}
