/* Layout: header, footer, pages */

/* —— Header —— */
.yp-topbar {
  position: relative;
  z-index: 50;
  padding: 12px 0;
  background: transparent;
}

.yp-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.yp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--yp-text);
  font-weight: 800;
  font-size: 1.15rem;
  min-width: 0;
  flex: 1;
}

.yp-brand__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yp-brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--yp-purple), #b794f6);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.yp-brand__dot { color: var(--yp-purple); }

.yp-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.yp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--yp-bg-card);
  color: var(--yp-text);
  box-shadow: var(--yp-shadow-soft);
  cursor: pointer;
  transition: transform 0.15s;
}
.yp-icon-btn:active { transform: scale(0.94); }
.yp-icon-btn.is-active { color: #ef4444; }

/* —— Bottom nav —— */
.yp-bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: var(--yp-nav-h);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: var(--yp-black);
  border-radius: 28px 28px 0 0;
  padding: 8px 12px 12px;
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}

.yp-bottomnav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: none;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}

.yp-bottomnav__item svg {
  width: 24px;
  height: 24px;
}

.yp-bottomnav__item.is-active {
  color: var(--yp-yellow);
}

.yp-bottomnav__item.is-active::before {
  content: '';
  position: absolute;
  top: 2px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.15);
  z-index: -1;
}

/* —— Footer —— */
.yp-foot {
  padding: 32px 0 24px;
  margin-top: 24px;
  border-top: 1px solid var(--yp-border);
  text-align: center;
}

.yp-foot__brand {
  font-weight: 800;
  margin: 0 0 12px;
}

.yp-foot__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 16px;
  margin-bottom: 12px;
}
.yp-foot__nav a {
  color: var(--yp-text-muted);
  font-size: 13px;
}

.yp-foot__bottom {
  font-size: 12px;
  color: var(--yp-text-muted);
  margin: 0;
}

/* —— Home sections —— */
.yp-home { padding-bottom: 8px; }

.yp-section {
  margin-bottom: 28px;
}

.yp-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.yp-section__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.yp-section__more {
  font-size: 13px;
  font-weight: 600;
  color: var(--yp-purple);
  white-space: nowrap;
}

.yp-section__head--icon .yp-section__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.yp-section__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--yp-purple-soft);
  color: var(--yp-purple);
  flex-shrink: 0;
}

/* —— Hero —— */
.yp-hero {
  position: relative;
  border-radius: var(--yp-radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  min-height: 220px;
  background: var(--yp-purple);
}

.yp-hero__wave {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #8a4fff 0%, #6b2fd4 55%, #5a25b8 100%);
}

.yp-hero__wave::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 48px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 48' preserveAspectRatio='none'%3E%3Cpath fill='%23fff9f2' d='M0 48V20c40-20 80 20 120 10s80-30 120-10 80 30 120 10 40-30 40-30v48z'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}

.yp-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
  padding: 28px 20px 36px;
  min-height: 220px;
}

.yp-hero__text { max-width: 200px; }

.yp-hero__title {
  margin: 0 0 16px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
  color: #fff;
}

.yp-hero__title em {
  font-style: normal;
  background: linear-gradient(90deg, #fde047, #a5f3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.yp-hero__char {
  width: 130px;
  height: auto;
  align-self: end;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
}

/* —— Category quick links —— */
.yp-quick-cats {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 8px;
  margin-bottom: 24px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.yp-quick-cats::-webkit-scrollbar { display: none; }

.yp-quick-cat {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 64px;
  text-decoration: none;
  color: var(--yp-text);
}

.yp-quick-cat__icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--yp-bg-card);
  box-shadow: var(--yp-shadow-soft);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.yp-quick-cat__label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

/* —— Horizontal scroll —— */
.yp-hscroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.yp-hscroll::-webkit-scrollbar { display: none; }

/* —— Editor's pick —— */
.yp-editors {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.yp-editors__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

/* —— Keep playing —— */
.yp-keep-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.yp-keep-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--yp-bg-card);
  border-radius: var(--yp-radius);
  box-shadow: var(--yp-shadow-soft);
  text-decoration: none;
  color: inherit;
}

.yp-keep-item__ring {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  position: relative;
}

.yp-keep-item__ring svg {
  width: 48px;
  height: 48px;
  transform: rotate(-90deg);
}

.yp-keep-item__ring img {
  position: absolute;
  inset: 8px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
}

.yp-keep-item__info { flex: 1; min-width: 0; }

.yp-keep-item__title {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yp-keep-item__sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--yp-text-muted);
}

/* —— Category hub —— */
.yp-cat-page__hero {
  position: relative;
  padding: 8px 0 24px;
  margin-bottom: 8px;
}

.yp-cat-page__title {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
}

.yp-cat-page__illus {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  opacity: 0.9;
}

.yp-filter-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.yp-filter-chips::-webkit-scrollbar { display: none; }

.yp-cat-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* —— Detail page —— */
.yp-detail-page {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.yp-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: relative;
  z-index: 10;
}

.yp-detail-topbar__actions {
  display: flex;
  gap: 8px;
}

.yp-detail-wave {
  height: 24px;
  background: var(--yp-yellow);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  margin-top: -4px;
}

.yp-detail-head {
  padding: 16px 16px 0;
}

.yp-detail-title {
  margin: 0 0 10px;
  font-size: 1.75rem;
  font-weight: 800;
}

.yp-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--yp-text-muted);
  margin-bottom: 12px;
}

.yp-detail-meta strong {
  color: var(--yp-text);
  font-weight: 800;
}

.yp-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 16px;
}

.yp-detail-preview {
  position: relative;
  margin: 0 16px 16px;
  border-radius: var(--yp-radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  max-height: 420px;
  background: #111;
}

.yp-detail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yp-detail-preview__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.25);
}

.yp-detail-actions-row {
  display: flex;
  justify-content: space-around;
  padding: 8px 16px 20px;
}

.yp-detail-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--yp-text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.yp-detail-action__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--yp-bg-card);
  box-shadow: var(--yp-shadow-soft);
  display: grid;
  place-items: center;
  color: var(--yp-purple);
}

.yp-detail-body {
  padding: 0 16px;
}

.yp-detail-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--yp-bg) 70%, transparent);
  z-index: 90;
  box-sizing: border-box;
}

.yp-detail-sticky .yp-btn--play-main { flex: 1; }

/* —— Play page —— */
.yp-play-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #000;
}

.yp-play-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--yp-black);
  color: #fff;
}

.yp-play-bar__title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yp-play-frame-wrap {
  flex: 1;
  min-height: 0;
}

.yp-play-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* —— Prose / legal —— */
.yp-prose {
  padding: 24px 0 32px;
}

.yp-prose h1 {
  font-size: 1.75rem;
  margin: 0 0 16px;
}

.yp-prose h2 {
  font-size: 1.1rem;
  margin: 24px 0 8px;
}

.yp-prose h3 {
  font-size: 1rem;
  margin: 16px 0 6px;
  color: var(--yp-text);
}

.yp-prose p, .yp-prose li {
  color: var(--yp-text-muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.yp-prose a { color: var(--yp-purple); }

/* —— Overlays —— */
.yp-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--yp-bg);
  padding: 16px;
  overflow-y: auto;
}

.yp-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.yp-search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--yp-purple-soft);
  border-radius: var(--yp-radius-sm);
  background: #fff;
}

.yp-search-empty {
  text-align: center;
  color: var(--yp-text-muted);
  padding: 32px;
}

.yp-fav-backdrop,
.yp-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.yp-fav-backdrop.is-visible,
.yp-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.yp-fav-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 360px);
  height: 100%;
  background: var(--yp-bg);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.25s;
  overflow-y: auto;
  padding: 20px;
  box-shadow: -8px 0 32px rgba(0,0,0,0.1);
}
.yp-fav-panel.is-open { transform: translateX(0); }

.yp-fav-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.yp-fav-panel__head h2 { margin: 0; font-size: 1.2rem; }

.yp-fav-empty {
  color: var(--yp-text-muted);
  text-align: center;
  padding: 24px;
}

.yp-fav-section__title {
  font-size: 14px;
  margin: 20px 0 12px;
}

/* —— Drawer menu —— */
.yp-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: var(--yp-bg-card);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
}

.yp-drawer.is-open {
  transform: translateX(0);
}

.yp-drawer__head {
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--yp-border);
}

.yp-drawer__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--yp-text-muted);
  margin: 0 0 8px;
}

.yp-drawer__section {
  margin-bottom: 22px;
}

.yp-drawer__link {
  display: block;
  width: 100%;
  padding: 12px 0;
  font-weight: 600;
  font-size: 15px;
  color: var(--yp-text);
  text-decoration: none;
  text-align: left;
  border: none;
  background: none;
  border-bottom: 1px solid var(--yp-border);
  cursor: pointer;
  font-family: inherit;
}

.yp-drawer__link.is-active {
  color: var(--yp-purple);
}

.yp-drawer__link--btn {
  color: var(--yp-text);
}
