/* Sumo Sudoku — 13 overlapping 9×9 grids */
#sumo-sudoku {
  --ss-cs: 20px;
  --ss-panel: #17110b;
  --ss-cell: #211910;
  --ss-cell-given: #2d2315;
  --ss-line: rgba(236, 214, 170, 0.13);
  --ss-box-line: rgba(236, 214, 170, 0.45);
  --ss-grid-line: #d4a95c;
  --ss-text: #f5ead3;
  --ss-accent: #ffc95e;
  --ss-muted: #a99470;
  --ss-bad: #ff7563;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  color: var(--ss-text);
}
#sumo-sudoku *,
#sumo-sudoku *::before,
#sumo-sudoku *::after { box-sizing: border-box; }

/* ── top bar ── */
.ss-topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 4px;
  flex-wrap: wrap;
}
.ss-stats { display: flex; gap: 18px; }
.ss-stat { color: var(--ss-muted); font-size: 13px; }
.ss-stat b { color: var(--ss-accent); font-size: 18px; font-family: 'Outfit', sans-serif; }
.ss-msg { color: var(--ss-muted); font-size: 13px; text-align: right; }

/* ── board ── */
.ss-board-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
#ss-board {
  display: grid;
  grid-template-columns: repeat(33, var(--ss-cs));
  grid-template-rows: repeat(33, var(--ss-cs));
  background: var(--ss-panel);
  padding: 3px;
  border-radius: 6px;
  transition: opacity .2s;
}
#ss-board.loading { opacity: 0.25; }

.ss-cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ss-cell);
  font-family: 'Outfit', sans-serif;
  font-size: calc(var(--ss-cs) * 0.58);
  font-weight: 600;
  color: var(--ss-accent);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background .08s;
}
.ss-cell.given { background: var(--ss-cell-given); color: var(--ss-text); font-weight: 700; }
.ss-cell.peer { background: #2c2316; }
.ss-cell.same { color: #ffe3a0; }
.ss-cell.sel { background: #4d3a1c; box-shadow: inset 0 0 0 2px var(--ss-accent); z-index: 2; }
.ss-cell.bad, .ss-cell.wrong {
  color: var(--ss-bad);
  background: rgba(255, 90, 70, 0.14);
}

.ss-notes {
  position: absolute;
  inset: 1px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  pointer-events: none;
}
.ss-notes em {
  font-style: normal;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: calc(var(--ss-cs) * 0.27);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ss-muted);
}

/* ── number pad & actions ── */
.ss-pad {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.ss-num, .ss-tool {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(236, 214, 170, 0.25);
  background: #241c12;
  color: var(--ss-accent);
  font: 700 20px 'Outfit', sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.ss-num:hover, .ss-tool:hover { border-color: var(--ss-accent); }
.ss-tool.active { background: var(--ss-accent); color: #241c12; }

.ss-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ss-btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(236, 214, 170, 0.3);
  background: #241c12;
  color: var(--ss-text);
  font: 600 14px 'Inter', sans-serif;
  cursor: pointer;
}
.ss-btn:hover { border-color: var(--ss-accent); color: var(--ss-accent); }

.ss-help {
  color: var(--ss-muted);
  font-size: 13px;
  max-width: 72ch;
  margin: 14px auto 0;
  line-height: 1.55;
}

/* ── overlays ── */
.ss-loading, .ss-win {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 7, 4, 0.75);
  border-radius: 6px;
  z-index: 5;
}
.hidden { display: none !important; }
.ss-loading-card, .ss-win-card {
  background: #1d150c;
  border: 1px solid rgba(236, 214, 170, 0.3);
  padding: 22px 28px;
  border-radius: 14px;
  text-align: center;
  max-width: 90%;
}
.ss-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(236, 214, 170, 0.25);
  border-top-color: var(--ss-accent);
  border-radius: 50%;
  animation: ss-spin 1s linear infinite;
  margin: 0 auto 12px;
}
@keyframes ss-spin { to { transform: rotate(360deg); } }
.ss-loading-card span { color: var(--ss-muted); font-size: 14px; }
.ss-win-card h2 {
  font-family: 'Outfit', sans-serif;
  margin: 0 0 6px;
  color: var(--ss-accent);
}
.ss-win-card p { margin: 0 0 14px; }
