.ts-game-entry{text-align:center;margin:8px 12px 16px}
.ts-game-entry button,#ts-game header button,.ts-memory-controls button,#ts-memory-match a,#ts-memory-match button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:6px 14px;border:1px solid #24565c;border-radius:8px;background:#f2faf9;color:#173f46;font:inherit;font-weight:700;cursor:pointer}
#ts-game,#ts-memory-match{box-sizing:border-box;width:min(560px,94vw);max-height:90vh;overflow:auto;border:1px solid #a5c3c2;border-radius:16px;padding:16px;background:#fff;color:#173f46;text-align:left}
#ts-game::backdrop,#ts-memory-match::backdrop{background:#102e34a6}
#ts-game header,.ts-memory-controls,#ts-memory-match>div{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
#ts-game h2,#ts-game form{margin:0}
.ts-memory-controls select{min-height:44px;font:inherit}
#ts-memory-board{display:grid;grid-template-columns:repeat(var(--columns,3),minmax(0,1fr));gap:clamp(4px,1.5vw,10px)}
#ts-memory-board button,.ts-memory-center{display:grid;place-items:center;aspect-ratio:1;min-width:0;padding:3px;border:2px solid #327477;border-radius:8px;background:#21575c;color:#fff;overflow:hidden}
#ts-memory-board button{position:relative;cursor:pointer}
#ts-memory-board button::before{content:'?';position:absolute;font-size:clamp(1rem,5vw,2rem);font-weight:700}
#ts-memory-board button.is-open{background:#f2faf9;color:#173f46}
#ts-memory-board button.is-open::before{display:none}
#ts-memory-board button:disabled{border-color:#27836b;cursor:default;opacity:1}
#ts-memory-board img{visibility:hidden;display:block;width:100%;height:100%;min-height:0;object-fit:contain}
#ts-memory-board .is-open img{visibility:visible}
#ts-memory-board .ts-memory-center{border-color:transparent;background:#e6f3f0;color:#327477}
#ts-memory-match h3{margin:0 0 10px}
#ts-memory-match img{display:block;width:100%;height:min(55vh,400px);object-fit:contain;background:#f4f8f7;border-radius:8px;margin-bottom:12px}
.ts-game-entry [hidden]{display:none!important}

#ts-memory-board button{box-sizing:border-box;width:100%;min-height:0}
.ts-game-entry [role=status]:not(:empty){display:block;margin-top:6px}
