/* =========================================================================
   responsive.css — adaptive layout + unified polish layer.

   Loaded LAST (after page-specific CSS) so its media queries win.
   The previous build shipped a fixed `viewport width=1200`, which disabled
   every existing media query; with `width=device-width` restored, this file
   provides the cross-page responsive behaviour and a little visual cohesion.
   ========================================================================= */

:root {
  /* Re-export the core brand tokens with safe fallbacks so every page
     (even the ones not using redesign.css) shares the same identity. */
  --rp-accent: var(--accent-primary, #e62020);
  --rp-accent-bright: var(--accent-bright, #ff4d4d);
  --rp-bg-deep: var(--bg-deep, #050505);
  --rp-text: var(--text-primary, #ffffff);
  --rp-border: var(--border-subtle, 1px solid rgba(255, 255, 255, 0.06));
  --rp-radius: 12px;
}

/* ---- Global, desktop-safe niceties ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, video, canvas, svg { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--rp-accent); outline-offset: 2px; }

/* Consistent thin scrollbars across the app */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================== TABLET (<= 980px) =========================== */
@media (max-width: 980px) {
  /* Main dashboard (redesign.css) is a 3-column full-height grid; collapse it
     to a single scrollable column and release the body scroll lock. */
  .app-container {
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 100vh;
  }
  body { height: auto !important; overflow: auto !important; }
  .panel {
    height: auto !important;
    border-right: none !important;
    border-bottom: var(--rp-border);
  }

  .container { max-width: 100% !important; }
}

/* =========================== MOBILE (<= 768px) =========================== */
@media (max-width: 768px) {
  body { font-size: 14px; }

  .container { padding-left: 14px !important; padding-right: 14px !important; }

  /* Wide data tables scroll horizontally instead of breaking the layout. */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Button / control rows wrap to new lines. */
  .controls, .topbar, .toolbar, .actions, .btn-row, .profile-card {
    flex-wrap: wrap !important;
  }

  /* Comfortable tap targets. */
  .btn, button, .nav-item, .steam, .logout { min-height: 42px; }

  /* Documentation definition rows stack label over value. */
  .docs-dl > div { grid-template-columns: 1fr !important; gap: 4px; }
  .docs-nav { flex-wrap: wrap; }
  .docs-nav__item { min-width: 0; flex: 1 1 auto; }
}

/* =========================== SMALL (<= 560px) =========================== */
@media (max-width: 560px) {
  .profile-card { flex-direction: column; text-align: center; }
  .site-footer { flex-direction: column; gap: 6px; text-align: center; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .panel { padding-left: 14px; padding-right: 14px; }
}
