/* ── Home hub view ──────────────────────────────────────────────────────────
   Root-level /home, rendered inside the main app (reuses login, favourites, the
   item viewer, and thumbnails). No carousel — a clean, scrollable landing page. */

/* View switching: when the home view is active, hide the gallery topbar + grid. */
#homeView { display: none; }
body.view-home #homeView { display: block; }
body.view-home .topbar,
body.view-home #grid { display: none !important; }

.homeView {
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 50% -10%, rgba(94, 231, 247, 0.10) 0%, rgba(11, 13, 18, 0) 60%),
    radial-gradient(80% 50% at 100% 0%, rgba(247, 110, 178, 0.10) 0%, rgba(11, 13, 18, 0) 55%),
    #0b0d12;
  color: #e8e9ee;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.homebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(11, 13, 18, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.homebar__logo {
  height: 34px;
  width: auto;
  display: block;
}

.homebar__account {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
}
.homebar__account:hover { background: rgba(255, 255, 255, 0.11); border-color: rgba(94, 231, 247, 0.4); }
.homebar__account svg { width: 18px; height: 18px; }
.homebar__account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5ee7f7, #f76eb2);
  color: #06232b;
  font-size: 12px;
  font-weight: 800;
}

.home__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) 72px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: clamp(20px, 5vw, 48px) 0 clamp(24px, 4vw, 40px);
}
.home-hero__title {
  font-size: clamp(30px, 6vw, 52px);
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: 0.01em;
  color: #fff;
}
.home-hero__subtitle {
  margin: 0 0 34px;
  font-size: clamp(14px, 2vw, 17px);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.home-spaces {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.home-space {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  position: relative;
  flex: 1 1 200px;
  min-width: 170px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  text-align: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.home-space:hover,
.home-space:focus-visible {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(94, 231, 247, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  outline: none;
}
.home-space__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(94, 231, 247, 0.22), rgba(247, 110, 178, 0.22));
}
.home-space__icon svg { width: 28px; height: 28px; }
.home-space__label { font-size: 19px; font-weight: 800; }
.home-space__sub { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.55); }

.home-space--soon { opacity: 0.72; }
.home-space--soon:hover,
.home-space--soon:focus-visible { border-color: rgba(255, 255, 255, 0.2); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
.home-space__soon {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #06232b;
  background: linear-gradient(135deg, #5ee7f7, #f76eb2);
  padding: 3px 8px;
  border-radius: 999px;
}

/* ── Content sections ────────────────────────────────────────────────────── */
.home-section { margin-top: clamp(28px, 4vw, 44px); }
.home-section__hdr {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.home-section__hdr h2 {
  margin: 0;
  font-size: clamp(17px, 2.4vw, 22px);
  font-weight: 800;
  color: #fff;
}
.home-section__more {
  all: unset;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #5ee7f7;
  white-space: nowrap;
}
.home-section__more:hover { text-decoration: underline; }

/* Recently added — horizontal scroll row of square tiles */
.home-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(130px, 22vw, 170px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.home-row::-webkit-scrollbar { height: 6px; }
.home-row::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 999px; }

.home-tile {
  all: unset;
  cursor: pointer;
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.home-tile:hover { transform: scale(1.03); box-shadow: 0 0 0 2px rgba(94, 231, 247, 0.6); }
.home-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-tile__play {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-tile__play svg { width: 14px; height: 14px; fill: #fff; }
.home-tile__new {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #06232b;
  background: linear-gradient(135deg, #5ee7f7, #f76eb2);
  padding: 2px 7px;
  border-radius: 999px;
}

/* Browse by category — responsive grid of tiles */
.home-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.home-cat {
  all: unset;
  cursor: pointer;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #14161d;
  aspect-ratio: 16 / 10;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.home-cat:hover { transform: translateY(-3px); border-color: rgba(94, 231, 247, 0.5); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5); }
.home-cat__imgs { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; }
.home-cat__imgs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-cat__imgs img:only-child { grid-column: span 2; }
.home-cat__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,0.82) 100%);
}
.home-cat__name {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  text-transform: capitalize;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}
.home-cat__count { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.65); margin-left: 8px; }

/* ── Account / favourites strip ──────────────────────────────────────────── */
.home-account {
  margin-top: clamp(30px, 5vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, rgba(94, 231, 247, 0.10), rgba(247, 110, 178, 0.10)), rgba(255,255,255,0.03);
}
.home-account__text { min-width: 0; }
.home-account__title { font-size: 18px; font-weight: 800; color: #fff; margin: 0 0 4px; }
.home-account__sub { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.62); margin: 0; }
.home-account__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.home-empty { color: rgba(255,255,255,0.4); font-size: 13px; padding: 20px 0; }

/* Coming-soon toast */
.home__toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(12px);
  z-index: 200;
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.home__toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 560px) {
  .home-spaces { flex-direction: column; align-items: stretch; }
  .home-space {
    max-width: none;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 14px;
    padding: 16px;
  }
  .home-space__icon { width: 46px; height: 46px; flex-shrink: 0; }
  .home-account { flex-direction: column; align-items: flex-start; }
}
