/* Jogo Leve — Caixas. A warehouse board, big arrow controls at thumb height. */

.jl-caixas {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #241c14 0%, #100c08 70%);
  color: #f2ece2;
  overflow: hidden;
}

.jl-cx-col {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 6px 8px 8px;
}

.jl-cx-hud { display: flex; gap: 14px; padding: 2px 0 6px; flex-wrap: wrap; justify-content: center; }
.jl-cx-stat { display: flex; align-items: baseline; gap: 5px; }
.jl-cx-lab { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: #a08a6c; }
.jl-cx-val { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; color: #ffd54f; }

/* THE BOARD IS SQUARE-CELLED. The grid's column count is set inline by the game from the level's
   width; each cell takes its size from the grid, and the grid is capped on both axes so a wide
   window does not stretch the crates into rectangles. */
.jl-cx-grid {
  flex: 0 1 auto;
  display: grid;
  gap: 2px;
  width: min(100%, 46vh, 420px);
  margin: 4px auto 0;
  aspect-ratio: 1;
  min-height: 0;
  background: #17110b;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #33281c;
}

.jl-cx-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(9px, 2.6vh, 18px);
  line-height: 1;
  border-radius: 3px;
  min-width: 0;
  min-height: 0;
}

.jl-cx-wall { background: #3a2e22; border-radius: 2px; }
.jl-cx-target { background: #241c14; box-shadow: inset 0 0 0 1.5px #7a6340; color: #7a6340; }
.jl-cx-crate { background: #8a6534; box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .45); }
/* A CRATE ON A TARGET turns green: it is the only progress signal the board needs. */
.jl-cx-done { background: #3f7d4a; box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .4), 0 0 0 2px #6fcf85; }
.jl-cx-player { background: #4a3a24; }

/* ---- the arrow pad: a cross, not a row of four ---- */
.jl-cx-pad {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(2, 48px);
  gap: 6px;
  padding: 8px 0 6px;
  justify-content: center;
}
.jl-cx-up { grid-column: 2; grid-row: 1; }
.jl-cx-left { grid-column: 1; grid-row: 2; }
.jl-cx-down { grid-column: 2; grid-row: 2; }
.jl-cx-right { grid-column: 3; grid-row: 2; }

.jl-cx-arrow {
  border: 1px solid #3d3023;
  border-radius: 10px;
  background: #241c14;
  color: #e8dcc8;
  font-size: 20px;
  cursor: pointer;
}
.jl-cx-arrow:active { background: #362a1e; }
.jl-cx-arrow:focus-visible { outline: 2px solid #ffd54f; outline-offset: 2px; }

.jl-cx-tools { display: flex; gap: 8px; padding-top: 2px; }
.jl-cx-tool {
  min-height: 40px;
  min-width: 110px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #3d3023;
  background: #1e1710;
  color: #c9b898;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.jl-cx-tool:disabled { opacity: .4; cursor: default; }
.jl-cx-tool:focus-visible { outline: 2px solid #ffd54f; outline-offset: 2px; }

/* ---- the veil ---- */
.jl-cx-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 7, 4, .96);
  z-index: 5;
}
.jl-cx-veil[hidden] { display: none; }
.jl-cx-box { width: 100%; max-width: 320px; text-align: center; }
.jl-cx-box h2 { margin: 0 0 8px; font-size: 21px; }
.jl-cx-sub { margin: 0 0 16px; font-size: 13px; color: #b6a184; line-height: 1.5; }
.jl-cx-go {
  width: 100%; min-height: 48px;
  border: 0; border-radius: 11px;
  background: #ffd54f; color: #1a1208;
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.jl-cx-go:active { background: #e8bf3d; }
.jl-cx-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-height: 520px) {
  .jl-cx-grid { width: min(100%, 50vh, 320px); }
  .jl-cx-pad { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(2, 42px); }
}
