/* ============================================================
   WIZARD ACADEMY — wa-all-games.css
   Full-catalog listing page (/all-games.html). Same visual
   language as the home grid and the Atari shelf: dark slate
   tile, cyan play pill, yellow badge, hover lift.
   ============================================================ */

.wa-ag-hero {
  position: relative;
  background: linear-gradient(150deg, rgba(15, 23, 42, .96), rgba(2, 6, 23, .96));
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .95);
  overflow: hidden;
}

.wa-ag-hero::after {
  content: '';
  position: absolute;
  inset-inline-end: -60px;
  top: -70px;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(234, 179, 8, .16), transparent 68%);
  pointer-events: none;
}

.wa-ag-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #94a3b8;
  margin-bottom: 10px;
}

.wa-ag-crumbs a {
  padding: 3px 9px;
  border-radius: 8px;
  border: 1px solid rgba(234, 179, 8, .4);
  background: rgba(69, 26, 3, .35);
  color: #fcd34d;
  text-decoration: none;
}

.wa-ag-title-main {
  margin: 2px 0 6px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: -.01em;
  color: #f8fafc;
}

.wa-ag-lead {
  margin: 0;
  color: #cbd5e1;
  font-size: .88rem;
  line-height: 1.75;
  max-width: 70ch;
}

.wa-ag-stat-row {
  /* The counters land after the catalogue does. Measured at 1280x800 the row
     grew 12px -> 29px then and dragged the category links and the whole grid
     up with it, so the finished height is reserved from the first frame. */
  min-height: 29px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.wa-ag-stat {
  padding: 5px 11px;
  border-radius: 10px;
  background: #161a22;
  border: 1px solid rgba(255, 255, 255, .06);
  color: #fde68a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  font-weight: 700;
}

.wa-ag-catlinks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.wa-ag-catlinks a {
  padding: 5px 11px;
  border-radius: 10px;
  background: rgba(8, 47, 73, .35);
  border: 1px solid rgba(34, 211, 238, .22);
  color: #bae6fd;
  font-size: .74rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.wa-ag-catlinks a:hover,
.wa-ag-catlinks a:focus-visible {
  background: rgba(8, 47, 73, .6);
  border-color: rgba(34, 211, 238, .55);
  outline: none;
}

.wa-ag-shelf {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: #13161c;
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .9);
}

.wa-ag-shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.wa-ag-shelf-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.wa-ag-shelf-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #1b1f2a;
  border: 1px solid rgba(255, 255, 255, .06);
  font-size: 20px;
}

.wa-ag-shelf-title h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  color: #fff;
}

.wa-ag-shelf-title p {
  margin: 2px 0 0;
  font-size: .74rem;
  color: #94a3b8;
}

.wa-ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
  padding: 14px 0 4px;
}

.wa-ag-card {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, .94);
  border: 1px solid rgba(148, 163, 184, .16);
  color: inherit;
  text-decoration: none;
  min-width: 0;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.wa-ag-card:hover,
.wa-ag-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(250, 204, 21, .6);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .85), 0 0 18px rgba(138, 43, 226, .45);
  outline: none;
}

.wa-ag-poster {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0b1220, #05080f 70%);
}

.wa-ag-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-ag-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  opacity: .45;
}

.wa-ag-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, .92) 0%, rgba(2, 6, 23, .35) 42%, transparent 68%);
}

.wa-ag-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(2, 6, 23, .9);
  border: 1px solid rgba(234, 179, 8, .45);
  color: #fde68a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.5;
  max-width: 62%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wa-ag-rating {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(2, 6, 23, .88);
  border: 1px solid rgba(251, 191, 36, .35);
  color: #fcd34d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
}

.wa-ag-foot {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 8px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-ag-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: #f8fafc;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wa-ag-play {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(34, 211, 238, .94);
  color: #02060f;
  font-size: 10px;
  font-weight: 900;
}

.wa-ag-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 20px 0 4px;
}

.wa-ag-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0b1120;
  font-family: inherit;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 26px -12px rgba(250, 204, 21, .75);
  transition: transform .15s ease, filter .15s ease, opacity .15s ease;
}

.wa-ag-more:hover:not(:disabled),
.wa-ag-more:focus-visible:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
  outline: none;
}

.wa-ag-more:disabled {
  cursor: default;
  opacity: .55;
  box-shadow: none;
}

.wa-ag-more[hidden] {
  display: none;
}

.wa-ag-more svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.wa-ag-count {
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .74rem;
  font-weight: 700;
}

.wa-ag-shelf-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.wa-ag-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.wa-ag-sort-text {
  color: #94a3b8;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.wa-ag-sort-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #0f172a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2367e8f9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 11px) center;
  background-size: 11px 8px;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 10px;
  color: #e2e8f0;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 8px 12px;
  padding-inline-end: 32px;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.wa-ag-sort-select:hover {
  border-color: rgba(103, 232, 249, .55);
  background-color: #111c33;
}

.wa-ag-sort-select:focus-visible {
  outline: none;
  border-color: #67e8f9;
  box-shadow: 0 0 0 3px rgba(103, 232, 249, .18);
}

.wa-ag-sort-select option {
  background-color: #0f172a;
  color: #e2e8f0;
}

@media (max-width: 560px) {
  .wa-ag-shelf-tools {
    width: 100%;
    justify-content: space-between;
  }
}

.wa-ag-end {
  color: #67e8f9;
  font-size: .78rem;
  font-weight: 700;
  text-align: center;
  margin: 4px 0 0;
}

.wa-ag-end[hidden] {
  display: none;
}

/* ---------- loading / failure ---------- */

.wa-ag-skel {
  pointer-events: none;
}

.wa-ag-skel .wa-ag-poster,
.wa-ag-skel .wa-ag-shade {
  background: linear-gradient(100deg, #131722 30%, #1c2231 50%, #131722 70%);
  background-size: 220% 100%;
  animation: waAgShimmer 1.15s ease-in-out infinite;
}

@keyframes waAgShimmer {
  from { background-position: 140% 0; }
  to { background-position: -40% 0; }
}

.wa-ag-status {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 12px;
  color: #94a3b8;
  font-size: .84rem;
  text-align: center;
}

.wa-ag-retry {
  padding: 9px 18px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, .35);
  background: rgba(8, 47, 73, .5);
  color: #bae6fd;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}

.wa-ag-retry:hover {
  background: rgba(14, 116, 144, .55);
}

@media (max-width: 640px) {
  .wa-ag-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
  }
  .wa-ag-title { font-size: 11px; }
  .wa-ag-more { width: 100%; }
  .wa-ag-hero { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .wa-ag-card,
  .wa-ag-more { transition: none; }
  .wa-ag-card:hover { transform: none; }
  .wa-ag-skel .wa-ag-poster,
  .wa-ag-skel .wa-ag-shade { animation: none; }
}
