/* Shared interface refinements. Game rules and region borders remain game-owned. */
.progress-notice{max-width:470px;margin:0 auto 14px;padding:12px;border:1px solid #967446;border-radius:8px;background:#fff6dc;color:#503c1e;font-size:14px;line-height:1.5}
.progress-notice[hidden]{display:none}.progress-notice button{display:block;margin-top:8px;min-height:44px;border:1px solid currentColor;border-radius:8px;background:white;color:inherit;padding:8px 12px;cursor:pointer}
body[data-difficulty] .page-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;padding-right:0}body[data-difficulty] .page-heading>div{min-width:0}body[data-difficulty] .page-heading h1{overflow-wrap:anywhere}
.expand-puzzle,.expanded-close{min-height:44px;border:1px solid #b9c9bc;border-radius:8px;background:#f6f8f0;color:#34523c;padding:8px 12px;font:600 12px 'DM Sans',sans-serif;cursor:pointer;flex-shrink:0}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid #c05835;outline-offset:3px}
.expanded-puzzle{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:none;padding:12px;border:0;box-sizing:border-box;background:#f7f8f2;color:#183e35;overflow:auto}
.expanded-puzzle .board-panel{margin:8px auto;max-width:900px;padding:18px;--puzzle-board-width:min(100%,680px)}
.expanded-puzzle .collection-board,.expanded-puzzle .queens-board,.expanded-puzzle .board{max-width:min(100%,680px);width:100%;margin-inline:auto}
.expanded-close{position:sticky;top:0;z-index:5;display:block;margin-left:auto;background:white}
body.puzzle-expanded{overflow:hidden}
.archive-game-picker{display:none}.archive-hub{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:24px}
.archive-hub-game{display:flex;flex-direction:column;gap:8px;padding:24px;border:1px solid #dce3d7;border-radius:16px;background:#fff;color:#183e35;text-decoration:none;font-weight:700}.archive-hub-game span{font-size:12px;font-weight:400;color:#526957}
body[data-puzzle=word-trails] .word-list.trail-slots{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 8px}
body[data-puzzle=word-trails] .trail-word{grid-template-columns:repeat(var(--slot-count),min(22px,calc((100cqw - 36px)/20)));justify-content:start;padding:5px 10px 5px 0;min-height:32px}
body[data-puzzle=word-trails] .trail-letter{width:100%;min-width:0;aspect-ratio:1;height:auto}
.loop-edge.excluded{position:relative}.loop-edge.excluded::after{content:'×';position:absolute;inset:0;display:grid;place-items:center;color:#526957;font-size:18px;font-weight:700}
@media(max-width:600px){
 body[data-difficulty] main{padding-top:12px}
 body[data-difficulty] h1{font-size:22px;margin-bottom:10px}
 body[data-difficulty] .archive-bar{padding:12px;margin-bottom:14px;min-height:0}
 body[data-difficulty] .date-navigation{gap:6px}
 body[data-difficulty] #archive-date-label{font-size:14px;line-height:1.3}
 body[data-difficulty] .board-panel{padding-top:16px}
 .expand-puzzle{font-size:11px;padding:6px 9px}
 .archive-puzzle-tiles{display:none!important}.archive-game-picker{display:flex;align-items:center;gap:12px;margin:18px 0;font-size:14px;font-weight:600}
 .archive-game-picker select{flex:1;min-width:0;min-height:44px;padding:8px 12px;border:1px solid #b9c9bc;border-radius:8px;background:white;color:#183e35;font:inherit}
 .archive-hub-game{padding:18px 14px}.archive-hub{gap:8px}
 body[data-puzzle=word-trails] .trail-letter{font-size:clamp(9px,2.6vw,13px)}
}
@media(max-width:350px){body[data-puzzle=word-trails] .word-list.trail-slots{grid-template-columns:1fr}body[data-puzzle=word-trails] .trail-word{grid-template-columns:repeat(var(--slot-count),min(22px,calc((100cqw - 24px)/10)));justify-content:center}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

body[data-difficulty] .expanded-puzzle .board,body[data-difficulty] .expanded-puzzle .queens-board-wrap{width:min(100%,680px);max-width:680px;margin-inline:auto}

@media(max-width:720px){body:not([data-difficulty]) .cards{gap:12px}body:not([data-difficulty]) .cards .preview{min-height:190px}body:not([data-difficulty]) .card-content{padding:14px 11px}body:not([data-difficulty]) .card-title{margin-bottom:7px}body:not([data-difficulty]) .description{line-height:1.55}body:not([data-difficulty]) .difficulty-label{margin-top:10px}body:not([data-difficulty]) .play{margin-top:9px;padding:10px 12px}}
@media(max-width:600px){body[data-difficulty] .puzzle-toolbar{padding:12px 14px;margin-bottom:16px}body[data-difficulty] .puzzle-toolbar .date-navigation{margin-top:0}body[data-difficulty] .puzzle-toolbar .archive-hint{margin-top:6px}body[data-difficulty] .puzzle-toolbar .date-trigger #archive-date-label{font-size:15px;letter-spacing:0}}
.house-logo{display:block;width:40px;height:40px;flex-shrink:0;object-fit:contain}.brand-puzzle{color:#62846b}@media(max-width:600px){.house-logo{width:34px;height:34px}}
@media(max-width:600px){
 body[data-difficulty] .puzzle-toolbar{flex-direction:row;flex-wrap:wrap;padding:10px;gap:4px 8px}
 body[data-difficulty] .puzzle-day{flex:1 1 auto}
 body[data-difficulty] .puzzle-toolbar .date-navigation{gap:4px}
 body[data-difficulty] .date-navigation>button:not(.date-trigger){width:38px;height:44px}
 body[data-difficulty] .puzzle-toolbar .archive-hint{margin:0}
 body[data-difficulty] .puzzle-toolbar .archive-hint a{font-size:12px;min-height:44px}
 body[data-difficulty] .puzzle-toolbar .date-trigger{gap:4px;flex:0 1 auto}
 body[data-difficulty] .puzzle-toolbar .date-trigger #archive-date-label{font-size:14px}
 body[data-difficulty] .page-heading{min-height:44px;display:grid;align-items:center}
}

/* Contained vector previews share a square canvas on every card. */
.home-page .puzzle-preview-art{display:block;width:min(160px,92%);height:auto;aspect-ratio:1;flex:none;position:relative;z-index:1;margin-top:20px;filter:drop-shadow(0 5px 7px #273b2714)}
.home-page .preview .game-label{z-index:2;right:10px;line-height:1.5}

/* Keep expansion beside gameplay actions, including on narrow screens. */
body[data-difficulty] .game-tools .expand-puzzle{margin:0}
.expanded-puzzle .expand-puzzle{display:none}
body[data-difficulty] .intro-panel{padding:22px 26px}
body[data-difficulty] .intro-panel h2{margin:10px 0}
body[data-difficulty] .intro-panel p{margin:0;line-height:1.65}
body[data-puzzle=sudoku] .board .cell{border-right-color:#c6d1c0;border-bottom-color:#c6d1c0}
body[data-puzzle=sudoku] .board .cell:nth-child(3n){border-right-color:#738a72}
body[data-puzzle=sudoku] .board .cell:nth-child(n+19):nth-child(-n+27),body[data-puzzle=sudoku] .board .cell:nth-child(n+46):nth-child(-n+54){border-bottom-color:#738a72}
body[data-puzzle=sudoku] .puzzle-actions .notes-mode-indicator{width:132px;gap:8px}
body[data-puzzle=sudoku] .notes-mode-indicator::before{content:"";width:26px;height:16px;border-radius:12px;background:radial-gradient(circle at 8px 8px,#fff 5px,transparent 5.5px),#a0b09a;flex:none}
body[data-puzzle=sudoku] .notes-mode-indicator[aria-pressed=true]::before{background:radial-gradient(circle at 18px 8px,#fff 5px,transparent 5.5px),#81a878}


/* Shared puzzle-page polish: one frame for all ten games. */
body[data-difficulty] .how-to-play{border-top:1px solid #e1e6dd;margin-top:18px;padding-top:16px}
body[data-difficulty] .how-to-play h3{font-size:14px;margin:0 0 8px}
body[data-difficulty] .how-to-play p{font-size:13px;line-height:1.7;color:#4d6659;margin:8px 0}
body[data-difficulty] .board-panel>.puzzle-actions{max-width:520px}
@media(min-width:851px) and (min-height:850px){
 body[data-difficulty]:not(.puzzle-expanded){--puzzle-board-width:min(100%,520px,calc(100svh - 390px))}
 body[data-difficulty]:not(.puzzle-expanded) .board,
 body[data-difficulty]:not(.puzzle-expanded) .queens-board-wrap,
 body[data-difficulty]:not(.puzzle-expanded) .collection-board{width:var(--puzzle-board-width);max-width:520px}
 body[data-difficulty]:not(.puzzle-expanded) .under-board{width:var(--puzzle-board-width);max-width:520px}
 body[data-difficulty] .board-panel>.difficulty-row .level-nav{width:min(100%,520px)}
 body[data-difficulty] .word-list,body[data-difficulty] .number-entry{max-width:520px}
}
@media(max-width:600px){
 body[data-difficulty] .board-panel>.puzzle-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
 body[data-difficulty] .puzzle-actions button{width:auto;min-width:0;padding:10px 12px;font-size:12px}
 body[data-difficulty] .puzzle-actions #completion-result{flex-basis:100%}
 body[data-difficulty] .intro-panel{padding:20px 22px}
 body[data-puzzle=sudoku] .puzzle-actions .notes-mode-indicator{width:132px}
}

@media(prefers-reduced-motion:no-preference){
 body[data-difficulty] .game-tools button,body[data-difficulty] .key,body[data-difficulty] .number-entry button{transition:background-color 120ms,border-color 120ms,transform 100ms}
 body[data-difficulty] .game-tools button:not(:disabled):active,body[data-difficulty] .key:not(:disabled):active,body[data-difficulty] .number-entry button:not(:disabled):active{transform:translateY(1px)}
 body[data-puzzle=sudoku] .cell{transition:background-color 120ms}
}
/* Presentation pass: quiet surfaces and a consistent response to interaction. */
button,a,input,select{touch-action:manipulation}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid #ee805c;outline-offset:3px}
body[data-difficulty] .game-tools button{font-variant-numeric:tabular-nums}
body[data-difficulty] .game-tools button:disabled{cursor:default}
body[data-difficulty] .board-panel{box-shadow:0 2px 8px #183e3504}
body[data-difficulty] .rules-panel h2{line-height:1.4}
body[data-difficulty] .rule-number{font-variant-numeric:tabular-nums}
.info-body,.archive-calendar-card{box-shadow:0 3px 14px #183e3505}
.info-body a:not(.info-button){text-decoration-thickness:1px;text-underline-offset:4px}
.info-body .info-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px}
.archive-main select{cursor:pointer}
.archive-day.today{box-shadow:inset 0 0 0 1px #62846b18}
.archive-day:focus-visible{outline-offset:2px}
.archive-hub-game{min-width:0}
.home-page .card .preview{isolation:isolate}
@media(hover:hover){
 .info-body a:not(.info-button):hover,.footer-links a:hover,header nav a:hover{color:#4b7455}
 .info-button:hover{background:#2e5b4f}
 .archive-hub-game:hover{background:#f2f6ec;border-color:#97af9c}
}
@media(prefers-reduced-motion:no-preference){
 header nav a,.footer-links a,.info-body a{transition:color 140ms,background-color 140ms}
 .archive-day,.archive-levels button,.archive-puzzle-tile,.archive-hub-game,.month-navigation button,.calendar-done,.calendar-close,.date-navigation button,.difficulty a,.level-nav a{transition:background-color 140ms,border-color 140ms,box-shadow 140ms}
 .archive-day[href]:active,.archive-levels button:active,.month-navigation button:not(:disabled):active,.date-navigation button:not(:disabled):active,.info-button:active{transform:translateY(1px)}
 dialog[open]:not(.completion-panel):not(.expanded-puzzle){animation:puzzle-dialog-in 160ms ease-out}
 .island{transition:background-color 150ms,border-color 150ms,color 150ms}
 .loop-edge::after{transition:background-color 100ms}
}
@keyframes puzzle-dialog-in{from{opacity:0;translate:0 5px}to{opacity:1;translate:0 0}}

/* Reserve the completion tick in every row so long words never crowd a neighbour. */
body[data-puzzle=word-trails] .word-list.trail-slots{max-width:520px}
body[data-puzzle=word-trails] .word-list.trail-slots .trail-word{grid-template-columns:repeat(var(--slot-count),min(24px,calc((100cqw - 104px) / var(--trail-max-length,10) / 2))) 12px;gap:2px;padding:6px 14px 6px 0}
@media(max-width:350px){body[data-puzzle=word-trails] .word-list.trail-slots .trail-word{grid-template-columns:repeat(var(--slot-count),min(24px,calc((100cqw - 48px) / var(--trail-max-length,10)))) 12px;justify-content:center;padding:6px 14px 6px 0}}
/* Completed results have a stable home below the puzzle, outside live controls. */
.completion-summary{min-height:44px;margin:12px auto 0;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;visibility:hidden;color:#456b50}
.completion-summary.ready{visibility:visible}
.completion-summary-label{font-size:13px;font-weight:600}
.completion-summary #completion-result{min-height:44px;border:1px solid #a9bda5;border-radius:8px;padding:10px 15px;background:#eef3e8;color:#34523c;font:600 13px 'DM Sans',Arial,sans-serif;cursor:pointer}
.completion-summary #completion-result[hidden]{display:none}
body[data-difficulty] .board-panel:has(.completion-summary){padding-bottom:20px}
/* Evergreen catalogue: one clear invitation per game. */
.catalogue-main{max-width:1176px;margin:22px auto 60px}
.catalogue-intro{padding:34px 38px;background:#e9eee2;border:1px solid #e1e6dd;border-radius:24px;margin-bottom:28px}
.catalogue-intro h1{font-size:clamp(32px,4vw,46px);letter-spacing:-1.5px;margin:14px 0}
.catalogue-intro p{font-size:16px;line-height:1.7;color:#4d6659;margin:8px 0}
.catalogue-intro .catalogue-note{font-size:14px;max-width:620px}
.catalogue-intro>a{display:inline-flex;align-items:center;min-height:44px;font-size:13px;font-weight:700;text-decoration:underline;text-underline-offset:4px;margin-top:6px}
.catalogue-page .puzzle-preview-art{display:block;width:min(160px,92%);height:auto;aspect-ratio:1;flex:none;position:relative;z-index:1;margin-top:20px;filter:drop-shadow(0 5px 7px #273b2714)}
.catalogue-page .preview .game-label{right:10px;z-index:2;line-height:1.5}
.catalogue-page .card-content{display:flex;flex-direction:column;padding:20px 16px 16px}
.catalogue-page .card-content h2{font:800 23px Manrope,Arial,sans-serif;letter-spacing:-.7px;margin:0 0 10px}
.catalogue-page .description{flex:1}
.catalogue-play{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:44px;margin-top:20px;border-radius:9px;padding:12px 16px;background:#183e35;color:#fff;font-size:13px;font-weight:600}
@media(hover:hover){.completion-summary #completion-result:hover{background:#e3ecdc;border-color:#62846b}.catalogue-play:hover{background:#2e5b4f}}
@media(prefers-reduced-motion:no-preference){.completion-summary #completion-result,.catalogue-play{transition:background-color 140ms,border-color 140ms}.catalogue-play:active,.completion-summary #completion-result:active{transform:translateY(1px)}}
@media(max-width:1259px){.catalogue-main{margin-left:42px;margin-right:42px}}
@media(max-width:720px){.catalogue-main{margin:16px 24px 44px}.catalogue-intro{padding:26px 24px;margin-bottom:20px}.catalogue-page .card .preview{min-height:180px}.catalogue-page .card-content{padding:18px 12px}.catalogue-page .card-content h2{font-size:21px}.catalogue-page .description{font-size:12px;line-height:1.6}.catalogue-play{margin-top:14px;padding:10px 12px}}
@media(max-width:420px){.catalogue-main{margin-inline:18px}.catalogue-intro h1{font-size:32px}.catalogue-page .preview .game-label{font-size:7px;letter-spacing:1px}.catalogue-page .card .preview{min-height:190px}.catalogue-page .card-content{padding:16px 10px}.catalogue-page .card-content h2{font-size:20px}}

/* The same production boards on both discovery pages, framed as small keepsakes. */
:is(.home-page,.catalogue-page) .puzzle-preview-art{box-sizing:border-box;width:min(164px,88%);height:auto;aspect-ratio:1;object-fit:contain;padding:8px;background:#fff;border:1px solid #183e3510;border-radius:12px;filter:none;box-shadow:0 6px 16px #183e3512;margin-top:22px}
@media(min-width:721px){:is(.home-page,.catalogue-page) .card .preview{height:210px}}
/* View actions belong with the page title, separate from puzzle controls. */
.puzzle-page-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.puzzle-page-heading h1{margin:0;min-width:0}
.puzzle-page-heading .expand-puzzle{background:transparent;border-color:#d2ddcc;color:#526e59}
@media(max-width:600px){.puzzle-page-heading{gap:8px}.puzzle-page-heading h1{font-size:24px}.puzzle-page-heading .expand-puzzle{padding:7px 10px}}
/* Keep transient game announcements available to assistive technology only. */
body[data-difficulty] :is(#collection-status,#queens-status,#sudoku-status,.game-status){position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}

/* Completion alternatives respect the dialog's hidden state. */
.completion-actions [hidden]{display:none!important}
