/* The Reserve List — a game framed by the hub.
 * ===========================================================================
 *
 * Loaded only for /games/<slug>?embed=1, and last of all, so it beats both the
 * game's own page stylesheet and bare.css. See rl_is_embed() in layout.php.
 *
 * This file removes CHROME and nothing else. It does not touch a single rule
 * belonging to a game: no canvas sizes, no colours, no layout inside the
 * playing area. That is the deal that makes framing the real page better than
 * reproducing its markup — the thing in the hub's arcade slot is the game, and
 * it stays the game.
 *
 * What comes off:
 *
 *   the eyebrow, the title and the tagline   the hub has just said what this
 *                                            is, one line above the frame
 *   the centring and the min-height          a page centres itself in a
 *                                            viewport; a 300px box has none
 *                                            to spare
 *   the reserved space for the pinned bar    there is no bar in here
 *   the background                           so the frame reads as part of the
 *                                            hub panel rather than a window
 *                                            cut into it
 *
 * All nine games have exactly one .brand-eyebrow (or .eyebrow), one <h1> and
 * one .tagline — checked, not assumed — which is why hiding them can be one
 * rule rather than nine.
 * ------------------------------------------------------------------------- */

/* body.rl-embed, not .rl-embed. bare.css writes `body.page-bare` and
   `body.page-bare > .rl-stage`, which are (0,1,1) and (0,2,1); a bare class
   selector loses to both no matter how late it loads. Matching the specificity
   and loading after is what makes these win. Measured, not assumed: the first
   version of this file used .rl-embed and left 52px of reserved bar space and
   30px of stage padding inside the frame, which showed up as a scrollbar. */
body.rl-embed {
  margin: 0;
  padding: 0;
  min-height: 0;
  /* Transparent, so the hub panel shows through and the frame does not read as
     a hole in the page. The games all paint their own panels and canvases. */
  background: transparent;
}

/* bare.css centres the stage in the viewport and reserves room for the bar.
   Neither applies inside a box that is exactly as tall as the game. */
body.rl-embed > .rl-stage {
  display: block;
  min-height: 0;
  padding: 0;
  margin: 0;
}

/* Margins and centring only. The max-width stays whatever the game set it to
   -- 460px for Spot the Spy, 480 for the bingo card, 720 for Single Market
   Risk -- because that is the width it was drawn at. An earlier version of
   this file set max-width:none here, which stretched every game past its own
   design and broke the promise three paragraphs up. */
body.rl-embed .wrap {
  margin: 0 auto;
  padding: 8px 10px 10px;
}

/* Said once already, by the hub, immediately above this frame. */
body.rl-embed .brand-eyebrow,
body.rl-embed .eyebrow,
body.rl-embed .wrap > h1,
body.rl-embed .tagline {
  display: none;
}

/* A game that scrolls inside a 300px box is a game you cannot play. If one
   overflows, that is a height to fix in nav.php rather than a scrollbar to
   live with — so this makes the failure visible instead of hiding it. */
body.rl-embed { overflow: hidden; }
