/* Jogo Leve — Astros.
 *
 * The frame (advert strip, control bar, help sheet) comes from `_shared/chrome.css`; this file
 * owns only the board's column and the few pieces unique to this game. The palette is the
 * project's, not an era-specific one (`IP-64-3` still governs the GAMES even where the retro
 * zone page overrides it).
 */

.jl-as {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #0b0e12;
  color: #e9eef5;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* ---- the HUD row ------------------------------------------------------- */
.jl-as-hud {
  flex: 0 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  height: 36px;
  padding: 0 12px;
}
.jl-as-stat { display: flex; gap: 6px; align-items: baseline; }
.jl-as-lab {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.jl-as-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- the board ---------------------------------------------------------
   The SIDE PADDING IS AN EDGE GUARD, not a margin: Android's back gesture owns roughly the outer
   24 px, and a game you leave by trying to move is not a game. 28 px clears it. The vertical
   padding stays small — a top or bottom edge swipe is not a navigation gesture. */
.jl-as-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 28px;
  touch-action: none;
}
.jl-as-canvas {
  display: block;
  border-radius: 8px;
  background: #10151c;
  /* The board is a grid of tiles; keeping the pixels crisp stops the lanes shimmering. */
  image-rendering: pixelated;
}

/* ---- the start / pause / over veil ------------------------------------- */
.jl-as-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(6, 9, 13, 0.82);
  z-index: 20;
}
.jl-as-veil[hidden] { display: none; }
.jl-as-box {
  width: 100%;
  max-width: 320px;
  padding: 20px 18px 16px;
  border-radius: 14px;
  background: #16202a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}
.jl-as-box h2 { margin: 0 0 8px; font-size: 18px; }
.jl-as-sub { margin: 0 0 14px; font-size: 13px; line-height: 1.5; opacity: 0.8; }
.jl-as-rec { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #f6d79a; }
.jl-as-go {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: #2f9e57;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.jl-as-go:active { background: #25864a; }

/* ---- small screens (320 px, SH-21) ------------------------------------ */
@media (max-width: 359px) {
  .jl-as-hud { gap: 10px; padding: 0 8px; height: 32px; }
  .jl-as-val { font-size: 13px; }
  /* THE SIDE PADDING MUST SURVIVE THIS QUERY — see `.jl-c10-mid` for the same lesson. */
  .jl-as-mid { padding: 3px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .jl-as-veil, .jl-as-go { transition: none; }
}

/*
 * THE PAD RESERVES ITS OWN SPACE (`--jl-pad-h`, published by _shared/pad.js).
 *
 * ⚠️ WITHOUT THIS THE PAD COVERS THE BOTTOM OF THE BOARD. In Travessia that is the bank the player
 * starts on; in Destruidor it is the lives row. A control that hides what it controls is worse than
 * no control at all, and the amount of space differs per device, so it is measured rather than
 * assumed.
 */
.jl-as-mid { padding-bottom: calc(var(--jl-pad-h, 96px) + 4px); }

/* ---- the reward box, every fifth level -------------------------------------------------------
   It does NOT pause the run: the formation keeps marching behind it, because a modal every five
   levels would break the rhythm the endless mode depends on. Fade in, hold, fade out. */
.jl-as-reward {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 2px solid #ffd54f;
  border-radius: 10px;
  background: rgba(18, 24, 32, 0.94);
  color: #ffd54f;
  font-family: "Courier New", Courier, ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  z-index: 7;
  pointer-events: none;
  animation: jl-as-reward-in 2.2s ease-out forwards;
}
.jl-as-reward-icon { font-size: 18px; }
@keyframes jl-as-reward-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.06); }
}
