/* Daily Sudoku */
.sudoku-page { padding-top: clamp(12px, 3vw, 40px); }
.sudoku-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; }
.sudoku-head h1 { font-size: clamp(36px, 5.4vw, 64px); margin-top: 10px; }
.date-nav { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px;
  border: 1px solid var(--rule); border-radius: 999px; background: transparent;
  color: var(--ink); text-decoration: none; font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.today-link { font: 500 13px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 6px; }
.today-link[hidden] { display: none; }

.levels { display: inline-flex; margin-top: 24px; border: 1px solid var(--rule); border-radius: 999px; padding: 4px; gap: 2px; }
.levels button {
  min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 500 15px/1 var(--sans); color: var(--muted);
}
.levels button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.levels button .tick { margin-left: 6px; color: var(--accent); }
.levels button[aria-pressed="true"] .tick { color: var(--paper); }

.play { margin-top: 24px; display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .play { grid-template-columns: minmax(0, 1fr); } .board-wrap { max-width: 560px; } }

.board-wrap { position: relative; container-type: inline-size; }
.board {
  display: grid; grid-template-columns: repeat(9, minmax(0, 1fr));
  border: 2px solid var(--ink); background: var(--rule); gap: 1px;
  user-select: none; -webkit-user-select: none;
}
.cell {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 0;
  background: var(--paper-2); color: var(--accent);
  font: 500 6cqi/1 var(--sans);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.cell:focus { outline: none; }
.cell.c3, .cell.c6 { border-left: 2px solid var(--ink); }
.cell.r3, .cell.r6 { border-top: 2px solid var(--ink); }
.cell.given { color: var(--ink); font-weight: 600; }
.cell.peer { background: color-mix(in srgb, var(--ink) 6%, var(--paper-2)); }
.cell.same { background: color-mix(in srgb, var(--accent) 16%, var(--paper-2)); }
.cell.selected { background: color-mix(in srgb, var(--accent) 30%, var(--paper-2)); }
.board:focus-within .cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.cell.conflict { color: #c0262d; }
.cell.conflict::after { content: ""; position: absolute; inset: 0; background: rgba(214, 40, 48, .12); pointer-events: none; }
@media (prefers-color-scheme: dark) { .cell.conflict { color: #ff6b6b; } }
.notes { position: absolute; inset: 6%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); }
.notes span { display: grid; place-items: center; font: 500 2.1cqi/1 var(--sans); color: var(--muted); }
.notes span.hit { color: var(--accent); font-weight: 700; }

/* win: a wave of light across the board (a nod to the LED piece) */
.board.won .cell { animation: wave 1.6s ease both; animation-delay: calc(var(--d) * 45ms); }
@keyframes wave {
  0% { background: var(--paper-2); }
  30% { background: #ffb347; color: #2a1606; box-shadow: 0 0 18px #ff8a2a; }
  60% { background: #e3192b; color: #fff; }
  100% { background: var(--paper-2); }
}
@media (prefers-reduced-motion: reduce) { .board.won .cell { animation: none; } }

.paused {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; text-align: center;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(6px); border: 2px solid var(--ink);
}
.paused[hidden] { display: none; }
.paused p { font: 400 36px/1 var(--serif); }
.noscript { padding: 24px; }

.panel { display: grid; gap: 18px; }
.clock { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); padding-bottom: 14px; }
.clock .time { font: 500 34px/1 var(--mono); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.clock .icon-btn { font-size: 12px; letter-spacing: -1px; }

.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .pad { grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; } }
.pad button {
  position: relative; min-height: 56px; border: 1px solid var(--rule); border-radius: 6px;
  background: var(--paper-2); color: var(--ink); cursor: pointer;
  font: 500 24px/1 var(--sans);
}
@media (max-width: 860px) { .pad button { min-height: 52px; font-size: 21px; } }
.pad button:hover { border-color: var(--ink); }
.pad button:active { transform: translateY(1px); }
.pad button small { position: absolute; right: 6px; bottom: 5px; font: 500 10px/1 var(--mono); color: var(--muted); }
.pad button.complete { opacity: .35; }
.panel.notes-on .pad button { color: var(--accent); font-size: 18px; font-style: italic; }

.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool {
  min-height: 46px; border: 1px solid var(--rule); border-radius: 6px; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; font: 500 14px/1 var(--sans); color: var(--ink);
}
.tool:hover { border-color: var(--ink); }
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool kbd, .help kbd {
  font: 500 10px/1 var(--mono); padding: 3px 5px; border-radius: 3px;
  border: 1px solid currentColor; opacity: .6;
}
@media (hover: none) { .tool kbd { display: none; } }

.status { min-height: 1.6em; font-size: 15px; color: var(--muted); }
.status.good { color: var(--jade); font-weight: 500; }
.done-actions[hidden] { display: none; }

.stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.stats div { padding: 14px 0 0; display: grid; gap: 6px; }
.stats dt { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font: 400 22px/1.1 var(--serif); }

.help { border-top: 1px solid var(--rule); padding-top: 14px; font-size: 15px; color: var(--muted); }
.help summary { cursor: pointer; color: var(--ink); font-weight: 500; min-height: 32px; }
.help p, .help ul { margin: 10px 0 0; }
.help ul { padding-left: 18px; display: grid; gap: 6px; }
.reset { margin-top: 14px; background: none; border: 0; padding: 8px 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: .2em; font-size: 14px; }
