/* Modern Minimal — blues, grays, off-white, charcoal UI, black grid only */
html[data-theme="minimal"] {
  --ink: #2f3540;            /* charcoal UI text */
  --ink-mid: #3d4450;
  --ink-lit: #5a6270;
  --paper: #ffffff;
  --paper-edge: #e2e8f0;
  --line: #1a1a1a;           /* black grid lines */
  --line-strong: #0a0a0a;
  --accent: #2f6fed;         /* back / accents / badges */
  --accent-lit: #3b82f6;
  --warn: #ea580c;
  --given: #0a0a0a;          /* black board numbers */
  --entry: #0a0a0a;
  --conflict: #dc2626;
  --select: #3b82f6;
  --peer: rgba(59, 130, 246, 0.14);
  --same: rgba(245, 158, 11, 0.28);
  --same-ring: rgba(217, 119, 6, 0.55);
  --shadow: rgba(15, 23, 42, 0.1);
  --font-display: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", monospace;
  --min-bg: #eef1f6;
  --min-card: #f7f8fb;
  --min-muted: #5a6270;
  /* Stats + tools + numpad: muted blue-gray (touch darker, more blue) */
  --min-stat: #6e7a96;
  --min-icon: #6e7a96;
  --min-track: #e8ecf2;
  --content-inset-top: 6px;
  --content-inset-x: 10px;
  --card-inset-top: 0px;
  --card-inset-x: 0px;
  --card-inset-bottom: 0px;
}

html[data-theme="minimal"] body {
  color: var(--ink);
  background: var(--min-bg);
}

html[data-theme="minimal"] .atmosphere {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(47, 111, 237, 0.07), transparent 55%),
    linear-gradient(180deg, #f4f6fa 0%, var(--min-bg) 45%, #e4e9f0 100%);
}

html[data-theme="minimal"] .atmosphere::after {
  opacity: 0;
}

html[data-theme="minimal"] .backdrop-card {
  display: block;
  background: var(--min-card);
  border-radius: 20px 20px 0 0;
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.8),
    0 12px 40px rgba(15, 23, 42, 0.08);
}

/* —— Top chrome —— */
html[data-theme="minimal"] .back-btn .chrome-btn-label {
  display: none;
}

/* Back chevron + pause: same size, blue */
html[data-theme="minimal"] .chrome-top .back-btn,
html[data-theme="minimal"] .chrome-top #btnPause {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(47, 111, 237, 0.1);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}

html[data-theme="minimal"] .chrome-top #btnPause {
  border-radius: 999px;
  background: #cfe0ff;
  border-color: #a8c4f5;
}

html[data-theme="minimal"] .chrome-top .back-btn .chrome-btn-icon,
html[data-theme="minimal"] .chrome-top #btnPause .chrome-btn-icon {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
}

html[data-theme="minimal"] .chrome-top #btnPause .chrome-btn-icon {
  font-size: 16px;
}

html[data-theme="minimal"] .chrome-top .back-btn:hover,
html[data-theme="minimal"] .chrome-top .back-btn:focus-visible,
html[data-theme="minimal"] .chrome-top #btnPause:hover,
html[data-theme="minimal"] .chrome-top #btnPause:focus-visible {
  background: rgba(47, 111, 237, 0.18);
  color: var(--accent);
}

html[data-theme="minimal"] .chrome-top #btnPause:hover,
html[data-theme="minimal"] .chrome-top #btnPause:focus-visible {
  background: #b9d2ff;
}

html[data-theme="minimal"] .chrome-score-value,
html[data-theme="minimal"] #highScore,
html[data-theme="minimal"] .stat-label,
html[data-theme="minimal"] .stat-value {
  color: var(--min-stat);
  opacity: 1;
}

html[data-theme="minimal"] .chrome-score-value {
  font-weight: 800;
}

html[data-theme="minimal"] .chrome-top .stat {
  background: rgba(47, 111, 237, 0.08);
  border: 1px solid rgba(47, 111, 237, 0.2);
}

html[data-theme="minimal"] .stat-label {
  font-weight: 600;
}

html[data-theme="minimal"] .stat-value {
  font-weight: 700;
}

html[data-theme="minimal"] .chrome-btn {
  color: var(--ink);
}

/* —— Board: black numbers + black lines only —— */
html[data-theme="minimal"] .board-slot {
  background: transparent;
  border: none;
  padding: 0;
}

html[data-theme="minimal"] .board {
  background: #fff;
  border: 2px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--shadow);
  color: var(--given);
  overflow: hidden;
}

html[data-theme="minimal"] .cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--given);
}

html[data-theme="minimal"] .cell.box-r {
  border-right: 2.5px solid var(--line-strong);
}

html[data-theme="minimal"] .cell.box-b {
  border-bottom: 2.5px solid var(--line-strong);
}

html[data-theme="minimal"] .cell.given,
html[data-theme="minimal"] .cell.given .glyph {
  color: var(--given);
  font-weight: 700;
}

html[data-theme="minimal"] .cell.entry,
html[data-theme="minimal"] .cell.entry .glyph {
  color: var(--entry);
  font-weight: 700;
}

html[data-theme="minimal"] .cell.selected {
  background: var(--select);
  box-shadow: none;
  color: #fff;
}

html[data-theme="minimal"] .cell.selected .glyph {
  color: #fff;
}

/* Pulse clears the blue fill — keep digits dark on the white board */
html[data-theme="minimal"] .cell.unit-pulse .glyph,
html[data-theme="minimal"] .cell.selected.unit-pulse .glyph {
  color: var(--entry);
}

html[data-theme="minimal"] .cell.unit-pulse {
  animation-name: minimal-unit-cell-pulse;
}

html[data-theme="minimal"] .cell.peer {
  background: var(--peer);
}

html[data-theme="minimal"] .cell.same,
html[data-theme="minimal"] .cell.peer.same {
  background: var(--same);
  box-shadow: inset 0 0 0 2px var(--same-ring);
}

html[data-theme="minimal"] .cell.conflict .glyph,
html[data-theme="minimal"] .cell.conflict .notes {
  color: var(--conflict);
}

html[data-theme="minimal"] .notes {
  color: rgba(74, 81, 96, 0.35);
}

html[data-theme="minimal"] .notes span.on {
  color: var(--min-icon);
  opacity: 1;
}

/* —— Tools: charcoal / gray icons; blue badges only —— */
html[data-theme="minimal"] .tools {
  background: transparent;
  border: none;
  gap: 10px;
  padding: 0 4px;
}

html[data-theme="minimal"] .tools .btn-tool {
  background: #fff;
  border: 1.5px solid #c5cad3;
  border-radius: 14px;
  color: var(--min-stat);
  aspect-ratio: 1;
  max-width: 72px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html[data-theme="minimal"] .tools .btn-tool:hover,
html[data-theme="minimal"] .tools .btn-tool:focus-visible {
  background: #f3f5f8;
  border-color: #9aa3b2;
  color: var(--min-stat);
}

html[data-theme="minimal"] .tools .btn-tool[aria-pressed="true"] {
  background: #eef1f6;
  border-color: var(--accent);
  color: var(--min-stat);
  box-shadow: inset 0 0 0 1px var(--accent);
}

html[data-theme="minimal"] .tools .btn-tool:disabled {
  opacity: 0.35;
  border-color: var(--paper-edge);
  color: var(--min-stat);
  box-shadow: none;
}

html[data-theme="minimal"] .tool-icon,
html[data-theme="minimal"] .tool-label {
  color: var(--min-stat);
}

html[data-theme="minimal"] .tools .btn-tool:disabled .tool-icon,
html[data-theme="minimal"] .tools .btn-tool:disabled .tool-label {
  color: var(--min-stat);
}

html[data-theme="minimal"] .tool-label {
  opacity: 1;
  font-weight: 600;
}

html[data-theme="minimal"] .tool-badge {
  top: 2px;
  right: 4px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 1;
}

html[data-theme="minimal"] .tools .btn-tool[aria-pressed="true"] .tool-badge {
  background: var(--accent);
  color: #fff;
}

html[data-theme="minimal"] .tool-badge.is-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  right: 2px;
  top: 2px;
}

html[data-theme="minimal"] .tool-icon-hint {
  border-color: currentColor;
}

/* —— Numpad: charcoal digits on white keys —— */
html[data-theme="minimal"] .pad-wrap {
  background: var(--min-track);
  border: none;
  border-radius: 14px;
  padding: 8px;
}

html[data-theme="minimal"] .numpad {
  gap: 6px;
}

html[data-theme="minimal"] .num-btn {
  background: #fff;
  border: 1px solid #d5dae3;
  border-radius: 10px;
  color: var(--min-stat);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

html[data-theme="minimal"] .num-btn:hover {
  border-color: #9aa3b2;
  background: #f7f8fb;
  color: var(--min-stat);
}

html[data-theme="minimal"] .num-btn:active {
  background: #eef1f6;
  color: var(--min-stat);
}

html[data-theme="minimal"] .num-btn.exhausted {
  opacity: 0.28;
  color: var(--min-stat);
}

/* —— Splash / menus / overlays —— */
html[data-theme="minimal"] .field-select,
html[data-theme="minimal"] .menu-trigger,
html[data-theme="minimal"] .btn {
  background: #fff;
  border: 1px solid var(--paper-edge);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="minimal"] .btn-primary {
  background: linear-gradient(135deg, var(--accent-lit), var(--accent));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.28);
}

html[data-theme="minimal"] .menu-list {
  background: #fff;
  border: 1px solid var(--paper-edge);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

html[data-theme="minimal"] .menu-option {
  color: var(--ink);
}

html[data-theme="minimal"] .menu-option:hover,
html[data-theme="minimal"] .menu-option:focus-visible,
html[data-theme="minimal"] .menu-option.is-selected {
  background: rgba(47, 111, 237, 0.1);
  color: var(--accent);
}

html[data-theme="minimal"] .splash-title {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--ink);
}

html[data-theme="minimal"] .splash-sub,
html[data-theme="minimal"] .field-label,
html[data-theme="minimal"] .back {
  color: var(--min-muted);
}

html[data-theme="minimal"] .overlay {
  background: rgba(15, 23, 42, 0.35);
}

html[data-theme="minimal"] .overlay-card {
  background: #fff;
  border: 1px solid var(--paper-edge);
  color: var(--ink);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

html[data-theme="minimal"] .overlay-card h2 {
  color: var(--ink);
}

html[data-theme="minimal"] .overlay-card p {
  color: var(--min-muted);
}

html[data-theme="minimal"] .settings-actions .btn-tool {
  width: 100%;
  aspect-ratio: auto;
  border-radius: 12px;
  flex-direction: row;
  background: #fff;
  border: 1px solid var(--paper-edge);
  color: var(--ink);
}

@keyframes minimal-unit-cell-pulse {
  0% { background-color: transparent; box-shadow: none; }
  28% {
    background-color: rgba(59, 130, 246, 0.4);
    box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.55);
  }
  100% { background-color: transparent; box-shadow: none; }
}
