body[data-page="game"],body[data-page="game"] .site-shell{min-height:var(--catalog-height,100dvh)}
body[data-page="game"] .header-inner a{min-height:44px;display:inline-flex;align-items:center}
body[data-page="game"] .level-card[hidden],body[data-page="game"] .catalog-pages[hidden]{display:none}
body[data-page="game"] .catalog-pages{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
body[data-page="game"] .catalog-pages button{min-width:80px;min-height:44px;font-size:16px;padding:4px 10px}
body[data-page="game"] .catalog-pages span{font-size:14px}
@media(max-width:700px){
 body[data-page="game"]:not([data-catalog-compact="true"]) .level-card.with-hint-summary{grid-template-columns:72px minmax(0,1fr) 48px}
 body[data-page="game"]:not([data-catalog-compact="true"]) .level-card.with-hint-summary .level-number{width:72px}
}
/* Registered levels share a compact list; this does not style the games. */
@media(min-width:701px){
 body[data-page="game"] .main-content{padding:16px 0;display:flex;flex-direction:column;justify-content:center;gap:14px}
 body[data-page="game"] .game-detail-hero{grid-template-columns:minmax(0,1fr) 170px;gap:20px;margin:0}
 body[data-page="game"] .game-cover-large{max-height:150px}
 body[data-page="game"] .level-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 body[data-page="game"] .level-card{padding:12px 16px}
 body[data-page="game"] .section-heading{margin-bottom:8px}
 body[data-page="game"] .footer-inner{padding:6px 0}
}
@media(max-width:700px){
 body[data-page="game"] .site-shell{min-height:var(--catalog-height,100dvh)}
 body[data-page="game"] .main-content{padding:6px 0;gap:8px;justify-content:center}
 body[data-page="game"] .game-detail-hero{display:block;margin:0;position:relative}
 body[data-page="game"] .game-detail-hero .hero{margin:0}
 body[data-page="game"] h1{font-size:20px;line-height:1.4;padding-right:38px;margin:0 0 5px}
 body[data-page="game"] .game-cover-large{position:absolute;width:32px;height:32px;right:0;top:0}
 body[data-page="game"] .lead{font-size:14px;line-height:1.4;margin:0 0 5px}
 body[data-page="game"] .context-note{font-size:14px;line-height:1.4;margin:0;padding:0;border:0}
 body[data-page="game"] .section-heading{display:flex;justify-content:space-between;align-items:center;margin:0 0 4px}
 body[data-page="game"] .section-heading>div{display:flex;align-items:center;gap:7px}
 body[data-page="game"] .section-heading h2{font-size:18px;margin:0}
 body[data-page="game"] .section-heading p,body[data-page="game"] .section-heading>a{font-size:14px}
 body[data-page="game"] .level-list{gap:6px}
 body[data-page="game"] .level-card{grid-template-columns:24px minmax(0,1fr) 52px;gap:6px;padding:7px}
 body[data-page="game"] .level-card .button{grid-column:auto;min-width:0;width:52px;padding:5px;font-size:16px;min-height:44px}
 body[data-page="game"] .level-number{width:24px;height:30px;font-size:22px}
 body[data-page="game"] .level-copy h3{font-size:16px;line-height:1.4;margin:0 0 2px}
 body[data-page="game"] .level-state{font-size:14px;line-height:1.4;margin:0}
 body[data-page="game"] .site-footer{padding:4px 0}
 body[data-page="game"] .footer-inner{font-size:14px;gap:3px;flex-wrap:wrap}
 body[data-page="game"] .footer-inner p{font-size:14px;line-height:1.4}
}
@media(max-width:700px){body[data-page="game"] .section-heading h2{line-height:1.5}body[data-page="game"] .level-number{font-size:20px}}
body[data-page="game"] h1,body[data-page="game"] h2,body[data-page="game"] h3{line-height:1.5}
@media(max-width:700px) and (max-height:540px){body[data-page="game"] .main-content{padding:3px 0;gap:5px}body[data-page="game"] .level-card{padding:6px}}
@media(max-width:700px){
 body[data-page="game"] .header-inner,body[data-page="game"] .main-content,body[data-page="game"] .footer-inner{width:calc(100% - 16px)}
 body[data-page="game"] .level-card{grid-template-columns:44px minmax(0,1fr) 48px;grid-template-rows:22px 20px;column-gap:6px;row-gap:0;padding:5px 6px}
 body[data-page="game"] .level-copy{display:contents}
 body[data-page="game"] .level-number{grid-column:1;grid-row:1;width:44px;height:22px;font-size:19px;background:transparent}
 body[data-page="game"] .level-state{grid-column:1;grid-row:2;font-size:14px;line-height:20px;justify-content:center;white-space:nowrap}
 body[data-page="game"] .level-copy h3{grid-column:2;grid-row:1/3;font-size:16px;line-height:1.3;margin:0;align-self:center}
 body[data-page="game"] .level-card .button{grid-column:3;grid-row:1/3;width:48px}
 body[data-page="game"] .footer-inner{padding:0}
 body[data-page="game"] .section-heading{gap:4px}
 body[data-page="game"] .section-heading>div{gap:4px}
}
/* Four registered levels also fit the compact visible area below browser bars. */
@media(max-width:700px) and (max-height:540px){
 body[data-page="game"] .level-list{gap:4px}
 body[data-page="game"] .level-card{grid-template-rows:22px 22px;padding:1px 6px}
 body[data-page="game"] .main-content{gap:3px;padding:2px 0}
 body[data-page="game"] .site-footer{padding:2px 0}
}
@media(min-width:701px){body[data-page="game"] .level-card{padding:9px 16px}}
/* Five registered levels, including the compact area below mobile browser bars. */
@media(max-width:700px) and (max-height:600px){
 body[data-page="game"] .header-inner{min-height:44px;gap:8px}
 body[data-page="game"] .header-inner a{min-height:44px;display:inline-flex;align-items:center}
 body[data-page="game"] .level-list{gap:2px}
 body[data-page="game"] .level-card{grid-template-rows:22px 22px;padding:0 6px}
 body[data-page="game"] .main-content{gap:3px;padding:2px 0}
 body[data-page="game"] .game-detail-hero h1{line-height:1.3;margin-bottom:3px}
 body[data-page="game"] .lead,body[data-page="game"] .context-note{line-height:1.3;margin-bottom:3px}
 body[data-page="game"] .section-heading{margin-bottom:2px}
 body[data-page="game"] .site-footer{padding:2px 0}
}
@media(min-width:701px){
 body[data-page="game"] .hero h1{font-size:32px;line-height:1.35;margin:0 0 8px}
 body[data-page="game"] .hero .lead{font-size:16px;line-height:1.5;margin:0 0 8px}
 body[data-page="game"] .context-note{margin:0;font-size:14px}
 body[data-page="game"] .section-heading>div{display:flex;gap:12px;align-items:center}
 body[data-page="game"] .section-heading h2,body[data-page="game"] .section-heading p{margin:0}
 body[data-page="game"] .level-copy h3{font-size:16px}
 body[data-page="game"] .level-state{font-size:14px;margin-top:0}
}
/* Six registered levels retain 44px targets in the 480px visible viewport. */
@media(max-width:700px) and (max-height:540px){
 body[data-page="game"] .level-list{gap:1px}
 body[data-page="game"] .level-card{border:0;box-shadow:inset 0 0 0 1px var(--border,#d4ded7)}
 body[data-page="game"] .main-content{gap:1px;padding:0}
 body[data-page="game"] .section-heading{margin-bottom:0}
 body[data-page="game"] .game-detail-hero h1{margin-bottom:1px}
}
/* At short mobile heights, each complete card is the entry target. All seven
   titles, progress labels and the introduction stay visible without scrolling. */
@media(max-width:700px){
 body[data-page="game"][data-catalog-compact="true"] .header-inner{min-height:44px;gap:8px}
 body[data-page="game"][data-catalog-compact="true"] .header-inner a{min-height:44px;display:inline-flex;align-items:center}
 body[data-page="game"][data-catalog-compact="true"] .main-content{gap:1px;padding:0}
 body[data-page="game"][data-catalog-compact="true"] .game-detail-hero h1{line-height:1.3;margin-bottom:1px}
 body[data-page="game"][data-catalog-compact="true"] .lead,body[data-page="game"][data-catalog-compact="true"] .context-note{line-height:1.3;margin-bottom:3px}
 body[data-page="game"][data-catalog-compact="true"] .section-heading{margin-bottom:0}
 body[data-page="game"][data-catalog-compact="true"] .site-footer{padding:2px 0}

 body[data-page="game"][data-catalog-compact="true"] .level-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
 body[data-page="game"][data-catalog-compact="true"] .level-card{position:relative;display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:minmax(40px,auto) 20px;gap:0 4px;padding:2px;min-height:64px;border:0;box-shadow:inset 0 0 0 1px var(--border,#d4ded7);background:#fff;isolation:isolate}
 body[data-page="game"][data-catalog-compact="true"] .level-number{grid-column:1;grid-row:2;width:22px;height:20px;align-self:center;font-size:14px;pointer-events:none;z-index:1}
 body[data-page="game"][data-catalog-compact="true"] .level-copy h3{grid-column:1/3;grid-row:1;font-size:16px;line-height:1.25;align-self:start;pointer-events:none;z-index:1}
 body[data-page="game"][data-catalog-compact="true"] .level-state{grid-column:2;grid-row:2;justify-self:start;justify-content:flex-start;align-self:center;font-size:14px;line-height:20px;pointer-events:none;z-index:1}
 body[data-page="game"][data-catalog-compact="true"] .level-card .button{position:absolute;inset:0;grid-area:auto;display:flex;align-items:flex-end;justify-content:flex-end;width:100%;height:100%;min-height:44px;padding:2px 4px;border:0;border-radius:inherit;background:transparent;color:var(--brand);font-size:14px;line-height:20px}
 body[data-page="game"][data-catalog-compact="true"] .level-card .button:hover,body[data-page="game"][data-catalog-compact="true"] .level-card .button:focus-visible{background:#edf5ef;outline:2px solid var(--brand);outline-offset:0}
}

/* Nine entries use three columns in the compact catalog; every full card remains a touch target. */
@media(max-width:700px){
 body[data-page="game"][data-level-count="9"][data-catalog-compact="true"] .level-list{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
 body[data-page="game"][data-level-count="9"][data-catalog-compact="true"] .level-card{grid-template-rows:minmax(60px,auto) 20px;min-height:84px;padding:2px 0}
 body[data-page="game"][data-level-count="9"][data-catalog-compact="true"] .level-card .button{font-size:14px;padding-right:2px}
}
