/* v0.1.36 — Home catalog only: breathable three-column cards and page scroll.
 * All class/race/print views retain their original fixed-stage layout.
 * Later game cards automatically flow into the next row.
 */
html:has(body[data-mode="home"]),
body[data-mode="home"] {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body[data-mode="home"] .app {
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-rows: 68px auto;
  overflow: visible;
  align-content: start;
}
body[data-mode="home"] .game-library {
  height: auto;
  min-height: calc(100dvh - 110px);
  max-width: 1540px;
  margin: 0 auto;
  padding: clamp(18px,2.4vw,38px);
  gap: clamp(16px,2vw,25px);
  overflow: visible;
}
body[data-mode="home"] .game-catalog {
  display: grid;
  flex: none;
  grid-template-columns: repeat(3,minmax(0,1fr));
  grid-template-rows: none !important;
  grid-auto-rows: auto;
  align-items: stretch;
  align-content: start;
  gap: clamp(15px,1.65vw,24px);
  min-height: 0;
  overflow: visible;
}
body[data-mode="home"] .catalog-card {
  width: 100%;
  height: auto !important;
  min-height: 345px;
  max-height: none !important;
  align-self: stretch !important;
  flex-direction: column;
  gap: 0;
  padding: clamp(14px,1.3vw,20px);
  border-radius: 19px;
}
body[data-mode="home"] .catalog-art,
body[data-mode="home"] .game-catalog .catalog-art {
  flex: 0 0 164px !important;
  width: 100%;
  height: 164px !important;
  min-height: 164px !important;
  max-height: 164px !important;
  align-self: stretch !important;
  border-radius: 15px;
  padding: 12px;
  overflow: hidden;
}
body[data-mode="home"] .catalog-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 14px;
  gap: 7px;
}
body[data-mode="home"] .catalog-number {
  font-size: .66rem;
  letter-spacing: .09em;
  line-height: 1.3;
}
body[data-mode="home"] .catalog-info > strong {
  font-size: clamp(1.3rem,1.55vw,1.62rem);
  line-height: 1.13;
}
body[data-mode="home"] .catalog-info > small {
  font-size: .87rem;
  line-height: 1.35;
  max-height: none;
  overflow: visible;
}
body[data-mode="home"] .catalog-features {
  font-size: .76rem;
  line-height: 1.35;
}
body[data-mode="home"] .catalog-open {
  margin-top: auto;
  padding-top: 10px;
  font-size: .92rem;
}
body[data-mode="home"] .catalog-open b {width: 34px;height: 34px;}
body[data-mode="home"] .catalog-art svg {max-height: 138px;height: 92%;}
body[data-mode="home"] .catalog-sudoku-grid {
  transform: none !important;
  width: min(42%,136px);
  max-width: 136px;
  max-height: 136px;
}
body[data-mode="home"] .game-catalog .abc-demo {
  font-size: clamp(1.15rem,1.5vw,1.55rem) !important;
  line-height: 1.28 !important;
  letter-spacing: .08em !important;
}
body[data-mode="home"] .game-catalog .fence-demo {
  font-size: clamp(1.06rem,1.35vw,1.35rem) !important;
  line-height: 1.24 !important;
}
body[data-mode="home"] .game-catalog .sky-catalog-graphic {
  font-size: clamp(1.35rem,1.7vw,1.7rem) !important;
  line-height: 1.18 !important;
}
body[data-mode="home"] .library-footer {
  padding: 7px 0 1px;
  line-height: 1.5;
}
@media (max-width:850px) {
  body[data-mode="home"] .game-catalog {grid-template-columns: repeat(2,minmax(0,1fr));}
  body[data-mode="home"] .catalog-card {min-height: 320px;}
  body[data-mode="home"] .catalog-art,
  body[data-mode="home"] .game-catalog .catalog-art {
    height: 143px !important;
    flex-basis: 143px !important;
    min-height: 143px !important;
    max-height: 143px !important;
  }
}
@media (max-width:560px) {
  body[data-mode="home"] .app {grid-template-rows: auto auto;gap: 8px;padding: 8px 10px 15px;}
  body[data-mode="home"] .game-library {padding: 16px;min-height: 0;gap: 15px;}
  body[data-mode="home"] .library-heading {gap: 8px;}
  body[data-mode="home"] .library-heading h2 {font-size: clamp(1.4rem,5.8vw,1.75rem);line-height:1.15;}
  body[data-mode="home"] .library-heading p {font-size:.79rem;line-height:1.42;}
  body[data-mode="home"] .game-catalog {grid-template-columns: minmax(0,1fr);gap: 14px;}
  body[data-mode="home"] .catalog-card {
    flex-direction: column;
    height: auto !important;
    min-height: 312px;
    padding: 13px;
    border-radius: 16px;
  }
  body[data-mode="home"] .catalog-art,
  body[data-mode="home"] .game-catalog .catalog-art {
    width:100%;height:139px !important;min-height:139px !important;max-height:139px !important;
    flex:0 0 139px !important;
    align-self:stretch !important;
    padding:9px;
  }
  body[data-mode="home"] .catalog-info {gap:6px;padding-top:12px;}
  body[data-mode="home"] .catalog-number {font-size:.59rem;letter-spacing:.065em;}
  body[data-mode="home"] .catalog-info > strong {font-size:1.28rem;}
  body[data-mode="home"] .catalog-info > small {font-size:.83rem;}
  body[data-mode="home"] .catalog-features {font-size:.71rem;}
  body[data-mode="home"] .catalog-open {font-size:.84rem;}
  body[data-mode="home"] .catalog-open b {width:30px;height:30px;}
  body[data-mode="home"] .game-catalog .catalog-card {align-self:stretch !important;max-height:none !important;height:auto !important;}
  body[data-mode="home"] .game-catalog .catalog-sudoku-grid {transform:none !important;}
  body[data-mode="home"] .library-footer {font-size:.7rem;}
}
@media (max-height:540px) {
  body[data-mode="home"] .library-heading p {display:block;}
  body[data-mode="home"] .library-footer {display:block;}
}
