/* Sudoku: the board, notes and the number pad. Shared tokens: games.css, play.css. User digits take the amber accent, selection is its glow. */ :root { --su-given: var(--ink); --su-user: var(--accent); --su-sel: var(--accent-line); --su-same: var(--accent-glow); --su-peer: #f4f1ea; --su-bad-bg: rgba(179, 38, 30, 0.14); --su-box: var(--ink2); } @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --su-peer: #232328; --su-bad-bg: rgba(236, 107, 92, 0.2); } } :root[data-theme="dark"] { --su-peer: #232328; --su-bad-bg: rgba(236, 107, 92, 0.2); } .su-board { display: grid; grid-template-columns: repeat(9, 1fr); width: var(--side, 360px); height: var(--side, 360px); user-select: none; -webkit-user-select: none; touch-action: manipulation; } .su-c { position: relative; display: grid; place-items: center; min-width: 0; border: 0 solid var(--line); border-width: 0 1px 1px 0; font: 500 calc(var(--side, 360px) / 9 * 0.56)/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; } .su-c.lc { border-right-width: 0; } .su-c.lr { border-bottom-width: 0; } .su-c.rb { border-right: 2px solid var(--su-box); } .su-c.bb { border-bottom: 2px solid var(--su-box); } .su-c.given { font-weight: 700; color: var(--su-given); } .su-c.user { color: var(--su-user); } .su-c.peer { background: var(--su-peer); } .su-c.same { background: var(--su-same); } .su-c.sel { background: var(--su-sel); } .su-c.bad { background: var(--su-bad-bg); color: var(--bad); } .su-c:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 1; } .su-notes { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 1px; } .su-notes i { display: grid; place-items: center; font: 600 max(var(--fs-caption), calc(var(--side, 360px) / 9 * 0.27))/1 var(--font); font-style: normal; color: var(--ink2); } .su-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); width: var(--side, 360px); max-width: 100%; } .su-board, .su-pad { margin: 0 auto; } .su-num { min-width: 0; min-height: 52px; padding: var(--sp-1) 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: var(--fs-sheet); border-radius: var(--radius); } .su-num small { font: 600 var(--fs-small)/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink2); height: 13px; } .su-num.done { opacity: 0.45; } /* Pencil is a toggle, so it reads as a selection (glow and amber line), never as the screen's one filled button. */ .su-tools { width: var(--side, 360px); max-width: 100%; flex-wrap: nowrap; } .su-tools .ar-btn { flex: 1 1 0; min-width: 0; min-height: var(--target); padding: 0 var(--sp-2); } .su-tools .ar-btn[aria-pressed="true"] { background: var(--accent-glow); border-color: var(--accent); color: var(--ink); font-weight: 650; } /* A row, column or box that comes right ripples through its cells; the win sweeps the board corner to corner. */ .su-c.flash { animation: su-flash 0.6s ease-out both; z-index: 2; } @keyframes su-flash { 0% { background: transparent; scale: 1; } 30% { background: var(--accent-line); scale: 1.14; } 100% { background: transparent; scale: 1; } } /* the key that completes a digit pops by a few pixels, less than the gap to its neighbours: a ring bigger than the other keys is never left on screen */ .su-num.pop { animation: su-key-pop 0.3s ease-out; } @keyframes su-key-pop { 0% { scale: 1; } 40% { scale: 1.04; border-color: var(--accent); } 100% { scale: 1; } } @media (prefers-reduced-motion: reduce) { html:not([data-anim="normal"]):not([data-anim="fast"]) .su-c.flash, html:not([data-anim="normal"]):not([data-anim="fast"]) .su-num.pop { animation: none; } }