/* Jogo Leve — Jogo da Velha. A three-by-three board, sized to the smaller axis. */

.jl-jogo-velha {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 50% 0%, #241634 0%, #120b1b 70%);
  color: #f0eaf7;
  overflow: hidden;
}

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

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

/* THE GRID IS SQUARE AND CAPPED BY HEIGHT. Nine cells on a wide screen will otherwise stretch
   into stretched rectangles; `min()` on width with a `1/1` ratio keeps it square everywhere. */
.jl-jv-grid {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  width: min(100%, 58vh, 380px);
  aspect-ratio: 1;
  margin: 14px auto 0;
}

.jl-jv-cell {
  border: 0;
  border-radius: 12px;
  background: #211633;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .5);
  font-size: clamp(38px, 13vh, 72px);
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
  /* The glyphs are drawn by the class, so the cell's own colour is the marker. */
  color: #cfc0e6;
}
.jl-jv-cell:disabled { cursor: default; }
.jl-jv-cell:not(:disabled):active { background: #2c1e44; }
.jl-jv-cell:focus-visible { outline: 2px solid #ffd54f; outline-offset: 2px; }

/* X is the player: a warm gold. O is the machine: a cool violet. That pair is distinguishable
   for the most common colour-vision deficiencies, and neither is the same weight as the other —
   X is a stroke, O is a circle, so the two never rely on colour alone. */
.jl-jv-x { color: #ffd54f; background: #2a2136; }
.jl-jv-o { color: #a98fe8; background: #251c36; }

/* THE WINNING THREE. A ring plus a glow; the ring is the signal that survives a greyscale
   screenshot and a colour-blind player. */
.jl-jv-win {
  box-shadow: inset 0 0 0 3px #ffd54f, 0 0 18px rgba(255, 213, 79, .55);
}

.jl-jv-status {
  margin: 12px 0 0;
  text-align: center;
  font-size: 13px;
  min-height: 18px;
  color: #b4a3cc;
}

/* ---- the veil ---- */
.jl-jv-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 6, 16, .96);
  z-index: 5;
}
.jl-jv-veil[hidden] { display: none; }
.jl-jv-box { width: 100%; max-width: 320px; text-align: center; }
.jl-jv-box h2 { margin: 0 0 8px; font-size: 21px; }
.jl-jv-sub { margin: 0 0 16px; font-size: 13px; color: #a48fbe; line-height: 1.5; }

.jl-jv-levels { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.jl-jv-lv {
  flex: 1 1 0; min-height: 44px;
  border: 1px solid #3a2a52; border-radius: 9px;
  background: #1e1530; color: #cbbfe0;
  font-size: 13px; font-weight: 650; cursor: pointer;
}
.jl-jv-lv.on { border-color: #ffd54f; color: #ffd54f; background: #291f3c; }

.jl-jv-go {
  width: 100%; min-height: 48px;
  border: 0; border-radius: 11px;
  background: #ffd54f; color: #160f20;
  font-size: 15px; font-weight: 800; cursor: pointer;
}
.jl-jv-go:active { background: #e8bf3d; }
.jl-jv-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .jl-jv-cell { transition: none; }
}

@media (max-height: 460px) {
  .jl-jv-grid { width: min(100%, 62vh, 300px); margin-top: 8px; }
  .jl-jv-status { margin-top: 6px; }
}
