  .cat-tabs {
    display: flex; gap: 4px;
    justify-content: center;
    margin: 0 0 12px;
    border-bottom: 1px solid var(--border-2);
    flex-wrap: wrap;
    position: sticky; top: 0; z-index: 5;
    background: var(--bg, #0e0e12);
    padding-top: 6px;
  }

  @media (max-width: 640px) {
    /* App-shell: .main is the scroll container, .side is a separate top row
       OUTSIDE it. So .cat-tabs sticky pins at the TOP of .main's scroll
       viewport (right under the top bar) — top:0, no magic offset needed. */
    .cat-tabs {
      top: 0;
      z-index: 10;
    }
    /* Raise .kv two-column→stacked breakpoint from 560px to 640px so the
       200px label column does not crush values on phone-width screens. */
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv .k { margin-top: 6px; }
    /* Bump card meta text one step for legibility on small screens. */
    .game-card .meta { font-size: 13px; }
  }

  @media (max-width: 640px), (hover: none) and (pointer: coarse) {
    /* Grow tap target for tab buttons to the 44px WCAG minimum. Use min-height
       so the layout does not break on wider screens. */
    .cat-tab { min-height: 44px; padding: 0 16px; }
  }

  @media (max-width: 560px) {
    /* Detail-hero title: clamp prevents the 32px heading overflowing narrow
       screens; line-clamp keeps it to 2 lines so the poster is still visible. */
    .detail-hero .title-on {
      font-size: clamp(18px, 5vw, 28px);
      left: 16px; bottom: 14px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
  }

  /* Catalog sits close to the top — trim the page's top gutter, scoped to the
     catalog screen via :has(> .cat-tabs) so no per-route class is needed. */
  .main:has(> .cat-tabs) { padding-top: 12px; }
  .cat-tab {
    padding: 7px 14px;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
  }
  @media (hover: hover) { .cat-tab:hover:not(:disabled) { color: var(--text); } }
  .cat-tab.active {
    color: var(--text);
    border-bottom-color: rgba(110, 150, 135, 0.7);
  }
  .cat-tab.disabled, .cat-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  .grid-games {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  .game-card {
    position: relative;
    background:
      linear-gradient(180deg, rgba(255,220,180,0.04), transparent 50%),
      var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--r-md);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    transition: transform 0.12s ease, border-color 0.12s ease;
  }
  @media (hover: hover) {
    .game-card:hover {
      transform: translateY(-2px);
      border-color: rgba(110,150,135,0.35);
    }
  }
  .game-card .poster {
    aspect-ratio: 16/9;
    background:
      radial-gradient(140% 140% at 0% 0%, rgba(255,180,120,0.12), transparent 55%),
      linear-gradient(135deg, #245c49 0%, #143a2c 60%, #1a1714 100%);
    position: relative;
  }
  .game-card .poster .ph {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.55); font-weight: 700; letter-spacing: 1px;
    font-size: 18px;
  }
  .game-card .body { padding: 12px 14px; }
  .game-card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
  .game-card .meta { font-size: 12px; color: var(--muted); }

  /* Game detail */
  .detail-hero {
    aspect-ratio: 21/9;
    border-radius: var(--r-lg);
    background:
      radial-gradient(140% 140% at 0% 0%, rgba(255,180,120,0.14), transparent 55%),
      linear-gradient(135deg, #225e4a 0%, #11362a 60%, #1a1714 100%);
    margin-bottom: 22px;
    border: 1px solid var(--border-2);
    box-shadow: var(--shadow-card);
    position: relative;
  }
  .detail-hero .title-on {
    position: absolute; left: 28px; bottom: 24px;
    font-size: 32px; font-weight: 700;
    text-shadow: 0 2px 18px rgba(0,0,0,0.6);
  }
  .kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 18px; font-size: 13px; }
  .kv .k { color: var(--muted); }
  .kv .v { color: var(--text); word-break: break-all; }
