/* 数独本体样式 — 颜色全部走 chrome.css 主题 token（浅色默认，深色随 data-theme） */

.wrap {
  width: min(92vw, 480px);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 56px) 0 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top { display: flex; align-items: center; gap: 12px; }
.top h1 { font-size: 24px; font-weight: 700; letter-spacing: -.3px; }
.back { color: var(--fg-secondary); font-size: 14px; white-space: nowrap; }
.back:hover { color: var(--fg); }
.timer {
  margin-left: auto; color: var(--accent); font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.pills { display: flex; gap: 8px; }
.pills button {
  flex: 1; background: var(--bg-raised); color: var(--fg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 7px 0; font-size: 14px; font-family: inherit; cursor: pointer;
  transition: color .15s, border-color .15s;
  touch-action: manipulation;
}
.pills button.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pills button:hover { color: var(--fg); }

.board-wrap { position: relative; }
.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  aspect-ratio: 1; width: 100%;
  background: var(--bg-panel);
  border: 2px solid color-mix(in srgb, var(--fg) 35%, transparent);
  border-radius: var(--radius-lg);
  overflow: hidden;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.cell {
  display: grid; place-items: center;
  font-size: clamp(18px, 4.6vw, 30px);
  font-weight: 600;
  color: var(--accent); /* 玩家数字 */
  border-right: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 8%, transparent);
  cursor: pointer;
}
.cell:nth-child(9n) { border-right: none; }
.cell:nth-child(n+73) { border-bottom: none; }
.cell.br { border-right: 2px solid color-mix(in srgb, var(--fg) 28%, transparent); }
.cell.bb { border-bottom: 2px solid color-mix(in srgb, var(--fg) 28%, transparent); }
.cell.given { color: var(--fg); }
.cell.peer { background: color-mix(in srgb, var(--fg) 4%, transparent); }
.cell.same { color: var(--accent); background: var(--accent-soft); }
.cell.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cell.conflict { color: #e5484d; background: rgba(229, 72, 77, .12); }
.cell.conflict.selected { box-shadow: inset 0 0 0 2px #e5484d; }
.notes {
  display: grid; grid-template-columns: repeat(3, 1fr);
  width: 100%; height: 100%; padding: 6%;
}
.notes span {
  display: grid; place-items: center;
  font-size: clamp(7px, 1.9vw, 11px); font-weight: 500;
  color: var(--fg-muted); line-height: 1;
}

.overlay {
  position: absolute; inset: 0; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}
.overlay.hidden { display: none; }
.win-title { font-size: 26px; font-weight: 800; }
.win-sub { color: var(--fg-secondary); }

.toolbar { display: flex; gap: 8px; }
.gbtn {
  flex: 1; background: var(--bg-raised); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 0; font-size: 14px; font-family: inherit; cursor: pointer;
  transition: border-color .15s, color .15s;
  touch-action: manipulation;
}
.gbtn:hover { border-color: var(--accent); }
.gbtn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.gbtn.primary {
  flex: none; padding: 10px 22px; color: #fff; border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  font-weight: 600;
}

.numpad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; }
.numpad button {
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--fg); font-family: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 52px; gap: 2px; cursor: pointer;
  transition: border-color .15s;
  touch-action: manipulation;
}
.numpad button:hover { border-color: var(--accent); }
.numpad button .d { font-size: 18px; font-weight: 700; line-height: 1; }
.numpad button .left { font-size: 10px; color: var(--fg-muted); line-height: 1; }
.numpad button.done .d { color: var(--fg-muted); }

.hint { color: var(--fg-muted); font-size: 12px; text-align: center; line-height: 1.7; }
