:root {
  color-scheme: light;
  --page: #f3f1eb;
  --page-glow: rgba(92, 88, 215, 0.1);
  --surface: #fdfcf9;
  --surface-raised: #ffffff;
  --surface-muted: #f4f3ef;
  --ink: #20222a;
  --ink-soft: #6c6d76;
  --ink-faint: #93949c;
  --line: #d8d6cf;
  --line-soft: #e9e7e1;
  --grid-line: #9c9ca4;
  --grid-strong: #292b32;
  --accent: #5c58d7;
  --accent-deep: #4743bb;
  --accent-soft: #e9e8ff;
  --accent-softer: #f3f2ff;
  --related: #f0effb;
  --same: #dedcff;
  --danger: #bc3d45;
  --danger-soft: #fde5e5;
  --warning: #9a6a12;
  --warning-soft: #fff1cf;
  --success: #248462;
  --success-soft: #ddf4e9;
  --shadow: 0 22px 55px rgba(32, 34, 42, 0.09), 0 2px 8px rgba(32, 34, 42, 0.04);
  --grid-heavy: 3px;
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #14151a;
  --page-glow: rgba(130, 125, 255, 0.11);
  --surface: #1d1f25;
  --surface-raised: #24262d;
  --surface-muted: #292b32;
  --ink: #f4f3ef;
  --ink-soft: #b6b5bd;
  --ink-faint: #85858e;
  --line: #3a3c44;
  --line-soft: #30323a;
  --grid-line: #5f616c;
  --grid-strong: #e8e7e2;
  --accent: #9692ff;
  --accent-deep: #b2afff;
  --accent-soft: #3b386f;
  --accent-softer: #2a2941;
  --related: #2a2b3c;
  --same: #44417b;
  --danger: #ff9298;
  --danger-soft: #4b292e;
  --warning: #f4c765;
  --warning-soft: #423820;
  --success: #65d1a8;
  --success-soft: #203f35;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --page: #14151a;
    --page-glow: rgba(130, 125, 255, 0.11);
    --surface: #1d1f25;
    --surface-raised: #24262d;
    --surface-muted: #292b32;
    --ink: #f4f3ef;
    --ink-soft: #b6b5bd;
    --ink-faint: #85858e;
    --line: #3a3c44;
    --line-soft: #30323a;
    --grid-line: #5f616c;
    --grid-strong: #e8e7e2;
    --accent: #9692ff;
    --accent-deep: #b2afff;
    --accent-soft: #3b386f;
    --accent-softer: #2a2941;
    --related: #2a2b3c;
    --same: #44417b;
    --danger: #ff9298;
    --danger-soft: #4b292e;
    --warning: #f4c765;
    --warning-soft: #423820;
    --success: #65d1a8;
    --success-soft: #203f35;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 300px;
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 12%, var(--page-glow), transparent 34rem),
    var(--page);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:not(:disabled),
summary {
  cursor: pointer;
}

button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 27px;
  height: 27px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 2px;
  padding: 3px;
  border: 2px solid var(--ink);
  border-radius: 7px;
}

.brand-mark span {
  background: var(--ink);
  border-radius: 1px;
  opacity: 0.88;
}

.brand-mark span:nth-child(even) {
  opacity: 0.28;
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  font-size: 0.82rem;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--grid-line);
  color: var(--ink);
  background: var(--surface);
}

.theme-icon {
  width: 18px;
  height: 18px;
  display: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="system"] .theme-icon-system,
:root[data-theme="light"] .theme-icon-light,
:root[data-theme="dark"] .theme-icon-dark {
  display: block;
}

.page-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 30px auto 70px;
  display: grid;
  grid-template-columns: minmax(190px, 0.32fr) minmax(680px, 0.92fr);
  align-items: start;
  gap: clamp(30px, 5vw, 72px);
}

.intro {
  padding-top: 50px;
}

.eyebrow,
.modal-kicker {
  margin: 0 0 14px;
  color: var(--accent-deep);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro h1 {
  max-width: 390px;
  margin: 0;
  font-size: clamp(2.4rem, 4.3vw, 4.25rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.intro h1 span {
  color: var(--ink-soft);
}

.intro-copy {
  max-width: 310px;
  margin: 24px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.game-card {
  min-width: 0;
  padding: clamp(22px, 3.4vw, 34px);
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.game-meta {
  min-height: 52px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line-soft);
}

.difficulty-meta,
.timer-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timer-meta {
  align-items: flex-end;
}

.meta-label {
  color: var(--ink-faint);
  font-size: 0.67rem;
  font-weight: 760;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.difficulty-value,
#timer {
  min-height: 25px;
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.difficulty-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.difficulty-value i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink-faint) 12%, transparent);
}

.difficulty-value[data-level="easy"] i {
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 13%, transparent);
}

.difficulty-value[data-level="medium"] i {
  background: var(--warning);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 13%, transparent);
}

.difficulty-value[data-level="hard"] i {
  background: var(--danger);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 13%, transparent);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(350px, 1fr) minmax(190px, 0.48fr);
  align-items: start;
  gap: clamp(24px, 3.7vw, 40px);
}

.board-column {
  min-width: 0;
}

.board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}

.board {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--grid-heavy) solid var(--grid-strong);
  border-radius: 12px;
  background: var(--surface-raised);
  isolation: isolate;
  transition: opacity 180ms ease;
}

.board-row {
  min-height: 0;
  display: grid;
  flex: 1 1 0;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.board.is-loading {
  opacity: 0.18;
  pointer-events: none;
}

.board-loader {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  color: var(--ink-soft);
  font-size: 0.83rem;
  font-weight: 650;
}

.board-loader[hidden] {
  display: none;
}

.loader-grid {
  width: 34px;
  height: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  transform: rotate(0deg);
  animation: loader-spin 1.3s ease-in-out infinite;
}

.loader-grid i {
  border-radius: 4px;
  background: var(--accent);
}

.loader-grid i:nth-child(2),
.loader-grid i:nth-child(3) {
  opacity: 0.35;
}

@keyframes loader-spin {
  50% { transform: rotate(90deg); }
  100% { transform: rotate(180deg); }
}

.cell {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--grid-line);
  border-bottom: 1px solid var(--grid-line);
  border-radius: 0;
  color: var(--accent-deep);
  background: var(--surface-raised);
  font-size: clamp(1.42rem, 4.1vw, 2.15rem);
  font-variant-numeric: tabular-nums;
  font-weight: 580;
  line-height: 1;
  transition: background-color 100ms ease, color 100ms ease, box-shadow 100ms ease;
}

.cell:nth-child(6n) {
  border-right: 0;
}

.board-row:last-child .cell {
  border-bottom: 0;
}

.cell.box-right {
  border-right: var(--grid-heavy) solid var(--grid-strong);
}

.cell.box-bottom {
  border-bottom: var(--grid-heavy) solid var(--grid-strong);
}

.cell:not(.is-given):hover {
  background: var(--accent-softer);
}

.cell.is-related {
  background: var(--related);
}

.cell.is-same {
  background: var(--same);
}

.cell.is-given {
  color: var(--ink);
  font-weight: 790;
}

.cell.is-selected {
  z-index: 4;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 3px var(--accent);
}

.cell.is-conflict {
  z-index: 3;
  color: var(--danger);
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 2px var(--danger);
}

.cell.is-selected.is-conflict {
  box-shadow: inset 0 0 0 3px var(--danger), inset 0 0 0 6px var(--surface-raised);
}

.cell.is-hint {
  z-index: 5;
  background: var(--warning-soft);
  box-shadow: inset 0 0 0 3px var(--warning);
  animation: hint-pulse 900ms ease-in-out 2;
}

.cell.is-hint-value::after {
  content: "✦";
  position: absolute;
  top: 6px;
  right: 7px;
  color: var(--warning);
  font-size: 0.56rem;
}

@keyframes hint-pulse {
  50% { background: color-mix(in srgb, var(--warning-soft) 55%, var(--surface-raised)); }
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.number-pad button {
  position: relative;
  min-width: 0;
  min-height: 52px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--accent-deep);
  background: var(--surface-raised);
  font-size: 1.25rem;
  font-weight: 730;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--line) 75%, transparent);
  transition: transform 80ms ease, background 100ms ease, border-color 100ms ease;
}

.number-pad button > span {
  display: inline-block;
  transform: translateY(-1px);
}

.number-pad button > small {
  position: absolute;
  right: 6px;
  bottom: 5px;
  min-width: 14px;
  color: var(--ink-faint);
  font-size: 0.58rem;
  font-weight: 760;
  line-height: 1;
  text-align: center;
}

.number-pad button:hover:not(:disabled),
.number-pad button.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.number-pad button:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.number-pad button.is-complete:not(.is-active) {
  color: var(--ink-faint);
  background: var(--surface-muted);
}

.number-pad button.is-complete > small {
  opacity: 0.58;
}

.number-pad button:disabled {
  cursor: default;
  opacity: 0.48;
  box-shadow: none;
}

.controls-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.control-button {
  min-width: 0;
  min-height: 67px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface-raised);
  font-size: 0.7rem;
  font-weight: 680;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.control-button svg,
.new-game-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-button:hover:not(:disabled) {
  border-color: var(--grid-line);
  color: var(--ink);
  background: var(--surface-muted);
}

.control-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.hint-button {
  color: var(--accent-deep);
  background: var(--accent-softer);
}

.hint-card {
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--warning) 38%, var(--line));
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  color: var(--ink);
}

.hint-card[hidden] {
  display: none;
}

.hint-card-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

.hint-bulb {
  color: var(--warning);
}

.icon-button {
  width: 28px;
  height: 28px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: transparent;
  font-size: 1.2rem;
  line-height: 1;
}

.icon-button:hover {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
}

.hint-card p {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.48;
}

.hint-card-actions {
  margin-top: 11px;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--warning);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 780;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.new-game-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-raised);
  font-size: 0.83rem;
  font-weight: 720;
  transition: transform 80ms ease, border-color 120ms ease, background 120ms ease;
}

.new-game-button:hover {
  border-color: var(--grid-line);
  background: var(--surface-muted);
}

.new-game-button:active {
  transform: translateY(1px);
}

.rules {
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.rules summary {
  padding: 15px 1px 6px;
  color: var(--ink-soft);
  font-weight: 670;
  list-style-position: inside;
}

.rules p {
  margin: 5px 0 0;
  line-height: 1.55;
}

.site-footer {
  width: min(1180px, calc(100% - 48px));
  margin: -42px auto 28px;
  color: var(--ink-faint);
  font-size: 0.76rem;
  text-align: center;
}

.site-footer a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--ink-soft);
}

.modal {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100svh - 30px);
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.28);
}

.modal::backdrop {
  background: rgba(16, 17, 22, 0.53);
  backdrop-filter: blur(5px);
}

.modal[open] {
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.modal-panel {
  position: relative;
  max-height: calc(100svh - 30px);
  margin: 0;
  padding: 31px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 1.35rem;
  line-height: 1;
}

.modal h2 {
  margin: 0;
  padding-right: 28px;
  font-size: clamp(1.55rem, 5vw, 2rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.modal-panel > p:not(.modal-kicker):not(.replace-warning):not(.result-time) {
  margin: 12px 0 22px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.difficulty-options {
  display: grid;
  gap: 8px;
}

.difficulty-option {
  width: 100%;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface-raised);
  text-align: left;
  transition: border-color 120ms ease, transform 100ms ease, background 120ms ease;
}

.difficulty-option:hover {
  border-color: var(--accent);
  background: var(--accent-softer);
  transform: translateY(-1px);
}

.difficulty-option > span:first-child {
  display: flex;
  flex-direction: column;
}

.difficulty-option strong {
  font-size: 0.91rem;
}

.difficulty-option small {
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.difficulty-option.surprise {
  margin-bottom: 6px;
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-softer);
}

.difficulty-option.surprise > span:last-child {
  font-size: 1.3rem;
}

.level-dots {
  display: flex;
  gap: 4px;
}

.level-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.level-dots i:nth-child(n + 2) {
  background: var(--line);
}

.level-dots.is-medium i:nth-child(1),
.level-dots.is-medium i:nth-child(2) {
  background: var(--warning);
}

.level-dots.is-medium i:nth-child(3) {
  background: var(--line);
}

.level-dots.is-hard i {
  background: var(--danger);
}

.replace-warning {
  margin: 16px 0 0;
  color: var(--danger);
  font-size: 0.76rem;
  text-align: center;
}

.result-panel {
  padding: 36px 31px 31px;
  text-align: center;
}

.success-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: var(--success);
  background: var(--success-soft);
}

.success-mark svg {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-panel h2 {
  padding: 0;
}

.result-time {
  margin: 12px 0 24px;
  color: var(--ink-soft);
}

.result-time strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.result-actions {
  display: grid;
  gap: 9px;
}

.primary-button,
.secondary-button {
  min-height: 49px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--accent);
  color: #fff;
  background: #5c58d7;
}

.primary-button:hover {
  background: #4c48c6;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface-raised);
}

@media (max-width: 1040px) {
  .page-shell {
    max-width: 820px;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 5px;
  }

  .intro {
    padding-top: 10px;
    text-align: center;
  }

  .intro h1,
  .intro-copy {
    max-width: 560px;
    margin-right: auto;
    margin-left: auto;
  }

  .intro h1 br {
    display: none;
  }

  .intro-copy {
    margin-top: 13px;
  }
}

@media (max-width: 720px) {
  .site-header,
  .page-shell {
    width: min(100% - 28px, 580px);
  }

  .site-header {
    min-height: 68px;
  }

  .page-shell {
    margin-bottom: 30px;
    gap: 22px;
  }

  .intro h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .intro-copy {
    max-width: 430px;
    font-size: 0.87rem;
  }

  .game-card {
    padding: 20px;
    border-radius: 24px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    gap: 21px;
  }

  .controls-column {
    gap: 11px;
  }

  .control-button {
    min-height: 60px;
    flex-direction: row;
    gap: 7px;
    font-size: 0.76rem;
  }

  .control-button svg {
    width: 18px;
    height: 18px;
  }

  .rules summary {
    padding-top: 13px;
  }

  .site-footer {
    width: calc(100% - 28px);
    margin-top: -10px;
  }
}

@media (max-width: 430px) {
  .site-header,
  .page-shell {
    width: calc(100% - 20px);
  }

  .brand {
    font-size: 0.97rem;
  }

  .theme-toggle {
    min-height: 40px;
    padding: 0 11px;
  }

  .theme-toggle span {
    display: none;
  }

  .intro {
    padding-top: 2px;
  }

  .eyebrow {
    margin-bottom: 8px;
  }

  .intro-copy {
    margin-top: 10px;
  }

  .game-card {
    padding: 16px;
    border-radius: 21px;
  }

  .game-meta {
    margin-bottom: 15px;
    padding-bottom: 13px;
  }

  .cell {
    font-size: clamp(1.32rem, 8vw, 1.85rem);
  }

  .cell.is-hint-value::after {
    top: 4px;
    right: 5px;
  }

  .number-pad {
    gap: 5px;
    margin-top: 9px;
  }

  .number-pad button {
    min-height: 47px;
    border-radius: 9px;
    font-size: 1.1rem;
  }

  .control-actions {
    gap: 5px;
  }

  .control-button {
    min-height: 54px;
    flex-direction: column;
    gap: 3px;
    font-size: 0.68rem;
  }

  .modal-panel {
    padding: 27px 20px 22px;
  }
}

@media (max-width: 340px) {
  .site-header,
  .page-shell {
    width: calc(100% - 12px);
  }

  .game-card {
    padding: 11px;
  }

  .intro-copy {
    display: none;
  }

  .number-pad button {
    min-height: 43px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@supports not (color: color-mix(in srgb, black, white)) {
  button:focus-visible,
  summary:focus-visible,
  a:focus-visible {
    outline-color: var(--accent);
  }
}
