/* Jogo Leve — Sudoku. A 9x9 board, a number pad at thumb height, and box borders drawn with
   cell classes rather than a nested grid. */

.jl-sudoku {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #0b1016;
  color: #e6edf5;
  overflow: hidden;
}

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

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

/* THE BOARD IS SQUARE, capped by BOTH axes, so it is the same puzzle on a 320px phone and a
   desktop window. `min()` on the width is what stops the cells stretching into rectangles. */
.jl-sd-board {
  flex: 0 1 auto;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: min(100%, 46vh, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  background: #1a2430;
  border: 2px solid #3d5a75;
  border-radius: 4px;
  min-height: 0;
}

.jl-sd-cell {
  position: relative;
  border: 0;
  border-right: 1px solid #253242;
  border-bottom: 1px solid #253242;
  background: transparent;
  color: #8fb4d6;
  font-size: clamp(13px, 3.4vh, 21px);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  padding: 0;
  min-width: 0;
  min-height: 0;
}

/* The 3x3 box borders, thicker than the cell borders. */
.jl-sd-br { border-right: 2px solid #3d5a75; }
.jl-sd-bb { border-bottom: 2px solid #3d5a75; }

/* A GIVEN IS HEAVY AND WHITE; a player's number is light and blue. Weight is the cue, so the
   distinction survives a greyscale screen. */
.jl-sd-given { color: #eef4fa; font-weight: 800; }
.jl-sd-set { color: #7fb8ee; }
.jl-sd-wrong { color: #ff7b72; }

.jl-sd-sel { background: #22415e; box-shadow: inset 0 0 0 2px #4b9be0; }
.jl-sd-peer { background: #16232f; }

/* Notes: a 3x3 of tiny digits inside the cell. */
.jl-sd-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  font-size: clamp(5px, 1.15vh, 8px);
  color: #6f8ba3;
  font-weight: 700;
}
.jl-sd-notes span { display: flex; align-items: center; justify-content: center; }

/* ---- tools ---- */
.jl-sd-tools { display: flex; gap: 8px; padding: 8px 0 6px; }
.jl-sd-tool {
  min-height: 40px;
  min-width: 96px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid #2c3b4e;
  background: #141d27;
  color: #b6c6d6;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
/* A mode shows its state; "Notas" on means the pad writes notes. */
.jl-sd-tool.on { border-color: #ffd54f; color: #10161d; background: #ffd54f; }
.jl-sd-tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---- the number pad ---- */
.jl-sd-pad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  width: min(100%, 46vh, 420px);
  padding-bottom: 2px;
}
.jl-sd-key {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: #1b2733;
  color: #cfe0f0;
  font-size: clamp(15px, 2.6vh, 19px);
  font-weight: 800;
  cursor: pointer;
}
.jl-sd-key:active { background: #27384a; }
.jl-sd-key:focus-visible { outline: 2px solid #ffd54f; outline-offset: 1px; }

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

.jl-sd-levels { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.jl-sd-lv {
  flex: 1 1 0; min-height: 44px;
  border: 1px solid #2c3b4e; border-radius: 9px;
  background: #141d27; color: #c3d2e0;
  font-size: 13px; font-weight: 650; cursor: pointer;
}
.jl-sd-lv.on { border-color: #ffd54f; color: #ffd54f; background: #1c2733; }

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

@media (max-height: 500px) {
  .jl-sd-board { width: min(100%, 54vh, 340px); }
  .jl-sd-key { min-height: 38px; }
  .jl-sd-tools { padding: 5px 0 4px; }
  .jl-sd-tool { min-height: 34px; }
}

/* ---- the advice button (one per round, and it reads as spent afterwards) ----
   A spent control stays VISIBLE and disabled rather than vanishing: a button that disappears makes
   the player wonder whether they imagined it. The gold tint marks it as the thing that costs
   points, so it is not pressed by accident. */
.jl-sd-advice {
  border-color: #6b5a2f;
  background: #2a2116;
  color: #f4e7cf;
}
.jl-sd-advice:not([disabled]):active { background: #3a2d1c; }
.jl-sd-advice[disabled] {
  opacity: 0.45;
  border-color: #2c3a49;
  background: #141a21;
  color: #8a97a8;
  cursor: default;
}
