/* Match the site's explicit theme, not the device preference alone. */
.cozy-main .word-board{position:relative;isolation:isolate;touch-action:none;user-select:none;gap:0;padding:6px;background:#f4f3e8;border-radius:14px}
.cozy-main .word-board button,.cozy-main .word-board button.found,.cozy-main .word-board button.selected{position:relative;z-index:1;background:transparent;border:0;box-shadow:none;outline-offset:-3px;color:#173f49}
.cozy-main .word-board button.selected{outline:none}
.word-marker{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:0;opacity:.8}
.cozy-main .pair-board canvas{display:block;width:100%;height:auto;aspect-ratio:120/84}
.cozy-main .pair-board button{overflow:hidden}
.cozy-main .pair-label{font-size:clamp(10px,2.5vw,12px)}
html:not([data-theme="dark"]) .cozy-main{color:#173f49}
html:not([data-theme="dark"]) .cozy-panel{background:#fffdf7;border-color:#c6d9d4}
html:not([data-theme="dark"]) .cozy-lead,html:not([data-theme="dark"]) .cozy-kicker{color:#527078}
.cozy-main button,.cozy-main select,.cozy-main .word-list span{color:#173f49}
.cozy-main button[aria-pressed="true"]{color:white}
.cozy-main .word-board{width:100%;min-width:0;box-sizing:border-box}
.cozy-main .word-board button{width:100%;height:auto;min-width:0;aspect-ratio:1;line-height:1;padding:0;border-radius:9px}
.cozy-main .pair-board{width:100%;box-sizing:border-box}
.cozy-main .pair-board button{color:#d7eece}
.cozy-main .pair-board button.open,.cozy-main .pair-board button.matched{color:#174953}
.puzzle-hub [hidden],.hub-extras [hidden]{display:none!important}
html[data-theme="dark"] .puzzle-card{background:#173a44;color:#e2eee9;border-color:#45606a}
html[data-theme="dark"] .puzzle-art{color:#8dd1c3}
html.theme-night .cozy-main{color:#e2eee9}
html.theme-night .cozy-panel{background:#173a44;border-color:#45606a}
html.theme-night .cozy-lead,html.theme-night .cozy-kicker{color:#b4cdc8}

/* Mobile play: readable tiles, deliberate gestures and stable card heights. */
.cozy-main .word-scroll{min-width:0;max-width:100%;overflow:auto;padding:3px 3px 10px;overscroll-behavior-x:contain;scrollbar-width:thin}
.cozy-main .word-board{touch-action:pan-x pan-y;min-width:268px}
.cozy-main .word-board[data-grid-size="12"]{min-width:396px}
.cozy-main .word-board[data-grid-size="14"]{min-width:460px}
.cozy-main .word-board[data-input-mode="drag"]{touch-action:none}
.cozy-main .word-board button{min-height:0;font-size:18px;touch-action:inherit;-webkit-tap-highlight-color:transparent}
.cozy-main .word-scroll .word-board[data-grid-size] button{font-size:18px}
.cozy-main .word-input-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0}
.cozy-main .word-input-controls>span{font-size:13px;font-weight:600;margin-right:auto}
.cozy-main .word-input-controls button{min-height:44px;padding:8px 12px;border:1px solid #bed4ce;border-radius:999px;background:#fffdf7}
.cozy-main .word-input-controls button[aria-pressed="true"]{background:#107e83;color:white;border-color:#107e83}
.cozy-main .pair-board{gap:10px;align-items:stretch}
.cozy-main .pair-board button{aspect-ratio:auto;min-height:112px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px;touch-action:manipulation;transition:background-color .15s,border-color .15s;position:relative}
.cozy-main .pair-board canvas{width:100%;height:65px;object-fit:contain;flex:none}
.cozy-main .pair-label{font-size:12px;line-height:1.25;min-height:30px;display:flex;align-items:center;justify-content:center;overflow-wrap:anywhere}
.cozy-main .pair-board button.matched{opacity:1;border-color:#56a48d;background:#e5f2e8}
.cozy-main .pair-board button.matched::after{content:'✓';position:absolute;right:5px;top:3px;font-size:12px;color:#25654f}
.cozy-main .cozy-status{min-height:2.8em;line-height:1.45}
.cozy-main button:focus-visible,.cozy-main select:focus-visible,.cozy-main .word-scroll:focus-visible{outline:3px solid #16878d;outline-offset:2px}
@media(max-width:600px){
 .cozy-main .cozy-toolbar select{font-size:16px;max-width:100%;min-width:0;flex:1 1 100%}
 .cozy-main .cozy-toolbar{gap:8px}
 .cozy-main .cozy-stats{gap:6px;flex-wrap:wrap}
 .cozy-main .pair-board{gap:7px}
 .cozy-main .pair-board button{min-height:98px;padding:4px}
 .cozy-main .pair-board canvas{height:53px}
 .cozy-main .word-input-controls>span{flex-basis:100%}
 .cozy-main .word-list{gap:6px}
}
@media(prefers-reduced-motion:reduce){.cozy-main .pair-board button{transition:none}}
.cozy-mode-picker{padding:16px;background:#eaf3ed;border:1px solid #c6d9d4;border-radius:16px;margin-bottom:18px;display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;align-items:center}
.cozy-mode-picker>label{font-weight:750;font-size:17px}
.cozy-mode-picker>select{width:100%;min-width:0;font-size:16px}
.cozy-mode-picker p{grid-column:1/-1;margin:0;font-size:14px;line-height:1.5;color:#45656b}
.cozy-mode-picker small{grid-column:1/-1;font-size:12px;color:#45656b}
#round-controls{grid-column:1/-1;display:flex;gap:12px;align-items:center;justify-content:space-between;background:#fffdf7;padding:8px 12px;border-radius:12px}
#round-clock{font-variant-numeric:tabular-nums;font-size:18px}
.deck-picker{display:flex;align-items:center;gap:8px;font-size:14px}
.cozy-main .pair-symbol{font-size:38px;line-height:1;display:grid;place-items:center;height:65px}
.cozy-main .clue-list{display:grid;grid-template-columns:1fr}
.cozy-main .clue-list span{font-size:13px;line-height:1.5;text-transform:none}
.cozy-main .word-board[data-grid-size="6"]{min-width:230px;max-width:390px}
.cozy-main #board button:disabled{cursor:default;opacity:.85}
.cozy-main #board button{scroll-margin-block:150px 110px}
@media(max-width:600px){.cozy-mode-picker{grid-template-columns:1fr;padding:12px}.cozy-main .pair-symbol{height:53px;font-size:32px}.deck-picker{width:100%}.deck-picker select{flex:1!important}.cozy-main .clue-list{grid-template-columns:1fr 1fr}}
