/* Scoped to Tower Defense; the other games retain their own layouts. */
html[data-game=tower]{--accent:#b9da95;--ink:#173f34}
html[data-game=tower] dialog{width:min(95vw,960px);padding:24px;scrollbar-gutter:stable;overscroll-behavior:contain}
html[data-game=tower] #dialogTitle{font-size:clamp(23px,4vw,34px);letter-spacing:-1px;line-height:1.15}
html[data-game=tower] .tower-realms{padding:26px;background:linear-gradient(130deg,#203f3b,#324c4b)!important;color:#f4f1dd!important;border:1px solid #7d998a;border-radius:22px;box-shadow:none}
html[data-game=tower] .tower-realms h2{color:#f4f1dd!important;font-size:clamp(25px,5vw,36px);letter-spacing:-1px;line-height:1.1;max-width:420px}
html[data-game=tower] .tower-realms p,html[data-game=tower] .tower-realms .eyebrow{color:#d2dfbf!important}
html[data-game=tower] .tower-realms .tower-menu-actions button{background:#eef4e7!important;color:#23443e!important;border-color:#a4baa0}
html[data-game=tower] .tower-realms .primary{background:#d3dfad!important;color:#243d31!important}
html[data-game=tower] .tower-catalog{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;align-items:stretch}
html[data-game=tower] .tower-catalog article{padding:0;overflow:hidden;border:1px solid #cedad4;border-radius:16px;box-shadow:0 4px 16px #213d3310}
html[data-game=tower] .tower-catalog canvas{width:100%;height:auto;max-height:none;aspect-ratio:3/2;object-fit:fill;border-radius:0;touch-action:pan-y}
html[data-game=tower] .tower-card-copy{padding:16px;display:flex;flex-direction:column;flex:1;gap:6px}
html[data-game=tower] .tower-card-copy h3{font-size:18px;line-height:1.15;letter-spacing:-.4px;margin:2px 0 0;overflow-wrap:anywhere}
html[data-game=tower] .tower-card-copy p{font-size:13px;line-height:1.55;margin:4px 0 10px;color:#4d625d!important;flex:1}
html[data-game=tower] .tower-tag{display:block;font-size:9px;font-weight:800;letter-spacing:1.5px;text-transform:uppercase;color:#56796a;margin-bottom:3px}
html[data-game=tower] .tower-specs{display:flex;gap:6px;flex-wrap:wrap;font-size:10px;color:#48655c;margin-top:auto}
html[data-game=tower] .tower-specs span{background:#eef3e9;border-radius:6px;padding:5px 7px}
html[data-game=tower] .tower-card-copy button{margin-top:10px;min-height:44px;background:#254f43!important;color:#f1f3df!important;border-color:#254f43}
html[data-game=tower] .tower-search{display:grid;grid-template-columns:1fr 160px;gap:12px;padding:14px;background:#eef3ec;border:1px solid #d6e0d7;border-radius:14px;margin:16px 0 8px}
html[data-game=tower] .tower-search label{display:grid;gap:7px;min-width:0;font-size:11px;font-weight:700;color:#446357}
html[data-game=tower] .tower-search input,html[data-game=tower] .tower-search select{font:inherit;font-size:14px;color:#243f36;background:#fff;border:1px solid #c9d8ce;border-radius:8px;min-width:0;width:100%;min-height:44px;padding:10px}
html[data-game=tower] .tower-count{font-size:11px;color:#597566!important;margin:9px 2px 16px}
html[data-game=tower] .tower-intro{max-width:640px;font-size:14px;line-height:1.6}
html[data-game=tower] .tower-filters{flex-wrap:nowrap;overflow-x:auto;padding:4px 2px 12px;scrollbar-width:thin}
html[data-game=tower] .tower-filters button{white-space:nowrap;min-height:44px;flex:none;border-radius:24px;padding:10px 15px}
html[data-game=tower] .tower-filters button[aria-pressed=true]{background:#254f43!important;color:#f1f3df!important;border-color:#254f43}
html[data-game=tower] .tower-map-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
html[data-game=tower] .tower-map{padding:8px 8px 13px;border-radius:15px;overflow:hidden}
html[data-game=tower] .tower-map canvas{height:auto;aspect-ratio:3/4;object-fit:fill;touch-action:pan-y}
html[data-game=tower] .tower-map b{font-size:13px;padding:0 3px}html[data-game=tower] .tower-map small{font-size:10px;padding:2px 3px}
html[data-game=tower] .tower-map .stars{display:block;margin:8px 3px 0;color:#b68d48}
html[data-game=tower] .tower-modes{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
html[data-game=tower] .tower-modes button{padding:20px;min-width:0}
html[data-game=tower] .tower-modes button[aria-pressed=true]{outline-color:#497b5f;background:#edf4e6!important}
html[data-game=tower] .tower-finish-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
html[data-game=tower] .tower-finish-grid .skin{padding:0 0 16px;border:1px solid #cbd8d2;border-radius:15px;overflow:hidden;background:#fff!important;color:#29453a!important}
html[data-game=tower] .tower-finish-grid .skin[aria-pressed=true]{outline:3px solid #668d58;outline-offset:-3px;background:#f4f7ec!important}
html[data-game=tower] .tower-finish-grid canvas{display:block;width:100%;height:auto;max-height:none;aspect-ratio:3/2;object-fit:fill;border:0;border-radius:0;margin:0 0 14px;touch-action:pan-y}
html[data-game=tower] .tower-finish-grid b{font-size:16px;display:block}html[data-game=tower] .tower-finish-grid small{font-size:12px;color:#4a6a52}
html[data-game=tower] .tower-purchase-preview{width:min(100%,420px);height:auto;aspect-ratio:3/2;margin:auto;border-radius:14px}
html[data-game=tower] #controls .row:first-child{grid-template-columns:1.4fr 1fr 1fr}
html[data-game=tower] #controls .row:first-child .compact{min-height:46px;font-weight:750}
html[data-game=tower] #controls #wave{background:#315e46!important;color:#f7f4df!important}
html[data-game=tower] #controls .compact:disabled{opacity:.45}
@media(min-width:1000px) and (min-height:650px){html[data-game=tower] #arena{max-width:1000px;display:grid;grid-template-columns:minmax(360px,1fr) 285px;grid-template-rows:auto 1fr auto;gap:12px;padding:18px}html[data-game=tower] .game-header{grid-column:1/-1}html[data-game=tower] #field{grid-column:1;grid-row:2/4}html[data-game=tower] #controls{grid-column:2;grid-row:2;align-self:center;gap:14px}html[data-game=tower] #controls .row:nth-child(2){grid-template-columns:repeat(2,minmax(0,1fr))}html[data-game=tower] #controls .compact{font-size:12px;min-height:46px}html[data-game=tower] #hint{grid-column:2;grid-row:3;font-size:12px;max-height:none;margin:12px}html[data-game=tower] .tower-camera{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){html[data-game=tower] dialog{padding:18px;width:95vw;max-height:91dvh}html[data-game=tower] .tower-catalog,html[data-game=tower] .tower-finish-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}html[data-game=tower] .tower-map-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}html[data-game=tower] .tower-card-copy{padding:12px}html[data-game=tower] .tower-card-copy h3{font-size:16px}html[data-game=tower] .tower-card-copy p{font-size:12px}html[data-game=tower] .tower-search{grid-template-columns:1fr 105px;gap:8px;padding:10px}html[data-game=tower] .tower-realms{padding:20px}}
@media(max-width:360px){html[data-game=tower] .tower-catalog{grid-template-columns:1fr}html[data-game=tower] .tower-catalog canvas{max-height:190px}html[data-game=tower] .tower-modes{grid-template-columns:1fr}html[data-game=tower] .tower-finish-grid b{font-size:13px}html[data-game=tower] dialog{padding:13px}}
@media(prefers-reduced-motion:reduce){html[data-game=tower] button:active{transform:none}}
html[data-game=tower] body #menu .tower-realms{background:#eef3e6!important;background-image:linear-gradient(120deg,#eef3e6,#e3eddf)!important;border-color:#b8cbb1!important}
html[data-game=tower] body #menu .tower-realms :is(h2,p,.eyebrow){color:#27493b!important}
html[data-game=tower] body #menu .tower-realms .tower-menu-actions{background:transparent!important}
html[data-game=tower] body #dialog .tower-specs{background:transparent!important}
html[data-game=tower] body #dialog .tower-specs span{color:#496350!important;background:#edf2e8!important}
html[data-game=tower] body #dialog .tower-search{background:#eff4e9!important;border-color:#d2dfcf!important}
html[data-game=tower] body #dialog .tower-search label{background:transparent!important}
/* The shared collection stylesheet loads after the game; keep this atelier's sizing. */
html[data-game=tower] body #dialog #dialogBody .tower-finish-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:16px!important}
html[data-game=tower] body #dialog #dialogBody .tower-finish-grid .skin{padding:0 0 16px!important;overflow:hidden;min-width:0;border-radius:15px!important;background:#fff!important}
html[data-game=tower] body #dialog #dialogBody .tower-finish-grid canvas{width:100%!important;height:auto!important;aspect-ratio:3/2!important;max-height:none!important;object-fit:fill!important;border:0!important;border-radius:0!important;margin:0 0 14px!important}
@media(max-width:700px){html[data-game=tower] body #dialog #dialogBody .tower-finish-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}}
