/* ==========================================================================
   PHASE 5: final consistency polish (visual only). Loaded LAST.
   1. (moved to css/typography.css)
   2. A screen-reader-only helper (used by the page heading).
   3. Find a Room rows on small phones.
   No script, room, Supabase or SQL behaviour is touched here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TYPOGRAPHY: see css/typography.css (Fredoka headings, Nunito body / UI, Space Mono for timers, badges and tags).
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   2. SCREEN-READER-ONLY TEXT
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. FIND A ROOM ROWS ON SMALL PHONES
   Before: the wide "Ask to join" button took half of a 320px row, so puzzle names broke into three narrow lines.
   Now: the name and host use the full row width, and the player count and the button share the line under them.
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .mp-room {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main main" "count join";
    align-items: center; row-gap: 8px; column-gap: 10px; padding: 12px 12px 12px 14px;
  }
  .mp-room-main { grid-area: main; }
  .mp-room-count { grid-area: count; justify-self: start; }
  .mp-room-join { grid-area: join; align-self: center; justify-self: end; padding-inline: 1rem; }
  .mp-room-puzzle { white-space: normal; overflow-wrap: anywhere; }
}

/* --------------------------------------------------------------------------
   Image optimization: puzzle thumbnails are <picture><source webp><img jpg></picture> (js/image-loader.js, index.html).
   The <picture> wrapper must not create a box of its own, so every thumbnail <img> keeps laying out exactly as the bare <img> did
   (gallery cards, Browse All, Create a Room).
   -------------------------------------------------------------------------- */
picture { display: contents; }
