.ts-extra-game-button,#ts-catalog-game button,#ts-catalog-game a,#ts-catalog-game select {
  min-height:44px; padding:6px 12px; border:1px solid #24565c; border-radius:8px;
  color:#173f46; background:#f2faf9; font:inherit; cursor:pointer;
}
.ts-extra-game-button { margin:0 12px 12px; }
.ts-extra-game-button[hidden] { display:none!important; }
#ts-catalog-game { box-sizing:border-box; width:min(650px,94vw); max-height:90vh; overflow:auto; padding:16px; border:1px solid #a5c3c2; border-radius:16px; background:white; color:#173f46; text-align:left; }
#ts-catalog-game::backdrop { background:#102e34a6; }
#ts-catalog-game header,.ts-extra-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
#ts-catalog-game header { justify-content:space-between; }
#ts-catalog-game header h2,#ts-catalog-game header form { margin:0; }
.ts-extra-controls { margin:12px 0; }
.ts-extra-controls select { max-width:min(55vw,320px); }
.ts-catch-board { position:relative; height:min(52vh,390px); background:#e0f2f5; border-radius:10px; overflow:hidden; touch-action:pan-y; }
.ts-falling-shirt,.ts-catching-shark { position:absolute; transform:translateX(-50%); pointer-events:none; }
.ts-falling-shirt { width:15%; height:18%; object-fit:contain; }
.ts-catching-shark { bottom:3%; font-size:clamp(26px,8vw,48px); line-height:1; }
.ts-sort-board { display:grid; grid-template-columns:repeat(auto-fit,minmax(76px,1fr)); gap:8px; }
#ts-catalog-game .ts-sort-shelf { padding:5px; font-size:.8rem; }
.ts-sort-stack { display:flex; flex-direction:column-reverse; min-height:144px; margin-top:5px; }
.ts-sort-stack img { width:100%; height:36px; object-fit:contain; box-sizing:border-box; border:3px solid var(--shirt-color); border-radius:5px; background:white; }
#ts-catalog-game button[aria-pressed=true] { outline:3px solid #a85b14; outline-offset:-3px; }
.ts-puzzle-board { display:grid; grid-template-columns:repeat(var(--pieces),minmax(0,1fr)); width:min(100%,390px); margin:auto; aspect-ratio:1; }
#ts-catalog-game .ts-puzzle-board button { min-width:0; min-height:0; aspect-ratio:1; padding:0; border:1px solid #abc3c1; border-radius:0; background-size:calc(var(--pieces) * 100%) calc(var(--pieces) * 100%); }
.ts-extra-results article { display:flex; align-items:center; gap:8px; margin:8px 0; }
.ts-extra-results img { width:110px; height:100px; object-fit:contain; background:#f4f8f7; }
.ts-extra-results a { display:inline-flex; align-items:center; overflow-wrap:anywhere; }

.ts-sort-preview article { display:grid; justify-items:start; }
.ts-sort-preview img { width:min(100%,320px); height:min(32vh,240px); }

#ts-catalog-game.ts-catch-fullscreen {
  position:fixed; inset:0; margin:0; width:100%; height:100%; max-width:none; max-height:none;
  border:0; border-radius:0; padding:0; background:transparent; overflow:hidden; touch-action:none;
}
#ts-catalog-game.ts-catch-fullscreen::backdrop { background:rgb(16 46 52 / 70%); }
.ts-catch-fullscreen :is(.ts-catch-board,.ts-invaders-board) {
  position:absolute; inset:0; height:auto; border-radius:0; background:transparent; touch-action:none;
}
#ts-catalog-game.ts-catch-fullscreen header,
.ts-catch-fullscreen .ts-extra-controls,.ts-catch-fullscreen .ts-extra-status {
  position:relative; z-index:1; width:fit-content; margin:8px 12px; padding:5px 8px;
  border-radius:8px; background:#fffffff2;
}
.ts-catch-fullscreen .ts-falling-shirt { width:clamp(22px,4vw,60px); height:clamp(28px,8vh,74px); filter:drop-shadow(0 1px 4px #fff) drop-shadow(0 2px 4px #173f46); }
.ts-catch-fullscreen .ts-catching-shark { bottom:max(3%,env(safe-area-inset-bottom)); filter:drop-shadow(0 1px 4px #fff); }

.ts-catching-shark.is-facing-right { transform:translateX(-50%) scaleX(-1); }

.ts-catch-fullscreen .ts-catching-shark { width:clamp(32px,7vw,66px); height:auto; }
.ts-puzzle-choices { display:grid; grid-template-columns:repeat(auto-fill,minmax(76px,1fr)); gap:8px; }
#ts-catalog-game .ts-puzzle-choices button { padding:4px; }
.ts-puzzle-choices img { display:block; width:100%; aspect-ratio:1; object-fit:contain; }

.ts-invaders-board { position:relative; height:clamp(260px,55vh,460px); overflow:hidden; touch-action:none; background:#102e34; border-radius:10px; }
.ts-invader,.ts-invaders-player,.ts-invaders-shot { position:absolute; transform:translate(-50%,-50%); pointer-events:none; }
.ts-invader { width:10%; height:9%; object-fit:contain; }
.ts-invaders-player { top:91%; width:clamp(32px,9%,52px); background:#fff; border-radius:50%; }
.ts-invaders-shot { width:4px; height:12px; background:#9ff6ee; border-radius:3px; }

.ts-home-games {
  box-sizing:border-box;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:360px;
  padding:20px 12px;
}
.ts-home-games > :is(.ts-game-entry,.ts-teendr-entry,.ts-extra-game-button) { margin:0; }
.ts-home-games > :is(.ts-game-entry,.ts-teendr-entry):not(:has(button:not([hidden]))) { display:none; }
