.page-home {
  --home-cover-h: 118px;
  --home-radius-sm: 8px;
  --home-radius-md: 12px;
  --home-border-w: 3px;
  --page-track-bg: #ECE9DF;
  --page-panel-border: rgba(0, 0, 0, 0.14);
  background: var(--warm-gray);
  color: var(--text-main);
  font-family: var(--font-body);
}

.page-home .container-wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}

/* ---------- Section heads ---------- */
.page-home .section-head {
  padding: 34px 0 14px;
}

.page-home .section-kicker {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.page-home .section-kicker-light {
  color: rgba(253, 246, 227, 0.72);
}

.page-home .section-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(22px, 4.5vw, 36px);
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.page-home .section-title-light {
  color: var(--beige);
}

/* ---------- Hero / update wall ---------- */
.page-home .hero-update {
  position: relative;
  background: var(--ink-green);
  color: var(--beige);
  overflow: hidden;
}

.page-home .hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.24;
}

.page-home .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 58, 45, 0.72) 0%, rgba(31, 58, 45, 0.96) 100%);
}

.page-home .hero-inner {
  position: relative;
  z-index: 1;
  padding: 14px 0 28px;
}

.page-home .hero-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line-dark);
}

.page-home .hero-crumb {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(253, 246, 227, 0.78);
}

.page-home .hero-crumb .crumb-sep {
  margin: 0 4px;
  color: rgba(253, 246, 227, 0.4);
}

.page-home .hero-version {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yellow);
  white-space: nowrap;
}

.page-home .hero-title-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 6px;
}

.page-home .hero-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(26px, 4.6vw, 56px);
  line-height: 1.12;
  letter-spacing: 0.01em;
  color: var(--beige);
}

.page-home .hero-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  color: rgba(253, 246, 227, 0.86);
}

.page-home .hero-subtitle strong {
  font-family: var(--font-mono);
  font-size: 1.2em;
  color: var(--yellow);
}

.page-home .hero-batch-tag {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-home .wall-title {
  margin: 14px 0 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--yellow);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.page-home .wall-title::before {
  content: "";
  width: 22px;
  height: 6px;
  background: var(--coral);
  display: block;
  border-radius: 2px;
}

.page-home .update-wall {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(162px, 186px);
  gap: 12px;
  overflow-x: auto;
  padding: 16px 4px 10px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(253, 246, 227, 0.4) transparent;
}

.page-home .update-wall .comic-card {
  scroll-snap-align: start;
  border-radius: var(--home-radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.page-home .card-cover {
  position: relative;
  height: var(--home-cover-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--teal);
}

.page-home .cover-coral { background-color: var(--coral); }
.page-home .cover-purple { background-color: var(--light-purple); }
.page-home .cover-yellow { background-color: var(--yellow); }
.page-home .cover-brown { background-color: var(--deep-brown); }
.page-home .cover-teal { background-color: var(--teal); }

.page-home .card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.34) 1px, transparent 1.2px);
  background-size: 7px 7px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.page-home .card-letter {
  position: relative;
  z-index: 1;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 34px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

.page-home .card-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 3px;
}

.page-home .card-body {
  background: var(--beige);
  padding: 10px;
}

.page-home .card-title {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-home .card-meta {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.page-home .card-tagline {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.page-home .hero-footnote {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 2px 0;
}

.page-home .hero-footnote-data {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(253, 246, 227, 0.68);
}

/* ---------- Genre section ---------- */
.page-home .genre-section {
  background: var(--warm-gray);
}

.page-home .genre-stats-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 16px;
  padding: 12px 14px;
  background: var(--ink-green);
  color: var(--beige);
  border-radius: var(--home-radius-md);
  font-size: 14px;
}

.page-home .genre-stats-label {
  font-weight: 700;
  color: var(--beige);
}

.page-home .genre-stats-num {
  font-family: var(--font-mono);
  font-size: 28px;
  line-height: 1;
  color: var(--yellow);
}

.page-home .genre-stats-unit {
  font-size: 13px;
  color: rgba(253, 246, 227, 0.7);
}

.page-home .genre-stats-divider {
  width: 1px;
  height: 18px;
  background: rgba(253, 246, 227, 0.3);
}

.page-home .genre-matrix {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.page-home .genre-matrix .tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: var(--home-radius-sm);
  border: 2px solid var(--page-panel-border);
  text-decoration: none;
  color: var(--ink);
  transition: transform var(--transition), box-shadow var(--transition);
}

.page-home .genre-matrix .tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

.page-home .tile-icon {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
}

.page-home .tile-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 15px;
}

.page-home .tile-count {
  font-family: var(--font-mono);
  font-size: 13px;
  opacity: 0.82;
}

.page-home .genre-foot {
  margin-top: 20px;
  padding-bottom: 8px;
  display: flex;
  justify-content: flex-end;
}

/* ---------- Track board ---------- */
.page-home .track-section {
  background: var(--page-track-bg);
  border-block: 4px solid var(--ink);
}

.page-home .track-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-bottom: 34px;
}

.page-home .track-col {
  padding: 16px;
  border-radius: var(--home-radius-md);
  border: 2px solid var(--page-panel-border);
}

.page-home .track-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.page-home .track-col-name {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 20px;
  color: var(--ink);
}

.page-home .track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.page-home .track-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  transition: background var(--transition);
}

.page-home .track-list a:hover {
  background: rgba(255, 255, 255, 0.82);
}

.page-home .track-eps {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.page-home .track-note {
  margin: 0 0 4px;
  padding: 8px 10px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 14px;
  border-radius: 4px;
}

.page-home .track-note-sub {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.page-home .track-more {
  margin-top: 14px;
}

/* ---------- Rank section ---------- */
.page-home .rank-section {
  background: var(--ink-green);
  color: var(--beige);
}

.page-home .rank-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 36px 0 8px;
}

.page-home .rank-illustration {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--yellow);
  display: none;
  flex-shrink: 0;
}

.page-home .rank-toolbar {
  margin: 14px 0 16px;
}

.page-home .rank-list {
  display: grid;
  gap: 8px;
}

.page-home .rank-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas:
    "num name eps"
    "num progress ratio"
    "flags flags flags";
  column-gap: 10px;
  row-gap: 6px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(253, 246, 227, 0.08);
  border: 1px solid rgba(253, 246, 227, 0.12);
  border-radius: var(--home-radius-sm);
}

.page-home .rank-num {
  grid-area: num;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--yellow);
}

.page-home .rank-name {
  grid-area: name;
  margin: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 14px;
  color: var(--beige);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-home .rank-progress {
  grid-area: progress;
  height: 8px;
  background: rgba(253, 246, 227, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.page-home .rank-fill {
  display: block;
  height: 100%;
  background: var(--yellow);
  border-radius: 4px;
}

.page-home .rank-fill-yellow { background: var(--yellow); }
.page-home .rank-fill-coral { background: var(--coral); }
.page-home .rank-fill-purple { background: var(--light-purple); }
.page-home .rank-fill-green { background: var(--green); }

.page-home .rank-eps {
  grid-area: eps;
  font-family: var(--font-mono);
  font-size: 11px;
  color: rgba(253, 246, 227, 0.7);
  white-space: nowrap;
  justify-self: end;
}

.page-home .rank-ratio {
  grid-area: ratio;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--yellow);
  text-align: right;
  white-space: nowrap;
}

.page-home .rank-flags {
  grid-area: flags;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-self: start;
}

.page-home .rank-foot {
  margin-top: 18px;
  padding-bottom: 36px;
}

/* ---------- Shelf wall ---------- */
.page-home .shelf-section {
  background: var(--warm-gray);
}

.page-home .shelf-decor {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--home-radius-md);
  margin: 6px 0 16px;
}

.page-home .shelf-toolbar {
  margin-bottom: 16px;
}

.page-home .shelf-wall {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.page-home .shelf-panel {
  padding: 18px;
  border: var(--home-border-w) solid var(--ink);
  border-radius: var(--home-radius-md);
  background: var(--beige);
}

.page-home .shelf-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.page-home .shelf-panel-title {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
}

.page-home .shelf-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
}

.page-home .shelf-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  transition: background var(--transition);
}

.page-home .shelf-list a:hover {
  background: rgba(255, 255, 255, 0.88);
}

.page-home .shelf-list a span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.page-home .shelf-more {
  margin-top: 4px;
}

.page-home .shelf-bottom {
  margin-top: 22px;
  padding-bottom: 40px;
  display: flex;
  justify-content: flex-end;
}

.page-home .shelf-live {
  background: var(--coral);
}

.page-home .shelf-end {
  background: var(--light-purple);
}

.page-home .shelf-quality {
  background: var(--yellow);
}

.page-home .shelf-quality .shelf-list a {
  background: rgba(255, 255, 255, 0.42);
}

.page-home .shelf-lang {
  background: var(--teal);
}

.page-home .shelf-lang .shelf-list a {
  background: rgba(253, 246, 227, 0.42);
}

.page-home .shelf-old {
  background: var(--deep-brown);
  color: var(--beige);
}

.page-home .shelf-old .shelf-panel-title {
  color: var(--beige);
}

.page-home .shelf-old-note {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(253, 246, 227, 0.8);
}

.page-home .shelf-old .shelf-list a {
  background: rgba(253, 246, 227, 0.08);
  color: var(--beige);
}

.page-home .shelf-old .shelf-list a:hover {
  background: rgba(253, 246, 227, 0.16);
}

.page-home .shelf-old .shelf-list a span {
  color: rgba(253, 246, 227, 0.7);
}

/* ---------- Media: tablet & up ---------- */
@media (min-width: 720px) {
  .page-home .container-wrap {
    padding-inline: 24px;
  }

  .page-home .hero-title-row {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .page-home .hero-batch-tag {
    flex-shrink: 0;
  }

  .page-home .hero-subtitle {
    font-size: 16px;
  }

  .page-home .update-wall {
    grid-auto-columns: 196px;
    gap: 14px;
  }

  .page-home .track-board {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .page-home .rank-illustration {
    display: block;
    width: 132px;
    height: 132px;
  }

  .page-home .rank-row {
    grid-template-columns: 32px minmax(110px, 1fr) minmax(90px, 140px) 84px 44px auto;
    grid-template-areas: none;
    align-items: center;
    column-gap: 12px;
    row-gap: 0;
  }

  .page-home .rank-row > * {
    grid-area: auto;
  }

  .page-home .rank-eps {
    justify-self: start;
  }

  .page-home .rank-ratio {
    text-align: left;
  }

  .page-home .rank-flags {
    justify-self: end;
  }

  .page-home .shelf-wall {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .page-home .shelf-panel.is-wide {
    grid-column: span 2;
  }
}

/* ---------- Media: desktop ---------- */
@media (min-width: 1024px) {
  .page-home .hero-title {
    font-size: clamp(32px, 4.2vw, 56px);
  }

  .page-home .update-wall {
    grid-auto-columns: 212px;
  }

  .page-home .rank-illustration {
    width: 180px;
    height: 180px;
  }

  .page-home .shelf-wall {
    grid-template-columns: repeat(3, 1fr);
  }

  .page-home .shelf-panel.is-wide {
    grid-column: span 2;
  }
}
