.grid-game{padding:22px 24px 18px}
.grid-game .game-title{font-size:clamp(22px,2.5vw,29px)}
.grid-game .game-header{margin-bottom:10px}
.grid-controls{gap:8px;flex-wrap:wrap}
.grid-pickers{display:flex;gap:8px}
.grid-pickers[hidden]{display:none}
.grid-pickers .game-field{max-width:130px}
.grid-pickers select{min-width:80px}
.grid-howto-link{border:0;background:none;color:var(--accent,#8d4c35);font:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer;margin-left:auto}
.grid-tools{margin-top:9px;gap:6px}
.grid-tools .game-tool{padding:8px 10px;font-size:12px;min-height:38px}
.grid-tools kbd{font-size:9px}
.grid-tools .game-tool:disabled{opacity:.45}
.grid-instruction{font-size:12px;line-height:1.5;margin:8px 0;color:#716355;min-height:18px}
.grid-message{font-size:12px;line-height:1.5;min-height:18px;margin:9px 0}
.grid-toolbar{gap:6px;flex-wrap:wrap}
.grid-toolbar .game-action{font-size:12px;padding:9px 10px;min-height:36px}
.grid-toolbar .game-action:last-child{margin-left:auto}
.grid-welcome{display:flex;align-items:center;gap:8px;background:#f5ead3;border:1px solid #dfcba6;border-radius:8px;padding:7px 9px;margin:7px 0;font-size:11px;line-height:1.4}
.grid-welcome[hidden]{display:none}
.grid-welcome span{flex:1}
.grid-welcome button{background:none;border:0;padding:4px;color:#75452d;text-decoration:underline;cursor:pointer;font:inherit;font-weight:700}
.grid-howto-dialog{max-width:480px}
.grid-howto-dialog>p{font-size:14px;line-height:1.6}
.grid-howto-dialog .game-toolbar{justify-content:flex-end}
.grid-game .game-shortcuts{margin-bottom:0}
.grid-game .game-dialog img{object-fit:contain}
.grid-game .level-chapter>p{display:flex;justify-content:space-between;gap:10px}
.grid-game .skipped-links .game-action{text-align:left}
@media(max-width:600px){.grid-game{padding:14px 12px}.grid-game .game-header{gap:8px;align-items:flex-start;margin-bottom:8px}.grid-game .game-eyebrow{font-size:9px;letter-spacing:.08em;margin-bottom:3px}.grid-game .game-title{font-size:21px;line-height:1.15}.grid-game .game-subtitle{font-size:11px;line-height:1.35;margin-top:4px}.grid-game .game-stats{gap:10px;flex-shrink:0}.grid-game .game-stat small{font-size:9px}.grid-game .game-stat strong{font-size:17px}.grid-game .game-play-modes{margin-bottom:8px}.grid-game .game-play-modes button{font-size:11px;padding:8px 6px}.grid-controls{margin-bottom:3px}.grid-controls .game-action{font-size:11px;padding:7px 9px;min-height:32px}.grid-howto-link{font-size:10px}.grid-pickers .game-field{font-size:10px}.grid-pickers select{font-size:11px;min-width:72px;padding:5px 7px;min-height:30px}.grid-tools{gap:4px;margin-top:6px}.grid-tools .game-tool{font-size:10px;padding:6px 7px;min-height:32px}.grid-tools kbd{display:none}.grid-instruction{font-size:11px;margin:6px 0;line-height:1.4;min-height:30px}.grid-message{font-size:11px;line-height:1.4;margin:7px 0;min-height:15px}.grid-toolbar{gap:4px}.grid-toolbar .game-action{font-size:10px;padding:7px 7px;min-height:32px}.grid-toolbar .game-action:last-child{margin-left:0;flex:1}.grid-game .game-social-tools{margin-top:10px}.grid-game .game-social-tools button{font-size:11px}.grid-game .game-shortcuts{font-size:10px}.grid-welcome{font-size:10px;padding:5px 7px;gap:5px}.grid-howto-dialog{padding:16px}}
@media(max-height:700px) and (min-width:601px){.grid-game{padding:16px 20px}.grid-instruction{margin:5px 0}.grid-message{margin:6px 0}}
@media(max-width:359px){.grid-game .grid-toolbar{display:flex;min-width:0}.grid-game .grid-toolbar .game-action{flex:0 0 auto}.grid-game .grid-toolbar .game-action:last-child{flex:1 0 auto}}
/* Put the board and its main controls in the first play area. */
.grid-page .page-wrap{padding-top:8px}
.grid-page .breadcrumbs{font-size:9px;line-height:1.35;gap:6px;margin-bottom:4px}
.grid-page .breadcrumbs>span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.grid-page .article-header{padding:4px 0 7px;margin-bottom:6px}
.grid-page .article-header h1{font-size:20px;line-height:1.15;margin:0 0 3px;letter-spacing:-.02em}
.grid-page .article-header>.eyebrow,.grid-page .article-meta{display:none}
.grid-page .article-intro{font-size:12px;line-height:1.4;margin:0}
.grid-game{padding:12px!important}
.grid-game .game-header{gap:12px;align-items:center;margin-bottom:6px}
.grid-game .game-eyebrow{display:none}
.grid-game .game-title{font-size:23px;line-height:1.13;margin:0 0 3px}
.grid-game .game-subtitle{font-size:11px;line-height:1.35;margin:0}
.grid-game .game-stats{gap:14px}
.grid-game .game-stat small{font-size:9px;line-height:1.3}
.grid-game .game-stat strong{font-size:19px;line-height:1.3}
.grid-game .game-play-modes{margin:6px 0 4px;padding:3px}
.grid-game .game-play-modes button{min-height:31px;padding:5px 6px;font-size:11px;line-height:1.3}
.grid-game .grid-controls{align-items:center;gap:5px 8px;margin:5px 0 7px}
.grid-game .grid-controls .game-action{font-size:11px;line-height:1.3;padding:5px 8px;min-height:30px}
.grid-game .grid-controls .game-puzzle-switch{gap:4px;min-width:0}
.grid-game .grid-controls .game-level-button{min-width:100px}
.grid-game .grid-howto-link{font-size:11px;line-height:1.4;padding:4px 0;min-height:28px}
.grid-game .grid-pickers{gap:6px;flex-wrap:wrap}
.grid-game .grid-pickers .game-field{gap:2px;font-size:10px;line-height:1.3}
.grid-game .grid-pickers select{min-width:72px;min-height:29px;padding:4px 7px;font-size:11px}
.grid-play-area{display:grid;grid-template-columns:minmax(0,380px) minmax(190px,1fr);grid-template-areas:"tools help" "board help" "toolbar help" "message help";gap:7px 12px;align-items:start}
.grid-help-panel{grid-area:help;display:flex;flex-direction:column;gap:9px;min-width:0;min-height:0;contain:size;align-self:stretch;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:2px}
.grid-help-panel>*{flex-shrink:0}
.grid-play-area>.game-board-wrap{grid-area:board;width:100%;max-width:none;margin:0}
.grid-play-area>.grid-tools{grid-area:tools;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;width:100%;max-width:none;padding:3px;margin:0;justify-content:stretch}
.grid-play-area .grid-tools .game-tool{min-width:0;min-height:34px;gap:3px;padding:5px 3px;font-size:11px;line-height:1.3;white-space:normal}
.grid-play-area .grid-tools kbd{font-size:9px;line-height:1}
.grid-game .grid-play-area .grid-instruction{grid-area:instruction;font-size:11px;line-height:1.45;min-height:0;margin:0;max-width:none;text-align:left}
.grid-play-area .grid-welcome{grid-area:welcome;align-items:center;flex-wrap:wrap;gap:3px 5px;margin:0;padding:5px 7px;font-size:11px;line-height:1.35}
.grid-play-area .grid-welcome span{min-width:0;flex:1 1 105px}
.grid-play-area .grid-welcome button{padding:3px 0;font-size:11px;line-height:1.35}
.grid-play-area>.grid-toolbar{grid-area:toolbar;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;width:100%;margin:0;min-width:0}
.grid-play-area .grid-toolbar .game-action{min-width:0;min-height:34px;margin:0;padding:6px 4px;font-size:11px;line-height:1.35;white-space:nowrap}
.grid-game .grid-play-area>.grid-message{grid-area:message;font-size:11px;line-height:1.4;min-height:0;max-width:none;margin:0;text-align:left}
.grid-game .grid-message:empty{display:none}
.grid-play-area #gg-evidence{grid-area:evidence;margin:0;padding:10px;font-size:11px;min-width:0}
.grid-game .grid-play-area #gg-evidence p{font-size:11px;line-height:1.5;margin:5px 0}
.grid-game .grid-play-area #gg-evidence h3{font-size:13px;line-height:1.3;margin:0}
.grid-game .grid-secondary-actions{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:5px 16px;margin-top:9px}
.grid-game .grid-secondary-actions button{font-size:11px;line-height:1.35;min-height:28px;padding:4px 0}
.grid-game .game-shortcuts{font-size:10px;line-height:1.4;margin:5px 0 0}
.grid-howto-dialog{max-height:calc(100dvh - 28px);overflow:auto}
@media(min-width:761px) and (max-width:1199px){.grid-play-area .grid-tools kbd{display:none}}
@media(min-width:761px) and (max-height:780px){.grid-page .article-intro{display:none}.grid-page .article-header{padding-bottom:3px;margin-bottom:4px}.grid-game{padding:10px!important}.grid-game .game-header{margin-bottom:4px}.grid-game .game-title{font-size:22px}.grid-game .game-play-modes{margin:4px 0 3px}.grid-game .game-play-modes button{min-height:30px}.grid-game .grid-controls{margin:3px 0 5px}.grid-play-area{grid-template-columns:minmax(0,350px) minmax(190px,1fr);row-gap:5px}}
@media(max-width:760px){.grid-page .page-wrap{padding-top:6px}.grid-page .breadcrumbs{display:none}.grid-page .article-header{padding:3px 0 5px;margin-bottom:4px}.grid-page .article-header h1{font-size:18px;line-height:1.15;margin:0}.grid-page .article-intro{display:none}.grid-page .game-navigation-region{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:start}.grid-page .game-navigation-region>.game-selector{grid-column:1;grid-row:1;width:100%;min-width:0;max-width:none;margin:0;align-self:start}.grid-page .game-navigation-region>[data-companion-dock="mobile"]{grid-column:2;grid-row:1;margin:0;align-self:start;position:relative;z-index:2}.grid-page .game-navigation-region>.play-layout{grid-column:1/-1;min-width:0;width:100%}.grid-page .game-selector>summary{min-height:43px;padding:6px 8px;gap:6px}.grid-page .game-selector .home-selector-art{flex:0 0 23px;width:23px;height:25px}.grid-page .game-selector .home-selector-art svg,.grid-page .game-selector .home-selector-art img{width:23px;height:25px}.grid-page .game-selector .home-selector-label{font-size:0;min-width:0}.grid-page .game-selector .home-selector-label strong{font-size:11px}.grid-page .game-selector .home-selector-change{font-size:0;gap:0}.grid-page .game-selector .home-selector-chevron{font-size:17px;line-height:1}.grid-page [data-companion-dock="mobile"] .companion-corner{width:110px;min-height:45px;padding:7px 8px;font-size:11px;line-height:1.3;border-radius:11px}.grid-page .game-navigation-region>.game-selector[open]{grid-column:1/-1}.grid-page .game-navigation-region:has([data-companion-dock="mobile"] .companion-corner:not([hidden]))>.game-selector[open]>summary{padding-right:126px}.grid-game{padding:9px!important}.grid-game .game-header{gap:7px;margin-bottom:5px;align-items:center}.grid-game .game-title{font-size:20px;line-height:1.12;margin-bottom:2px}.grid-game .game-subtitle{font-size:10px;line-height:1.3}.grid-game .game-stats{gap:9px}.grid-game .game-stat small{font-size:8px}.grid-game .game-stat strong{font-size:17px;line-height:1.3}.grid-game .game-play-modes{margin:5px 0 3px}.grid-game .game-play-modes button{min-height:30px;font-size:11px;padding:4px}.grid-game .grid-controls{margin:3px 0 5px;gap:4px 7px}.grid-game .grid-controls .game-action{min-height:29px;padding:4px 7px}.grid-game .grid-howto-link{font-size:11px;min-height:26px;padding:3px 0}.grid-play-area{display:flex;flex-direction:column;gap:4px}.grid-help-panel{display:contents;contain:none;overflow:visible}.grid-play-area>.grid-tools{order:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}.grid-play-area .grid-tools .game-tool{min-height:31px;font-size:11px;padding:4px 3px}.grid-play-area .grid-tools kbd{display:none}.grid-game .grid-play-area .grid-instruction{order:1;font-size:11px;line-height:1.35;width:100%;margin:0;min-height:0}.grid-play-area .grid-welcome{order:2;width:100%;padding:3px 5px;gap:3px 5px;font-size:11px;line-height:1.3}.grid-play-area .grid-welcome span{flex-basis:120px}.grid-play-area .grid-welcome button{font-size:11px;line-height:1.3;padding:2px 0}.grid-play-area>.game-board-wrap{order:3;width:100%;max-width:380px;margin:0 auto}.grid-play-area>.grid-toolbar{order:4;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;width:100%;margin:0}.grid-play-area .grid-toolbar .game-action{font-size:11px;line-height:1.3;padding:6px 2px;min-height:33px;letter-spacing:-.015em}.grid-game .grid-play-area>.grid-message{order:5;width:100%;font-size:11px;line-height:1.35;margin:0;min-height:0}.grid-play-area #gg-evidence{order:6;width:100%;box-sizing:border-box}.grid-game .grid-secondary-actions{gap:5px 12px;margin-top:6px}.grid-game .grid-secondary-actions button{font-size:11px}.grid-game .game-shortcuts{font-size:10px;line-height:1.35;margin-top:3px}}
@media(max-width:359px){.grid-game{padding:7px!important}.grid-game .game-title{font-size:18px}.grid-game .game-stats{gap:6px}.grid-game .game-stat strong{font-size:16px}.grid-play-area .grid-toolbar .game-action{font-size:10px;padding:6px 1px}}
/* ── Shared grid-game board and tools ── */
.grid-board{width:min(100%,430px);aspect-ratio:1;margin:0 auto;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
.grid-play-area .grid-board{width:100%;max-width:380px;margin:0 auto}
.grid-play-area>.grid-tools{grid-area:tools;display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:34px;padding:3px}
.grid-tools[hidden]{display:none!important}
.grid-game .grid-help-panel{grid-template-areas:none}
.grid-instruction{font-size:12px;line-height:1.5;color:#716355}
.grid-howto-link{border:0;background:none;color:var(--accent,#8d4c35);font:inherit;font-size:12px;text-decoration:underline;text-underline-offset:3px;cursor:pointer;margin-left:auto}
.grid-howto-dialog{max-width:520px}
.grid-howto-steps{padding-left:20px;margin:10px 0}
.grid-howto-steps li{margin:0 0 8px;font-size:14px;line-height:1.55}
.grid-howto-body>p{font-size:14px;line-height:1.6}
.grid-howto-dialog .game-toolbar{justify-content:flex-end}
.grid-chapter-note{font-size:11px;line-height:1.4;color:#716355;margin:-4px 0 6px}
.grid-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ── Zoomdoku ── */
.zoom-svg{display:block;width:100%;height:100%;border:2px solid #80634a;border-radius:8px;background:#f6efe2;overflow:hidden;touch-action:manipulation}
.zoom-floor{fill:#fbf5e8}
.zoom-dot{fill:#d8cdbb}
.zoom-lit{fill:#d6e8ee}
.zoom-ray{fill:#f6d3c4}
.zoom-hit{fill:none;stroke:transparent;stroke-width:.92;stroke-linecap:round;stroke-linejoin:round;pointer-events:stroke}
.zoom-body-outline{fill:none;stroke-width:.58;stroke-linecap:round;stroke-linejoin:round}
.zoom-body{fill:none;stroke-width:.44;stroke-linecap:round;stroke-linejoin:round}
.zoom-tail{fill:none;stroke-width:.12;stroke-linecap:round}
.zoom-head,.zoom-ears{stroke-width:.06;stroke-linejoin:round}
.zoom-muzzle,.zoom-eye-rim{fill:#fff2d7}
.zoom-eye{fill:#2b1f18}
.zoom-nose{fill:#2b1f18;stroke:#fff2d7;stroke-width:.025;stroke-linejoin:round}
.zoom-body-outline,.zoom-body,.zoom-tail,.zoom-face{pointer-events:none}
.zoom-cat{cursor:pointer;outline:none}
.zoom-cat:hover .zoom-body,.zoom-cat:hover .zoom-head{filter:brightness(1.08)}
.zoom-cat:focus-visible .zoom-body-outline,.zoom-cat:focus-visible .zoom-head{stroke:#654e8c;stroke-width:.66}
.zoom-cat:focus-visible .zoom-head{stroke-width:.1}
.zoom-cat.is-leaving{animation:zoom-away .45s cubic-bezier(.55,0,.9,.45) forwards;pointer-events:none}
@keyframes zoom-away{to{transform:translate(var(--zoom-dx),var(--zoom-dy));opacity:0}}
.zoom-cat.is-bumped{animation:zoom-bump .36s ease-in-out}
@keyframes zoom-bump{25%{transform:translate(.09px,.04px)}50%{transform:translate(-.09px,-.04px)}75%{transform:translate(.05px,0)}}
.zoom-cat.is-blocker .zoom-body-outline{stroke:#c0392b;stroke-width:.72}
.zoom-cat.is-blocker .zoom-head{stroke:#c0392b;stroke-width:.1}
.is-locked .zoom-cat{cursor:default;opacity:.72}
.zoom-hearts{display:flex;align-items:center;gap:3px;font-size:19px;line-height:1;color:#c4473a}
.zoom-heart.is-spent{color:#cdbfae}
.zoom-heart-label{font-size:11px;color:#716355;margin-right:4px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}
@media(prefers-reduced-motion:reduce){.zoom-cat.is-leaving{animation-duration:.01s}.zoom-cat.is-bumped{animation:none}}

/* ── Purrdoku ── */
.purr-game .grid-board{display:grid;grid-template-columns:repeat(var(--purr-size),1fr);border:2px solid #80634a;border-radius:8px;overflow:hidden;background:#fffdf7}
.purr-cell{position:relative;display:grid;place-items:center;min-width:0;min-height:0;aspect-ratio:1;padding:0;border:0;border-right:1px solid #e3d9c8;border-bottom:1px solid #e3d9c8;background:#fffdf7;color:#5c3d2f;cursor:pointer;font:inherit;outline-offset:-3px;-webkit-tap-highlight-color:transparent}
.purr-cell.box-right{border-right:2px solid #80634a}
.purr-cell.box-bottom{border-bottom:2px solid #80634a}
.purr-cell.is-given{background:#f4ecdc}
.purr-cell.is-related{background:#f8f1e1}
.purr-cell.is-given.is-related{background:#efe4cf}
.purr-cell.is-same{background:#f1dfb9}
.purr-cell.is-selected{background:#f5d4b9;box-shadow:inset 0 0 0 3px #a45435;z-index:1}
.purr-cell.is-lit{background:#d6e8ee;box-shadow:inset 0 0 0 2px #568997}
.purr-cell.is-conflict{background:#f8d7cf}
.purr-cell.is-conflict .purr-number,.purr-cell.is-conflict .purr-digit{color:#b2321f}
.purr-cell:focus-visible{outline:3px solid #654e8c;z-index:2}
.purr-cell[aria-disabled=true]{cursor:default}
.purr-piece{shape-rendering:geometricPrecision}
.purr-cell .purr-piece{width:78%;height:78%}
.purr-digit{position:absolute;right:2px;bottom:1px;font-size:clamp(8px,1.1vw,11px);font-weight:800;line-height:1;color:#7a604a}
.purr-cell.is-given .purr-digit{color:#3d2a1f}
.purr-number{font-family:var(--font-display,Georgia,serif);font-size:clamp(15px,2.4vw,26px);font-weight:700;line-height:1;color:#6a4f8f}
.purr-cell.is-given .purr-number{color:#3d2a1f}
.purr-notes{display:grid;grid-template-columns:repeat(var(--purr-note-cols,3),1fr);width:88%;height:88%;font-size:clamp(7px,.95vw,10px);line-height:1;color:#8a7764;font-weight:700}
.purr-notes span{display:grid;place-items:center}
.grid-board[style*="--purr-size: 4"] .purr-notes,.grid-board[style*="--purr-size:4"] .purr-notes{font-size:clamp(9px,1.4vw,13px)}
.purr-game .grid-play-area>.grid-tools{display:flex;flex-direction:column;align-items:stretch;gap:5px}
.purr-pad{display:grid;grid-template-columns:repeat(var(--purr-pad,9),minmax(0,1fr));gap:3px}
.purr-pad-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-width:0;min-height:40px;padding:2px 0;border:1px solid #d8cdbb;border-radius:6px;background:#fffdf7;color:#553a2b;font:inherit;font-size:11px;font-weight:800;cursor:pointer;line-height:1}
.purr-pad-button .purr-piece{width:24px;height:24px}
.purr-pad-button:hover{background:#f9f2df}
.purr-pad-button.is-complete{opacity:.42}
.purr-pad-button:disabled{cursor:default}
.purr-tool-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
.purr-tool-row .game-tool{min-width:0;min-height:32px;padding:5px 4px;font-size:11px;justify-content:center}
.purr-tool-row kbd{font-size:9px}
@media(max-width:600px){.purr-pad-button{min-height:38px}.purr-pad-button .purr-piece{width:20px;height:20px}.purr-tool-row kbd{display:none}.purr-digit{font-size:8px}}

/* ── Yarndoku ── */
.yarn-game .grid-board{touch-action:none;outline:none;border-radius:8px}
.yarn-game .grid-board:focus-visible{outline:3px solid #654e8c;outline-offset:2px}
.yarn-svg{display:block;width:100%;height:100%;border:2px solid #80634a;border-radius:8px;background:#fffdf7;cursor:crosshair}
.yarn-cell{fill:#fffdf7}
.yarn-cell.is-lit{fill:#d6e8ee!important}
.yarn-grid{stroke:#e3d9c8;stroke-width:.03;fill:none}
.yarn-thread{fill:none;stroke-width:.3;stroke-linecap:round;stroke-linejoin:round}
.yarn-ball circle:first-child{stroke:rgba(0,0,0,.28);stroke-width:.045}
.yarn-wind{fill:none;stroke:rgba(255,255,255,.55);stroke-width:.045;stroke-linecap:round}
.yarn-ball.is-active circle:first-child{stroke:#3d2a1f;stroke-width:.09}
.yarn-joined-dot{fill:#fff;stroke:rgba(0,0,0,.25);stroke-width:.03}
.yarn-tip{fill:none;stroke-width:.07;opacity:.85;animation:yarn-pulse 1.1s ease-in-out infinite}
@keyframes yarn-pulse{50%{opacity:.35}}
.yarn-cursor{fill:none;stroke:#654e8c;stroke-width:.06;stroke-dasharray:.12 .08}
.is-locked .yarn-svg{cursor:default}
.yarn-game .grid-play-area>.grid-tools{justify-content:space-between}
.yarn-legend{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.yarn-chip{width:16px;height:16px;border-radius:50%;background:var(--yarn);opacity:.45;box-shadow:inset 0 0 0 2px rgba(255,255,255,.6)}
.yarn-chip.is-joined{opacity:1;box-shadow:0 0 0 2px #fffdf7,0 0 0 3px var(--yarn)}
.yarn-clear{min-height:32px;padding:5px 9px;font-size:11px}
@media(prefers-reduced-motion:reduce){.yarn-tip{animation:none}}
.purr-tool-row,.yarn-game .grid-tools{background:#f0f3e9;border-radius:10px;padding:3px}
.purr-tool-row .game-tool,.yarn-clear{cursor:pointer}
.purr-tool-row .game-tool:hover,.yarn-clear:hover{background:#fbf8f0}
.yarn-game .grid-tools{padding:3px 3px 3px 9px}

/* Player-facing clues use shape, labels and candidates as well as colour. */
.yarn-number{fill:#28221d;paint-order:stroke fill;stroke:#fffdf7;stroke-width:.08;font-size:.37px;font-family:system-ui,sans-serif;font-weight:850;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.yarn-ball .yarn-number-badge{fill:#fffdf7;stroke:#5b5145;stroke-width:.025;pointer-events:none}
.yarn-hint-arrow{fill:none;stroke:#315d4e;stroke-width:.065;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.yarn-svg marker path{fill:#315d4e}
.yarn-chip{display:inline-grid;place-items:center;flex:none;color:#28221d;font-size:10px;font-weight:850;line-height:1;opacity:1;text-shadow:0 0 2px #fff,0 0 2px #fff,0 0 2px #fff;border:1px solid #827564;box-shadow:inset 0 0 0 2px #ffffff80}
.yarn-chip.is-selected{outline:2px solid #322c24;outline-offset:1px;transform:scale(1.08)}
.yarn-ball.is-selected circle:first-child{stroke:#28221d;stroke-width:.09}
.yarn-ball.is-muted,.yarn-thread.is-muted{opacity:.4}
.yarn-thread.is-selected{stroke-width:.36;filter:drop-shadow(0 0 .035px #30271e)}
.yarn-cell.is-next{fill:#dceddf!important;stroke:#376849;stroke-width:.05}
.yarn-cell.is-excluded{fill:#f7ddd5!important}
.yarn-cell.is-witness{fill:#fbe6a8!important;stroke:#90642c;stroke-width:.055;stroke-dasharray:.13 .08}
.yarn-hint-mark{fill:#7e3427;stroke:#fffdf7;paint-order:stroke fill;stroke-width:.07;font-size:.46px;font-weight:850;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.yarn-witness-mark{fill:#6d4a19;stroke:#fffdf7;paint-order:stroke fill;stroke-width:.07;font-size:.43px;font-weight:850;text-anchor:middle;dominant-baseline:central;pointer-events:none}
.purr-hint-notes{display:grid;grid-template-columns:repeat(var(--purr-note-cols,3),1fr);width:92%;height:92%;font-family:system-ui,sans-serif;font-size:clamp(7px,.95vw,10px);line-height:1;color:#25485b;font-weight:750}
.purr-hint-notes span{display:grid;place-items:center}
.purr-hint-notes .is-eliminated{color:#a02f21;text-decoration:line-through;text-decoration-thickness:1.3px;background:#f7d8cf;border-radius:2px}
.purr-hint-role{position:absolute;top:1px;left:1px;z-index:2;min-width:10px;padding:0 1px;border-radius:2px;background:#355c73;color:white;font-family:system-ui,sans-serif;font-size:8px;line-height:11px;font-weight:800;pointer-events:none}
.purr-cell.is-hint-source{background:#e2edf0;box-shadow:inset 0 0 0 2px #608597}
.purr-cell.is-hint-remove{background:#f8e1d6;box-shadow:inset 0 0 0 2px #a65f43}
.purr-cell.is-hint-target{background:#dcebd9;box-shadow:inset 0 0 0 3px #4a7750}
.purr-cell.is-hint-source .purr-hint-notes{padding-left:8px}
.grid-evidence-steps{margin:7px 0 4px;padding-left:20px;font-size:11px;line-height:1.55}
.grid-evidence-steps li{margin:4px 0}
.grid-howto-example{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:10px;border:1px solid #d8ddcf;border-radius:10px;background:#f8f8f0}
.grid-howto-example figure{margin:0;min-width:0}
.grid-howto-example svg{display:block;max-width:155px;width:100%;height:auto;aspect-ratio:1;margin:0 auto 7px;border:1px solid #b9aa95;border-radius:7px;background:#fffdf7}
.grid-howto-example figcaption{font-size:12px;line-height:1.45;color:#5f5144}
.zoom-example-grid{fill:none;stroke:#dfd2bd;stroke-width:.025}
.zoom-example-run{fill:none;stroke:#315d4e;stroke-width:.09;stroke-linecap:round;stroke-linejoin:round}
.purr-howto-example{max-width:320px;margin:0 auto 13px;padding:12px;border:1px solid #d8ddcf;border-radius:10px;background:#f8f8f0;font-size:13px;line-height:1.5}
.purr-howto-grid{display:grid;grid-template-columns:repeat(4,1fr);max-width:180px;aspect-ratio:1;margin:0 auto 8px;border:2px solid #80634a;border-radius:6px;overflow:hidden;background:#fffdf7}
.purr-howto-grid>span{display:grid;place-items:center;border-right:1px solid #ddd0ba;border-bottom:1px solid #ddd0ba;font-size:20px;font-weight:700;min-width:0}
.purr-howto-grid>span:nth-child(4n+2){border-right:2px solid #80634a}
.purr-howto-grid>span:nth-child(n+5):nth-child(-n+8){border-bottom:2px solid #80634a}
.purr-howto-grid>.purr-howto-missing{background:#e4efdd;color:#365c3d;box-shadow:inset 0 0 0 2px #54835b}
.grid-load-error{margin:8px 0;padding:12px;border:1px solid #b48c6b;border-radius:10px;background:#fff4df;color:#5d3f2d;font-size:12px;line-height:1.5}
.grid-load-error[hidden]{display:none!important}
.grid-load-error p{margin:0 0 8px}
.grid-load-error button{min-height:36px;margin:3px;padding:7px 10px;border:1px solid #bca483;border-radius:7px;background:#fffdf7;color:#573f2e;font:inherit;font-weight:650;cursor:pointer}
.grid-game.has-grid-error .grid-play-area{display:none}
.grid-help-summary{display:none}

/* The game picker already names the game. Keep the goal, rules and board
   together on a phone rather than repeat the page heading above them. */
@media(max-width:760px){
  .grid-page .article-header{display:none}
  .grid-page .game-navigation-region{row-gap:4px}
  .grid-page .game-selector>summary{min-height:40px}
  .grid-page [data-companion-dock="mobile"] .companion-corner{min-height:40px}
  .grid-game .game-header{margin-bottom:3px}
  .grid-game .game-title{font-size:19px;line-height:1.08}
  .grid-game .game-play-modes{margin:4px 0 3px}
  .grid-game .grid-controls{gap:3px 7px;margin:3px 0 4px}
  .grid-game .grid-pickers{width:100%;gap:8px}
  .grid-game .grid-pickers .game-field{display:flex;flex-direction:row;align-items:center;gap:5px;max-width:none;font-size:10px;white-space:nowrap}
  .grid-game .grid-pickers select{min-width:65px;min-height:32px;padding:4px 5px;font-size:11px}
  .grid-game .grid-pickers #gg-difficulty{min-width:74px}
  .grid-play-area{gap:3px}
  .grid-play-area .grid-welcome{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:5px;padding:3px 5px;font-size:10px;line-height:1.25}
  .grid-play-area .grid-welcome[hidden]{display:none}
  .grid-play-area .grid-welcome button{min-height:28px;font-size:10px}
  .grid-play-area .grid-welcome span{font-size:10px;line-height:1.25}
  .grid-play-area>.grid-toolbar{gap:3px}
  .grid-play-area .grid-toolbar .game-action{min-height:36px;font-size:11px;padding:7px 2px}
  .purr-game .grid-play-area>.grid-tools{gap:3px;padding:0}
  .purr-pad{gap:2px}
  .purr-pad-button{flex-direction:row;gap:1px;min-height:36px;font-size:10px}
  .purr-pad-button .purr-piece{width:17px;height:19px}
  .purr-tool-row .game-tool{min-height:33px;padding:4px 2px}
  .yarn-game .grid-play-area>.grid-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px;padding:3px 4px}
  .yarn-legend{display:flex;gap:3px;flex-wrap:wrap;min-width:0}
  .yarn-chip{width:16px;height:16px;font-size:9px}
  .grid-play-area .grid-tools .yarn-clear{min-height:32px;padding:4px;font-size:10px;white-space:nowrap}
  .grid-howto-example{gap:8px;padding:8px}
  .grid-howto-example figcaption{font-size:11px}
  .grid-evidence-steps{font-size:12px;line-height:1.5}
  .grid-play-area>.grid-help-summary:not([hidden]){display:block;order:5;align-self:flex-start;min-height:32px;margin:0;padding:5px 1px;border:0;background:none;color:#395f56;font:inherit;font-size:11px;line-height:1.4;text-decoration:underline;text-underline-offset:3px;cursor:pointer;text-align:left}
  .grid-game .grid-play-area>.grid-message{order:6}
  .grid-play-area #gg-evidence{order:7}
}
@media(max-width:600px) and (max-height:740px){
  .grid-page .site-header{height:56px}
  .grid-page .site-header nav{top:56px}
  .grid-page .game-selector>summary{min-height:38px}
  .grid-page [data-companion-dock="mobile"] .companion-corner{min-height:38px}
}
@media(max-width:359px){
  .grid-game .game-title{font-size:17px;line-height:1.1}
  .grid-game .grid-pickers{gap:7px}
  .grid-game .grid-pickers .game-field{gap:3px}
  .yarn-game .grid-play-area>.grid-tools{gap:3px}
  .yarn-legend{gap:2px}
  .yarn-chip{width:14px;height:14px;font-size:8px}
  .grid-play-area .grid-tools .yarn-clear{font-size:9px;padding:4px 2px;min-height:32px}
  .purr-hint-role{min-width:8px;font-size:7px;line-height:9px}
  .purr-cell.is-hint-source .purr-hint-notes{padding-left:6px}
  /* Both selects retain their explicit accessible labels. At this width the
     selected values identify the controls, leaving room for puzzle navigation. */
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])){gap:3px;flex-wrap:nowrap;justify-content:space-between}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) .grid-pickers{width:auto;flex-wrap:nowrap;gap:3px;flex:none}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) .game-field{font-size:0;gap:0}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) #gg-size{width:68px;min-width:68px}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) #gg-difficulty{width:74px;min-width:74px}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) .game-puzzle-switch{gap:3px;flex:none}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) .game-puzzle-switch .game-action{min-width:30px;min-height:32px;padding:4px 3px}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) .game-level-button{min-width:48px;font-size:10px}
  .grid-game .grid-controls:has(#gg-pickers:not([hidden])) .grid-howto-link{display:none}
}

/* A small celebration stays inside the result dialog, away from the board. */
.grid-game .game-complete>.grid-victory-art{display:block;width:100px;height:120px;object-fit:contain;margin:2px auto 8px}
.grid-game #gg-complete-dialog .game-action{min-height:40px}
