/* Torre — the play column only. The frame lives in `_shared/chrome.css`. */

.jl-torre {
  --jl-bg: #0e1116;
  --jl-fg: #e9eef5;
  --jl-line: #232c36;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--jl-bg);
  color: var(--jl-fg);
  /* A game page never scrolls: the whole screen is the input, so a scroll gesture would
     fight the tap that drops the block (I1). */
  overflow: hidden;
  touch-action: manipulation;
}

.jl-torre *,
.jl-torre *::before,
.jl-torre *::after { box-sizing: border-box; margin: 0; padding: 0; }

.jl-torre-col {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---- HUD (§4.1) -------------------------------------------------------- */
.jl-torre-hud {
  flex: 0 0 auto;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 12px;
}

.jl-torre-stat { display: flex; align-items: baseline; gap: 6px; }

.jl-torre-lab {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .62;
}

.jl-torre-val {
  font-size: 15px;
  font-weight: 800;
  /* A-3: tabular numerals, so the HUD does not jitter as the score climbs. */
  font-variant-numeric: tabular-nums;
}

/* ---- the stage: the entire tap target -------------------------------- */
.jl-torre-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  /* `touch-action:none` is what stops the browser turning a drop into a scroll. */
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.jl-torre-stage canvas { display: block; }

/* Focus ring for the keyboard user (A-4). Visible, never the only signal. */
.jl-torre-stage:focus-visible {
  outline: 2px solid #4DD0E1;
  outline-offset: -2px;
}

/* The perfect chip (§4.4): text, not colour alone (A-1). */
.jl-torre-chip {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 800;
  color: #06222a;
  background: #4DD0E1;
  padding: 4px 12px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
}

.jl-torre-chip[hidden] { display: none; }

/* ---- the veil: start, pause and result ------------------------------- */
.jl-torre-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* Fully opaque (UI-8's sibling rule for the help panel): a faded veil invites a tap on
     a board that is not accepting them. */
  background: #0e1116;
}

.jl-torre-veil[hidden] { display: none; }

.jl-torre-box {
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.jl-torre-box h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 10px;
}

.jl-torre-sub {
  font-size: 15px;
  line-height: 1.5;
  opacity: .88;
  margin-bottom: 18px;
}

.jl-torre-rec {
  font-size: 15px;
  font-weight: 800;
  color: #FFD54F;
  margin: -8px 0 18px;
}

.jl-torre-go {
  display: inline-block;
  min-width: 150px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  background: #2b6cb0;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.jl-torre-go:active { transform: scale(.97); }
.jl-torre-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- reduced motion --------------------------------------------------- */
/* A-5/M20: the camera stops scrolling. The canvas is redrawn in place by the renderer;
   this rule only removes the transition-like feel of the chip. */
@media (prefers-reduced-motion: reduce) {
  .jl-torre-go:active { transform: none; }
}

/* ---- very small screens (SH-21: 320px) -------------------------------- */
@media (max-width: 359px) {
  .jl-torre-hud { gap: 12px; padding: 0 8px; }
  .jl-torre-lab { font-size: 9px; }
  .jl-torre-val { font-size: 14px; }
  .jl-torre-box h2 { font-size: 19px; }
  .jl-torre-sub { font-size: 14px; }
}

/* Short screens: the HUD yields height to the play area, which is the tap target. */
@media (max-height: 560px) {
  .jl-torre-hud { height: 34px; }
}
