/* Direction: Calculator Black — true-black chrome, round keys, an amber operator column, a light numeric display */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  color-scheme: dark;
  --canvas: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --border: #38383a;
  --border-strong: #4d4d4d;
  --ink: #ffffff;
  --muted: #9d9da3;
  --accent: #ff9f0a;
  --accent-hover: #ffad2f;
  --accent-ink: #000000;
  --accent-text: #ffb340;
  --accent-strong: #ffbe5c;
  --accent-soft: #3a2708;
  --accent-border: #734805;
  --success: #30d158;
  --success-ink: #ffffff;
  --success-soft: #0b2e13;
  --success-strong: #30d158;
  --warning: #ffd60a;
  --warning-ink: #ffffff;
  --warning-soft: #382f02;
  --warning-strong: #ffd60a;
  --danger: #ff453a;
  --danger-ink: #ffffff;
  --danger-soft: #380f0d;
  --danger-strong: #ff453a;
  --chart-1: #ff9f0a;
  --chart-2: #9fd14a;
  --chart-3: #00b7ac;
  --chart-4: #86c4fd;
  --chart-5: #b87bed;
  --chart-6: #fc9fb1;

  --font-display: "Inter Tight", -apple-system, system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --display-weight: 300;
  --display-tracking: -0.03em;
  --radius-card: 22px;
  --radius-btn: 999px;
  --radius-input: 14px;
  --card-pad: 1.25rem;
  --x-key: #333336;
  --x-key-util: #5b5b60;
  --x-cell: #1b1b1d;
  --x-cell-lit: #2c2c2e;
  --x-on-key: #ffffff;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Inter", system-ui, sans-serif;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="light"] {
  color-scheme: light;
  --canvas: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --border: #dbdbdb;
  --border-strong: #b3b3b3;
  --ink: #000000;
  --muted: #666666;
  --accent: #ff9f0a;
  --accent-hover: #d98709;
  --accent-ink: #000000;
  --accent-text: #9b6006;
  --accent-strong: #9b6006;
  --accent-soft: #fff2dd;
  --accent-border: #ffd491;
  --success: #30d158;
  --success-ink: #000000;
  --success-soft: #e6f9eb;
  --success-strong: #1d7f35;
  --warning: #ffd60a;
  --warning-ink: #000000;
  --warning-soft: #fffae2;
  --warning-strong: #846f06;
  --danger: #ff453a;
  --danger-ink: #000000;
  --danger-soft: #ffe9e7;
  --danger-strong: #c7352d;
  --chart-1: #cc7e06;
  --chart-2: #749b2b;
  --chart-3: #1b8d84;
  --chart-4: #3998e5;
  --chart-5: #8e5db9;
  --chart-6: #e16e89;
}

/* The board ---------------------------------------------------------------- */
.board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 2px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  padding: 8px;
  user-select: none;
  touch-action: manipulation;
}

.cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-size: clamp(0.95rem, 4.3vw, 1.5rem);
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease, transform 0.1s ease;
}

.cell.given {
  color: var(--ink);
}

.cell.lit {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.cell.lit.given {
  color: var(--ink);
}

.cell.same {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.cell.wrong {
  color: var(--danger-strong);
}

.cell.sel {
  background: var(--accent);
  color: var(--accent-ink);
  transform: scale(1.05);
}

.cell.sel.wrong {
  color: var(--accent-ink);
}

.cell:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* 3x3 block separation */
.board .cell:nth-child(9n + 4),
.board .cell:nth-child(9n + 7) {
  margin-left: 5px;
}
.board .cell:nth-child(n + 28):nth-child(-n + 36),
.board .cell:nth-child(n + 55):nth-child(-n + 63) {
  margin-top: 5px;
}

.cell .notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 2px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.48rem;
  line-height: 1;
}
.cell .notes i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

/* The keypad --------------------------------------------------------------- */
.key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  transition: filter 0.12s ease, transform 0.08s ease, opacity 0.15s ease;
}
.key:hover {
  filter: brightness(1.2);
}
.key:active {
  transform: scale(0.94);
  filter: brightness(1.4);
}
.key:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.key .left {
  height: 0.7rem;
  font-family: var(--font-body);
  font-size: 0.6rem;
  color: var(--muted);
}
.key.done {
  opacity: 0.4;
}
.key.op {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.key.util {
  background: var(--border-strong);
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.key.op .icon,
.key.util .icon {
  width: 1.2rem;
  height: 1.2rem;
}
.key.wide {
  aspect-ratio: auto;
  flex-direction: row;
  gap: 0.45rem;
  padding: 1rem;
}
.key.on {
  background: var(--ink);
  color: var(--canvas);
}

/* Solved state ------------------------------------------------------------- */
.board.locked .cell {
  pointer-events: none;
}
