:root {
  --st-bg: #f8fafc;
  --st-card: #ffffff;
  --st-text: #0f172a;
  --st-muted: #64748b;
  --st-border: #cbd5e1;
  --st-border-dark: #334155;
  --st-primary: #0f172a;
  --st-primary-contrast: #ffffff;
  --st-accent: #4f46e5;
  --st-accent-soft: #eef2ff;
  --st-amazon: #f59e0b;
  --st-good: #059669;
  --st-bad: #dc2626;
  --st-shadow: 0 1px 3px rgba(15, 23, 42, 0.10), 0 1px 2px rgba(15, 23, 42, 0.06);
  --st-radius: 18px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--st-bg); color: var(--st-text); }
a { color: inherit; }
.st-sudoku-app { min-height: 100vh; padding: 24px 16px; background: var(--st-bg); }
.st-container { max-width: 1100px; margin: 0 auto; }
.st-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.st-title { margin: 0; font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.1; font-weight: 800; }
.st-subtitle { margin: 8px 0 0; color: var(--st-muted); font-size: 0.96rem; }
.st-header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.st-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(520px, 2fr); gap: 16px; align-items: start; }
.st-sidebar { display: grid; gap: 14px; }
.st-card { background: var(--st-card); border: 1px solid #e2e8f0; border-radius: var(--st-radius); box-shadow: var(--st-shadow); padding: 16px; }
.st-card-title { margin: 0 0 10px; font-size: 0.95rem; font-weight: 750; }
.st-card-text { margin: 0; color: #334155; font-size: 0.95rem; line-height: 1.45; }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.st-button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.st-btn, .st-select { border-radius: 12px; border: 1px solid var(--st-border); background: #fff; color: var(--st-text); padding: 9px 12px; font-size: 0.94rem; line-height: 1.1; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease; }
.st-btn:hover, .st-select:hover { background: #f8fafc; box-shadow: var(--st-shadow); }
.st-btn:active { transform: translateY(1px); }
.st-btn-primary { background: var(--st-primary); color: var(--st-primary-contrast); border-color: var(--st-primary); }
.st-btn-primary:hover { background: #1e293b; }
.st-btn-amazon { background: var(--st-amazon); color: #fff; border-color: var(--st-amazon); font-weight: 700; }
.st-btn-amazon:hover { background: #d97706; }
.st-btn-danger { color: #be123c; border-color: #fecdd3; }
.st-btn-active { border-color: var(--st-accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.18); }
.st-select { min-width: 120px; }
.st-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-stat { background: #f1f5f9; border-radius: 12px; padding: 10px; font-size: 0.84rem; color: #334155; }
.st-stat strong { display: block; margin-top: 4px; color: var(--st-text); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: 1.1rem; }
.st-tip { margin: 10px 0 0; color: var(--st-muted); font-size: 0.8rem; line-height: 1.35; }
.st-list { margin: 0; padding-left: 18px; color: #334155; font-size: 0.93rem; line-height: 1.45; }
.st-list li + li { margin-top: 5px; }
.st-board-card { padding: 18px; }
.st-board-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.st-board { display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); width: min(100%, 560px); aspect-ratio: 1 / 1; background: #fff; border: 2px solid var(--st-border-dark); }
.st-cell { display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--st-border); border-bottom: 1px solid var(--st-border); font-weight: 750; font-size: clamp(1.05rem, 4.2vw, 1.75rem); cursor: pointer; user-select: none; position: relative; color: var(--st-accent); background: #fff; }
.st-cell:nth-child(3n) { border-right-width: 2px; border-right-color: var(--st-border-dark); }
.st-cell:nth-child(9n) { border-right: 0; }
.st-cell:nth-child(n+19):nth-child(-n+27), .st-cell:nth-child(n+46):nth-child(-n+54) { border-bottom-width: 2px; border-bottom-color: var(--st-border-dark); }
.st-cell:nth-child(n+73) { border-bottom: 0; }
.st-cell-given { color: var(--st-text); background: #f8fafc; }
.st-cell-highlight { background: var(--st-accent-soft); }
.st-cell-same { background: #e0e7ff; }
.st-cell-selected { outline: 3px solid rgba(79,70,229,0.55); outline-offset: -3px; background: #dbeafe; }
.st-cell-wrong { color: var(--st-bad); }
.st-notes { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 100%; height: 100%; font-size: clamp(0.52rem, 1.7vw, 0.78rem); color: var(--st-muted); line-height: 1; }
.st-note { display: flex; align-items: center; justify-content: center; }
.st-number-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.st-pad-btn { min-width: 42px; min-height: 42px; }
.st-board-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: 12px; }
.st-message { color: var(--st-muted); font-size: 0.92rem; }
.st-message-good { color: var(--st-good); font-weight: 700; }
.st-message-bad { color: var(--st-bad); font-weight: 700; }
.st-footer { margin: 28px 0 8px; text-align: center; color: var(--st-muted); font-size: 0.82rem; }
.st-logo-line { display: flex; align-items: center; justify-content: center; gap: 8px; }
.st-logo { width: 28px; height: 28px; }
.st-quality { color: #334155; font-size: 0.9rem; line-height: 1.45; }
.st-quality .good { color: var(--st-good); font-weight: 700; }
.st-quality .bad { color: var(--st-bad); font-weight: 700; }
@media (max-width: 860px) {
  .st-header { flex-direction: column; }
  .st-header-actions { justify-content: flex-start; }
  .st-grid { grid-template-columns: 1fr; }
  .st-board { width: min(100%, 540px); }
}
@media (max-width: 520px) {
  .st-sudoku-app { padding: 16px 10px; }
  .st-header-actions, .st-button-row { gap: 6px; }
  .st-btn, .st-select { padding: 8px 9px; font-size: 0.86rem; }
  .st-card { padding: 13px; }
  .st-board-card { padding: 10px; }
  .st-board-footer { flex-direction: column; align-items: stretch; }
}
