.compact-sudokus {
  padding-block: 24px 26px;
}

.sudoku-catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(20px, 4vw, 42px);
  margin-bottom: 18px;
  border-radius: 16px;
  border: 1px solid #c4d3bb;
  background: #eff4e9;
  color: #234b3e;
}

.sudoku-heading-copy .eyebrow {
  color: #6c5527;
  margin: 0 0 8px;
}

.sudoku-catalog-heading h1 {
  font: clamp(32px, 5vw, 53px)/1.08 var(--serif);
  letter-spacing: -1.1px;
  color: inherit;
  width: auto;
  margin: 0 0 9px;
}

.sudoku-heading-copy > p:last-child {
  color: #365748;
  font-size: 15px;
  margin: 0;
}

.sudoku-hero-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  width: clamp(86px, 14vw, 130px);
  aspect-ratio: 1;
  padding: 4px;
  border: 1px solid #a9bd9d;
  border-radius: 10px;
  background: #f9faf3;
  transform: rotate(6deg);
  box-shadow: 3px 4px 0 #234b3e21;
}

.sudoku-hero-grid span {
  display: grid;
  place-items: center;
  min-height: 0;
  border-radius: 4px;
  background: #e0ead9;
  color: #234b3e;
  font: 600 clamp(13px, 2.3vw, 25px)/1 var(--serif);
}

.sudoku-hero-grid span:nth-child(5) {
  background: #f4dc9b;
  color: #173d31;
}

.sudoku-catalog-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1.5fr);
  gap: 16px;
  padding: 13px 17px;
  background: #e7efdf;
  border: 1px solid #bacdae;
  border-radius: 12px;
}

.sudoku-catalog-filters > div { min-width: 0; }

.sudoku-catalog-filters label {
  display: block;
  color: #214737;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
}

.sudoku-catalog-filters select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  color: #214737;
  background: #fffef9;
  border: 1px solid #a4ba98;
  border-radius: 7px;
  font: inherit;
  font-size: 15px;
}

:is(#sudoku-choice-count, #game-result-count) {
  font-size: 13px;
  color: #4c664b;
  margin: 7px 0 12px;
}

.sudoku-selection {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 17px 22px;
  border: 1px solid #bfceae;
  border-left: 5px solid #638550;
  border-radius: 12px;
  background: #fffef9;
  box-shadow: 0 5px 14px #203b2410;
}

.sudoku-selection-copy { min-width: 0; }

.sudoku-selection .sudoku-field-label,
.sudoku-card-meta > span:first-child {
  color: #546b4e;
  font: 700 10px/1.35 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0;
}

.sudoku-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  align-items: center;
  font-size: 14px;
  color: #214737;
}

.sudoku-level-tag {
  background: #e0ecd5;
  color: #244c39;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
}

.sudoku-selection-copy .sudoku-field-label { margin-top: 9px; }

.sudoku-selection-copy h2 {
  font: clamp(26px, 3.2vw, 36px)/1.15 var(--serif);
  letter-spacing: -.45px;
  overflow-wrap: anywhere;
  margin: 1px 0 8px;
}

.sudoku-selection .button {
  min-width: 140px;
  flex-shrink: 0;
  font-size: 16px;
  padding: 13px 22px;
  border-radius: 8px;
}

.sudoku-selection .button:hover {
  box-shadow: 0 4px 10px #234b3e2e;
}

.sudoku-light-action {
  background: #e5eee0;
  color: #234b3e;
  border: 1px solid #78916e;
}

.sudoku-light-action:hover {
  background: #d8e7d1;
}

.sudoku-catalog-note {
  font-size: 13px;
  color: #4c664b;
  margin: 12px 0 0;
}

.sudoku-catalog-filters select:focus-visible,
.sudoku-light-action:focus-visible {
  outline: 3px solid #a2782a;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .compact-sudokus { padding-top: 16px; }
  .sudoku-catalog-heading { padding: 18px 15px; gap: 13px; margin-bottom: 12px; }
  .sudoku-hero-grid { width: 70px; }
  .sudoku-catalog-heading h1 { font-size: clamp(27px, 7.5vw, 38px); }
  .sudoku-heading-copy > p:last-child { font-size: 13px; }
  .sudoku-catalog-filters { gap: 8px; padding: 10px; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .sudoku-catalog-filters > :has(#sudoku-choice, #game-choice) { grid-column: 1 / -1; }
  .sudoku-catalog-filters select { padding-inline: 6px; font-size: 14px; }
  .sudoku-selection { padding: 14px; gap: 11px; flex-direction: column; align-items: stretch; }
  .sudoku-selection .button { padding: 11px 16px; text-align: center; }
  .sudoku-catalog-note { font-size: 12px; line-height: 1.5; }
}

@media screen {
  html:has(> body.sudoku-page-shell) {
    scrollbar-gutter: stable;
  }

  body.sudoku-page-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .sudoku-page-shell .site-header .header-inner {
    max-width: 1220px;
  }

  body.sudoku-page-shell > footer {
    width: 100%;
    margin-top: auto;
    padding: 0;
    background: #eeefe7;
  }
}

.sudoku-page-shell .sudoku-game-actions {
  gap: 12px;
  margin: 16px 0;
}

.sudoku-page-shell .sudoku-game-actions .button {
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 700;
}

.sudoku-page-shell .sudoku-game-actions .sudoku-catalog-button {
  color: #234b3e;
  background: #eee3bd;
  border: 1px solid #aa8e48;
}

.sudoku-page-shell .sudoku-game-actions .sudoku-catalog-button:hover {
  background: #e4d5a5;
}

.sudoku-game-context {
  margin: 0 0 18px;
}

.sudoku-game-context a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sudoku-game-context:not(:has(a:not([hidden]))) {
  display: none;
}

@media (max-width: 460px) {
  .sudoku-page-shell .sudoku-game-actions .button {
    flex: 1 1 100%;
  }
}

#sudoku-resume {
  margin-block: 14px;
  padding: clamp(12px, 2.5vw, 20px);
  border: 1px solid #bfceae;
  border-left: 5px solid #638550;
  border-radius: 12px;
  background: #eff4e9;
}
#sudoku-resume[hidden] { display: none; }
.sudoku-resume-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1rem;
  margin-block-end: .75rem;
}
#sudoku-resume-title { font-size: clamp(20px, 3vw, 29px); margin: 0; }
#sudoku-resume-count { color: #3c5d44; font-size: .875rem; margin: 0; }

:is(#sudoku-results, #sudoku-resume-list, #game-results) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: .55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
:is(#sudoku-results, #sudoku-resume-list, #game-results) li { min-width: 0; }
.sudoku-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .3rem;
  min-block-size: 100%;
  padding: .95rem 1rem;
  border: 1px solid #d6decc;
  border-top: 3px solid #9aa77b;
  border-radius: 7px;
  background: #fffef9;
  box-shadow: 0 7px 22px #234b3e0c;
  color: var(--green);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.sudoku-result > strong { font-weight: inherit; }

.sudoku-result > span {
  align-self: flex-start;
  padding: .12em .65em;
  border-radius: 20px;
  background: #f0ecd7;
  color: #5e502b;
  font-size: .875em;
  font-weight: 400;
}

.sudoku-result > .sudoku-resume-action {
  padding: 0;
  background: transparent;
  color: #234b3e;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sudoku-result:hover {
  background: #edf2e5;
  border-color: #799468;
}
.sudoku-result:focus-visible {
  outline: 3px solid #9c742c;
  outline-offset: 3px;
}
:is(#sudoku-clear, #game-clear) { min-height: 44px; }
.sudoku-back-to-catalogue {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block-end: .35rem;
  color: #234b3e;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
