/* Flappy Bird wears the shared frame from game.css. What is here is the cabinet
   the sky sits in — the same machine Pong is set into, at this board's width.
   See design/DESIGN.md. */

/* ---------- one column, as wide as the board ---------- */

/* Derived from --court exactly as Pong's is: board + the canvas's own 1px
   border + 12px of bezel padding + the bezel's own 1px border, each doubled.
   Change the board size and nothing drifts out of line. */
.cabinet,
.game-page .game-foot {
  --court: 400px;
  width: min(100%, calc(var(--court) + 28px));
  margin-inline: auto;
}

/* .game-stage is a flex row for a game with something standing beside its
   board. Flappy has nothing beside it, and a row would fight the centring. */
.game-stage {
  display: block;
}

/* The cabinet is already a centred column exactly as wide as the board, so the
   strap, the buttons and the ? panel line up with the board's left edge rather
   than with each other. */
.cabinet .game-strap {
  margin: 0.2rem 0 0.9rem;
  text-align: left;
}

.game-page .controls {
  justify-content: flex-start;
}

.cabinet .instructions {
  margin-inline: 0;
}

/* ---------- the readout ---------- */

/* Pong's scorebar layout with a drawn glyph in place of its word: the number
   large, tabular and lit. Its ends are flush with the board's, which is what
   the court-width column buys. */
.hud {
  align-items: center;
  padding: 0 0 0.55rem;
  margin-bottom: 0;
}

/* The glyphs are chrome — one weight, one colour, no hue of their own — the
   same call hub.css makes for the tile icons beside a coloured bar. */
.hud .gly svg {
  display: block;
  width: 2rem;
  height: 2rem;
}

/* The word each glyph stands for, kept for a screen reader and taken out of the
   picture. Not `display: none`, which would take it out of the reading too. */
.hud .lbl {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hud span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

/* Both numbers are amber. What separates them is the light rather than the hue:
   the live count glows, the stored record does not — the same distinction the
   bird itself makes when it dies. */
.hud .n {
  font-size: 2rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--p-amber);
  text-shadow: 0 0 10px rgba(255, 176, 0, 0.5);
}

#best-score .n {
  text-shadow: none;
}

/* ---------- the bezel ---------- */

/* The sky reads as a screen set into a machine rather than a rectangle on
   black. Square corners: nothing on this page has a radius. */
.bezel {
  position: relative;
  padding: 12px;
  background: linear-gradient(#160f08, #0d0905);
  border: 1px solid var(--p-hairline);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
  line-height: 0; /* no descender gap under the canvas */
}

/* Corner brackets, two sides each, on opposite corners. Two are enough to say
   "machined panel"; four reads as a border and a border is already there. */
.bezel::before,
.bezel::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--p-rule);
}

.bezel::before {
  left: 4px;
  top: 4px;
  border-right: 0;
  border-bottom: 0;
}

.bezel::after {
  right: 4px;
  bottom: 4px;
  border-left: 0;
  border-top: 0;
}

#board {
  /* The same court value Pong's canvas sits on: the two canvas games are one
     machine and their screens are the same screen. */
  background: #0d0905;
  border: 1px solid var(--p-hairline);
  /* The canvas is a fixed pixel size; this keeps it inside a narrow window
     without the script needing to know anything about layout. */
  max-width: 100%;
  height: auto;
  /* A tap on the board flaps, so the browser must not also treat it as a
     double-tap zoom or a scroll gesture. */
  touch-action: manipulation;
  cursor: pointer;
}

