/* v0.1.60 – approved symmetrical composition, screen only.
   All games inherit this look with shared-game-shell. Race/PDF internals untouched. */
:root{--shell-header-height:122px;--shell-button-height:46px}
html[data-theme] .app{grid-template-rows:var(--shell-header-height) minmax(0,1fr)!important;gap:8px!important;padding:6px clamp(9px,1.2vw,22px) 10px!important}
html[data-theme] .topbar{height:var(--shell-header-height)!important;min-height:0!important;width:100%;padding:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:space-between!important;gap:3px!important;color:var(--theme-text)!important;position:relative}
html[data-theme] .topbar .identity{height:53px;min-height:53px;width:100%;display:flex!important;justify-content:center!important;align-items:center!important;margin:0!important;gap:0!important;flex:none!important}
html[data-theme] .topbar .identity-mark{display:none!important}
html[data-theme] .topbar .identity-text{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-width:0;width:100%}
html[data-theme] .topbar .identity .eyebrow{font-size:.58rem;line-height:1;letter-spacing:1.5px;margin:0 0 6px;color:var(--theme-muted);font-weight:900}
html[data-theme] .topbar .identity-title-line{display:flex;align-items:center;justify-content:center;gap:12px;min-width:0;width:100%;text-align:center}
html[data-theme] .topbar h1{font-size:clamp(20px,2.2vw,30px);font-weight:950;line-height:1.1;white-space:nowrap;letter-spacing:-.05em}
html[data-theme] .topbar #brand-home{font:inherit!important;font-size:inherit!important;font-weight:inherit!important;line-height:inherit!important;letter-spacing:inherit!important}
html[data-theme="light"] .topbar #brand-home,html[data-theme="light"] .topbar #brand-home:hover{color:#203a51!important}
html[data-theme="light"] .topbar #brand-home span,html[data-theme="light"] .topbar #brand-home:hover span{color:#087e81!important}
html[data-theme="dark"] .topbar #brand-home,html[data-theme="dark"] .topbar #brand-home:hover{color:#e7f6fe!important}
html[data-theme="dark"] .topbar #brand-home span,html[data-theme="dark"] .topbar #brand-home:hover span{color:#66dcd1!important}
html[data-theme] .topbar #active-game-name{display:inline-flex!important;align-items:center;max-width:min(33vw,310px);font-size:clamp(13px,1.12vw,18px);font-weight:900;line-height:1.1;height:37px;min-height:37px;padding:7px 14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-radius:11px;background:var(--theme-elev);border:1px solid var(--theme-border);box-shadow:0 2px 0 #899db225;color:var(--theme-text)}
html[data-theme] .topbar #active-game-name[hidden]{display:none!important}
html[data-theme] .primary-toolbar{display:flex;align-items:center;justify-content:center;gap:clamp(5px,.85vw,14px);width:100%;height:61px;min-height:0;padding:5px clamp(8px,1.2vw,19px);border:1px solid var(--theme-border);background:var(--theme-elev);border-radius:17px;box-shadow:0 6px 22px #13324713;min-width:0;overflow:hidden}
html[data-theme] .primary-toolbar .mode-nav,html[data-theme] .primary-toolbar .top-actions{display:contents!important}
html[data-theme] .primary-toolbar :is(.mode-button,.mode-settings-button,.top-tool){box-sizing:border-box;flex:0 1 auto;min-height:var(--shell-button-height)!important;height:var(--shell-button-height)!important;max-height:var(--shell-button-height)!important;display:inline-flex;align-items:center;justify-content:center;gap:5px;margin:0!important;border-radius:13px;white-space:nowrap;font-size:clamp(11px,.91vw,15px)!important;font-weight:900;line-height:1;letter-spacing:0;transform:none;padding:0 clamp(9px,1.03vw,19px)!important;transition:filter .12s,box-shadow .12s!important;box-shadow:0 3px 0 #3d668112,0 4px 9px #20374812}
html[data-theme] .primary-toolbar :is(.mode-button,.mode-settings-button,.top-tool):hover:not(:disabled){filter:brightness(.96)}
html[data-theme] .primary-toolbar .mode-button .nav-icon{font-size:1.1em!important;margin:0 3px 0 0!important}
html[data-theme] .primary-toolbar .mode-settings-button{background:linear-gradient(180deg,#0ea39b,#0d8580);color:white;border:1px solid #0b7774;box-shadow:0 3px 0 #07605e,0 6px 12px #136c691f}
html[data-theme="dark"] .primary-toolbar .mode-settings-button{background:linear-gradient(180deg,#168f89,#0e746f);border-color:#66aaa7;color:#fff}
html[data-theme] .primary-toolbar .mode-settings-button:disabled{opacity:.5;cursor:default}
html[data-theme] .primary-toolbar #theme-toggle{min-width:0!important;width:auto!important}
html[data-theme] .primary-toolbar #theme-toggle .tool-label{display:inline!important;font-size:inherit!important}
html[data-theme] .primary-toolbar #open-help .tool-label,html[data-theme] .primary-toolbar #fullscreen .tool-label{display:inline!important;font-size:inherit!important}
html[data-theme] .primary-toolbar .theme-icon{font-size:1.05em}
html[data-theme] .primary-toolbar #fullscreen .fullscreen-symbol{font-size:1.2em}
html[data-theme] .primary-toolbar #go-home{background:linear-gradient(180deg,#bd4980,#982f62)!important;color:#fff!important;border-color:#963260!important}
html[data-theme="dark"] .primary-toolbar #go-home{background:linear-gradient(180deg,#8b3966,#64274c)!important;border-color:#c27ba6!important}
html[data-theme] .primary-toolbar :is(#mode-class,#mode-race,#mode-print){font-size:clamp(11px,.91vw,15px)!important;min-width:0!important}
html[data-theme] .primary-toolbar :is(#mode-class,#mode-race,#mode-print) .nav-icon{font-size:1.1em!important;margin-right:3px!important}
html[data-theme] body[data-mode="home"] .primary-toolbar .mode-nav{display:contents!important}
html[data-theme] body[data-mode="home"] #open-help{display:inline-flex!important}
html[data-theme] body[data-mode="home"] .primary-toolbar .top-actions{display:contents!important}
/* The former top-of-game command strip is removed; native new-game buttons are moved into each controls row. */
body[data-mode="class"] section.shared-game-shell > .arena-head{display:none!important}
body[data-mode="class"] section.shared-game-shell > .playground{height:100%;flex:1;min-height:0;align-items:center;justify-content:center;padding:5px 12px 8px!important}
body[data-mode="class"] section.shared-game-shell .playground :is(.game-actions,.maze-controls,.abc-controls,.fence-controls,.sky-controls,.akari-controls,.bs-controls,.kk-controls,.ft-controls,.hs-controls,.ng-controls,.hi-controls,.sh-controls,.tt-controls,.nu-controls,.sb-controls,.kr-controls,.tz-controls,.py-controls,.cd-controls,.tg-controls){display:flex!important;align-items:center;justify-content:center;flex-wrap:wrap!important;gap:clamp(5px,.65vw,10px)!important;width:100%;max-width:100%;margin-inline:auto}
body[data-mode="class"] section.shared-game-shell .playground button.shell-new-game{order:-99;min-width:120px;min-height:40px;padding:7px 14px!important;border-radius:12px!important;font-size:.85rem!important;background:linear-gradient(180deg,#10a098,#087e79)!important;border:1px solid #0b7770!important;color:#fff!important;box-shadow:0 3px 0 #075d58!important;white-space:nowrap!important;display:inline-flex!important;align-items:center;justify-content:center}
body[data-mode="class"] section.shared-game-shell .playground button.shell-new-game:hover:not(:disabled){background:linear-gradient(180deg,#12aea3,#0a8b82)!important}
body[data-mode="class"] section.shared-game-shell .playground :is(.game-actions,.maze-controls,.abc-controls,.fence-controls,.sky-controls,.akari-controls,.bs-controls,.kk-controls,.ft-controls,.hs-controls,.ng-controls,.hi-controls,.sh-controls,.tt-controls,.nu-controls,.sb-controls,.kr-controls,.tz-controls,.py-controls,.cd-controls,.tg-controls) .btn:not(.shell-new-game){min-height:40px!important;min-width:82px!important;padding:7px 11px!important;font-size:.84rem!important;border-radius:12px!important}
/* Game-specific adaptations: Hedef Sayı needs its right process/history pane. Do not flatten its grid. */
body[data-mode="class"] .tg-solo-layout{width:min(1120px,100%)!important;max-width:100%!important}
body[data-mode="class"] .tg-history-panel{max-height:min(65dvh,570px);overflow-y:auto;scrollbar-width:thin}
body[data-mode="class"] .tg-play-area{width:min(680px,100%);max-width:100%}
/* Complex grids and teacher-facing bars keep enough room for the player's actual actions. */
body[data-mode="class"] section.shared-game-shell .playground .feedback{max-width:min(100%,820px)}
@media(max-width:1260px){
 :root{--shell-header-height:113px;--shell-button-height:42px}
 html[data-theme] .topbar .identity{height:48px;min-height:48px}
 html[data-theme] .primary-toolbar{height:58px;gap:5px;padding:5px 6px}
 html[data-theme] .primary-toolbar :is(.mode-button,.mode-settings-button,.top-tool){font-size:clamp(10px,.9vw,13px)!important;padding:0 clamp(6px,.75vw,11px)!important}
}
@media(max-width:880px){
 :root{--shell-header-height:108px;--shell-button-height:41px}
 html[data-theme] .topbar .identity{height:45px;min-height:45px}
 html[data-theme] .primary-toolbar{justify-content:flex-start;overflow-x:auto;scrollbar-width:thin;overscroll-behavior-x:contain;gap:6px;padding:4px 7px}
 html[data-theme] .primary-toolbar :is(.mode-button,.mode-settings-button,.top-tool){flex:0 0 auto!important;min-width:0!important;font-size:11px!important;padding:0 11px!important}
 html[data-theme] .topbar h1{font-size:clamp(18px,3.3vw,24px)}
 html[data-theme] .topbar .identity .eyebrow{font-size:.5rem;margin-bottom:5px}
 html[data-theme] .topbar #active-game-name{max-width:30vw;font-size:.8rem;height:29px;min-height:29px;padding:4px 7px}
 body[data-mode="class"] section.shared-game-shell .playground button.shell-new-game{min-height:36px!important;min-width:92px;padding:4px 10px!important;font-size:.75rem!important}
 body[data-mode="class"] section.shared-game-shell .playground :is(.game-actions,.maze-controls,.abc-controls,.fence-controls,.sky-controls,.akari-controls,.bs-controls,.kk-controls,.ft-controls,.hs-controls,.ng-controls,.hi-controls,.sh-controls,.tt-controls,.nu-controls,.sb-controls,.kr-controls,.tz-controls,.py-controls,.cd-controls,.tg-controls) .btn:not(.shell-new-game){min-height:36px!important;min-width:65px!important;padding:4px 8px!important;font-size:.74rem!important}
}
@media(max-width:520px){
 :root{--shell-header-height:95px;--shell-button-height:35px}
 html[data-theme] .app{gap:4px!important;padding:3px 6px 6px!important}
 html[data-theme] .topbar .identity{height:40px;min-height:40px}
 html[data-theme] .topbar h1{font-size:clamp(17px,4.6vw,22px)}
 html[data-theme] .primary-toolbar{height:51px;border-radius:11px;gap:5px}
 html[data-theme] .topbar #active-game-name{display:none!important}
 html[data-theme] .primary-toolbar :is(.mode-button,.mode-settings-button,.top-tool){font-size:11px!important;padding:0 10px!important;border-radius:9px!important}
 body[data-mode="class"] section.shared-game-shell > .playground{padding:3px 5px 6px!important}
 body[data-mode="class"] section.shared-game-shell .playground button.shell-new-game{min-height:33px!important;min-width:78px;padding:4px 7px!important;font-size:.72rem!important}
 body[data-mode="class"] section.shared-game-shell .playground :is(.game-actions,.maze-controls,.abc-controls,.fence-controls,.sky-controls,.akari-controls,.bs-controls,.kk-controls,.ft-controls,.hs-controls,.ng-controls,.hi-controls,.sh-controls,.tt-controls,.nu-controls,.sb-controls,.kr-controls,.tz-controls,.py-controls,.cd-controls,.tg-controls) .btn:not(.shell-new-game){min-height:32px!important;min-width:60px!important;padding:3px 6px!important;font-size:.69rem!important}
}
@media(max-height:620px){
 :root{--shell-header-height:77px;--shell-button-height:30px}
 html[data-theme] .topbar .identity{height:33px;min-height:33px}
 html[data-theme] .topbar .identity .eyebrow{display:none}
 html[data-theme] .topbar h1{font-size:20px}
 html[data-theme] .primary-toolbar{height:41px;padding:3px 6px;border-radius:10px}
 html[data-theme] .primary-toolbar :is(.mode-button,.mode-settings-button,.top-tool){font-size:11px!important;height:31px!important;min-height:31px!important;max-height:31px!important}
 body[data-mode="class"] section.shared-game-shell .playground .feedback{min-height:18px;font-size:.65rem}
}
/* A little more room for the flagship Sudoku board on tall desktop displays.
   Small/short screens keep their existing fit calculation. */
@media(min-width:1261px) and (min-height:800px){
 body[data-mode="class"] section.shared-game-shell #sudoku-board{
   max-width:min(525px,calc(100dvh - 290px),calc(100vw - 45px))!important;
   max-height:min(525px,calc(100dvh - 290px),calc(100vw - 45px))!important;
 }
}

/* v0.1.61 — The catalogue/home page displays ONLY the centered platform title.
   The approved eight-button toolbar remains unchanged for class/race/A4 screens.
   Catalog cards and their natural vertical scrolling remain untouched. */
html[data-theme] body[data-mode="home"] .app {
  grid-template-rows: var(--home-title-height, 64px) auto !important;
  align-content: start !important;
}
html[data-theme] body[data-mode="home"] .topbar {
  height: var(--home-title-height, 64px) !important;
  min-height: 0 !important;
  gap: 0 !important;
  justify-content: center !important;
}
html[data-theme] body[data-mode="home"] .topbar .identity {
  height: 100% !important;
  min-height: 0 !important;
  justify-content: center !important;
}
html[data-theme] body[data-mode="home"] .topbar .identity .eyebrow,
html[data-theme] body[data-mode="home"] .topbar #active-game-name,
html[data-theme] body[data-mode="home"] .topbar .primary-toolbar {
  display: none !important;
}
html[data-theme] body[data-mode="home"] .topbar .identity-title-line {
  justify-content: center !important;
  text-align: center !important;
}
@media(max-width:520px){
  html[data-theme] body[data-mode="home"] .app {--home-title-height:51px}
  html[data-theme] body[data-mode="home"] .topbar h1 {font-size:clamp(19px,5.2vw,25px)}
}
@media(max-height:620px){
  html[data-theme] body[data-mode="home"] .app {--home-title-height:46px}
}
