/* PlayZone — layout: topbar, bottom nav, footer, pages */

.pz-topbar {
  position: relative;
  z-index: 10;
  height: var(--pz-topbar-h);
  background: rgba(21, 18, 31, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pz-border);
}

.pz-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 12px;
}

.pz-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  min-width: 0;
}

.pz-brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pz-purple), var(--pz-purple-light));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--pz-glow);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
}

.pz-brand__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pz-topbar__actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.pz-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--pz-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pz-text);
  transition: background 0.15s;
}

.pz-icon-btn:active,
.pz-icon-btn.is-active {
  background: rgba(147, 51, 234, 0.2);
  color: var(--pz-purple-light);
}

/* Drawer */
.pz-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.pz-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pz-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: var(--pz-surface);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-right: 1px solid var(--pz-border);
}

.pz-drawer.is-open {
  transform: translateX(0);
}

.pz-drawer__head {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--pz-border);
}

.pz-drawer__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pz-text-muted);
  margin-bottom: 8px;
}

.pz-drawer__section {
  margin-bottom: 20px;
}

.pz-drawer__link {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-weight: 500;
  border-bottom: 1px solid var(--pz-border);
}

.pz-drawer__link span {
  color: var(--pz-text-muted);
  font-size: 0.85rem;
}

/* Search overlay */
.pz-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--pz-bg);
  display: flex;
  flex-direction: column;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
}

.pz-search-overlay[hidden] {
  display: none;
}

.pz-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.pz-search-bar input {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--pz-radius-md);
  border: 1px solid var(--pz-border);
  background: var(--pz-surface);
  color: var(--pz-text);
  font: inherit;
}

.pz-search-empty {
  text-align: center;
  color: var(--pz-text-muted);
  padding: 32px 16px;
}

/* Favorites panel */
.pz-fav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.pz-fav-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.pz-fav-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(340px, 92vw);
  background: var(--pz-surface);
  z-index: 251;
  transform: translateX(100%);
  transition: transform 0.25s;
  overflow-y: auto;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
}

.pz-fav-panel.is-open {
  transform: translateX(0);
}

.pz-fav-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.pz-fav-panel__head h2 {
  font-size: 1.1rem;
  font-weight: 800;
}

.pz-fav-section__title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--pz-text-muted);
  margin: 16px 0 10px;
}

.pz-fav-empty {
  color: var(--pz-text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}

/* Bottom nav */
.pz-bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  height: calc(var(--pz-bottomnav-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: rgba(21, 18, 31, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--pz-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.pz-bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--pz-text-muted);
  min-height: 44px;
  justify-content: center;
}

.pz-bottomnav__item.is-active {
  color: var(--pz-purple-light);
}

.pz-bottomnav__item svg {
  width: 22px;
  height: 22px;
}

/* Footer */
.pz-foot {
  background: rgba(21, 18, 31, 0.85);
  border-top: 1px solid var(--pz-border);
  padding: 28px 0 20px;
  margin-top: 24px;
}

.pz-foot__brand {
  font-weight: 800;
  margin-bottom: 14px;
}

.pz-foot__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 16px;
}

.pz-foot__nav a {
  font-size: 0.85rem;
  color: var(--pz-text-muted);
}

.pz-foot__bottom {
  font-size: 0.78rem;
  color: var(--pz-text-muted);
}

/* Home feed */
.pz-home {
  padding-bottom: 8px;
}

.pz-section {
  margin-bottom: 24px;
}

.pz-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.pz-section__title {
  font-size: 1.15rem;
  font-weight: 800;
}

.pz-section__more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pz-purple-light);
}

/* Detail sub-header */
.pz-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--pz-shell-pad);
  background: rgba(21, 18, 31, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pz-border);
  position: relative;
}

.pz-detail-topbar__title {
  font-weight: 700;
  font-size: 0.95rem;
}

.pz-detail-topbar__actions {
  display: flex;
  gap: 4px;
}

/* Play page */
.pz-play-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #000;
}

.pz-play-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--pz-shell-pad);
  background: var(--pz-surface);
  flex-shrink: 0;
}

.pz-play-frame-wrap {
  flex: 1;
  min-height: 0;
}

.pz-play-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Prose / legal */
.pz-prose {
  padding: 24px 0 32px;
}

.pz-prose h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 8px 0 16px;
}

.pz-prose h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 24px 0 10px;
}

.pz-prose h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 16px 0 8px;
}

.pz-prose p,
.pz-prose li {
  color: var(--pz-text-muted);
  margin-bottom: 12px;
}

.pz-prose ul {
  padding-left: 20px;
  list-style: disc;
}

.pz-prose a {
  color: var(--pz-purple-light);
  text-decoration: underline;
}

.pz-prose--legal {
  font-size: 0.92rem;
}

/* Category hub */
.pz-cat-hub {
  padding: 16px 0 24px;
}

.pz-cat-hub__banner {
  border-radius: var(--pz-radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #581c87, #9333ea);
  padding: 24px 20px;
  position: relative;
}

.pz-cat-hub__banner h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.pz-cat-hub__banner p {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 14px;
}

.pz-cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pz-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.pz-cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--pz-surface);
  border-radius: var(--pz-radius-md);
  border: 1px solid var(--pz-border);
  text-align: center;
  transition: transform 0.12s, border-color 0.15s;
}

.pz-cat-tile:active {
  transform: scale(0.98);
  border-color: rgba(147, 51, 234, 0.35);
}

.pz-cat-tile__name {
  font-weight: 700;
  font-size: 0.88rem;
}

.pz-cat-tile__count {
  font-size: 0.75rem;
  color: var(--pz-text-muted);
}

.pz-cat-icon {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: var(--pz-radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.pz-cat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--pz-surface);
  border-radius: var(--pz-radius-md);
  border: 1px solid var(--pz-border);
}

.pz-cat-row__info {
  flex: 1;
  min-width: 0;
}

.pz-cat-row__name {
  font-weight: 700;
  font-size: 0.95rem;
}

.pz-cat-row__count {
  font-size: 0.8rem;
  color: var(--pz-text-muted);
}

.pz-cat-row__chev {
  flex-shrink: 0;
  color: var(--pz-text-muted);
}

.pz-breadcrumb {
  font-size: 0.85rem;
  color: var(--pz-text-muted);
  margin-bottom: 12px;
}

.pz-breadcrumb a {
  color: var(--pz-purple-light);
}

.pz-category-head h1 {
  font-size: 1.4rem;
  font-weight: 800;
}

.pz-category-count {
  color: var(--pz-text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}
