:root {
  color-scheme: light;
  --paper: #f7f4eb;
  --surface: #fbf8f0;
  --ink: #172538;
  --muted: #4d514d;
  --line: #b7b1a4;
  --rust: #a63816;
  --olive: #56633a;
  --display: Impact, "Arial Narrow", "Helvetica Neue Condensed", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 16px/1.55 var(--body); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
a:hover { color: var(--rust); }
:focus-visible { outline: 3px solid #a63816; outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 5; padding: .65rem; background: var(--surface); }
.skip-link:focus { top: .5rem; }
.shell { width: min(100% - 72px, 1180px); margin-inline: auto; }
.masthead { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 2px solid var(--ink); }
.wordmark { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font: 2.1rem/1 var(--display); letter-spacing: .01em; }
.brand-mark { width: 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.brand-mark i { aspect-ratio: 1; background: var(--rust); border-radius: 1px; }
.desktop-nav { display: flex; gap: 30px; font-weight: 750; }
.desktop-nav a { padding: 3px 0; text-decoration: none; border-bottom: 2px solid transparent; }
.desktop-nav a[aria-current] { border-color: var(--rust); }
.site-search { display: flex; align-items: stretch; width: 250px; height: 43px; border: 1px solid var(--ink); border-radius: 5px; background: var(--surface); }
.site-search input { width: 100%; min-width: 0; border: 0; background: transparent; padding-inline: 10px; border-radius: 4px 0 0 4px; }
.site-search button { width: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 0 4px 4px 0; }
.search-icon { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid currentColor; position: relative; margin-right: 4px; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; background: currentColor; top: 9px; left: 8px; transform: rotate(45deg); }
.mobile-menu { display: none; }
.main { padding-block: 33px 57px; min-height: 65vh; }
h1, h2 { font-family: var(--display); font-weight: 500; line-height: 1.02; letter-spacing: .012em; text-transform: uppercase; }
h1 { font-size: clamp(2.8rem, 6.8vw, 6.6rem); margin: 0 0 .2em; }
h2 { font-size: clamp(1.65rem, 3.2vw, 3rem); margin: 0; }
p { margin: 0 0 1rem; }
.intro { font-size: clamp(1.04rem, 1.7vw, 1.32rem); line-height: 1.45; max-width: 540px; }
.text-link { color: var(--rust); font-weight: 750; text-underline-offset: .23em; }
.text-link:hover { color: var(--ink); }
.catalog-hero { display: grid; align-items: center; gap: clamp(28px, 6vw, 80px); padding: clamp(25px, 5vw, 56px); border: 1px solid var(--ink); border-radius: 12px; background: var(--surface); }
.catalog-hero.with-feature { grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr); }
.catalog-intro { min-width: 0; }
.catalog-intro h1 { max-width: 14ch; font-size: clamp(2.9rem, 6.2vw, 6.35rem); }
.hero-search, .results-search { width: min(100%, 480px); height: 50px; margin-block: 19px 13px; }
.hero-search button, .results-search button { color: white; background: var(--rust); }
.hero-search button:hover, .results-search button:hover { background: #872b0e; }
.catalog-intro .filters { margin-top: 17px; }
.home-feature { min-width: 0; }
.home-feature h2, .home-collections h2 { font-size: clamp(1.35rem, 2.7vw, 2.1rem); }
.home-feature h2 { margin-bottom: 9px; }
.featured-cards { display: grid; gap: 8px; }
.featured-cards .card-art { min-height: 139px; }
.featured-cards .art-grid { width: 102px; }
.home-collections { margin-top: 34px; padding-top: 23px; border-top: 1px solid var(--line); }
.home-collections ul { margin: 12px 0 0; padding: 0; list-style: none; }
.home-collections a { display: grid; gap: 3px; max-width: 43rem; border-block: 1px solid var(--line); padding: 11px 0; text-decoration-color: var(--rust); text-underline-offset: .2em; }
.home-collections a span { color: var(--muted); font-size: .94rem; text-decoration: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 20px; margin-bottom: 18px; }
.related { margin-top: 34px; }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.game-card { display: flex; flex-direction: column; position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); text-decoration: none; transition: border-color .16s, translate .16s; }
.game-card:hover { border-color: var(--rust); translate: 0 -2px; }
.card-art { min-height: 118px; width: 100%; display: grid; place-items: center; background: var(--cream, #e4dac5); color: var(--ink); overflow: hidden; }
.card-art img { width: 100%; height: 100%; max-height: 145px; object-fit: cover; }
.art-slider { background: #b44722; color: #fff5df; }
.art-sudoku { background: #20334a; color: #fff5df; }
.art-fibonacci { background: #526439; color: #fff5df; }
.art-dots { background: #e8d8ad; color: #172538; }
.art-lights { background: #75402a; color: #ffe1a4; }
.art-grid { width: 84px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; }
.art-grid i { display: grid; place-items: center; min-width: 0; border: 1px solid currentColor; border-radius: 2px; font: 750 13px/1 var(--body); font-style: normal; }
.art-dots .art-grid i:nth-child(5) { background: var(--rust); color: var(--surface); }
.art-fibonacci .art-grid i:nth-child(3n) { background: #f7f4eb; color: #394a26; }
.art-lights .art-grid i:nth-child(odd) { background: #ffe1a4; color: #75402a; }
.card-copy { display: grid; gap: 5px; padding: 15px 30px 15px 14px; }
.card-copy strong { font: 1.26rem/1.08 var(--display); text-transform: uppercase; letter-spacing: .018em; }
.card-copy > span { color: var(--muted); font-size: .9rem; line-height: 1.42; }
.card-arrow { position: absolute; bottom: 13px; right: 12px; font-weight: 800; }

.guide { border-top: 1px solid var(--line); margin-top: 37px; padding-top: 24px; max-width: 68ch; }
.guide h2 { font-size: clamp(1.45rem, 2.6vw, 2.2rem); }
.guide ol { padding-left: 1.45rem; }
.guide li + li { margin-top: .55rem; }
.source { font-size: .87rem; color: var(--muted); }
.breadcrumb { margin-bottom: 14px; font-size: .9rem; color: var(--muted); }
.breadcrumb a { text-underline-offset: .2em; }
.breadcrumb span { padding-inline: .35em; }
.game-detail h1, .list-heading h1, .plain h1 { font-size: clamp(2.85rem, 6vw, 5.7rem); }
.detail-layout { display: grid; grid-template-columns: minmax(270px, 480px) minmax(0, 1fr); align-items: start; gap: clamp(26px, 5vw, 64px); margin-top: 23px; }
.detail-layout .game-player { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: clamp(14px, 3vw, 25px); }
.detail-layout .guide { margin: 0; border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 26px; }
.game-categories { margin-top: 20px; }
.catalog-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; }
.catalog-tools .site-search { width: min(100%, 390px); min-height: 44px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filters a { border: 1px solid var(--line); border-radius: 5px; display: inline-flex; align-items: center; min-height: 42px; padding: 3px 13px; text-decoration: none; font-size: .9rem; font-weight: 650; }
.filters a[aria-current] { background: var(--rust); color: #fff; border-color: var(--rust); }
.catalog-count { color: var(--muted); margin: 13px 0 9px; font-size: .875rem; }
.catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-grid .game-card { flex-direction: row; align-items: center; min-height: 112px; }
.catalog-grid .card-art { min-height: 110px; width: 128px; align-self: stretch; flex: 0 0 128px; }
.catalog-grid .card-art img { max-height: none; }
.catalog-grid .card-copy { padding-left: 18px; }
.empty { padding: 1.2rem; border: 1px solid var(--line); border-radius: 5px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-block: 19px; }
.pagination .secondary { display: inline-flex; align-items: center; text-decoration: none; }
.search-page [data-search-results]:not(:empty) { margin-bottom: 14px; }
.search-page > p:last-of-type { margin-top: 12px; }
.game-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; }
.game-heading h1 { min-width: 0; }
.game-heading > button { align-self: flex-start; flex-shrink: 0; margin-top: 7px; }
.share-dialog { max-width: min(100% - 28px, 470px); width: 100%; border: 1px solid var(--ink); border-radius: 10px; background: var(--surface); color: var(--ink); padding: clamp(16px, 4vw, 28px); }
.share-dialog::backdrop { background: rgb(14 22 34 / 52%); }
.share-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 15px; }
.share-heading h2 { font-size: clamp(1.6rem, 4vw, 2.35rem); }
.share-dialog label { font-size: .9rem; font-weight: 700; }
.share-dialog input { display: block; width: 100%; height: 44px; padding: 0 9px; margin: 5px 0 15px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.share-status { min-height: 1.55em; margin: 8px 0 0; color: var(--muted); font-size: .9rem; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 13px; border-top: 1px solid var(--line); padding-block: 20px 28px; }
.site-footer > a { font-weight: 800; text-decoration: none; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: .875rem; }

.game-player { min-width: 0; }
.loading { text-align: center; padding: 24px; }
.play-grid { display: grid; gap: 5px; width: 100%; margin-inline: auto; }
.slider-grid, .fibonacci-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { display: grid; aspect-ratio: 1; min-width: 0; min-height: 0; padding: 0; place-items: center; border-radius: 6px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: clamp(1.25rem, 5vw, 3.2rem)/1 var(--display); font-variant-numeric: tabular-nums; touch-action: manipulation; }
button.tile:not(.gap):not([aria-disabled=true]):hover { filter: brightness(1.26); }
button.tile:active { scale: .97; }
.tile.gap { background: #e8e0cd; color: var(--ink); border-color: #beb5a2; cursor: default; }
.game-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 9px; margin-top: 13px; }
.move-status { margin: 0; min-height: 1.55em; font-size: .95rem; font-weight: 750; }
.button-row, .keypad { display: flex; flex-wrap: wrap; gap: 6px; }
.primary, .secondary { min-height: 44px; padding: 6px 13px; border-radius: 5px; font-weight: 680; font-size: .9rem; }
.primary { color: #fff; background: var(--rust); border: 1px solid var(--rust); }
.primary:hover { background: #872b0e; }
.secondary { background: var(--surface); border: 1px solid var(--line); }
.secondary:hover { border-color: var(--ink); }
.keypad { margin-top: 10px; }
.keypad > button { flex: 1; min-width: 38px; padding-inline: 0; }
.keypad > button:last-child { min-width: 51px; }
.sudoku-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border: 2px solid var(--ink); }
.sudoku-grid .tile { border-width: 0 1px 1px 0; border-color: var(--line); background: var(--surface); color: var(--rust); border-radius: 0; font-size: clamp(1rem, 5vw, 2.2rem); }
.sudoku-grid .tile.given { color: var(--ink); background: #ece5d5; cursor: default; }
.sudoku-grid .tile.box-right { border-right: 2px solid var(--ink); }
.sudoku-grid .tile.box-bottom { border-bottom: 2px solid var(--ink); }
.sudoku-grid .tile:nth-child(6n) { border-right: 0; }
.sudoku-grid .tile:nth-last-child(-n + 6) { border-bottom: 0; }
.sudoku-grid .tile[aria-pressed=true] { box-shadow: inset 0 0 0 2px var(--rust); }
.lights-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lights-grid .tile { color: var(--paper); background: var(--ink); }
.lights-grid .tile[aria-pressed=true] { background: #ffe0a5; color: #67280e; border-color: #9f541e; }
.fibonacci-grid { touch-action: none; }
.fibonacci-grid .tile:not(.gap) { background: var(--olive); background: color-mix(in srgb, #432724 calc(var(--tile-rank) * 7%), #52643d); }
.dots-board { display: grid; width: 100%; aspect-ratio: 1; gap: 0; grid-template-columns: repeat(3, 28px minmax(0, 1fr)) 28px; grid-template-rows: repeat(3, 28px minmax(0, 1fr)) 28px; }
.dot, .box, .edge { display: grid; place-items: center; min-width: 0; }
.dot::before { content: ""; width: 12px; aspect-ratio: 1; background: var(--ink); border-radius: 50%; }
.box { font-weight: 800; }
.edge { border: 0; background: transparent; padding: 0; touch-action: manipulation; }
.edge::before { content: ""; display: block; background: #c5b8a1; border-radius: 2px; }
.edge.horizontal::before { width: 100%; height: 4px; }
.edge.vertical::before { width: 4px; height: 100%; }
.edge:hover::before { background: var(--ink); }
.edge[data-owner="1"]::before { background: var(--rust); }
.edge[data-owner="2"]::before { background: var(--olive); }
.box[data-owner="1"] { background: #eed5c1; color: #712705; }
.box[data-owner="2"] { background: #dfe3cf; color: #3d4726; }
.embed-player { display: grid; justify-items: center; align-content: center; gap: 8px; min-height: 240px; }
.embed-player iframe { width: 100%; aspect-ratio: var(--player-ratio, 4 / 3); border: 0; }
.embed-status:empty { display: none; }

@media (max-width: 920px) {
  .shell { width: min(100% - 46px, 1180px); }
  .card-grid:not(.catalog-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .masthead { gap: 15px; }
  .desktop-nav { gap: 16px; }
  .desktop-search { width: 210px; }
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  .masthead { min-height: 64px; position: relative; }
  .wordmark { font-size: 1.85rem; gap: 8px; }
  .brand-mark { width: 21px; }
  .desktop-nav, .desktop-search { display: none; }
  .mobile-menu { display: block; }
  .mobile-menu summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; list-style: none; font-weight: 750; padding: 0 5px; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .menu-sheet { position: absolute; top: 100%; right: 0; left: 0; z-index: 3; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
  .menu-sheet .site-search { width: 100%; }
  .menu-sheet nav { display: grid; margin-top: 10px; }
  .menu-sheet nav a { min-height: 44px; display: flex; align-items: center; }
  .main { padding-block: 20px 39px; }
  .intro { margin-bottom: 7px; }
  .tile { font-size: clamp(1.2rem, 7vw, 2.7rem); }
  .related { margin-top: 26px; }
  .section-head { margin-bottom: 12px; align-items: center; }
  .section-head .text-link { font-size: .83rem; white-space: nowrap; }
  .card-grid { gap: 9px; }
  .card-art { min-height: 88px; }
  .art-grid { width: 62px; }
  .card-copy { padding: 10px 22px 12px 9px; }
  .card-copy strong { font-size: 1.1rem; }
  .card-copy > span { font-size: .8rem; }
  .card-arrow { bottom: 7px; right: 8px; }
  .detail-layout { grid-template-columns: 1fr; gap: 24px; margin-top: 14px; }
  .detail-layout .game-player { width: min(100%, 480px); margin-inline: auto; }
  .detail-layout .guide { border-left: 0; border-top: 1px solid var(--line); padding: 17px 0 0; }
  .catalog-tools { display: grid; justify-content: stretch; margin-top: 16px; }
  .catalog-tools .site-search { width: 100%; }
  .catalog-hero.with-feature { grid-template-columns: 1fr; }
  .catalog-hero { padding: 17px; gap: 21px; }
  .catalog-intro h1 { font-size: clamp(2.7rem, 10vw, 4.3rem); }
  .hero-search { margin-block: 12px 10px; }
  .catalog-intro .filters { margin-top: 11px; }
  .filters a { padding-inline: 9px; }
  .featured-cards .game-card { flex-direction: row; align-items: center; min-height: 94px; }
  .featured-cards .card-art { width: 94px; min-height: 94px; flex: 0 0 94px; align-self: stretch; }
  .featured-cards .art-grid { width: 65px; }
  .game-heading h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); }
  .game-heading > button { margin-top: 1px; padding-inline: 10px; }
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-grid .card-art { width: 86px; min-height: 92px; flex-basis: 86px; }
  .catalog-grid .game-card { min-height: 92px; }
  .catalog-grid .card-copy { padding-left: 12px; }
  .site-footer { align-items: flex-start; }
  .site-footer nav { gap: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.solver-heading { margin-bottom: 24px; }
.solver-heading h1 { font-size: clamp(2.8rem, 7vw, 5.8rem); }
.solver-heading .intro { max-width: 54ch; margin-bottom: 0; }
.solver-workspace { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 18px; align-items: start; }
.solver-panel { padding: clamp(16px, 3vw, 29px); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.solver-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.solver-panel-heading h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.solver-panel-heading .secondary { flex-shrink: 0; }
.solver-panel button:disabled { opacity: .45; cursor: default; }
.solver-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; width: min(100%, 310px); margin: 0 auto 13px; padding: 9px; background: #e7dec9; border-radius: 7px; border: 1px solid #c0b6a1; }
.solver-tile { aspect-ratio: 1; display: grid; place-items: center; min-width: 0; padding: 0; border: 2px solid var(--ink); border-radius: 6px; background: var(--ink); color: var(--surface); font: clamp(2rem, 6vw, 3.1rem)/1 var(--display); touch-action: manipulation; transition: background-color .15s, color .15s; }
.solver-tile.is-blank { border: 1px dashed #958977; background: #f4eee0; }
.solver-tile.is-selected { border-color: var(--rust); box-shadow: 0 0 0 2px var(--rust); }
.solver-tile.is-selected:not(.is-blank) { background: var(--rust); border-color: var(--surface); }
.solver-tile:not(:disabled):hover { filter: brightness(1.15); }
.solver-panel .solver-tile:disabled { opacity: 1; }
.solver-hint { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.solver-keypad { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)) minmax(48px, 1.3fr); gap: 5px; }
.solver-keypad button { padding-inline: 0; touch-action: manipulation; }
.solver-paste { margin-top: 12px; }
.solver-paste summary { color: var(--rust); font-weight: 700; cursor: pointer; min-height: 34px; align-content: center; }
.solver-paste label { display: block; font-size: .9rem; margin: 4px 0; }
.solver-paste textarea { display: block; width: 100%; resize: vertical; font: 1rem/1.4 ui-monospace, monospace; color: var(--ink); border: 1px solid var(--line); border-radius: 5px; background: var(--paper); padding: 8px; margin-bottom: 7px; }
.solver-submit { display: block; width: 100%; margin-top: 10px; min-height: 48px; }
.solver-feedback { margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.solver-feedback:empty { display: none; }
.solver-feedback.is-error { color: #992e12; font-weight: 700; }
.solver-result { min-height: 346px; }
.solver-empty { display: grid; justify-items: center; gap: 12px; padding: 38px 10px 24px; text-align: center; color: var(--muted); }
.solver-empty p { max-width: 28ch; margin: 0; }
.solver-goal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; width: 116px; padding: 5px; border-radius: 6px; background: #e7dec9; }
.solver-goal span { aspect-ratio: 1; border-radius: 3px; display: grid; place-items: center; color: var(--ink); background: var(--surface); font-weight: 750; }
.solver-goal .is-blank { background: transparent; border: 1px dashed #958977; }
.solver-count { color: #3d4c27; background: #e6eadb; border-radius: 5px; padding: 4px 10px; font-size: .88rem; font-weight: 750; white-space: nowrap; }
.solver-step { margin-bottom: 8px; font-weight: 750; }
.solver-step-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.solver-step-controls button { padding-inline: 5px; }
.solver-steps { position: relative; max-height: 364px; overflow-y: auto; margin: 0; padding: 1px 3px 1px 0; list-style: none; }
.solver-steps li + li { margin-top: 4px; }
.solver-steps button { display: flex; align-items: center; gap: 9px; padding: 5px 9px; background: transparent; border: 1px solid transparent; border-radius: 5px; min-height: 40px; width: 100%; text-align: left; font-weight: 650; }
.solver-steps button span { display: grid; place-items: center; min-width: 28px; height: 26px; background: #eee6d4; border-radius: 4px; font-size: .82rem; color: var(--ink); }
.solver-steps button:hover, .solver-steps button[aria-current] { background: #f2e5d6; border-color: #ddaf91; }
.solver-guide h3 { font-size: 1rem; margin-bottom: 4px; }
.solver-guide { max-width: 74ch; }
@media (max-width: 900px) {
  .solver-keypad { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .solver-heading { margin-bottom: 17px; }
  .solver-heading h1 { font-size: clamp(2.35rem, 8.5vw, 3.65rem); }
  .solver-workspace { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .solver-board { width: min(100%, 260px); }
  .solver-panel-heading { margin-bottom: 10px; }
  .solver-paste { margin-top: 7px; }
  .solver-result { min-height: 0; }
  .solver-empty { padding: 15px 8px; }
}
