/* home.css — Layer 3: home page only. Do not modify papupa.css. */

/* ───────────────────────────── Page shell ──────────────────────────────── */
.home-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.home-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem 0;
}

.home-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0.5rem 1.5rem 2rem;
}

/* ───────────────────────────── Layout wrapper ─────────────────────────── */
.home-grid-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-bottom: 3rem;
}

/* ───────────────────────────── Section header ─────────────────────────── */
.home-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-section__header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.home-section__title-row {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.home-section__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pa-color-primary);
  margin: 0;
  line-height: 1.2;
}

.home-section__see-all {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pa-color-secondary);
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

.home-section__see-all:hover {
  text-decoration: underline;
}

.home-section__subtitle {
  font-size: 0.8rem;
  color: var(--pa-color-text-muted);
  margin: 0;
}

/* ───────────────────────────── Horizontal scroll ──────────────────────── */
.home-scroll-row {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -1rem; /* bleed to edge on mobile */
  padding: 0 1rem;
}

.home-scroll-row::-webkit-scrollbar {
  display: none;
}

.home-scroll-track {
  display: flex;
  gap: 1rem;
  padding-bottom: 0.5rem;
}

.home-scroll-track .home-card-wrapper,
.home-scroll-track .home-card {
  flex: 0 0 180px;
  min-width: 180px;
}

/* ───────────────────────────── Hero banner ─────────────────────────────── */
.home-section--hero .home-hero {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.home-section--hero .home-hero::-webkit-scrollbar {
  display: none;
}

.home-section--hero .home-card-wrapper,
.home-section--hero .home-card {
  flex: 0 0 260px;
  min-width: 260px;
}

.home-section--hero .home-card__image {
  height: 160px;
}

/* ───────────────────────────── Featured row ────────────────────────────── */
.home-section--featured {
  background: linear-gradient(135deg, rgba(92, 47, 138, 0.06), rgba(255, 107, 53, 0.04));
  border-radius: var(--pa-radius-lg, 20px);
  padding: 1.25rem;
}

.home-section--featured .home-featured {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
}

.home-section--featured .home-featured::-webkit-scrollbar {
  display: none;
}

.home-section--featured .home-card-wrapper,
.home-section--featured .home-card {
  flex: 0 0 200px;
  min-width: 200px;
}

/* ───────────────────────────── GameCard ────────────────────────────────── */
.home-card-wrapper {
  display: block;
  height: 100%;
}

.home-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--pa-shadow-sm, 0 4px 14px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  cursor: pointer;
}

.home-card-wrapper:hover .home-card,
.home-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--pa-shadow-hover, 0 16px 48px rgba(0, 0, 0, 0.14));
}
.home-card-wrapper:hover .app-tile--coming-soon,
.app-tile--coming-soon:hover {
  transform: none;
  box-shadow: var(--pa-shadow-sm, 0 4px 14px rgba(0, 0, 0, 0.08));
  cursor: default;
}

.home-card__image {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
  flex-shrink: 0;
}

.home-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-card__emoji-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100px;
  flex-shrink: 0;
}

.home-card__emoji-ring span {
  font-size: 2.5rem;
}

.home-card__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
}

.home-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.5rem 0.5rem 0.5rem;
  flex: 1;
  position: relative;
  min-height: 5.5rem;
  min-width: 0;
  width: 100%;
  justify-content: space-between;
}

.home-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.1rem;
}

.home-card__type-badge {
  font-size: 0.60rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pa-color-primary);
  background: rgba(92, 47, 138, 0.08);
  border-radius: 999px;
  padding: 3px 8px;
}

.home-card__lock {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pa-yellow, #fee440);
  color: var(--pa-color-text);
}

/* ───────────────────────────── Star rating ─────────────────────────────── */
.home-star-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 0.65rem;
  color: var(--pa-yellow, #fee440);
  line-height: 1;
}

.home-star-rating .empty {
  color: #d1d5db;
}

.home-star-rating .half {
  opacity: 0.65;
}

.home-star-score {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pa-color-text-muted);
  margin-left: 3px;
}

/* ───────────────────────────── Filter trigger ──────────────────────────── */
.home-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1.5px solid var(--pa-color-border, #e8e8f0);
  background: #fff;
  color: var(--pa-color-text);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.home-filter-trigger:hover {
  border-color: var(--pa-color-primary);
  color: var(--pa-color-primary);
}

.home-filter-trigger--active {
  border-color: var(--pa-color-primary);
  background: rgba(92, 47, 138, 0.06);
  color: var(--pa-color-primary);
}

.home-filter-trigger__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--pa-color-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0 4px;
}

/* ───────────────────────────── Filter overlay ──────────────────────────── */
.home-filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  justify-content: flex-end;
}

.home-filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.home-filter-panel {
  position: relative;
  z-index: 1;
  width: 340px;
  max-width: 90vw;
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  animation: paSlideInRight 0.2s ease;
}

@keyframes paSlideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.home-filter-panel--pending {
  opacity: 0.6;
  pointer-events: none;
}

.home-filter-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--pa-color-border, #e8e8f0);
  flex-shrink: 0;
}

.home-filter-panel__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pa-color-text);
}

.home-filter-panel__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.home-filter-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0f0f4;
  color: var(--pa-color-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.home-filter-panel__close:hover {
  background: #e0e0e8;
  color: var(--pa-color-text);
}

.home-filter-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ───────────────────────────── Chip groups ─────────────────────────────── */
.home-chip-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.home-chip-group--panel {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.home-chip-group__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pa-color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0;
}

/* h3 reset: preserve visual style when used as semantic heading */
h3.home-chip-group__label { font-size: inherit; font-weight: inherit; }

.home-chip-group__chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.home-chip-group__chips::-webkit-scrollbar {
  display: none;
}

.home-chip-group__chips--wrap {
  overflow-x: visible;
  flex-wrap: wrap;
  padding-bottom: 0;
}

.home-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  border: 1.5px solid var(--pa-color-border, #e8e8f0);
  background: #fff;
  color: var(--pa-color-text);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  font-family: inherit;
}

.home-chip:hover {
  border-color: var(--pa-color-primary);
  color: var(--pa-color-primary);
}

.home-chip--active {
  background: var(--pa-color-primary);
  border-color: var(--pa-color-primary);
  color: #fff;
}

.home-chip--active:hover {
  background: var(--pa-purple, #8662a8);
  border-color: var(--pa-purple, #8662a8);
  color: #fff;
}

.home-chip-clear {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pa-color-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: inherit;
}

.home-chip-clear:hover {
  text-decoration: underline;
}

/* ───────────────────────────── Search trigger ──────────────────────────── */
.home-search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(92, 47, 138, 0.08);
  border: none;
  cursor: pointer;
  color: var(--pa-color-primary);
  transition: background 0.15s ease, transform 0.15s ease;
}

.home-search-trigger:hover {
  background: rgba(92, 47, 138, 0.15);
  transform: scale(1.08);
}

/* ───────────────────────────── Search overlay ──────────────────────────── */
.home-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6rem;
}

.home-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.home-search-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 1rem;
  animation: paSlideUp 0.2s ease;
}

.home-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 2px solid var(--pa-color-primary);
  border-radius: 999px;
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  background: #fff;
}

.home-search-form__icon {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--pa-color-text-muted);
  flex-shrink: 0;
}

.home-search-form__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--pa-color-text);
  background: transparent;
}

.home-search-form__input::placeholder {
  color: var(--pa-color-text-muted);
}

.home-search-form__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: #f0f0f4;
  color: var(--pa-color-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.home-search-form__submit {
  background: var(--pa-color-primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.4rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.home-search-form__submit:disabled {
  opacity: 0.7;
}

.home-search-panel__close {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--pa-color-text-muted);
  font-weight: 500;
  padding: 0.2rem 0.5rem;
}

.home-search-panel__close:hover {
  color: var(--pa-color-text);
}

/* ───────────────────────────── Search results ──────────────────────────── */
.home-search-results-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.home-search-results-count {
  font-size: 0.9rem;
  color: var(--pa-color-text-muted);
  font-weight: 500;
  margin: 0;
}

.home-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

/* ───────────────────────────── Responsive ──────────────────────────────── */
@media (max-width: 600px) {
  .home-section__title {
    font-size: 1.05rem;
  }

  .home-search-panel {
    border-radius: 16px;
  }
}