:root{
  --bg:#0b0d12; --card:#141922; --ink:#e7ecf3; --muted:#9fb0c4; --accent:#3aa3ff; --error:#ff4d6d;
  --ring: #3aa3ff55;
  --cell: clamp(34px, 10.5vw, 48px);
  --pad: clamp(10px, 3vw, 16px);
  --radius: 14px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial;
  color:var(--ink);
  background:linear-gradient(180deg,#0a0d13,#0e131b);
  min-height:100dvh;
  display:flex; flex-direction:column; gap:10px;
}

/* Header */
header{
  position:sticky; top:0; z-index:10;
  backdrop-filter: blur(6px);
  background: linear-gradient(180deg, #0b0f16cc, #0b0f1600);
  border-bottom:1px solid #1c2636;
}
.wrap{max-width:900px; margin:0 auto; padding:var(--pad); width:100%}
.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.space{justify-content:space-between}
h1{margin:0; font-size:clamp(18px, 2.8vw, 24px); letter-spacing:.3px}
.muted{color:var(--muted)}

select, button{
  background:var(--card); color:var(--ink);
  border:1px solid #243041; border-radius:12px;
  padding:10px 14px; cursor:pointer; font-size:16px;
}
button:hover, select:hover{ border-color:var(--accent) }
button:focus-visible, select:focus-visible{ outline:2px solid var(--ring) }

/* Main */
main{ padding: 4px var(--pad) 20px }
.controls{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center }
.board{
  display:grid; gap:2px; background:#243041; padding:8px;
  grid-template-columns: repeat(9, var(--cell));
  border-radius:16px; margin: 8px auto; width: fit-content;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  touch-action: manipulation;
}
.cell{
  width:var(--cell); height:var(--cell);
  display:grid; place-items:center;
  background:var(--card);
  border:1px solid #1d2735;
  font-size:clamp(16px, 3.5vw, 20px);
  font-weight:700; border-radius:10px;
}
.cell input{
  width:100%; height:100%;
  text-align:center; border:none; background:transparent; color:var(--ink);
  font: inherit; outline:none; caret-color:var(--accent);
}
.cell.prefilled input{ color:#8eb6ff; font-weight:700 }
.cell.conflict{ background: rgba(255,77,109,.12); border-color:var(--error) }
.cell.focused{ outline:2px solid var(--accent) }
.cell.same-number{ background: rgba(58,163,255,.12) }
.bold-r{ border-bottom:2px solid #3a4b66 }
.bold-c{ border-right:2px solid #3a4b66 }

.tips{ text-align:center; color:var(--muted); margin-top:6px; font-size:14px }

footer{ text-align:center; color:var(--muted); padding: 6px 0 16px }

@media (max-width:520px){
  select, button{ padding:11px 14px; font-size:16px }
}
