main.sudoku-wrap {
  max-width: 960px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem 3rem;
  display: grid;
  gap: 1.5rem;
}
.sudoku-hero {
  background: #fff;
  padding: 1.5rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: 0 12px 30px rgba(0,0,0,.05);
  display: grid;
  gap: 1.5rem;
}
.sudoku-hero h1 { margin:.25rem 0;font-size:2rem; }
.sudoku-hero .eyebrow {
  text-transform: uppercase;
  font-size:.85rem;
  letter-spacing:.08em;
  color:var(--muted,#777);
  margin:0;
}
.hero-actions {
  display:flex;
  flex-wrap:wrap;
  gap:1rem;
  align-items:flex-end;
}
.hero-actions .nickname {
  flex:1 1 200px;
  display:flex;
  flex-direction:column;
  font-size:.9rem;
  color:var(--muted,#555);
}
.hero-actions .nickname input {
  border:1px solid rgba(0,0,0,.15);
  border-radius:.8rem;
  padding:.8rem 1rem;
  font-size:1rem;
}
.hero-actions .btn {
  background:#b74718;
  color:#fff;
  border:none;
  border-radius:.9rem;
  padding:.85rem 1.4rem;
  font-size:1rem;
  font-weight:600;
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
}
.hero-actions .btn:hover { transform:translateY(-1px); box-shadow:0 6px 15px rgba(183,71,24,.3); }
.stats {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:1rem;
}
.stats div {
  background:var(--muted-bg,#f8f8f8);
  border-radius:1rem;
  padding:1rem;
  text-align:center;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.05);
}
.stats strong { display:block;font-size:1.4rem;margin-top:.25rem; }
.stats select {
  margin-top:.35rem;
  border-radius:.7rem;
  border:1px solid rgba(0,0,0,.2);
  padding:.4rem .6rem;
}

.sudoku-board-card {
  background:#fff;
  border-radius:1.25rem;
  border:1px solid rgba(0,0,0,.05);
  padding:1.25rem;
  box-shadow:0 8px 25px rgba(0,0,0,.05);
  display:grid;
  gap:1rem;
}
.sudoku-board {
  display:grid;
  grid-template-columns:repeat(9, minmax(32px,1fr));
  gap:0;
  width:100%;
  border:3px solid #1c140b;
  border-radius:1rem;
  overflow:hidden;
}
.sudoku-board button {
  aspect-ratio:1 / 1;
  border-radius:0;
  border:1px solid rgba(0,0,0,.15);
  background:var(--surface,#fefefe);
  font-size:1.2rem;
  font-weight:600;
  transition:transform .15s ease, background .15s ease, color .15s ease;
  position:relative;
}
.sudoku-board button:nth-child(9n+1) { border-left-width:3px; }
.sudoku-board button:nth-child(9n) { border-right-width:3px; }
.sudoku-board button:nth-child(-n+9) { border-top-width:3px; }
.sudoku-board button:nth-child(n+73) { border-bottom-width:3px; }
.sudoku-board button:nth-child(9n+4),
.sudoku-board button:nth-child(9n+7) { border-left-width:3px; }
.sudoku-board button:nth-child(9n+3),
.sudoku-board button:nth-child(9n+6) { border-right-width:3px; }
.sudoku-board button:nth-child(n+28):nth-child(-n+36),
.sudoku-board button:nth-child(n+55):nth-child(-n+63) { border-top-width:3px; }
.sudoku-board button.fixed {
  background:#f1f4ff;
  color:#203c7b;
  border-color:rgba(32,60,123,.2);
}
.sudoku-board button.active {
  border-color:#b74718;
  box-shadow:0 0 0 2px rgba(183,71,24,.2);
}
.sudoku-board button.invalid {
  animation:shake .2s linear;
  background:#ffeded;
  color:#992828;
}
.sudoku-board button.conflict {
  background:#fff3d9;
  color:#8c2f00;
  box-shadow:inset 0 0 0 2px rgba(216,118,12,.4);
}
.sudoku-board button.correct {
  animation:pop .25s ease;
  background:#f0fff3;
  color:#267c40;
}
@keyframes pop {
  0% { transform:scale(.8); }
  70% { transform:scale(1.05); }
  100% { transform:scale(1); }
}
@keyframes shake {
  0% { transform:translateX(0); }
  25% { transform:translateX(-2px); }
  50% { transform:translateX(2px); }
  75% { transform:translateX(-1px); }
  100% { transform:translateX(0); }
}
.number-pad {
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  justify-content:center;
}
.number-pad button {
  flex:1 0 calc(20% - .5rem);
  padding:.85rem 0;
  border-radius:.9rem;
  border:1px solid rgba(0,0,0,.15);
  font-size:1.1rem;
  font-weight:600;
  background:#fff;
  transition:transform .2s ease, background .2s ease;
}
.number-pad button:active { transform:scale(.96); }
.number-pad button.ghost {
  flex-basis:100%;
  background:#f4f4f4;
  font-size:.95rem;
}

.ranking-card {
  background:#fff;
  border-radius:1.25rem;
  border:1px solid rgba(0,0,0,.04);
  padding:1.25rem;
  box-shadow:0 8px 20px rgba(0,0,0,.04);
}
.ranking-card header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:1rem;
}
.ranking-card .ghost {
  border:none;
  background:transparent;
  color:var(--muted,#666);
  cursor:pointer;
}
.ranking-list {
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:.6rem;
}
.ranking-list li {
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:var(--muted-bg,#f7f7f7);
  border-radius:.9rem;
  padding:.7rem 1rem;
}
.ranking-list li span {
  font-weight:600;
}
.ranking-list small {
  color:var(--muted,#666);
}

@media (max-width:720px){
  .sudoku-board { font-size:1rem; }
  .sudoku-hero { padding:1.1rem; }
  .number-pad button { flex-basis:calc(33.33% - .5rem); }
}
