/* Community + contact footer (home) */
.home-footer { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border-soft); }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-link {
  display: flex; align-items: center; gap: 14px; flex: 1 1 240px; min-width: 0;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.footer-link:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35); }
.fl-ic { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; color: #fff; }
.fl-ic svg { width: 24px; height: 24px; }
.fl-discord .fl-ic { background: #5865f2; }
.fl-mail .fl-ic { background: linear-gradient(135deg, #7c3aed, #db2777); }
.fl-text { display: flex; flex-direction: column; min-width: 0; }
.fl-text strong { color: var(--text); font-size: 15px; font-weight: 700; }
.fl-sub { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-legal { text-align: center; color: var(--faint); font-size: 12px; margin-top: 22px; }



.app {
  --px: clamp(14px, 3vw, 28px);
  --pt: clamp(16px, 3vw, 28px);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pt) var(--px) 60px;
  min-height: calc(100vh - var(--header-h));
}

.section { margin-bottom: 42px; animation: sectionIn 0.4s var(--ease) both; }
@keyframes sectionIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.section-title { font-size: clamp(18px, 2.4vw, 23px); font-weight: 750; letter-spacing: -0.02em; display: flex; align-items: center; gap: 11px; }
.section-title .dot { width: 5px; height: 22px; border-radius: 6px; background: var(--accent-grad); box-shadow: 0 0 12px rgba(139, 92, 246, 0.55); }
.section-sub { color: var(--muted); font-size: 14px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  transition: color 0.18s, border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.18s var(--ease);
}
.chip:hover { color: #fff; border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(139, 92, 246, 0.25); background: var(--surface-3); }
.chip.active { background: var(--accent-soft); color: #fff; border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.4); }
/* 18+ genre chips (only shown to age-verified users) */
.chip.chip-adult { background: rgba(219, 39, 119, 0.12); border-color: rgba(219, 39, 119, 0.45); color: #f9a8d4; }
.chip.chip-adult:hover { color: #fff; border-color: #db2777; background: rgba(219, 39, 119, 0.28); box-shadow: 0 6px 16px rgba(219, 39, 119, 0.3); }


.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 2vw, 20px);
}

.card { display: block; cursor: pointer; animation: cardIn 0.36s var(--ease) both; }
.grid .card:nth-child(2n) { animation-delay: 0.03s; }
.grid .card:nth-child(3n) { animation-delay: 0.06s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.card-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease), opacity 0.4s; }
.card:hover .card-cover { transform: translateY(-5px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(139, 92, 246, 0.3); }
.card:hover .card-cover img { transform: none; }
/* Bottom veil + a soft accent sweep on hover. */
.card-cover::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.6), transparent 45%),
    linear-gradient(120deg, rgba(124,58,237,0.28), transparent 55%);
  opacity: 0; transition: opacity 0.3s;
}
.card:hover .card-cover::after { opacity: 1; }
/* Thin inner ring for depth (always on). */
.card-cover::before {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); pointer-events: none;
}
.card-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  padding: 3px 9px; border-radius: 8px; font-size: 11px; font-weight: 800;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.card-badge.rank { background: var(--accent-grad); }
/* "Open" chip revealed on hover, centered on the cover. */
.card-open {
  position: absolute; z-index: 3; left: 50%; top: 50%;
  width: 46px; height: 46px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.6); opacity: 0;
  display: grid; place-items: center;
  background: var(--accent-grad); color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.card-open svg { width: 24px; height: 24px; overflow: visible; }
.card:hover .card-open { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Page hinged at the book's spine (centre); turns from the left half to the
   right half and stays there. */
.card-open .pg { transform-box: fill-box; transform-origin: right center; }
.card:hover .card-open .pg { animation: cardFlip 0.8s cubic-bezier(0.34, 0, 0.2, 1) 0.1s 1 both; }
@keyframes cardFlip {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(-180deg); }
}
@media (hover: none) { .card-open { display: none; } }
.card-title {
  margin-top: 10px; font-size: 13.5px; font-weight: 650; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color 0.15s;
}
.card:hover .card-title { color: #fff; }
.card-sub { font-size: 12px; color: var(--faint); margin-top: 2px; }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: translateX(-100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }
.sk-line { height: 12px; border-radius: 6px; margin-top: 8px; }

/*  Home: greeting hero + horizontal snap rows*/
.home-hero {
  position: relative; overflow: hidden;
  margin: 0 0 30px; padding: 28px 30px;
  border-radius: 22px;
  background:
    radial-gradient(600px 300px at 100% 0%, rgba(219,39,119,0.16), transparent 60%),
    linear-gradient(120deg, rgba(124,58,237,0.16), rgba(20,18,32,0.4));
  border: 1px solid var(--border-soft);
  animation: sectionIn 0.4s var(--ease) both;
}
.home-hero::after {
  content: ""; position: absolute; top: -60%; right: -10%; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(124,58,237,0.25), transparent 65%);
  filter: blur(20px); pointer-events: none;
}
.home-title { position: relative; margin: 0 0 6px; font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -0.03em; }
.home-title .grad { background: linear-gradient(100deg, #a78bfa, #f472b6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-sub { position: relative; margin: 0; color: var(--muted); font-size: 15.5px; }
@media (max-width: 560px) { .home-hero { padding: 22px 20px; margin-bottom: 24px; } }

/* Featured spotlight banner — auto-rotating art that blends into the page bg. */
.feature-hero {
  position: relative; overflow: hidden;
  /* Break out of the centred content column → full viewport width (body clips overflow-x). */
  width: 100vw; margin: calc(var(--pt) * -1) calc(50% - 50vw) 28px;
  height: clamp(390px, 46vw, 560px);
}
.feature-skeleton { animation: none; }
.feature-slide {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  transition: opacity 0.8s var(--ease);
}
.feature-slide.active { opacity: 1; pointer-events: auto; }
.feature-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 12%;
  /* Cinematic backdrop: lighter blur (art is recognizable) + darkened for contrast. */
  transform: scale(1.14); filter: blur(5px) saturate(1.2) brightness(0.8);
  animation: featurePan 20s ease-in-out infinite alternate;
}
.feature-bg::after {
  content: ""; position: absolute; inset: 0;
  /* All fades resolve to rgb(11,11,18) = --bg, so the banner dissolves into the
     exact home-page background colour on every edge (no seam, no dark band). */
  background:
    /* left scrim for title legibility */
    linear-gradient(to right, var(--bg) 0%, rgba(11,11,18,0.72) 26%, rgba(11,11,18,0.18) 54%, transparent 78%),
    /* bottom (and a touch of top) melt into the page background colour */
    linear-gradient(to top, var(--bg) 0%, var(--bg) 8%, transparent 46%, transparent 86%, rgba(11,11,18,0.5) 100%),
    /* soft edge vignette to the page bg */
    radial-gradient(150% 130% at 64% 40%, transparent 50%, rgba(11,11,18,0.42) 82%, var(--bg) 100%);
}
.feature-content {
  position: relative; z-index: 2; height: 100%;
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: flex-end; gap: clamp(18px, 3vw, 32px);
  padding: 0 var(--px) clamp(38px, 5vw, 60px);
}
.feature-cover {
  position: relative; width: clamp(120px, 15vw, 166px); flex-shrink: 0; aspect-ratio: 2/3;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.1);
}
.feature-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-slide.active .feature-cover { animation: featureCoverIn 0.8s var(--ease) both; }
.feature-text { min-width: 0; padding-bottom: 4px; }
.feature-slide.active .feature-text { animation: featureIn 0.7s var(--ease) 0.06s both; }
.feature-badge {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  padding: 5px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em; color: #fff;
  background: linear-gradient(100deg, #7c3aed, #db2777);
  box-shadow: 0 6px 18px rgba(219,39,119,0.4);
}
.feature-badge svg { width: 14px; height: 14px; }
.feature-title {
  /* Extra line-height + padding so descenders (g, y, p) never clip. */
  margin: 0 0 12px; font-size: clamp(30px, 4.6vw, 50px); font-weight: 800;
  letter-spacing: -0.025em; line-height: 1.12; text-shadow: 0 1px 2px rgba(0,0,0,0.55);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  padding-bottom: 3px;
}
.feature-title a { color: #fff; }
.feature-meta { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; }
.feature-meta:empty { display: none; }
.feature-tag {
  padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); color: #e7e8f0;
  backdrop-filter: blur(4px); transition: background 0.15s, border-color 0.15s;
}
.feature-tag:hover { background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.4); }
.feature-desc {
  margin: 0 0 20px; max-width: 600px; color: #dcdce8; font-size: 14.5px; line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.feature-desc:empty { display: none; }
.feature-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.feature-btn { padding: 13px 28px; font-size: 15px; }
.feature-save {
  background: rgba(255,255,255,0.13); border: 1px solid rgba(255,255,255,0.26); color: #fff;
  backdrop-filter: blur(8px);
}
.feature-save:hover { background: rgba(255,255,255,0.22); }
.feature-save.active-fav { background: var(--accent-soft); border-color: var(--accent); color: #eadcff; }
.feature-dots { position: absolute; z-index: 3; bottom: 18px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.feature-dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(255,255,255,0.35); cursor: pointer; transition: background 0.2s, width 0.25s var(--ease);
}
.feature-dot:hover { background: rgba(255,255,255,0.65); }
.feature-dot.active { background: #fff; width: 28px; }
@keyframes featurePan { from { transform: scale(1.14) translateX(-1.4%); } to { transform: scale(1.14) translateX(1.4%); } }
@keyframes featureIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes featureCoverIn { from { opacity: 0; transform: translateY(26px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Phone: compact cover + text over the darkened art; buttons fit in one row. */
@media (max-width: 640px) {
  .feature-hero { height: clamp(330px, 80vw, 430px); margin-bottom: 20px; }
  .feature-bg::after {
    background:
      linear-gradient(to top, var(--bg) 0%, var(--bg) 8%, transparent 48%, transparent 88%, rgba(11,11,18,0.45) 100%),
      linear-gradient(to right, rgba(11,11,18,0.72), rgba(11,11,18,0.15) 68%, transparent);
  }
  .feature-content { gap: 14px; padding: 0 var(--px) 30px; }
  .feature-cover { width: clamp(88px, 27vw, 120px); border-radius: 12px; box-shadow: 0 14px 34px rgba(0,0,0,0.55); }
  .feature-badge { margin-bottom: 9px; padding: 4px 10px; font-size: 10px; letter-spacing: 0.04em; }
  .feature-title { font-size: clamp(21px, 6.2vw, 30px); margin-bottom: 8px; }
  .feature-meta { margin-bottom: 12px; gap: 6px; }
  .feature-tag { padding: 3px 9px; font-size: 11px; }
  .feature-desc { display: none; }
  .feature-actions { gap: 8px; }
  .feature-btn { padding: 10px 16px; font-size: 13.5px; }
  .feature-save { padding: 10px; }
  .feature-save span { display: none; }
  .feature-dots { bottom: 12px; }
}

.h-row {
  display: flex; gap: clamp(10px, 1.6vw, 16px);
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* hide scrollbar, keep scrollable (free, no snap) */
}
.h-row::-webkit-scrollbar { display: none; }
.h-row .card { flex: 0 0 clamp(118px, 23vw, 150px); }

/* Clean scroll wrapper: progress indicator + end-flash edges */
.h-scroll { position: relative; }
.h-ind { position: relative; height: 4px; width: clamp(120px, 26%, 260px); margin: 2px auto 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.h-ind-bar { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--accent-grad); }
.h-flash {
  position: absolute; top: 0; bottom: 18px; width: 56px; z-index: 4; opacity: 0; pointer-events: none;
}
.h-flash.left { left: 0; background: linear-gradient(to right, rgba(139,92,246,0.55), transparent); }
.h-flash.right { right: 0; background: linear-gradient(to left, rgba(139,92,246,0.55), transparent); }
.h-flash.on { animation: hflash 0.5s var(--ease); }
@keyframes hflash { 0% { opacity: 0; } 28% { opacity: 1; } 100% { opacity: 0; } }

/* Cards drift in one after another */
.grid .card, .h-row .card { animation: sectionIn 0.4s var(--ease) both; }
.grid .card:nth-child(1), .h-row .card:nth-child(1) { animation-delay: 0.02s; }
.grid .card:nth-child(2), .h-row .card:nth-child(2) { animation-delay: 0.05s; }
.grid .card:nth-child(3), .h-row .card:nth-child(3) { animation-delay: 0.08s; }
.grid .card:nth-child(4), .h-row .card:nth-child(4) { animation-delay: 0.11s; }
.grid .card:nth-child(5), .h-row .card:nth-child(5) { animation-delay: 0.14s; }
.grid .card:nth-child(6), .h-row .card:nth-child(6) { animation-delay: 0.17s; }
.grid .card:nth-child(7), .h-row .card:nth-child(7) { animation-delay: 0.2s; }
.grid .card:nth-child(8), .h-row .card:nth-child(8) { animation-delay: 0.23s; }

/* Top-3 medals on ranked cards */
.card-badge.rank.r1 { background: linear-gradient(120deg, #fde68a, #f59e0b); color: #451a03; box-shadow: 0 3px 12px rgba(245, 158, 11, 0.45); }
.card-badge.rank.r2 { background: linear-gradient(120deg, #f3f4f6, #9ca3af); color: #111827; }
.card-badge.rank.r3 { background: linear-gradient(120deg, #f59e0b, #92400e); color: #fff; }

