/* ============================================================
   BRICK BREAKER, the cabinet
   --u is one playfield unit in pixels, set by game.js as the window
   is resized, so the type scales with the game instead of with the
   page. Every size has a floor, because PP NeueBit stops being
   readable below about 15px.
   ============================================================ */

.bb {
  --u: 2px;
  --bb-bg:    #14100d;
  --bb-line:  #2a221c;
  --bb-ink:   #f2e7d4;
  --bb-mute:  #8f8270;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bb-bg);
  color: var(--bb-ink);
  font-family: var(--bit);
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- the score line ---------- */
.bb-hud {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding: max(10px, calc(var(--u) * 5)) max(14px, calc(var(--u) * 8));
  border-bottom: 1px solid var(--bb-line);
  font-size: max(15px, calc(var(--u) * 7.5));
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}
.bb-hud .k { color: var(--bb-mute); margin-right: 0.45em; }
.bb-hud .v { color: var(--bb-ink); }
.bb-lives i {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  margin-left: 0.28em;
  background: var(--blue, #165ddd);
}

/* ---------- the screen ---------- */
.bb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
.bb-screen {
  position: relative;
  touch-action: none;      /* a drag on the field steers the paddle, not the page */
}
.bb-canvas { display: block; width: 100%; height: 100%; }
.bb.is-live .bb-screen,
.bb.is-live .bb-over { cursor: none; }   /* the paddle is the pointer while a ball is in play */

/* ---------- messages over the field ---------- */
.bb-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: max(10px, calc(var(--u) * 6));
  padding: 0 8%;
  text-align: center;
  background: rgba(20, 16, 13, 0.7);
  cursor: pointer;
}
.bb-over[hidden] { display: none; }
/* serving: no veil, just the prompt low down, out of the bricks' way */
.bb-over--thin {
  background: none;
  justify-content: flex-end;
  padding-bottom: calc(var(--u) * 62);
}

/* the title wears the desktop's gradient */
.bb-title {
  font-size: calc(var(--u) * 34);
  line-height: 0.84;
  letter-spacing: 0.02em;
  background: var(--screen-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: calc(var(--u) * 4);
}
.bb-big {
  font-size: max(26px, calc(var(--u) * 20));
  line-height: 0.9;
  color: var(--bb-ink);
}
.bb-score {
  font-size: max(22px, calc(var(--u) * 14));
  color: var(--blue, #165ddd);
  letter-spacing: 0.08em;
}
.bb-sub {
  font-size: max(15px, calc(var(--u) * 7.5));
  letter-spacing: 0.08em;
  color: var(--bb-ink);
  animation: bb-blink 1.1s steps(2, start) infinite;
}
.bb-hint {
  font-size: max(13px, calc(var(--u) * 6));
  letter-spacing: 0.08em;
  color: var(--bb-mute);
}
.bb-new { color: #e2b46c; }

@keyframes bb-blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .bb-sub { animation: none; } }

/* ---------- the menu bar button ---------- */
.menubar .game {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0.4cqw;
  margin-left: 0.5cqw;
}
.menubar .game svg {
  display: block;
  height: 1.55cqw;
  width: auto;
  fill: var(--blue);
  transition: fill 140ms ease;
}
.menubar .game:hover svg,
.menubar .game:focus-visible svg { fill: #f0e6d2; }
