/* Shared catalog UI for printable tools and classroom games. */
body.catalog-page {
  --lobby-ink: #172337;
  color: var(--lobby-ink);
  background: #fff;
}
.catalog-page .app-header {
  height: auto;
  flex-wrap: nowrap;
  gap: 24px;
  min-height: 76px;
  background: #fff;
  border-bottom: 1px solid #e0e6ee;
  padding: 5px 32px;
}
.catalog-page .game-logo {
  width: 235px;
  height: 66px;
  object-fit: contain;
}
.catalog-page .section-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 28px;
  margin: auto;
}
.section-nav a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.section-nav svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}
.catalog-page .section-nav a {
  padding: 20px 0;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  color: var(--lobby-ink);
  font-weight: 650;
}
.catalog-page .section-nav a[aria-current] {
  color: #0877de;
  border-color: #0877de;
}
.catalog-page .game-catalog {
  margin: auto;
  max-width: 1530px;
  padding: 26px 36px 32px;
}
.catalog-page .catalog-title {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}
.catalog-page .catalog-title h1 {
  margin: 0;
  color: var(--lobby-ink);
  font-size: 29px;
  line-height: 1.3;
  font-weight: 800;
}
.catalog-page #catalogCount {
  display: inline;
  color: #748092;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.catalog-page .game-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}
.catalog-page .game-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.catalog-page .game-filters button {
  min-width: 86px;
  border: 1px solid #c6cfdb;
  border-radius: 7px;
  padding: 8px 15px;
  background: #fff;
  color: var(--lobby-ink);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
}
.catalog-page .game-filters button[aria-pressed="true"] {
  background: #1a929f;
  border-color: #1a929f;
  color: #fff;
}
.catalog-page .search-field {
  min-height: 41px;
  padding: 10px 12px;
  width: 310px;
  min-width: 170px;
  height: 41px;
  border: 1px solid #9eabba;
  border-radius: 7px;
  background: #fff;
}
.catalog-page .search-field input {
  min-width: 0;
  width: 100%;
  color: var(--lobby-ink);
  font-size: 14px;
}
.catalog-page .search-field svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
}
.catalog-page .game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}
.catalog-page .game-card {
  display: block;
  text-decoration: none;
  border: 1px solid #d5dfe9;
  border-radius: 8px;
  background: #fff;
  color: var(--lobby-ink);
  box-shadow: 0 2px 2px #1723370a;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
  overflow: hidden;
}
.catalog-page .game-thumb {
  height: auto;
  aspect-ratio: 3 / 2;
  background: #f9fcff;
  border: 0;
  overflow: hidden;
}
.catalog-page .game-thumb .game-art {
  width: 100%;
  height: 100%;
  background-image: url("/classroom/assets/catalog-scenes.png");
  background-size: 400% 400%;
}
.catalog-page .coming-soon-art {
  display: grid;
  place-items: center;
  background-image:
    linear-gradient(#e7f0f8 1px, transparent 1px),
    linear-gradient(90deg, #e7f0f8 1px, transparent 1px);
  background-size: 22px 22px;
}
.catalog-page .coming-soon-art > svg {
  width: 100px;
  height: 100px;
  max-width: 55%;
  color: #26354d;
  fill: none;
  stroke-width: 1.5;
}
.coming-soon-caption {
  margin: 0;
  color: #60728a;
  font-size: 14px;
  line-height: 1.4;
}
.catalog-page .game-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 13px;
  gap: 10px;
}
.catalog-page .game-card footer > div {
  min-width: 0;
}
.catalog-page .game-card h2 {
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}
.catalog-page .game-card .game-category {
  display: inline-block;
  color: #096dcc;
  border: 1px solid #bddefe;
  background: #eef7ff;
  padding: 3px 11px;
  border-radius: 14px;
  font-size: 11px;
  line-height: 1.2;
}
.catalog-page .game-card footer > svg:last-child {
  color: var(--lobby-ink);
  width: 32px;
  height: 32px;
  padding: 7px;
  border: 1px solid #26354d;
  border-radius: 50%;
  flex-shrink: 0;
  stroke-width: 2px;
}
.spelling-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(#e7f1f8 1px, transparent 1px),
    linear-gradient(90deg, #e7f1f8 1px, transparent 1px);
  background-size: 22px 22px;
}
.spelling-art span {
  display: grid;
  place-items: center;
  width: 60px;
  height: 65px;
  color: #1d2d44;
  font:
    700 36px Georgia,
    serif;
  border: 2px solid #243349;
  border-radius: 8px;
  box-shadow: 0 4px 0 #829baa;
  background: #a9d9ed;
  transform: rotate(-8deg);
}
.spelling-art span:nth-child(2) {
  background: #f4bacb;
  transform: translateY(-15px) rotate(7deg);
}
.spelling-art span:nth-child(3) {
  background: #f5de8b;
  transform: rotate(5deg);
}
@media (hover: hover) {
  .catalog-page .game-card:not(.game-coming-soon):hover {
    transform: translateY(-3px);
    border-color: #82b7df;
    box-shadow: 0 7px 16px #274b7a14;
  }
  .catalog-page .game-filters button:hover {
    border-color: #1a929f;
  }
}
.catalog-page .game-card:active {
  transform: translateY(0);
}
.catalog-page :is(button, a, input):focus-visible {
  outline: 3px solid #176ab0;
  outline-offset: 4px;
}
.catalog-empty:not([hidden]) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 16px;
}
.catalog-empty > svg {
  width: 40px;
  height: 40px;
  color: #65758a;
}
.catalog-empty p {
  margin: 0;
}
.catalog-reset {
  border: 1px solid #86afca;
  background: #eef7ff;
  border-radius: 6px;
  padding: 10px 16px;
  color: #17629c;
  cursor: pointer;
}
.catalog-footer {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #e1e8ef;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #657186;
  font-size: 12px;
}
@media (max-width: 1280px) {
  .catalog-page .app-header {
    flex-wrap: wrap;
    gap: 0;
  }
  .catalog-page .section-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .catalog-page .section-nav a {
    flex-shrink: 0;
  }
}
@media (max-width: 1100px) {
  .catalog-page .game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .catalog-page .game-catalog {
    padding-inline: 24px;
  }
  .catalog-page .game-toolbar {
    flex-wrap: wrap;
  }
  .catalog-page .search-field {
    flex: 1;
  }
}
@media (max-width: 750px) {
  .catalog-page .app-header {
    flex-wrap: wrap;
    gap: 0;
    padding: 5px 16px 0;
  }
  .catalog-page .game-logo {
    width: 182px;
    height: 60px;
  }
  .catalog-page .section-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    border-top: 1px solid #e0e8e3;
    gap: 8px;
  }
  .catalog-page .section-nav a {
    flex-shrink: 0;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 5px;
    line-height: 1.3;
    padding: 12px 0;
    font-size: 14px;
  }
  .catalog-page .game-catalog {
    padding: 22px 16px;
  }
  .catalog-page .catalog-title {
    margin-bottom: 18px;
    gap: 12px;
  }
  .catalog-page .catalog-title h1 {
    font-size: 24px;
  }
  .catalog-page #catalogCount {
    font-size: 15px;
  }
  .catalog-page .game-toolbar {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 13px;
  }
  .catalog-page .search-field {
    width: 100%;
    min-height: 42px;
    flex: auto;
  }
  .catalog-page .game-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .catalog-page .game-filters button {
    min-width: 0;
    padding: 8px 10px;
    font-size: 12px;
  }
  .catalog-page .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .catalog-page .game-card footer {
    padding: 10px;
    gap: 5px;
  }
  .catalog-page .game-card h2 {
    font-size: 15px;
    margin-bottom: 6px;
  }
  .catalog-page .game-card .game-category {
    font-size: 10px;
    padding: 3px 7px;
  }
  .catalog-page .game-card footer > svg:last-child {
    display: block;
    width: 25px;
    height: 25px;
    padding: 5px;
  }
  .spelling-art {
    gap: 7px;
  }
  .spelling-art span {
    width: 32px;
    height: 36px;
    font-size: 24px;
  }
  .catalog-footer {
    flex-direction: column;
    gap: 6px;
  }
}
.catalog-page .tool-card .game-thumb {
  background-color: #f9fcff;
  background-image:
    linear-gradient(#e7f1f8 1px, transparent 1px),
    linear-gradient(90deg, #e7f1f8 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 0;
}
.catalog-page .tool-card .game-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  background: transparent;
}
@media (max-width: 750px) {
  .catalog-page .ui-language-select {
    width: 110px;
    max-width: 110px;
    font-size: 14px;
  }
  .catalog-page .tool-card .game-thumb {
    padding: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .catalog-page .game-card {
    transition: none;
  }
  .catalog-page .game-card:hover {
    transform: none;
  }
}
