/* PLAYGROUND: a responsive directory plus focused child-module pages. */

.playground-hero {
  width: min(1280px, 100%);
  min-height: min(700px, 88dvh);
  margin: 0 auto;
  padding: max(112px, calc(var(--mdj-header-safe-offset) + 28px)) 50px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.82fr);
  align-items: center;
  gap: clamp(44px, 8vw, 112px);
}
.playground-hero__copy { max-width: 640px; }
.playground-hero__copy h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(3rem, 5.5vw, 5.2rem);
  letter-spacing: -0.055em;
  line-height: 0.96;
}
.playground-hero__copy > p:not(.eyebrow) {
  max-width: 52ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.65;
}

.playground-hero__index {
  display: grid;
  border-top: 1px solid var(--line);
}
.playground-hero__index a {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  transition: color 200ms ease, padding-left 200ms ease, background 200ms ease;
}
.playground-hero__index a:hover,
.playground-hero__index a:focus-visible {
  padding-left: 12px;
  color: var(--gold);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
}
.playground-hero__index span {
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 850;
}
.playground-hero__index strong {
  min-width: 0;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.playground-directory { padding-top: 32px; }
.playground-directory__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}
.playground-directory-card {
  min-width: 0;
  min-height: 360px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.playground-directory-card:hover,
.playground-directory-card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--gold) 46%, var(--line));
  box-shadow: 0 28px 80px color-mix(in srgb, var(--bg) 72%, transparent);
}
.playground-directory-card--merch { grid-column: span 7; }
.playground-directory-card--games { grid-column: span 5; grid-template-columns: 1fr; }
.playground-directory-card--swap { grid-column: span 5; grid-template-columns: 1fr; }
.playground-directory-card--factory {
  grid-column: span 7;
  background:
    radial-gradient(circle at 92% 10%, var(--fx-gold), transparent 34%),
    radial-gradient(circle at 14% 92%, var(--fx-red), transparent 44%),
    var(--surface);
}
.playground-directory-card__media {
  min-height: 260px;
  overflow: hidden;
  background: #111;
}
.playground-directory-card__media > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}
.playground-directory-card:hover .playground-directory-card__media > img,
.playground-directory-card:focus-visible .playground-directory-card__media > img { transform: scale(1.025); }
.playground-directory-card__media--collage {
  display: grid;
  grid-template-columns: 1.45fr 0.75fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 4px;
}
.playground-directory-card__media--collage img:first-child { grid-row: 1 / 3; }
.playground-directory-card__body {
  min-width: 0;
  padding: clamp(24px, 3.2vw, 40px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 42px;
}
.playground-directory-card__body h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.65rem);
  line-height: 1.04;
  overflow-wrap: anywhere;
}
.playground-directory-card__body div > p:last-child {
  max-width: 42ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.58;
}
.playground-status {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.playground-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, var(--line));
  border-radius: 14px;
  color: var(--text);
  background: color-mix(in srgb, var(--gold) 14%, var(--surface));
}
.playground-icon .ui-icon { width: 23px; height: 23px; }
.playground-icon--large { width: 66px; height: 66px; border-radius: 18px; }
.playground-icon--large .ui-icon { width: 32px; height: 32px; }

/* Child module pages share one stable shell and collapse to one column. */
.playground-module-page {
  width: min(1280px, 100%);
  min-height: calc(100dvh - 120px);
  margin: 0 auto;
  padding: max(108px, calc(var(--mdj-header-safe-offset) + 24px)) 50px 76px;
}
.playground-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
  color: var(--subtle);
  font-size: 0.8rem;
  font-weight: 800;
}
.playground-breadcrumb a { color: var(--muted); }
.playground-breadcrumb a:hover { color: var(--gold); }
.playground-module-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(420px, 1.14fr);
  align-items: stretch;
  gap: 20px;
}
.playground-module-hero__copy,
.playground-module-visual,
.playground-module-content {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.playground-module-hero__copy {
  min-width: 0;
  padding: clamp(30px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.playground-module-hero__copy h1 {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(2.8rem, 5.7vw, 5.4rem);
  letter-spacing: -0.05em;
  line-height: 0.96;
  overflow-wrap: anywhere;
}
.playground-module-hero__copy > p:not(.playground-status) {
  max-width: 48ch;
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.playground-module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.playground-module-visual {
  min-height: 520px;
  overflow: hidden;
  position: relative;
}
.playground-module-visual > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.playground-module-visual--collage {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.playground-module-visual--collage img:first-child { grid-row: 1 / 3; }
.playground-module-visual--factory {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, transparent 0 48%, color-mix(in srgb, var(--line) 68%, transparent) 48% 49%, transparent 49%),
    radial-gradient(circle at 82% 12%, var(--fx-gold), transparent 32%),
    radial-gradient(circle at 12% 88%, var(--fx-red), transparent 40%),
    var(--surface);
  background-size: 48px 48px, auto, auto, auto;
}
.playground-module-visual--factory .playground-icon { transform: scale(1.55); }
.playground-module-content {
  margin-top: 20px;
  padding: clamp(24px, 4vw, 46px);
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(280px, 1fr);
  align-items: start;
  gap: clamp(28px, 6vw, 80px);
}
.playground-module-content h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 3.2rem);
  line-height: 1.05;
}
.playground-module-content p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.playground-merch-shell { margin-top: 20px; }
.playground-merch-shell .merch-grid { margin-top: 0; }

@media (max-width: 900px) {
  .playground-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: max(112px, calc(var(--mdj-header-safe-offset) + 24px)) 20px 56px;
  }
  .playground-hero__copy { max-width: 680px; }
  .playground-directory__grid { grid-template-columns: 1fr; }
  .playground-directory-card,
  .playground-directory-card--merch,
  .playground-directory-card--games,
  .playground-directory-card--swap,
  .playground-directory-card--factory { grid-column: auto; }
  .playground-directory-card { grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.95fr); }
  .playground-directory-card--games,
  .playground-directory-card--swap { grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr); }
  .playground-module-page { padding: max(108px, calc(var(--mdj-header-safe-offset) + 24px)) 20px 64px; }
  .playground-module-hero { grid-template-columns: 1fr; }
  .playground-module-visual { min-height: min(72vw, 540px); }
  .playground-module-content { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .playground-hero__copy h1 { font-size: clamp(2.55rem, 13vw, 3.8rem); }
  .playground-directory { padding: 24px 14px 56px; }
  .playground-directory-card,
  .playground-directory-card--games,
  .playground-directory-card--swap {
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .playground-directory-card__media { min-height: 250px; }
  .playground-directory-card__body { gap: 28px; padding: 22px; }
  .playground-module-page { padding-inline: 14px; }
  .playground-module-hero__copy { padding: 28px 22px; }
  .playground-module-hero__copy h1 { font-size: clamp(2.5rem, 14vw, 4rem); }
  .playground-module-actions { display: grid; width: 100%; }
  .playground-module-visual { min-height: 82vw; }
  .playground-module-content { padding: 24px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .playground-directory-card:hover,
  .playground-directory-card:focus-visible,
  .playground-directory-card:hover .playground-directory-card__media > img,
  .playground-directory-card:focus-visible .playground-directory-card__media > img { transform: none; }
}
