/* game-sudoku.css — the Sudoku stage (prefix gs-). SPEC §18f.
   Shared classes (.panel .btn .seg .num .pf .sub .pill) come from app.css; the hub's .gm-seg sizing
   comes from games.css. Everything here is gs-. Desktop cells 40 px, phones ≤ 420 px 34 px:
   9 × 34 + 18 px of borders (6 outer, 6 thick, 6 thin) = 324 px, flush in .gm-stage. */

.gs-root{display:flex;flex-direction:column;align-items:center;gap:12px;width:100%;min-width:0}
.gs-hidden{display:none !important}

/* ---------- bar: level / new puzzle / time ---------- */
.gs-bar{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;width:378px;max-width:100%}
.gs-time{font-size:18px;color:var(--gold);margin-left:auto;min-width:4.5ch;text-align:right;line-height:1}
.gs-level{font-size:13px}
.gs-new{flex:none}
.gs-prep{padding:36px 8px;text-align:center;font-size:15px}
.gs-prep::before{content:"✦ ";color:var(--gold)}

/* ---------- board ---------- */
.gs-board{
  display:flex;flex-direction:column;border:3px solid var(--edge);background:var(--pale);
  box-shadow:4px 4px 0 var(--shadow);user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;
  touch-action:manipulation;cursor:default
}
.gs-board:focus-visible{outline:3px solid var(--star);outline-offset:3px}
.gs-row{display:flex}
.gs-cell{
  position:relative;width:40px;height:40px;flex:none;box-sizing:content-box;
  border-right:1px solid var(--line);border-bottom:1px solid var(--line);
  display:grid;place-items:center;background:var(--pale);color:var(--ink);
  transition:background-color .12s
}
.gs-row:last-child .gs-cell{border-bottom:0}
.gs-cell:last-child{border-right:0}
.gs-cell.gs-br{border-right:3px solid var(--edge)}
.gs-cell.gs-bb{border-bottom:3px solid var(--edge)}
.gs-d{font-family:"Pixelify Sans",monospace;font-size:26px;line-height:1;color:var(--accent)}
.gs-cell.gs-given .gs-d{color:var(--ink);font-weight:700}
.gs-cell.gs-peer{background:var(--panel2)}
.gs-cell.gs-same{background:rgba(184,119,26,.3)}
.gs-cell.gs-sel{background:var(--line)}
.gs-cell.gs-wrong .gs-d{color:#c45a4a}
.gs-cell.gs-wrong{background-image:linear-gradient(transparent 70%,rgba(196,90,74,.35) 70%)}
.gs-cell.gs-done.gs-entry .gs-d{color:var(--green-dk)}
.gs-notes{
  position:absolute;inset:1px;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);
  pointer-events:none
}
.gs-note{font-family:Nunito,system-ui,sans-serif;font-weight:600;font-size:10px;line-height:1;color:var(--muted);display:grid;place-items:center}
.gs-cell.gs-entry .gs-notes,.gs-cell.gs-given .gs-notes{display:none}

/* ---------- pad ---------- */
.gs-pad{display:flex;flex-direction:column;gap:8px;width:378px;max-width:100%}
.gs-digits{display:flex;gap:4px}
.gs-digit{
  flex:1 1 0;min-width:0;min-height:44px;font-family:Silkscreen,monospace;font-size:18px;line-height:1;
  background:var(--panel2);color:var(--ink);border:3px solid var(--edge);
  box-shadow:inset 0 -3px 0 var(--line),3px 3px 0 var(--shadow);cursor:pointer;padding:0 0 3px
}
.gs-digit:hover{filter:brightness(1.04)}
.gs-digit:active{transform:translate(2px,2px);box-shadow:inset 0 -3px 0 var(--line),1px 1px 0 var(--shadow)}
.gs-digit:disabled{opacity:.6;cursor:default;transform:none}
.gs-digit.gs-digit-done{color:var(--pale2);background:var(--pale)}
.gs-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.gs-actions .btn{min-height:40px;flex:1 1 auto}
.gs-actions .btn.on{color:var(--ink);box-shadow:inset 0 -3px 0 var(--gold),3px 3px 0 var(--shadow)}

/* ---------- phones ---------- */
@media (max-width:420px){
  .gs-root{gap:10px}
  .gs-bar,.gs-pad{width:324px}
  .gs-board{box-shadow:none}
  .gs-cell{width:34px;height:34px}
  .gs-d{font-size:22px}
  .gs-note{font-size:9px}
  .gs-digit{font-size:16px}
  .gs-actions .btn{font-size:14px;padding-left:8px;padding-right:8px}
  .gs-seg button{flex:1 1 0}
}

@media (prefers-reduced-motion:reduce){
  .gs-root *{transition:none !important;animation:none !important}
}
