/* Jogo Leve — Travessia.
 *
 * 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-tv {
  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-tv-hud {
  flex: 0 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  height: 36px;
  padding: 0 12px;
}
.jl-tv-stat { display: flex; gap: 6px; align-items: baseline; }
.jl-tv-lab {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.jl-tv-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-tv-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 28px;
  touch-action: none;
}
.jl-tv-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-tv-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-tv-veil[hidden] { display: none; }
.jl-tv-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-tv-box h2 { margin: 0 0 8px; font-size: 18px; }
.jl-tv-sub { margin: 0 0 14px; font-size: 13px; line-height: 1.5; opacity: 0.8; }
.jl-tv-rec { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #f6d79a; }
.jl-tv-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-tv-go:active { background: #25864a; }

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

@media (prefers-reduced-motion: reduce) {
  .jl-tv-veil, .jl-tv-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-tv-mid { padding-bottom: calc(var(--jl-pad-h, 96px) + 4px); }

/* ---- the completion screen's frog head (owner request, 2026-11-22) ---------------------------
   It bobs and flashes, so the panel has a character rather than a tick. The image is cropped to
   the HEAD of the sprite: the body belongs on the road, not on a panel. */
.jl-tv-win-face{display:flex;align-items:center;justify-content:center;width:84px;height:84px;
  margin:0 auto 4px;border-radius:50%;overflow:hidden;
  background:radial-gradient(circle at 50% 35%, rgba(74,222,128,.35), rgba(74,222,128,0) 70%);
  animation:jl-tv-win-bob 1.1s ease-in-out infinite}
.jl-tv-win-frog{width:88px;height:auto;display:block}
.jl-tv-win-face:not(:has(.jl-tv-win-frog)){font-size:40px;animation:none}
@keyframes jl-tv-win-bob{
  0%,100%{transform:translateY(0)}
  50%    {transform:translateY(-5px)}
}
@media (prefers-reduced-motion:reduce){.jl-tv-win-face{animation:none}}
