/* Mini portal Playpager — ringan, tanpa framework */

:root {
  --bg: #f7f3ee;
  --bg-pattern: #efe8df;
  --card: #fff;
  --text: #3b2a1f;
  --muted: #6b5a4a;
  --gold: #c8a951;
  --gold-dark: #8b7349;
  --bar: linear-gradient(180deg, #2a221c 0%, #1a1512 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

body[data-page='list'] {
  background-color: var(--bg);
  background-image: radial-gradient(
      circle at 20% 10%,
      rgba(200, 169, 81, 0.12) 0%,
      transparent 45%
    ),
    radial-gradient(circle at 90% 30%, rgba(139, 115, 73, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-pattern) 100%);
  background-attachment: fixed;
}

a {
  color: #6b4f3a;
}

/* ——— Sticky header ——— */
.pp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.5rem 1rem;
  padding-top: max(0.5rem, env(safe-area-inset-top));
  background: var(--bar);
  border-bottom: 1px solid rgba(200, 169, 81, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pp-header.pp-header--list {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.pp-header--list .pp-header__back {
  grid-column: 1;
  justify-self: start;
}

.pp-header--list .pp-header__title {
  grid-column: 2;
}

.pp-header--list .pp-header__home {
  grid-column: 3;
  justify-self: end;
}

.pp-header.pp-header--play {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.65rem;
}

.pp-header--play .pp-header__title {
  flex: unset;
  font-size: clamp(0.95rem, 2.8vw, 1.1rem);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  justify-self: end;
}

.pp-header--play .pp-header__actions {
  grid-column: 3;
}

.pp-header__ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(200, 169, 81, 0.28);
  background: transparent;
  color: rgba(245, 230, 200, 0.92);
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.pp-header__ghost:hover {
  border-color: rgba(230, 199, 122, 0.5);
  background: rgba(59, 42, 31, 0.35);
  color: #fff;
}

.pp-header__home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.95rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(200, 169, 81, 0.5);
  background: linear-gradient(180deg, #e6c77a, #b8943a);
  color: #1f140c;
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset;
}

.pp-header__home:hover {
  filter: brightness(1.06);
}

@media (max-width: 380px) {
  .pp-header__ghost {
    padding: 0 0.55rem;
    font-size: 0.75rem;
  }

  .pp-header__home {
    padding: 0 0.65rem;
    font-size: 0.75rem;
  }

  .pp-header__back {
    padding: 0 0.65rem;
    font-size: 0.8rem;
  }
}

.pp-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(200, 169, 81, 0.35);
  background: rgba(59, 42, 31, 0.85);
  color: #f5e6c8;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
}

.pp-header__back:hover {
  border-color: rgba(230, 199, 122, 0.55);
}

.pp-header__title {
  flex: 1;
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  min-width: 0;
}

.pp-header__action {
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(200, 169, 81, 0.45);
  background: linear-gradient(180deg, #e6c77a, #b8943a);
  color: #1f140c;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ——— Layout list / katalog ——— */
.pp-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.pp-catalog {
  max-width: 1180px;
}

.pp-catalog__intro {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0.25rem 0 0.5rem;
}

.pp-catalog__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dark);
  opacity: 0.9;
}

.pp-catalog__heading {
  margin: 0 0 0.4rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pp-catalog__count {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.pp-catalog__count--sub {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.pp-catalog__count--sub a {
  color: var(--gold-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pp-catalog__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 520px) {
  .pp-catalog__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 800px) {
  .pp-catalog__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.15rem;
  }
}

@media (min-width: 1100px) {
  .pp-catalog__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.pp-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid rgba(59, 42, 31, 0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(59, 42, 31, 0.07);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .pp-card:hover {
    box-shadow: 0 12px 32px rgba(59, 42, 31, 0.14);
    transform: translateY(-3px);
  }

  .pp-card:hover .pp-card__img {
    transform: scale(1.04);
  }

  .pp-card:hover .pp-card__playhint {
    opacity: 1;
  }
}

.pp-card__media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(145deg, #e5d9c8 0%, #c9b89e 50%, #b8a68a 100%);
  text-decoration: none;
  outline-offset: -2px;
}

.pp-card__provider {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(26, 21, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}

.pp-card__playhint {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    rgba(26, 21, 18, 0.15) 0%,
    rgba(26, 21, 18, 0.45) 100%
  );
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.pp-card__playicon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: linear-gradient(145deg, #e6c77a, #a8893a);
  color: #1f140c;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.pp-card__playicon::after {
  content: '';
  margin-left: 3px;
  border-style: solid;
  border-width: 0.55rem 0 0.55rem 0.95rem;
  border-color: transparent transparent transparent #1f140c;
}

.pp-card__media:focus-visible {
  outline: 2px solid var(--gold);
}

.pp-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.pp-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 8rem;
  background: linear-gradient(
    135deg,
    rgba(200, 169, 81, 0.25) 0%,
    rgba(59, 42, 31, 0.08) 100%
  );
}

.pp-card__body {
  padding: 1rem 1.15rem 1.1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pp-card__title {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pp-card__desc {
  margin: 0 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
  flex: 1;
}

.pp-card__footer {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(59, 42, 31, 0.08);
  display: flex;
  justify-content: flex-end;
}

.pp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.pp-btn--primary {
  color: #1f140c;
  background: linear-gradient(135deg, #e6c77a, #c8a951);
}

.pp-btn--primary:hover {
  filter: brightness(1.05);
}

/* ——— Play page ——— */
.pp-play {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: #0f0c0a;
}

.pp-play__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#pp-stage {
  position: relative;
  flex: 1;
  min-height: min(70vh, 900px);
  background: #000;
}

#pp-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #111;
}

#pp-frame[hidden] { display: none !important; }

#pp-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: #0f0c0a;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
}

#pp-loading[hidden] { display: none !important; }

.pp-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid #3b2a1f;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: pp-spin 0.75s linear infinite;
}

@keyframes pp-spin {
  to { transform: rotate(360deg); }
}

#pp-fallback {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem;
  text-align: center;
  background: #0f0c0a;
  color: rgba(255, 255, 255, 0.88);
}

#pp-fallback[hidden] { display: none !important; }

#pp-fallback p {
  margin: 0;
  max-width: 22rem;
  font-size: 0.9rem;
}

/* ——— Error ——— */
.pp-error {
  padding: 2.5rem 1rem;
  text-align: center;
}

.pp-error h1 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.pp-error p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
