/* Components: buttons, cards, chips, detail sections */

/* —— Buttons —— */
.yp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.yp-btn:active { transform: scale(0.97); }

.yp-btn--explore {
  background: var(--yp-black);
  color: #fff;
  padding: 10px 18px;
  font-size: 13px;
}

.yp-btn--explore svg {
  width: 16px;
  height: 16px;
}

.yp-btn--yellow {
  background: var(--yp-yellow);
  color: var(--yp-black);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.35);
}

.yp-btn--purple {
  background: var(--yp-purple);
  color: #fff;
}

.yp-btn--play-main {
  background: var(--yp-yellow);
  color: var(--yp-black);
  font-size: 16px;
  padding: 14px 24px;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.yp-btn--play-icon {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 16px;
  flex-shrink: 0;
}

.yp-btn--ghost {
  background: transparent;
  color: var(--yp-purple);
  border: 2px solid var(--yp-purple-soft);
}

.yp-btn--sm {
  padding: 8px 16px;
  font-size: 12px;
}

.yp-btn--circle-play {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 50%;
  background: var(--yp-yellow);
  color: var(--yp-black);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.5);
}

.yp-btn--circle-play svg {
  width: 28px;
  height: 28px;
  margin-left: 3px;
}

/* —— Filter chips —— */
.yp-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--yp-bg-card);
  color: var(--yp-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--yp-shadow-soft);
  text-decoration: none;
}

.yp-chip.is-active {
  background: var(--yp-black);
  color: #fff;
}

.yp-chip--icon {
  width: 42px;
  height: 42px;
  padding: 0;
  justify-content: center;
  border-radius: 14px;
}

/* —— Trending card (vertical scroll) —— */
.yp-trend-card {
  flex: 0 0 140px;
  width: 140px;
  text-decoration: none;
  color: inherit;
}

.yp-editors__row .yp-trend-card--pick {
  flex: none;
  width: 100%;
  min-width: 0;
}

.yp-trend-card--pick .yp-trend-card__thumb {
  aspect-ratio: 1 / 1;
}

.yp-trend-card--pick .yp-trend-card__rating {
  bottom: 8px;
  left: 8px;
  padding: 4px 8px;
  font-size: 10px;
}

.yp-trend-card--pick .yp-trend-card__play {
  bottom: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
}

.yp-trend-card--pick .yp-trend-card__play svg {
  width: 12px;
  height: 12px;
}

.yp-trend-card--pick .yp-trend-card__title {
  font-size: 11px;
  text-align: center;
  padding: 0;
}

.yp-trend-card__thumb {
  position: relative;
  border-radius: var(--yp-radius);
  overflow: hidden;
  aspect-ratio: 3 / 4;
  width: 100%;
  background: #e5e7eb;
  margin-bottom: 10px;
  box-shadow: var(--yp-shadow-soft);
}

.yp-trend-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yp-trend-card__rating {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.yp-trend-card__rating-star {
  color: var(--yp-yellow);
  font-size: 12px;
}

.yp-trend-card__play {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  color: var(--yp-black);
}

.yp-trend-card__play svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
}

.yp-trend-card__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

/* —— Editor featured card —— */
.yp-featured-card {
  position: relative;
  display: block;
  border-radius: var(--yp-radius-lg);
  overflow: hidden;
  min-height: 160px;
  text-decoration: none;
  color: #fff;
}

.yp-featured-card__bg {
  position: absolute;
  inset: 0;
}

.yp-featured-card__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yp-featured-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
}

.yp-featured-card__body {
  position: relative;
  z-index: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 160px;
}

.yp-featured-card__hot {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 8px;
  background: #ef4444;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.yp-featured-card__title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 800;
}

.yp-featured-card__meta {
  margin: 0 0 12px;
  font-size: 13px;
  opacity: 0.9;
}

.yp-mini-card {
  /* legacy alias — use .yp-trend-card */
  display: block;
}

/* —— Rank list —— */
.yp-rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--yp-bg-card);
  border-radius: var(--yp-radius);
  box-shadow: var(--yp-shadow-soft);
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
}

.yp-rank-row__num {
  width: 28px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--yp-purple);
  text-align: center;
}

.yp-rank-row__num--1 { color: #eab308; }
.yp-rank-row__num--2 { color: #94a3b8; }
.yp-rank-row__num--3 { color: #d97706; }

.yp-rank-row__thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.yp-rank-row__info { flex: 1; min-width: 0; }

.yp-rank-row__title {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
}

.yp-rank-row__meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--yp-text-muted);
}

.yp-rank-row__play {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--yp-yellow);
  color: var(--yp-black);
  font-size: 12px;
  font-weight: 800;
}

/* —— Game grid (category) —— */
.yp-game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.yp-game-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.yp-game-card__thumb {
  position: relative;
  border-radius: var(--yp-radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: #eee;
  margin-bottom: 6px;
}

.yp-game-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yp-game-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff;
  font-size: 20px;
}
.yp-game-card:hover .yp-game-card__play,
.yp-game-card:focus .yp-game-card__play { opacity: 1; }

.yp-game-card__title {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yp-game-card__meta {
  font-size: 11px;
  color: var(--yp-text-muted);
}

/* —— Category gradient cards —— */
.yp-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-radius: var(--yp-radius-lg);
  text-decoration: none;
  color: var(--yp-text);
  min-height: 100px;
  box-shadow: var(--yp-shadow-soft);
  transition: transform 0.15s;
}
.yp-cat-card:active { transform: scale(0.98); }

.yp-cat-card__info h3 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 800;
}

.yp-cat-card__count {
  margin: 0;
  font-size: 13px;
  opacity: 0.75;
}

.yp-cat-card__emoji {
  font-size: 48px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

/* —— Detail tags & sections —— */
.yp-detail-tag {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--yp-purple-soft);
  color: var(--yp-purple-dark);
  font-size: 12px;
  font-weight: 600;
}

.yp-detail-section {
  margin-bottom: 24px;
}

.yp-detail-section__title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
}

.yp-detail-section__body {
  color: var(--yp-text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.yp-detail-section__body p { margin: 0 0 10px; }

.yp-overview-viewport {
  position: relative;
  overflow: hidden;
  transition: max-height 0.3s;
}

.yp-overview-viewport.is-collapsed {
  max-height: 120px;
}

.yp-overview-viewport.is-expanded {
  max-height: none;
}

.yp-overview-viewport__fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to top, var(--yp-bg), transparent);
  pointer-events: none;
}

.yp-overview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  color: var(--yp-purple);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* How to play icon rows */
.yp-howto-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.yp-howto-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.yp-howto-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}

.yp-howto-item__icon--up { background: #fef08a; color: #854d0e; }
.yp-howto-item__icon--down { background: #e9d5ff; color: #6b21a8; }
.yp-howto-item__icon--side { background: #99f6e4; color: #115e59; }
.yp-howto-item__icon--tap { background: #fde68a; color: #92400e; }

.yp-howto-item__text {
  font-size: 14px;
  color: var(--yp-text);
  font-weight: 600;
}

.yp-howto-item__text small {
  display: block;
  font-weight: 400;
  color: var(--yp-text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* FAQ */
.yp-faq-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--yp-border);
}

.yp-faq-q {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--yp-text);
  font-size: 14px;
}

.yp-faq-a {
  margin: 0;
  font-size: 13px;
  color: var(--yp-text-muted);
}

/* Related games — grid rows (no horizontal scroll) */
.yp-related {
  padding: 24px 16px;
}

.yp-related__title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 800;
}

.yp-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.yp-related-grid .yp-trend-card {
  flex: none;
  width: 100%;
  min-width: 0;
}

.yp-breadcrumb {
  font-size: 13px;
  color: var(--yp-text-muted);
  margin-bottom: 12px;
}
.yp-breadcrumb a { color: var(--yp-purple); }

.yp-category-head h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.yp-category-count {
  margin: 0 0 12px;
  color: var(--yp-text-muted);
  font-size: 14px;
}

.yp-sentinel {
  text-align: center;
  padding: 16px;
  color: var(--yp-text-muted);
  font-size: 13px;
}

.yp-cat-hub[hidden],
.yp-cat-grid-view[hidden] { display: none !important; }

/* —— New Arrivals (square mini cards) —— */
.yp-arrivals-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.yp-arrival-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.yp-arrival-card__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--yp-radius);
  overflow: hidden;
  background: #e5e7eb;
  margin-bottom: 8px;
  box-shadow: var(--yp-shadow-soft);
}

.yp-arrival-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yp-arrival-card__title {
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}

/* —— Top Rated This Week (2×2 horizontal rows) —— */
.yp-toprated-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.yp-toprated-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--yp-bg-card);
  border-radius: var(--yp-radius);
  box-shadow: var(--yp-shadow-soft);
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.yp-toprated-card__thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eee;
}

.yp-toprated-card__info {
  flex: 1;
  min-width: 0;
}

.yp-toprated-card__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yp-toprated-card__cat {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--yp-text-muted);
}

.yp-toprated-card__score {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
}

.yp-toprated-card__score-star {
  color: var(--yp-yellow-dark);
  font-size: 14px;
}
