@keyframes playground-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

body {
  animation: playground-fade-in 0.5s ease both;
}

/* ── Layout ─────────────────────────────────── */

.playground-main {
  max-width: 1600px;
  margin: 0px auto;
  padding-top: 158px;
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ── Label ──────────────────────────────────── */

.playground-label-row {
  padding: 0 20px;
}

.playground-label {
  font-family: var(--font-slab);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.6;
}

/* ── Grid ───────────────────────────────────── */

.playground-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 8px;
  row-gap: 40px;
  padding: 0 12px;
}

/* ── Card ───────────────────────────────────── */

.pg-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Image ──────────────────────────────────── */

.pg-image {
  width: 100%;
  height: 450px;
  overflow: hidden;
  background: rgba(245, 245, 245, 0.08);
}

.pg-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.pg-item:hover .pg-image img {
  transform: scale(1.03);
}

/* ── Text ───────────────────────────────────── */

.pg-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pg-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  font-style: normal;
  color: var(--text);
  line-height: 1.15;
}

.pg-desc {
  font-family: var(--font-slab);
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ── Card cursor ────────────────────────────── */

.pg-item {
  cursor: pointer;
}

/* ── Modal overlay ──────────────────────────── */

.pg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background: rgba(245, 245, 245, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pg-modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

[data-theme="light"] .pg-modal-overlay {
  background: rgba(26, 26, 26, 0.5);
}

/* ── Modal panel ────────────────────────────── */

.pg-modal {
  position: absolute;
  inset: 12px;
  transform: translateY(calc(100% + 12px));
  background: var(--bg);
  overflow: hidden;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.pg-modal-overlay.is-open .pg-modal {
  transform: translateY(0);
}

/* ── Modal header ───────────────────────────── */

.pg-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 40px;
  flex-shrink: 0;
}

.pg-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.pg-modal-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  font-weight: 400;
  font-style: normal;
  color: var(--text);
  line-height: 1.2;
}

.pg-modal-desc {
  font-family: var(--font-slab);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.5;
}

/* ── Modal live link ────────────────────────── */

.pg-modal-live-link {
  flex-shrink: 0;
  align-self: flex-start;
}

.pg-modal-live-link .btn-arrow {
  transform: rotate(-45deg);
}

.pg-modal-live-link:hover .btn-arrow {
  transform: rotate(-45deg) translate(4px, -4px);
}

@media (max-width: 768px) {
  .pg-modal-header {
    flex-wrap: wrap;
  }

  .pg-modal-heading {
    flex: 0 0 calc(100% - 52px);
    order: 1;
  }

  .pg-modal-close {
    order: 2;
  }

  .pg-modal-live-link {
    order: 3;
    flex: none;
    margin-top: 8px;
  }
}

/* ── Modal close button ─────────────────────── */

.pg-modal-close {
  position: relative;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.pg-modal-close span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

.pg-modal-close span:first-child {
  transform: translate(-50%, -50%) rotate(45deg);
}

.pg-modal-close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ── Modal media ────────────────────────────── */

.pg-modal-image-wrap {
  flex: 1;
  min-height: 0;
  padding: 0 40px 40px;
  overflow-y: auto;
  overflow-x: hidden;
}

.pg-modal-img {
  width: 100%;
  height: auto;
  display: block;
}

.pg-modal-video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

/* ── Skeleton ───────────────────────────────── */

.pg-item-skeleton {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pg-item-skeleton .sk-image {
  width: 100%;
  height: 450px;
  border-radius: 0;
}

.pg-item-skeleton .sk-title {
  height: 18px;
  width: 65%;
}

.pg-item-skeleton .sk-desc {
  height: 13px;
  width: 88%;
  margin-top: 2px;
}

@media (max-width: 768px) {
  .pg-item-skeleton .sk-image {
    height: 340px;
  }
}

/* ── Empty state ────────────────────────────── */

.pg-empty {
  font-family: var(--font-slab);
  font-size: 1rem;
  color: var(--text-muted);
  padding: 0 20px;
}

/* ── Responsive ─────────────────────────────── */

@media (max-width: 1024px) {
  .playground-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .playground-main {
    padding-top: 140px;
  }

  .playground-grid {
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .pg-image {
    height: 340px;
  }

  .pg-modal-header {
    padding: 20px;
  }

  .pg-modal-title {
    font-size: 28px;
  }

  .pg-modal-desc {
    font-size: 16px;
  }

  .pg-modal-image-wrap {
    padding: 0 20px 20px;
  }
}