/* ============================================================
   WIZARD ACADEMY — wa-atari.css
   Cards for the archive.org Atari 2600 shelf. Same visual
   language as .clean-card / .wa-feat-card: dark slate tile,
   cyan play pill, yellow badge, hover lift.
   ============================================================ */

.wa-atari-rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 2px 12px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

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

.wa-atari-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.16);
  cursor: pointer;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.wa-atari-card:hover,
.wa-atari-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .85), 0 0 20px #8a2be2, inset 0 0 10px #00d2ff;
  outline: none;
}

.wa-atari-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 18%, rgba(34, 211, 238, .09), transparent 55%),
    radial-gradient(circle at 76% 82%, rgba(138, 43, 226, .12), transparent 55%),
    repeating-linear-gradient(0deg, rgba(148, 163, 184, .05) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, #0b1220, #05080f 70%);
}

/* Scanline sweep while the archive.org cover is in flight, so a slow
   thumbnail reads as "loading" instead of a dead black tile. */
.wa-atari-poster::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 32%, rgba(148, 163, 184, .12) 46%, transparent 60%);
  background-size: 220% 100%;
  animation: waAtariShimmer 1.45s linear infinite;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

.wa-atari-loading::before { opacity: 1; }

.wa-atari-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}

.wa-atari-poster img.wa-loaded { opacity: 1; }

.wa-atari-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-atari-ghost::before {
  content: '';
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(234, 179, 8, .3);
  background: radial-gradient(circle, rgba(234, 179, 8, .12), transparent 72%);
}

.wa-atari-ghost b {
  position: relative;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .05em;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.wa-atari-tag {
  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;
}

.wa-atari-play {
  position: absolute;
  bottom: 6px;
  inset-inline-start: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(34, 211, 238, .94);
  color: #02060f;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.wa-atari-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
  margin: 0;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.wa-atari-meta {
  overflow: hidden;
  /* Reserving the line here means an empty skeleton meta box and a filled one
     measure the same, which is what keeps the grid height constant. */
  min-height: 1.2em;
  color: #67e8f9;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Rails keep a fixed footprint like the other home rows */
.wa-atari-rail .wa-atari-card { flex: 0 0 150px; width: 150px; }

@media (max-width: 860px) {
  .wa-atari-rail .wa-atari-card { flex-basis: 128px; width: 128px; }
}

@media (max-width: 640px) {
  .wa-atari-rail .wa-atari-card { flex-basis: 112px; width: 112px; }
  .wa-atari-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
}

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

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

.wa-atari-skel .wa-atari-poster {
  background: linear-gradient(100deg, #0b1220 18%, #1a2740 42%, #0b1220 66%);
  background-size: 220% 100%;
  animation: waAtariShimmer 1.45s linear infinite;
}

.wa-atari-skel .wa-atari-title,
.wa-atari-skel .wa-atari-meta {
  background: linear-gradient(100deg, #0b1220 18%, #1a2740 42%, #0b1220 66%);
  background-size: 220% 100%;
  animation: waAtariShimmer 1.45s linear infinite;
  border-radius: 5px;
}

@keyframes waAtariShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -20% 0; }
}

.wa-atari-status {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 18px 4px;
  color: #cbd5e1;
  font-size: 13px;
}

.wa-atari-status p { margin: 0; }

.wa-atari-retry {
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, .45);
  background: rgba(8, 47, 73, .7);
  color: #a5f3fc;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

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

.wa-atari-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px auto 4px;
  padding: 11px 26px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, .35);
  background: linear-gradient(135deg, rgba(8, 145, 178, .35), rgba(15, 23, 42, .9));
  color: #e2f6ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.wa-atari-more:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, .7);
  background: linear-gradient(135deg, rgba(14, 116, 144, .5), rgba(15, 23, 42, .95));
}

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

@media (prefers-reduced-motion: reduce) {
  .wa-atari-poster::before,
  .wa-atari-skel .wa-atari-poster,
  .wa-atari-skel .wa-atari-title,
  .wa-atari-skel .wa-atari-meta { animation: none; }
  .wa-atari-poster img { transition: none; }
  .wa-atari-card { transition: none; }
}
