/* style.css */
:root{
  --bg:#f8f9fa; --card:#ffffff; --accent:#0077cc; --muted:#6c757d; --cell:#f1f3f5;
}
*{box-sizing:border-box}
html,body{min-height:100%;height:auto}
body{
  margin:0;font-family:Inter,system-ui,Segoe UI,Roboto,Arial; background:linear-gradient(180deg,#e9ecef, #dee2e6); color:#212529;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:18px
}
.app{width:100%;max-width:920px;display:flex;flex-direction:column;align-items:center}
.top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;margin-bottom:12px;width:100%}
.top h1{margin:0;font-size:1.4rem;color:#343a40}
.controls{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.controls select, .controls button{padding:8px 10px;border-radius:8px;border:1px solid #ced4da;background:#ffffff;color:#0077cc;font-weight:600}
.controls button{cursor:pointer}
.controls button.active{background:#e7f5ff;border-color:#a5d8ff}

.board-wrap{display:flex;justify-content:center;width:100%}
.board{
  width:min(720px,92vw);
  aspect-ratio:1/1;
  display:grid;grid-template-columns:repeat(9,1fr);grid-template-rows:repeat(9,1fr);
  gap:2px;padding:6px;border-radius:12px;background:#ffffff;border:2px solid #adb5bd;
}
.cell{
  background:var(--cell);display:flex;align-items:center;justify-content:center;position:relative;
  font-size:2.4rem;touch-action:manipulation;user-select:none;border-radius:4px;color:#212529;font-weight:600
}
.cell.prefilled{color:#495057;background:#e9ecef}
.cell.selected{outline:3px solid rgba(0,119,204,0.3)}
.cell.conflict{background:#ffe3e3}
.cell .notes{
  position:absolute;inset:6px;
  display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);
  font-size:1.1rem;color:var(--muted);
}
.cell .notes span{
  display:flex;align-items:center;justify-content:center;opacity:0.9;
  width:100%;height:100%;
}
/* Assign each number to its logical position */
.cell .notes span:nth-child(1){grid-column:1;grid-row:1}
.cell .notes span:nth-child(2){grid-column:2;grid-row:1}
.cell .notes span:nth-child(3){grid-column:3;grid-row:1}
.cell .notes span:nth-child(4){grid-column:1;grid-row:2}
.cell .notes span:nth-child(5){grid-column:2;grid-row:2}
.cell .notes span:nth-child(6){grid-column:3;grid-row:2}
.cell .notes span:nth-child(7){grid-column:1;grid-row:3}
.cell .notes span:nth-child(8){grid-column:2;grid-row:3}
.cell .notes span:nth-child(9){grid-column:3;grid-row:3}

.cell .value{z-index:2}

/* thicker borders for 3x3 blocks */
.board .cell:nth-child(3n){border-right:2px solid #adb5bd}
.board .cell:nth-child(n+19):nth-child(-n+27),
.board .cell:nth-child(n+46):nth-child(-n+54),
.board .cell:nth-child(n+73):nth-child(-n+81){border-bottom:2px solid #adb5bd}

.numpad{display:grid;grid-template-columns:1fr;gap:8px;margin-top:12px;justify-items:center;width:100%}
.numpad .num-row{display:flex;gap:8px;flex-wrap:wrap;justify-content:center}
.numpad button{padding:12px 18px;border-radius:8px;border:1px solid #ced4da;background:#ffffff;color:#0077cc;font-weight:700;font-size:2rem;min-width:54px}
.numpad button:active{transform:translateY(1px)}

.footer{margin-top:10px;text-align:center;color:var(--muted);width:100%}

/* Responsive tweaks */
@media (max-width:600px){
  .top h1{font-size:1.1rem}
  .controls select{padding:7px}
  .cell{font-size:2rem}
  .cell .notes{font-size:0.9rem}
  .numpad button{min-width:44px;padding:10px;font-size:1.6rem}
}

/* Accessibility focus */
button:focus{outline:2px dashed var(--accent);outline-offset:3px}