/* Jogo Leve — Destruidor.
 *
 * 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-de {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  /* ⭐ THE ANCHOR for the absolutely-positioned level banner. Without it the banner would position
     against the PAGE and float off the game. */
  position: relative;
  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-de-hud {
  flex: 0 0 auto;
  display: flex;
  gap: 14px;
  align-items: center;
  height: 36px;
  padding: 0 12px;
}
.jl-de-stat { display: flex; gap: 6px; align-items: baseline; }
.jl-de-lab {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.jl-de-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-de-mid {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 28px;
  touch-action: none;
}
.jl-de-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-de-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-de-veil[hidden] { display: none; }
.jl-de-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-de-box h2 { margin: 0 0 8px; font-size: 18px; }
.jl-de-sub { margin: 0 0 14px; font-size: 13px; line-height: 1.5; opacity: 0.8; }
.jl-de-rec { margin: 0 0 12px; font-size: 13px; font-weight: 700; color: #f6d79a; }
.jl-de-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-de-go:active { background: #25864a; }

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

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

/* ---- ⭐ the level's name and the new-level banner (owner request, 2026-11-25) ----------------
   The HUD showed a bare number. A name says WHERE the player is, and the banner announces a new
   level rather than leaving the player to notice the counter moved. */
.jl-de-name {
  margin: 2px 0 0; padding: 0 4px;
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: #9fb4cf; text-align: center;
  min-height: 15px;
}
.jl-de-toast {
  position: absolute; left: 50%; top: 34%;
  transform: translate(-50%, -50%);
  padding: 9px 16px; border-radius: 10px;
  background: rgba(12,20,32,.92);
  border: 1px solid rgba(120,160,210,.45);
  color: #e7eef8; font-size: 14px; font-weight: 700;
  white-space: nowrap; pointer-events: none;
  z-index: 40;
  animation: jl-de-toast-in .22s ease-out;
}
.jl-de-toast[hidden] { display: none; }
@keyframes jl-de-toast-in {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .jl-de-toast { animation: none; }
}

/* ---- ⭐ the winning screen (owner request, 2026-11-25) ----------------------------------------
   Clearing a level used to be a toast. This is the moment the player is told how they did, so the
   score is the largest thing on the panel and the scoreboard is one tap away. */
.jl-de-winmark {
  font-size: 34px; line-height: 1;
  margin: 0 0 4px;
  animation: jl-de-bob .9s ease-in-out infinite alternate;
}
@keyframes jl-de-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-4px); }
}
@media (prefers-reduced-motion: reduce) {
  .jl-de-winmark { animation: none; }
}
.jl-de-score {
  margin: 6px 0 2px;
  font-size: 22px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #4ade80;
}
.jl-de-board {
  display: block; width: 100%;
  margin: 10px 0 6px; padding: 9px 12px;
  border-radius: 9px; cursor: pointer;
  background: #24334a; color: #cfe0f5;
  border: 1px solid rgba(120,160,210,.5);
  font: inherit; font-size: 14px; font-weight: 700;
}
.jl-de-board:hover { background: #2c3f5c; }

/* ---- ⭐ THE RETRO SLIDER (owner request, 2026-11-26) ----------------------------------------
   The D-pad moved the paddle ONE COLUMN per press — about 39px on a phone — with no repeat, so
   lining up on a corner brick was a series of jumps. This is a continuous control: drag anywhere
   across the track and the paddle follows the thumb, with no steps at all.

   It takes half the screen width, which is what the owner asked for, and it sits where the D-pad
   was so the layout above it does not move. */
.jl-de-slider {
  position: relative;
  width: 50%;
  min-width: 150px;
  max-width: 260px;
  height: 64px;
  margin: 0 auto 6px;
  border-radius: 32px;
  background: #141d29;
  border: 1px solid #2f4356;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .55);
  touch-action: none;
  overflow: hidden;
  cursor: pointer;
}
/* The grooves, so the track reads as a physical thing rather than a coloured bar. */
.jl-de-slider::before {
  content: '';
  position: absolute; left: 12px; right: 12px; top: 50%;
  height: 6px; margin-top: -3px;
  border-radius: 3px;
  background: repeating-linear-gradient(90deg, #26374a 0 6px, transparent 6px 12px);
}
/* The thumb: the thing the player actually drags. */
.jl-de-knob {
  position: absolute; top: 50%; left: 0;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6fd79c, #3aa870 62%, #237a4c);
  border: 2px solid #8fe9b8;
  box-shadow: 0 2px 8px rgba(0,0,0,.6), 0 0 12px rgba(74,222,128,.35);
  pointer-events: none;
}
/* The fill shows how much of the board the paddle can reach, which is the whole point. */
.jl-de-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(90deg, rgba(74,222,128,.06), rgba(74,222,128,.20));
  pointer-events: none;
}

/* ---- ⭐ THE CONTROL BAR: slider + A/B, where the D-pad used to be (owner request, 2026-11-26) ----
   ⚠️ IT IS FIXED, LIKE THE SHARED PAD, because that is how the classic-mode pages reserve their
   bottom strip. The first version put the slider in the normal flow and the fixed pad drew over it. */
.jl-de-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(12,17,24,0) 0%, rgba(12,17,24,.82) 34%, #0c1118 100%);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.jl-de-bar-btns { display: flex; align-items: center; gap: 14px; }
.jl-de-bar .jl-pad-a,
.jl-de-bar .jl-pad-b {
  width: 74px; height: 74px;
  min-width: 74px; min-height: 74px;
  border-radius: 50%;
  font: 700 21px/1 system-ui, sans-serif;
  background: #1b2f44;
  border: 1px solid #3d6b96;
  color: #dbe8f4;
}
.jl-de-bar .jl-pad-a { width: 80px; height: 80px; min-width: 80px; min-height: 80px; }
.jl-de-bar .jl-pad-a:active { background: #3d6b96; }
.jl-de-bar .jl-pad-b:active { background: #2f4356; }
