/* =========================
   RESTED XP - RPG THEME v2
   ========================= */

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0b0f14;
  color: #e6e6e6;
}

/* HEADER */
header {
  padding: 15px;
  background: #0f1620;
  border-bottom: 2px solid #1f2a3a;
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logotext {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 2px;
}

/* XP BAR */
.xpbar {
  width: 200px;
  height: 10px;
  background: #1c2a3a;
  border-radius: 5px;
  overflow: hidden;
}

.xpfill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00ff99, #00aaff);
  transition: width 0.3s ease;
}

/* NAV */
nav {
  margin-top: 10px;
}

nav a {
  color: #9ecbff;
  margin-right: 15px;
  text-decoration: none;
}

nav a:hover {
  color: white;
}

/* GAME UI GRID */
.game-ui {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 15px;
  padding: 15px;
}

/* PANELS */
.panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* CARDS */
.card {
  background: #111a24;
  border: 1px solid #1f2a3a;
  padding: 15px;
  border-radius: 10px;
}

/* BUTTONS */
button {
  background: #1f6feb;
  border: none;
  padding: 8px 12px;
  color: white;
  cursor: pointer;
  border-radius: 6px;
  margin-top: 10px;
}

button:hover {
  background: #2f81f7;
}

/* LEFT PANEL */
.panel.left .card {
  border-left: 3px solid #00ff99;
}

/* CENTER PANEL */
.panel.center .card {
  border-left: 3px solid #00aaff;
}

/* RIGHT PANEL */
.panel.right .card {
  border-left: 3px solid #ffcc00;
}

/* LISTS */
ul {
  padding-left: 18px;
}

/* TAGS */
.tag {
  display: inline-block;
  padding: 3px 8px;
  margin: 3px;
  background: #1f2a3a;
  border-radius: 5px;
  font-size: 12px;
}

/* ===========================
   QUEST PANEL
=========================== */

.quest-panel{
    background:#151515;
    border:2px solid #4CAF50;
    border-radius:12px;
    padding:20px;
    margin:20px 0;
    box-shadow:0 0 18px rgba(76,175,80,.25);
}

.quest-panel h2{
    text-align:center;
    color:#7CFC00;
    margin-bottom:15px;
}

.quest-box{
    background:#222;
    border-radius:10px;
    padding:18px;
}

.quest-box h3{
    color:#FFD54F;
    margin:8px 0;
}

.quest-box ul{
    margin-left:20px;
}

.quest-box li{
    margin:8px 0;
}

/* ===================================
   ABOUT PAGE
=================================== */

.about-page{
    max-width:1100px;
    margin:40px auto;
    padding:0 20px;
}

.about-card{
    background:#1b1b1b;
    border:1px solid #333;
    border-radius:16px;
    padding:40px;
    box-shadow:0 0 25px rgba(0,0,0,.4);
}

.about-card h1{
    text-align:center;
    font-size:42px;
    margin-bottom:20px;
}

.about-card h2{
    margin-top:40px;
    color:#FFD54F;
    border-bottom:1px solid #333;
    padding-bottom:8px;
}

.about-card p{
    line-height:1.8;
    font-size:17px;
}

.about-card ul{
    margin-left:30px;
}

.about-card li{
    margin:10px 0;
}

.about-card hr{
    margin:35px 0;
    border:none;
    border-top:1px solid #333;
}

/* ===========================
   SYSTEM BOOT SCREEN
=========================== */

#systemBoot {
  max-width: 900px;
  margin: 50px auto;
  background: #111;
  border: 2px solid #44ff66;
  border-radius: 14px;
  padding: 35px;
  box-shadow: 0 0 25px rgba(0,255,100,.25);
  text-align: center;
}

#systemBoot h1 {
  color: #FFD54F;
  letter-spacing: 3px;
}

#bootTitle {
  color: #44ff66;
  margin-bottom: 25px;
  letter-spacing: 3px;
}

.bootBar {
  width: 100%;
  height: 22px;
  background: #222;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 25px;
}

#bootProgress {
  width: 0%;
  height: 100%;
  background: #44ff66;
  transition: width .25s linear;
}

#bootMessages {
  min-height: 150px;
  text-align: left;
  font-family: monospace;
  color: #9cffb2;
}

#bootMessages p {
  margin: 8px 0;
}

#enterButton {
  margin-top: 20px;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid #44ff66;
  background: #111;
  color: #44ff66;
  cursor: pointer;
  font-weight: bold;
}

#enterButton:hover {
  background: #44ff66;
  color: #111;
}

/* ===========================
   LEDGER LIBRARY v2
=========================== */

.library-hero h1 {
  font-size: 34px;
  margin-bottom: 10px;
}

.library-row-block {
  margin-bottom: 34px;
}

.library-row-header h2 {
  margin: 10px 0 15px;
}

.book-row {
  display: grid;
  grid-template-columns: repeat(5, 145px);
  gap: 16px;
  overflow: visible;
  padding: 6px 4px 18px;
}

.book-cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 18px;
}

.netflix-book-card {
  width: 145px;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.netflix-book-card:hover {
  transform: scale(1.05);
  filter: brightness(1.15);
}

.cover-wrap {
  position: relative;
  width: 145px;
  height: 215px;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  border: 2px solid #333;
  box-shadow: 0 0 12px rgba(0,0,0,.4);
}

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

.netflix-book-card h3 {
  font-size: 14px;
  margin: 8px 0 4px;
  line-height: 1.2;
}

.netflix-book-card p {
  font-size: 12px;
  margin: 3px 0;
}

.rarity-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  font-size: 10px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(0,0,0,.75);
}

.cover-wrap.legendary {
  border-color: #ff9800;
  box-shadow: 0 0 18px rgba(255,152,0,.45);
}

.cover-wrap.epic {
  border-color: #9c27b0;
  box-shadow: 0 0 16px rgba(156,39,176,.4);
}

.cover-wrap.rare {
  border-color: #2196f3;
  box-shadow: 0 0 14px rgba(33,150,243,.35);
}

.cover-wrap.common {
  border-color: #4caf50;
  box-shadow: 0 0 12px rgba(76,175,80,.25);
}

@media (max-width: 900px) {
  .book-row {
    grid-template-columns: repeat(2, 120px);
  }

  .netflix-book-card {
    width: 120px;
  }

  .cover-wrap {
    width: 120px;
    height: 180px;
  }
}

/* ===========================
   FEATURED HERO BOOK
=========================== */

.featured-hero-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255,152,0,.16), rgba(0,0,0,.25)),
    #161616;
  border: 1px solid rgba(255,152,0,.35);
  box-shadow: 0 0 22px rgba(255,152,0,.18);
}

.featured-hero-cover img {
  width: 180px;
  height: 270px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(0,0,0,.6);
}

.featured-hero-content h1 {
  font-size: 34px;
  margin: 8px 0;
}

.featured-label {
  color: #FFD54F;
  font-weight: bold;
  letter-spacing: 2px;
}

@media (max-width: 900px) {
  .featured-hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .featured-hero-cover img {
    width: 150px;
    height: 225px;
  }
}

/* =========================
   Statistics Page Add-ons
========================= */

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero-card,
.content-card,
.stat-card,
.mini-card {
  background: rgba(15, 20, 31, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 20px;
}

.hero-card {
  margin-bottom: 22px;
  padding: 30px;
}

.eyebrow {
  color: #b991ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 800;
  margin-bottom: 8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn-primary,
.btn-secondary,
.inline-link {
  display: inline-block;
  text-decoration: none;
  font-weight: 800;
  border-radius: 12px;
  padding: 10px 14px;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #7f49ff, #4f8cff);
}

.btn-secondary {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.inline-link {
  color: #b991ff;
  margin-top: 14px;
  padding-left: 0;
}

.dashboard-grid,
.content-grid,
.mini-grid,
.link-grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-card {
  grid-column: 1 / -1;
}

.stat-card span,
.muted,
.mini-card span,
.leaderboard-row em,
.link-grid span {
  color: #aeb4c4;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 6px;
}

.stat-row {
  margin-bottom: 14px;
}

.stat-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.stat-bar {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7f49ff, #4f8cff);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-block;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(127, 73, 255, 0.16);
  border: 1px solid rgba(185, 145, 255, 0.26);
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mini-grid,
.link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-grid a {
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 15px;
  padding: 16px;
}

.link-grid strong,
.link-grid span {
  display: block;
}

@media (max-width: 850px) {
  .dashboard-grid,
  .content-grid,
  .mini-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Find My Next Read
========================= */

.finder-hero button {
  border: 0;
  cursor: pointer;
}

.finder-app {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.finder-controls {
  position: sticky;
  top: 86px;
}

.finder-controls-head h2 {
  margin-bottom: 4px;
}

.finder-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.finder-block h3 {
  margin: 0 0 10px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.choice-grid label {
  display: block;
  cursor: pointer;
}

.choice-grid input {
  display: none;
}

.choice-grid span {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  color: #d9ddec;
  font-weight: 700;
}

.choice-grid input:checked + span {
  background: rgba(127,73,255,0.22);
  border-color: rgba(185,145,255,0.62);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(185,145,255,0.18);
}

.finder-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.finder-buttons button {
  border: 0;
  cursor: pointer;
}

.finder-results-area {
  display: grid;
  gap: 14px;
}

.finder-results {
  display: grid;
  gap: 14px;
}

.next-read-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(15, 20, 31, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
}

.next-read-card:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.next-read-cover img {
  width: 130px;
  height: 195px;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
}

.next-read-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.match-label {
  color: #b991ff;
  font-weight: 900;
  letter-spacing: 0.6px;
  margin: 0 0 3px;
}

.next-read-topline h3 {
  margin: 0;
}

.next-read-topline h3 a {
  color: inherit;
  text-decoration: none;
}

.match-score strong {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.result-meta,
.match-reasons,
.next-read-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.result-meta span,
.match-reasons span {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 0.86rem;
  background: rgba(255,255,255,0.08);
  color: #d9ddec;
}

.match-reasons span {
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.25);
}

.next-read-actions a {
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .finder-app,
  .next-read-card {
    grid-template-columns: 1fr;
  }

  .finder-controls {
    position: static;
  }

  .next-read-cover img {
    width: 120px;
    height: 180px;
  }
}



/* =========================================================
   Dungeon Ledger HQ UI Kit v2
   Shared layout/components for all main pages
   Paste at bottom of css/style.css
========================================================= */

:root {
  --dl-bg: #070a11;
  --dl-panel: rgba(15, 20, 31, 0.92);
  --dl-panel-soft: rgba(255,255,255,0.045);
  --dl-border: rgba(255,255,255,0.08);
  --dl-border-bright: rgba(185,145,255,0.52);
  --dl-text: #f4f4f7;
  --dl-muted: #aeb4c4;
  --dl-purple: #7f49ff;
  --dl-purple-soft: rgba(127,73,255,0.18);
  --dl-blue: #4f8cff;
  --dl-radius: 18px;
  --dl-shadow: 0 12px 32px rgba(0,0,0,0.30);
}

body {
  background:
    radial-gradient(circle at top left, rgba(127, 73, 255, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(255, 107, 74, 0.08), transparent 28%),
    var(--dl-bg);
  color: var(--dl-text);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.hero-card,
.content-card,
.stat-card,
.mini-card,
.feature-card {
  background: var(--dl-panel);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
  box-shadow: var(--dl-shadow);
}

.hero-card {
  padding: clamp(24px, 5vw, 42px);
  margin-bottom: 22px;
}

.content-card,
.stat-card,
.mini-card,
.feature-card {
  padding: 20px;
}

.eyebrow {
  color: #b991ff;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 900;
  margin: 0 0 8px;
}

.hero-card h1,
.page-title {
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1;
  margin: 0 0 14px;
}

.hero-card p,
.muted {
  color: var(--dl-muted);
}

.hero-actions,
.card-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn-primary,
.btn-secondary,
.inline-link {
  display: inline-block;
  text-decoration: none;
  font-weight: 900;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--dl-purple), var(--dl-blue));
  border: 0;
}

.btn-secondary {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.inline-link {
  color: #b991ff;
  padding-left: 0;
}

.dashboard-grid,
.content-grid,
.mini-grid,
.link-grid,
.feature-grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-grid,
.link-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wide-card {
  grid-column: 1 / -1;
}

.stat-card span,
.mini-card span,
.link-grid span {
  color: var(--dl-muted);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  margin-top: 6px;
}

.pill-list,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill,
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 8px 11px;
  background: var(--dl-purple-soft);
  border: 1px solid rgba(185,145,255,0.26);
  color: #eee8ff;
  font-weight: 800;
}

.link-grid a,
.feature-card {
  text-decoration: none;
  color: inherit;
  background: var(--dl-panel-soft);
  border: 1px solid var(--dl-border);
  border-radius: 15px;
  padding: 16px;
}

.link-grid a:hover,
.feature-card:hover {
  border-color: var(--dl-border-bright);
  background: rgba(127,73,255,0.10);
}

.link-grid strong,
.link-grid span {
  display: block;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
}

.section-head p {
  margin: 4px 0 0;
}

.empty-state {
  padding: 24px;
  text-align: center;
  background: var(--dl-panel-soft);
  border: 1px solid var(--dl-border);
  border-radius: var(--dl-radius);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 9999;
  background: #fff;
  color: #080b12;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 900;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .dashboard-grid,
  .content-grid,
  .feature-grid,
  .mini-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* =========================
   Generator v2 Add-ons
   Add to bottom of css/style.css if needed
========================= */

.generator-result {
  min-height: 220px;
}

.generator-card {
  text-align: left;
}

.generator-rolls button {
  border: 0;
}

/* =========================
   Compact Hero v2
   Add to bottom of css/style.css
========================= */

.compact-hero {
  padding: 24px 28px;
}

.compact-hero .hero-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.compact-hero .page-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  background: rgba(127,73,255,0.18);
  border: 1px solid rgba(185,145,255,0.28);
  font-size: 1.8rem;
  box-shadow: 0 0 22px rgba(127,73,255,0.16);
}

.compact-hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
  margin: 0;
}

.compact-hero .hero-subtitle {
  margin: 5px 0 0;
  color: #c7ccda;
  font-size: 1.05rem;
  font-weight: 700;
}

.compact-hero > p {
  max-width: 760px;
  margin: 0;
  color: #aeb4c4;
}

.compact-hero .hero-actions {
  margin-top: 18px;
}

@media (max-width: 650px) {
  .compact-hero {
    padding: 20px;
  }

  .compact-hero .hero-title-row {
    align-items: flex-start;
  }

  .compact-hero .page-icon {
    width: 46px;
    height: 46px;
    font-size: 1.45rem;
    border-radius: 14px;
  }

  .compact-hero h1 {
    font-size: 2rem;
  }
}


/* =========================================================
   Dungeon Ledger HQ Fantasy App Shell v3
   Paste at bottom of css/style.css
========================================================= */

body {
  background:
    radial-gradient(circle at top center, rgba(127, 73, 255, 0.16), transparent 34%),
    linear-gradient(180deg, #05070c 0%, #090b13 50%, #05070c 100%);
  color: #f4f4f7;
}

.hq-header {
  position: relative;
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: rgba(5, 7, 12, 0.96);
  box-shadow: 0 14px 35px rgba(0,0,0,0.45);
}

.xp-topbar {
  max-width: 1420px;
  height: 64px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
}

.xp-left,
.xp-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #d7d2e7;
}

.xp-left strong {
  color: #c77dff;
  font-size: 1.5rem;
}

.xp-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  overflow: hidden;
}

.xp-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7f49ff, #b65cff);
  box-shadow: 0 0 18px rgba(182,92,255,0.75);
}

.login-link {
  color: #d9b3ff;
  text-decoration: none;
  border: 1px solid rgba(185,145,255,0.45);
  border-radius: 9px;
  padding: 8px 12px;
}

.hq-logo-wrap {
  position: absolute;
  left: 50%;
  top: 8px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.hq-logo-wrap a {
  pointer-events: auto;
}

.hq-main-logo {
  width: min(310px, 34vw);
  max-height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,0.75));
}

.hq-nav {
  min-height: 62px;
  display: flex;
  justify-content: center;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(7, 10, 17, 0.88);
}

.hq-nav a {
  color: #d9ddec;
  text-decoration: none;
  padding: 20px 18px 17px;
  font-weight: 800;
  border-bottom: 3px solid transparent;
}

.hq-nav a:hover,
.hq-nav a.active {
  color: #e8c8ff;
  border-bottom-color: #b65cff;
  background: rgba(127,73,255,0.10);
}

.hq-page-shell {
  width: min(1500px, calc(100% - 44px));
  margin: 0 auto;
  padding: 24px 0;
}

.finder-quest-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.quest-sidebar,
.quest-main {
  border: 1px solid rgba(185,145,255,0.28);
  background:
    radial-gradient(circle at top, rgba(127,73,255,0.12), transparent 35%),
    rgba(12, 15, 26, 0.94);
}

.quest-sidebar {
  padding: 24px;
}

.quest-sidebar h2 {
  color: #d99cff;
  margin-top: 0;
}

.quest-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0;
}

.quest-steps span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.04);
}

.quest-steps span.active {
  border-color: #b65cff;
  background: linear-gradient(135deg, #7f49ff, #b65cff);
}

.quest-menu {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.quest-menu button {
  text-align: left;
  border-radius: 13px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #f4f4f7;
  cursor: pointer;
}

.quest-menu button.active {
  border-color: rgba(185,145,255,0.55);
  background: rgba(127,73,255,0.18);
}

.quest-menu strong,
.quest-menu span {
  display: block;
}

.quest-menu span {
  color: #aeb4c4;
  font-size: 0.88rem;
  margin-top: 4px;
}

.login-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 15px;
  background: rgba(127,73,255,0.14);
  border: 1px solid rgba(185,145,255,0.24);
}

.login-card strong,
.login-card span {
  display: block;
}

.login-card span {
  color: #c7ccda;
  margin: 6px 0 14px;
}

.quest-main {
  padding: clamp(28px, 4vw, 44px);
}

.quest-hero {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 28px;
}

.quest-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #d9b3ff;
  background: rgba(127,73,255,0.18);
  border: 1px solid rgba(185,145,255,0.42);
  font-size: 1.7rem;
}

.quest-hero h1 {
  font-size: clamp(2.4rem, 4vw, 3.9rem);
  line-height: 1;
  margin: 0 0 10px;
}

.quest-hero p {
  color: #c7ccda;
  font-size: 1.05rem;
}

.quest-question h2 {
  color: #d99cff;
  margin-bottom: 6px;
}

.quest-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.quest-option {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.22);
  background:
    linear-gradient(180deg, rgba(8,10,17,0.10), rgba(8,10,17,0.92)),
    radial-gradient(circle at top left, rgba(127,73,255,0.22), transparent 40%),
    #111827;
}

.quest-option:hover,
.quest-option.selected {
  border-color: #b65cff;
  box-shadow: 0 0 0 1px rgba(182,92,255,0.28), 0 0 28px rgba(127,73,255,0.18);
}

.option-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: auto;
  background: rgba(127,73,255,0.22);
  border: 1px solid rgba(185,145,255,0.42);
  font-size: 1.4rem;
}

.quest-option strong {
  font-size: 1.18rem;
  margin-top: 18px;
}

.quest-option em {
  color: #d7d2e7;
  font-style: normal;
  margin-top: 8px;
  line-height: 1.45;
}

.quest-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.quest-results {
  margin-top: 28px;
}

.quest-results-head {
  text-align: center;
  margin-bottom: 18px;
}

.quest-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.quest-book-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 15px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.quest-book-card img {
  width: 96px;
  height: 144px;
  object-fit: cover;
  border-radius: 10px;
}

.quest-book-card h3 {
  margin: 0;
}

.quest-book-card a {
  color: inherit;
  text-decoration: none;
}

.result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.result-meta span {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(127,73,255,0.16);
  color: #eee8ff;
  font-size: 0.84rem;
}

.hq-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: center;
  padding: 22px 52px;
  border-top: 1px solid rgba(255,255,255,0.10);
  color: #aeb4c4;
  background: rgba(5, 7, 12, 0.96);
}

.hq-footer strong {
  color: #c77dff;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.hq-footer nav {
  justify-self: end;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hq-footer a {
  color: #aeb4c4;
  text-decoration: none;
}

@media (max-width: 1100px) {
  .finder-quest-layout,
  .quest-option-grid,
  .quest-result-grid,
  .hq-footer {
    grid-template-columns: 1fr;
  }

  .hq-nav {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .hq-logo-wrap {
    position: static;
    transform: none;
    text-align: center;
    padding: 8px 0;
  }

  .xp-topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px;
  }

  .hq-footer nav {
    justify-self: start;
  }
}

/* Logo overlap fix */
.hq-header {
  padding-top: 10px;
}

.hq-logo-wrap {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  text-align: center;
  margin: 4px auto -8px;
  z-index: 2;
}

.hq-main-logo {
width: min(220px, 48vw);
  max-height: 120px;
  object-fit: contain;
}

.hq-nav {
  position: relative;
  z-index: 3;
  padding-top: 6px;
}

/* SAFE logo over XP fix */
.hq-header {
  position: relative;
  overflow: visible;
}

.xp-topbar {
  position: relative;
  z-index: 1;
}

.hq-logo-wrap {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
}

.hq-logo-wrap a {
  pointer-events: auto;
}

.hq-main-logo {
  width: 240px;
  max-height: 120px;
  object-fit: contain;
}

.hq-nav {
  position: relative;
  z-index: 10;
  margin-top: 58px;
}

@media (max-width: 900px) {
  .hq-logo-wrap {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    text-align: center;
  }

  .hq-nav {
    margin-top: 0;
  }
}

.world-card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  margin-bottom: 14px;
  pointer-events: none;
}

.quest-option {
  min-height: auto;
  justify-content: flex-start;
}

.quest-option .option-icon {
  display: none;
}

.world-card-art {
  width: 100%;
  height: 145px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  margin-bottom: 14px;
  pointer-events: none;
}

.quest-option .option-icon {
  display: none;
}

/* =========================
   Dashboard Homepage v2
 ========================= */

.dashboard-home-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.dashboard-column,
.dashboard-main {
  display: grid;
  gap: 16px;
}

.dashboard-feature-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.22), transparent 38%),
    rgba(15,20,31,0.92);
}

.quick-roll-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
  margin-top: 14px;
}

.quick-roll-grid label span {
  display: block;
  margin-bottom: 6px;
  color: #aeb4c4;
  font-weight: 800;
}

.quick-roll-grid select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.roll-result {
  margin-top: 14px;
}

.dashboard-book-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-book-row img {
  width: 70px;
  height: 105px;
  object-fit: cover;
  border-radius: 9px;
  background: #111827;
}

.release-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.release-item:last-child {
  border-bottom: 0;
}

@media (max-width: 1150px) {
  .dashboard-home-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-feature-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .quick-roll-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Worlds Page - matches Find My Next Read / HQ v3
========================================================= */

.worlds-page {
  display: grid;
  gap: 20px;
}

.worlds-page .worlds-hero {
  padding: clamp(28px, 4vw, 44px);
}

.worlds-page .worlds-panel {
  padding: clamp(20px, 3vw, 28px);
}

.worlds-page .worlds-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.worlds-page .world-link {
  text-decoration: none;
  min-height: auto;
  justify-content: flex-start;
}

.worlds-page .world-link strong,
.worlds-page .world-link em {
  display: block;
}

.worlds-page .world-card-art {
  width: 100%;
  height: 145px;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
  margin-bottom: 14px;
  pointer-events: none;
}

.worlds-page .quest-actions a {
  text-decoration: none;
}

@media (max-width: 1100px) {
  .worlds-page .worlds-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .worlds-page .worlds-grid {
    grid-template-columns: 1fr;
  }

  .worlds-page .world-card-art {
    height: 125px;
  }
}


/* =========================================================
   Achievements Page - matches Find My Next Read / HQ v3
========================================================= */

.achievements-page {
  display: grid;
  gap: 20px;
}

.achievements-page .achievements-hero {
  padding: clamp(28px, 4vw, 44px);
}

.achievement-dashboard {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.achievement-sidebar {
  display: grid;
  gap: 16px;
}

.achievement-main,
.achievement-quick-paths,
.achievement-summary-card {
  padding: clamp(20px, 3vw, 28px);
}

.achievement-progress-count {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 0;
}

.achievement-progress-count strong {
  font-size: 2.4rem;
  line-height: 1;
  color: #f4f4f7;
}

.achievement-progress-count span {
  color: #aeb4c4;
  font-size: 1.4rem;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.achievement-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(180deg, rgba(8,10,17,0.10), rgba(8,10,17,0.92)),
    radial-gradient(circle at top left, rgba(127,73,255,0.18), transparent 40%),
    #111827;
}

.achievement-card.unlocked {
  border-color: rgba(185,145,255,0.55);
  box-shadow: 0 0 0 1px rgba(182,92,255,0.18), 0 0 26px rgba(127,73,255,0.12);
}

.achievement-card.locked {
  opacity: 0.78;
}

.achievement-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.achievement-icon {
  font-size: 1.35rem;
}

.achievement-status {
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255,255,255,0.08);
  color: #d9ddec;
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.achievement-card.unlocked .achievement-status {
  background: rgba(127,73,255,0.22);
  color: #eee8ff;
  border: 1px solid rgba(185,145,255,0.35);
}

.achievement-card h3 {
  margin: 0;
  color: #f4f4f7;
}

.achievement-card p {
  margin: 0;
  color: #aeb4c4;
  line-height: 1.45;
}

.achievement-reward {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.achievement-reward span {
  color: #aeb4c4;
}

.achievement-reward strong {
  color: #d9b3ff;
}

.achievement-actions a {
  text-decoration: none;
}

@media (max-width: 1100px) {
  .achievement-dashboard,
  .achievement-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 1100px) {
  .achievement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   Guides Page - matches Dungeon Ledger HQ v3
========================================================= */

.guides-page {
  display: grid;
  gap: 20px;
}

.guides-page .guides-hero {
  padding: clamp(28px, 4vw, 44px);
}

.guides-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.guides-sidebar,
.guides-main {
  display: grid;
  gap: 16px;
}

.guide-nav-card,
.guide-player-card,
.featured-guide-card,
.guide-card,
.guide-quick-paths {
  padding: clamp(20px, 3vw, 28px);
}

.guide-link-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.guide-link-list a {
  display: block;
  color: #d9ddec;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
}

.guide-link-list a:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
  color: #fff;
}

.featured-guide-card {
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.22), transparent 38%),
    rgba(15,20,31,0.92);
}

.featured-guide-card h2,
.guide-card h2,
.guide-quick-paths h2 {
  margin-top: 0;
  color: #f4f4f7;
}

.featured-guide-card p,
.guide-card p {
  color: #aeb4c4;
  line-height: 1.65;
}

.featured-guide-card a,
.guide-card a,
.guide-actions a {
  text-decoration: none;
}

.guide-pick-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.guide-pick-list div {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.guide-pick-list strong,
.guide-pick-list span {
  display: block;
}

.guide-pick-list strong {
  color: #f4f4f7;
  margin-bottom: 5px;
}

.guide-pick-list span {
  color: #aeb4c4;
}

@media (max-width: 1100px) {
  .guides-layout,
  .guide-pick-list {
    grid-template-columns: 1fr;
  }
}

/* =========================
   About Page - HQ Design
========================= */

.about-hq-page .about-hero-card {
  margin-bottom: 20px;
}

.about-boot-card {
  padding: clamp(20px, 4vw, 34px);
}

.about-hq-page #systemBoot {
  max-width: 900px;
  margin: 0 auto;
  background:
    radial-gradient(circle at top, rgba(127,73,255,0.16), transparent 36%),
    rgba(10, 13, 23, 0.96);
  border: 1px solid rgba(185,145,255,0.34);
  border-radius: 22px;
  padding: clamp(24px, 5vw, 42px);
  box-shadow: 0 0 35px rgba(127,73,255,0.18);
  text-align: center;
}

.about-hq-page #systemBoot h1 {
  margin: 0 0 10px;
  color: #f4f4f7;
  letter-spacing: 2px;
}

.about-hq-page #bootTitle {
  color: #d9b3ff;
  margin: 0 0 24px;
  letter-spacing: 3px;
  font-size: 1rem;
  text-transform: uppercase;
}

.about-hq-page .bootBar {
  width: 100%;
  height: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 24px;
}

.about-hq-page #bootProgress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #7f49ff, #b65cff);
  box-shadow: 0 0 18px rgba(182,92,255,0.75);
  transition: width .25s linear;
}

.about-hq-page #bootMessages {
  min-height: 150px;
  text-align: left;
  font-family: Consolas, Monaco, monospace;
  color: #c7ccda;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 16px;
}

.about-hq-page #bootMessages p {
  margin: 8px 0;
}

.about-hq-page #enterButton {
  margin-top: 22px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #7f49ff, #4f8cff);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

.about-hq-page #aboutContent {
  max-width: 980px;
  margin: 0 auto;
}

.about-section {
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.about-section h2 {
  margin-top: 0;
  color: #f4f4f7;
}

.about-section p,
.about-section li {
  color: #c7ccda;
  line-height: 1.65;
}

.quest-panel-modern {
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.20), transparent 38%),
    rgba(255,255,255,0.045);
  border-color: rgba(185,145,255,0.28);
}

.about-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.about-stat-grid div {
  padding: 14px;
  border-radius: 14px;
  background: rgba(127,73,255,0.12);
  border: 1px solid rgba(185,145,255,0.22);
}

.about-stat-grid span,
.about-feature-grid span {
  display: block;
  color: #aeb4c4;
  font-size: 0.9rem;
}

.about-stat-grid strong,
.about-feature-grid strong {
  display: block;
  margin-top: 5px;
  color: #fff;
}

.about-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.about-feature-grid a {
  text-decoration: none;
  color: inherit;
  padding: 16px;
  border-radius: 15px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.about-feature-grid a:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.about-clean-list {
  columns: 2;
  gap: 28px;
  padding-left: 18px;
}

.about-final-card {
  text-align: center;
  background: rgba(127,73,255,0.10);
  border-color: rgba(185,145,255,0.28);
}

@media (max-width: 800px) {
  .about-stat-grid,
  .about-feature-grid {
    grid-template-columns: 1fr;
  }

  .about-clean-list {
    columns: 1;
  }
}

/* =========================
   Books + Book Detail Pages
========================= */

.books-page .library-layout,
.book-detail-page .book-detail-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.library-sidebar,
.book-detail-sidebar,
.library-main,
.book-detail-main {
  display: grid;
  gap: 16px;
}

.library-hero-panel {
  margin-bottom: 20px;
}

.library-filter-card label {
  display: block;
  margin: 14px 0 6px;
  color: #c7ccda;
  font-weight: 800;
}

.library-filter-card input,
.library-filter-card select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
}

.library-filter-card option {
  background: #111827;
  color: #fff;
}

.library-stat-card .stat-row,
.reader-card .stat-row,
.book-detail-page .stat-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.library-stat-card .stat-row:last-child,
.reader-card .stat-row:last-child,
.book-detail-page .stat-row:last-child {
  border-bottom: 0;
}

.library-stat-card .stat-row span,
.reader-card .stat-row span,
.book-detail-page .stat-row span {
  color: #aeb4c4;
}

.library-stat-card .stat-row strong,
.reader-card .stat-row strong,
.book-detail-page .stat-row strong {
  color: #f4f4f7;
  text-align: right;
}

.quick-link-grid {
  display: grid;
  gap: 10px;
}

.quick-link-grid a {
  text-decoration: none;
  color: #f4f4f7;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
}

.quick-link-grid a:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.books-page #activeFilterNotice .card,
.books-page #activeFilterNotice .content-card {
  margin-bottom: 16px;
}

.books-page .library-row-block {
  margin-bottom: 28px;
}

.books-page .library-row-header h2,
.books-page .library-row-block h2 {
  margin: 0 0 14px;
  color: #f4f4f7;
}

.books-page .book-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 145px));
  gap: 16px;
  overflow: visible;
  padding: 4px 0 12px;
}

.books-page .book-cover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 18px;
}

.books-page .netflix-book-card {
  width: 145px;
  cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}

.books-page .netflix-book-card:hover {
  transform: translateY(-4px) scale(1.03);
  filter: brightness(1.12);
}

.books-page .cover-wrap {
  position: relative;
  width: 145px;
  height: 215px;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 28px rgba(0,0,0,.32);
}

.books-page .cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.books-page .netflix-book-card h3 {
  font-size: 0.92rem;
  margin: 8px 0 4px;
  line-height: 1.2;
  color: #f4f4f7;
}

.books-page .netflix-book-card p {
  font-size: 0.82rem;
  margin: 3px 0;
  color: #aeb4c4;
}

.books-page .featured-hero-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.20), transparent 38%),
    rgba(15,20,31,0.92);
}

.books-page .featured-hero-cover img {
  width: 180px;
  height: 270px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(0,0,0,.45);
}

.books-page .featured-label {
  color: #b991ff;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.books-page .featured-hero-content h1 {
  margin: 6px 0 8px;
}

.book-detail-page .book-detail-cover {
  width: 100%;
  max-width: 230px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 16px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 18px 38px rgba(0,0,0,0.42);
}

.book-detail-hero h1 {
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
  margin: 0 0 12px;
}

.book-author-line,
.book-rating-line,
.book-description {
  color: #c7ccda;
}

.book-description {
  margin-top: 18px;
  line-height: 1.7;
  font-size: 1.02rem;
}

.book-stars p {
  margin: 8px 0 0;
  color: #d9b3ff;
}

.book-detail-page #worldInfo h3 {
  margin-top: 0;
}

.book-detail-page #worldInfo button,
.book-detail-page #similar button {
  border: 0;
  border-radius: 10px;
  padding: 8px 11px;
  color: #fff;
  background: linear-gradient(135deg, #7f49ff, #4f8cff);
  cursor: pointer;
  font-weight: 800;
}

.book-detail-page #similar {
  display: grid;
  gap: 12px;
}

.book-detail-page .recommended-book {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.book-detail-page .recommended-book:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

@media (max-width: 1150px) {
  .books-page .library-layout,
  .book-detail-page .book-detail-layout {
    grid-template-columns: 1fr;
  }

  .books-page .book-row {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .books-page .featured-hero-card {
    grid-template-columns: 1fr;
  }

  .books-page .featured-hero-cover img {
    width: 150px;
    height: 225px;
  }
}

@media (max-width: 700px) {
  .books-page .netflix-book-card,
  .books-page .cover-wrap {
    width: 120px;
  }

  .books-page .cover-wrap {
    height: 180px;
  }
}

/* =========================
   Systems Page
========================= */

.systems-page .systems-hero-panel {
  margin-bottom: 20px;
}

.systems-page .systems-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.systems-page .systems-sidebar,
.systems-page .systems-main {
  display: grid;
  gap: 16px;
}

.systems-page .content-card h2 {
  margin-top: 0;
}

.systems-page .system-list {
  display: grid;
  gap: 10px;
}

.systems-page .system-list button,
.systems-page .system-list .system-button,
.systems-page .system-list a {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 13px;
  padding: 12px 14px;
  color: #f4f4f7;
  text-decoration: none;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
  cursor: pointer;
}

.systems-page .system-list button:hover,
.systems-page .system-list .system-button:hover,
.systems-page .system-list a:hover,
.systems-page .system-list button.active,
.systems-page .system-list .active {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.14);
}

.systems-page .featured-system-card {
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.22), transparent 38%),
    rgba(15,20,31,0.92);
}

.systems-page .featured-system-card h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
  margin-bottom: 10px;
}

.systems-page .clean-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.systems-page .clean-stat-row:last-child {
  border-bottom: 0;
}

.systems-page .clean-stat-row span {
  color: #aeb4c4;
}

.systems-page .clean-stat-row strong {
  color: #f4f4f7;
  text-align: right;
}

.systems-page .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.systems-page .system-book-results {
  display: grid;
  gap: 12px;
}

.systems-page .system-book-results .recommended-book,
.systems-page .system-book-results > div {
  border-radius: 14px;
}

@media (max-width: 1150px) {
  .systems-page .systems-layout {
    grid-template-columns: 1fr;
  }
}

/* =========================
   Auth / Account Pages
========================= */

.auth-page .auth-layout {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(560px, 100%);
}

.auth-card h2 {
  margin-top: 0;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-form label {
  color: #d9ddec;
  font-weight: 900;
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 1rem;
}

.auth-form input:focus {
  border-color: rgba(185,145,255,0.62);
  box-shadow: 0 0 0 1px rgba(185,145,255,0.18);
}

.auth-message {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  font-weight: 800;
}

.auth-error {
  background: rgba(255, 77, 109, 0.14);
  border: 1px solid rgba(255, 77, 109, 0.35);
  color: #ffd7df;
}

.auth-switch a {
  color: #d9b3ff;
  font-weight: 900;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.account-grid .content-card {
  padding: 22px;
}

.account-grid .stat-row {
  display: grid;
  gap: 5px;
  margin: 16px 0;
}

.account-grid .stat-row span {
  color: #aeb4c4;
  font-weight: 800;
}

.account-grid .stat-row strong {
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .account-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================
   Beginner Guide Page
========================= */

.beginner-guide-page .guide-quest-card {
  margin-bottom: 18px;
}

.beginner-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.beginner-book-card {
  position: relative;
  padding: 20px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.beginner-book-card:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.beginner-book-card h3 {
  margin: 0 0 10px;
  padding-right: 40px;
}

.beginner-book-card p {
  color: #aeb4c4;
  line-height: 1.5;
}

.beginner-rank {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #7f49ff, #4f8cff);
}

.quest-results {
  margin-top: 2rem;
}

.quest-option-grid[hidden],
.quest-results[hidden] {
  display: none;
}

.quest-option {
  cursor: pointer;
}

.quest-option.selected,
.quest-option:hover {
  transform: translateY(-3px);
}

.quest-steps span.complete {
  background: var(--accent, #d4af37);
  color: #111;
}

.recommendation-stack {
  display: grid;
  gap: 1.5rem;
}

.recommendation-card {
  display: grid;
  grid-template-columns: 110px 150px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.25rem;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 18px;
  background: rgba(10, 10, 18, 0.75);
}

.recommendation-rank {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  text-align: center;
  font-size: 0.95rem;
}

.recommendation-rank span {
  font-size: 2rem;
}

.recommendation-cover {
  width: 100%;
  max-width: 150px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.recommendation-body h3 {
  margin-top: 0;
  margin-bottom: 0.15rem;
}

.recommendation-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.recommendation-meta span,
.tag-row span {
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.04);
}

.match-reasons {
  margin: 1rem 0;
}

.match-reasons ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.result-actions {
  margin-top: 1.5rem;
}

.empty-results {
  text-align: center;
  padding: 2rem;
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: 18px;
}

@media (max-width: 800px) {
  .recommendation-card {
    grid-template-columns: 1fr;
  }

  .recommendation-rank {
    justify-items: start;
    text-align: left;
  }

  .recommendation-cover {
    max-width: 180px;
  }
}

.quest-menu button.complete {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(212, 175, 55, 0.12);
}

.quest-menu button.complete strong::after {
  content: " ✓";
  color: #d4af37;
}


.dlhq-toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  display: grid;
  gap: 0.25rem;
  min-width: 240px;
  max-width: 340px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 14px;
  background: rgba(12, 10, 20, 0.95);
  color: #f5e6b8;
  box-shadow: 0 12px 35px rgba(0,0,0,0.45);
  transform: translateY(20px);
  opacity: 0;
  transition: 0.3s ease;
}

.dlhq-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.dlhq-toast strong {
  color: #d4af37;
}

.dlhq-toast span {
  font-size: 0.9rem;
}

.favourite-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;

    margin-top:10px;
    width:100%;

    padding:10px 14px;

    border-radius:10px;

    border:1px solid #555;

    background:#252525;

    color:#fff;

    cursor:pointer;

    transition:.25s;
}

.favourite-btn:hover{
    transform:translateY(-2px);
    border-color:#d4af37;
}

.favourite-btn.active{
    background:#c62828;
    border-color:#ff6b81;
    color:#fff;
}

.favourite-btn:disabled{
    opacity:.7;
    cursor:wait;
}

.favourite-btn.saving {
  opacity: 0.75;
  cursor: wait;
}

.favourite-btn.favourite-pop {
  animation: favouritePop 0.42s ease;
}

@keyframes favouritePop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

.library-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.library-btn {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: #2b2f36;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.library-btn:hover {
    background: #3a4049;
}

.library-btn.active-library-status {
    background: #2e7d32;
    border-color: #66bb6a;
    color: #fff;
    font-weight: bold;
}

.want-btn.active-library-status {
    background: #1565c0;
    border-color: #42a5f5;
}

.reading-btn.active-library-status {
    background: #7b1fa2;
    border-color: #ba68c8;
}

.finished-btn.active-library-status {
    background: #2e7d32;
    border-color: #66bb6a;
}

/* =========================================================
   Homepage v2 Fix / Polish
   Add to bottom of css/style.css
========================================================= */

.homepage-v2 {
  display: grid;
  gap: 22px;
}

.homepage-v2 img {
  max-width: 100%;
  height: auto;
}

.home-hero-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.24), transparent 38%),
    radial-gradient(circle at bottom right, rgba(79,140,255,0.14), transparent 32%),
    rgba(15,20,31,0.94);
}

.home-hero-copy h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 0.95;
  margin: 0 0 14px;
}

.home-hero-lead {
  max-width: 760px;
  color: #c7ccda;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.6;
}

.home-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.home-stat-strip div,
.home-mini-stats div {
  padding: 14px;
  border-radius: 15px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
}

.home-stat-strip strong,
.home-mini-stats strong {
  display: block;
  font-size: 1.45rem;
  color: #fff;
}

.home-stat-strip span,
.home-mini-stats span {
  display: block;
  margin-top: 4px;
  color: #aeb4c4;
  font-size: 0.9rem;
  font-weight: 800;
}

.home-hero-feature {
  min-width: 0;
}

.home-hero-book-card {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(185,145,255,0.28);
  box-shadow: 0 18px 42px rgba(0,0,0,0.38);
}

.home-hero-book-card img {
  width: 170px;
  height: 255px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.45);
}

.home-hero-book-card h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.4rem, 2.4vw, 2.2rem);
  line-height: 1.05;
}

.home-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-action-card {
  text-decoration: none;
  color: inherit;
  display: block;
  min-height: 145px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-action-card:hover {
  transform: translateY(-4px);
  border-color: rgba(185,145,255,0.55);
  background: rgba(127,73,255,0.12);
}

.home-action-card span {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.home-action-card strong {
  display: block;
  font-size: 1.05rem;
}

.home-action-card p {
  color: #aeb4c4;
  line-height: 1.5;
}

.home-personal-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px) auto;
  gap: 18px;
  align-items: center;
}

.home-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.home-discovery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.home-main-column,
.home-side-column {
  display: grid;
  gap: 18px;
}

.home-featured-book-large {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.home-featured-book-large img {
  width: 190px;
  height: 285px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.42);
}

.home-featured-book-large h3 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.home-book-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 16px;
}

.home-cover-card {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-cover-card:hover {
  transform: translateY(-4px);
  border-color: rgba(185,145,255,0.55);
  background: rgba(127,73,255,0.12);
}

.home-cover-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
}

.home-cover-card strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.25;
}

.home-cover-card span {
  color: #aeb4c4;
  font-weight: 800;
}

.home-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.home-category-card {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 8px;
  min-height: 130px;
  padding: 18px;
  border-radius: 17px;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.16), transparent 40%),
    rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1.7rem;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(185,145,255,0.55);
  background: rgba(127,73,255,0.12);
}

.home-category-card strong {
  display: block;
  font-size: 1rem;
}

.home-category-card span {
  color: #aeb4c4;
  font-size: 0.9rem;
  line-height: 1.45;
}

.home-side-column .content-card {
  min-width: 0;
}

.homepage-v2 .quest-actions {
  justify-content: flex-start;
}

.homepage-v2 .section-head {
  align-items: center;
}

@media (max-width: 1200px) {
  .home-hero-v2,
  .home-discovery-layout,
  .home-personal-panel {
    grid-template-columns: 1fr;
  }

  .home-action-grid,
  .home-book-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .home-stat-strip,
  .home-action-grid,
  .home-mini-stats,
  .home-book-row,
  .home-category-grid,
  .home-hero-book-card,
  .home-featured-book-large {
    grid-template-columns: 1fr;
  }

  .home-hero-book-card img,
  .home-featured-book-large img {
    width: 150px;
    height: 225px;
  }

  .home-hero-v2 {
    padding: 20px;
  }

  .homepage-v2 .quest-actions {
    flex-direction: column;
  }

  .homepage-v2 .quest-actions a,
  .homepage-v2 .quest-actions button {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* =========================================================
   Homepage v2.1 Premium Polish
   Add to bottom of css/style.css
========================================================= */

.homepage-v21 {
  display: grid;
  gap: 28px;
}

.homepage-v21 img {
  max-width: 100%;
}

.home-v21-hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
  padding: clamp(32px, 5vw, 70px);
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(185,145,255,0.22);
  background:
    radial-gradient(circle at 18% 10%, rgba(127,73,255,0.35), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(79,140,255,0.20), transparent 30%),
    linear-gradient(135deg, rgba(15,20,31,0.98), rgba(7,10,17,0.96));
  box-shadow: 0 24px 60px rgba(0,0,0,0.42);
}

.home-v21-hero-copy h1 {
  max-width: 900px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: -0.06em;
  margin: 0 0 22px;
}

.home-v21-lead {
  max-width: 720px;
  color: #c7ccda;
  font-size: clamp(1.05rem, 1.8vw, 1.34rem);
  line-height: 1.6;
}

.home-v21-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 8px;
}

.home-v21-stats div,
.home-v21-mini-stats div {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.home-v21-stats strong,
.home-v21-mini-stats strong {
  display: block;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
}

.home-v21-stats span,
.home-v21-mini-stats span {
  display: block;
  margin-top: 6px;
  color: #aeb4c4;
  font-weight: 900;
  font-size: 0.86rem;
}

.home-v21-actions {
  justify-content: flex-start;
}

.home-v21-showcase-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 22px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(185,145,255,0.18), transparent 40%),
    rgba(0,0,0,0.30);
  border: 1px solid rgba(185,145,255,0.28);
  box-shadow: 0 22px 50px rgba(0,0,0,0.48);
  animation: showcaseFade .45s ease both;
}

@keyframes showcaseFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-v21-showcase-card img {
  width: 220px;
  height: 330px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 22px 44px rgba(0,0,0,0.55);
}

.home-v21-showcase-card h2 {
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1;
  margin: 6px 0 12px;
}

.home-v21-action-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-v21-action-strip a {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 6px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(15,20,31,0.82);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-v21-action-strip a:hover {
  transform: translateY(-5px);
  border-color: rgba(185,145,255,0.55);
  background: rgba(127,73,255,0.12);
}

.home-v21-action-strip span {
  font-size: 2rem;
}

.home-v21-action-strip strong {
  font-size: 1.05rem;
}

.home-v21-action-strip em {
  color: #aeb4c4;
  font-style: normal;
}

.home-v21-dashboard {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.9fr;
  gap: 18px;
}

.home-v21-panel,
.home-v21-section {
  border-radius: 26px;
  padding: clamp(22px, 3vw, 32px);
  background: rgba(15,20,31,0.88);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 16px 38px rgba(0,0,0,0.30);
}

.reader-rpg-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.reader-rpg-head > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: rgba(127,73,255,0.18);
  border: 1px solid rgba(185,145,255,0.26);
  font-size: 1.8rem;
}

.reader-rpg-head h2 {
  margin: 0;
  font-size: 2rem;
}

.reader-rpg-head p {
  margin: 4px 0 0;
  color: #aeb4c4;
  font-weight: 900;
}

.home-v21-xpbar {
  height: 16px;
  margin: 20px 0 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
}

.home-v21-xpbar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7f49ff, #4f8cff);
  box-shadow: 0 0 24px rgba(127,73,255,0.75);
  transition: width .35s ease;
}

.home-v21-quest-card {
  background:
    radial-gradient(circle at top left, rgba(255,213,79,0.15), transparent 40%),
    rgba(15,20,31,0.88);
}

.home-v21-quest-card h2 {
  font-size: 1.8rem;
}

.home-v21-reward {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffe7a3;
  background: rgba(255,213,79,0.12);
  border: 1px solid rgba(255,213,79,0.25);
  font-weight: 900;
}

.home-v21-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin: 18px 0;
}

.home-v21-section {
  display: grid;
  gap: 18px;
}

.home-v21-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
}

.home-v21-section-head h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.home-v21-featured-book {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(22px, 4vw, 42px);
  align-items: center;
  padding: 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.18), transparent 36%),
    rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.07);
}

.home-v21-featured-book img {
  width: 250px;
  height: 375px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.48);
}

.home-v21-featured-book h3 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
  margin: 0 0 12px;
}

.home-v21-featured-book p {
  color: #c7ccda;
  line-height: 1.65;
}

.home-v21-cover-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 8px 6px 18px;
  scroll-snap-type: x proximity;
}

.home-v21-cover-row::-webkit-scrollbar {
  height: 10px;
}

.home-v21-cover-row::-webkit-scrollbar-thumb {
  background: rgba(185,145,255,0.45);
  border-radius: 999px;
}

.home-v21-cover-card {
  flex: 0 0 180px;
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 10px;
  scroll-snap-align: start;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-v21-cover-card:hover {
  transform: translateY(-6px) scale(1.03);
  border-color: rgba(185,145,255,0.58);
  background: rgba(127,73,255,0.12);
  box-shadow: 0 18px 34px rgba(0,0,0,0.35);
}

.home-v21-cover-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 15px;
  background: #111827;
}

.home-v21-cover-card strong {
  line-height: 1.25;
}

.home-v21-cover-card span {
  color: #aeb4c4;
  font-weight: 900;
}

.home-v21-roll-section {
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
}

.home-v21-roll-result {
  min-height: 250px;
  display: grid;
  place-items: center;
}

.home-v21-roll-empty {
  text-align: center;
  color: #aeb4c4;
}

.home-v21-roll-empty span {
  display: block;
  font-size: 3rem;
}

.home-v21-roll-card {
  width: 100%;
  display: grid;
  grid-template-columns: 150px minmax(0,1fr);
  gap: 20px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: rgba(127,73,255,0.10);
  border: 1px solid rgba(185,145,255,0.28);
}

.home-v21-roll-card img {
  width: 150px;
  height: 225px;
  object-fit: cover;
  border-radius: 15px;
}

.home-v21-roll-card h3 {
  font-size: 2rem;
  margin: 0 0 8px;
}

.home-v21-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}

.home-v21-category-card {
  min-height: 170px;
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  border-radius: 24px;
  font-size: 2.2rem;
  background:
    linear-gradient(180deg, rgba(8,10,17,0.05), rgba(8,10,17,0.90)),
    radial-gradient(circle at top left, rgba(127,73,255,0.24), transparent 42%),
    rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.09);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.home-v21-category-card:hover {
  transform: translateY(-6px);
  border-color: rgba(185,145,255,0.58);
  background:
    linear-gradient(180deg, rgba(8,10,17,0.02), rgba(8,10,17,0.86)),
    radial-gradient(circle at top left, rgba(127,73,255,0.34), transparent 46%),
    rgba(127,73,255,0.12);
}

.home-v21-category-card strong {
  display: block;
  font-size: 1.18rem;
}

.home-v21-category-card span {
  display: block;
  color: #c7ccda;
  font-size: 0.94rem;
  line-height: 1.45;
}

.home-v21-lower-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
}

.home-v21-link-list {
  display: grid;
  gap: 10px;
}

.home-v21-link-list a {
  color: inherit;
  text-decoration: none;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.home-v21-link-list a:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.home-v21-link-list strong,
.home-v21-link-list span {
  display: block;
}

.home-v21-link-list span {
  color: #aeb4c4;
  margin-top: 4px;
}

.homepage-v21 .release-item {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.homepage-v21 .release-item:last-child {
  border-bottom: 0;
}

@media (max-width: 1250px) {
  .home-v21-hero,
  .home-v21-dashboard,
  .home-v21-roll-section,
  .home-v21-lower-grid {
    grid-template-columns: 1fr;
  }

  .home-v21-action-strip,
  .home-v21-category-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 760px) {
  .home-v21-hero {
    min-height: auto;
    padding: 24px;
  }

  .home-v21-stats,
  .home-v21-action-strip,
  .home-v21-mini-stats,
  .home-v21-category-grid,
  .home-v21-featured-book,
  .home-v21-roll-card,
  .home-v21-showcase-card {
    grid-template-columns: 1fr;
  }

  .home-v21-showcase-card img,
  .home-v21-featured-book img,
  .home-v21-roll-card img {
    width: 160px;
    height: 240px;
  }

  .home-v21-section-head {
    align-items: start;
    flex-direction: column;
  }

  .home-v21-cover-card {
    flex-basis: 150px;
  }

  .home-v21-hero-copy h1 {
    font-size: 3.1rem;
  }
}


/* Continue Reading card */
.home-v21-continue-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.home-v21-continue-card img {
  width: 92px;
  height: 138px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.38);
}

.home-v21-continue-card h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
  line-height: 1.15;
}

.home-v21-continue-card p {
  margin: 5px 0;
  color: #c7ccda;
}

@media (max-width: 700px) {
  .home-v21-continue-card {
    grid-template-columns: 1fr;
  }

  .home-v21-continue-card img {
    width: 130px;
    height: 195px;
  }
}


/* =========================================================
   Author Pages
   Add to bottom of css/style.css
========================================================= */

.author-page {
  display: grid;
  gap: 20px;
}

.author-hero-card h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  margin: 0 0 14px;
}

.author-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.author-sidebar,
.author-main {
  display: grid;
  gap: 16px;
}

.author-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 18px;
}

.author-book-card {
  color: inherit;
  text-decoration: none;
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.author-book-card:hover {
  transform: translateY(-5px);
  border-color: rgba(185,145,255,0.55);
  background: rgba(127,73,255,0.12);
}

.author-book-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
}

.author-book-card strong {
  display: block;
  line-height: 1.25;
}

.author-book-card span {
  color: #aeb4c4;
  font-weight: 800;
  font-size: 0.9rem;
}

.author-start-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.author-start-card img {
  width: 150px;
  height: 225px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.36);
}

.author-start-card h3 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.book-author-line a {
  color: #d9b3ff;
  font-weight: 900;
  text-decoration: none;
}

.book-author-line a:hover {
  text-decoration: underline;
}

.author-mini-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.author-mini-row img {
  width: 58px;
  height: 86px;
  object-fit: cover;
  border-radius: 8px;
  background: #111827;
}

@media (max-width: 900px) {
  .author-layout,
  .author-start-card {
    grid-template-columns: 1fr;
  }

  .author-start-card img {
    width: 130px;
    height: 195px;
  }
}


/* =========================================================
   Series Pages + Book Series Navigation
   Add to bottom of css/style.css
========================================================= */

.series-page {
  display: grid;
  gap: 20px;
}

.series-hero-card h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.95;
  margin: 0 0 14px;
}

.series-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.series-sidebar,
.series-main {
  display: grid;
  gap: 16px;
}

.series-book-list {
  display: grid;
  gap: 16px;
}

.series-book-row {
  display: grid;
  grid-template-columns: 72px 110px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.series-book-row:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.series-book-number {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 16px;
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.26);
}

.series-book-number span {
  color: #aeb4c4;
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 900;
}

.series-book-number strong {
  font-size: 1.8rem;
}

.series-book-row img {
  width: 110px;
  height: 165px;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
  box-shadow: 0 14px 28px rgba(0,0,0,0.32);
}

.series-book-main h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.series-book-main h3 a,
#seriesAuthor a,
#seriesInfo a {
  color: #d9b3ff;
  text-decoration: none;
}

.series-book-main h3 a:hover,
#seriesAuthor a:hover,
#seriesInfo a:hover {
  text-decoration: underline;
}

.series-start-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.series-start-card img {
  width: 150px;
  height: 225px;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 16px 34px rgba(0,0,0,0.36);
}

.series-start-card h3 {
  margin: 0 0 8px;
  font-size: 1.8rem;
}

.series-navigation {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.series-position {
  margin-bottom: 12px;
  color: #d9b3ff;
}

.series-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.series-nav-buttons a,
.series-nav-disabled {
  font-size: 0.85rem;
}

.series-nav-disabled {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 12px;
  color: #6f7687;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.06);
  font-weight: 900;
}

@media (max-width: 900px) {
  .series-layout,
  .series-book-row,
  .series-start-card {
    grid-template-columns: 1fr;
  }

  .series-book-row img,
  .series-start-card img {
    width: 130px;
    height: 195px;
  }

  .series-book-number {
    width: 72px;
  }
}

.breadcrumbs{

display:flex;
flex-wrap:wrap;
align-items:center;
gap:8px;

margin-bottom:20px;

font-size:.95rem;

color:#b9c0d0;

}

.breadcrumbs a{

color:#7ec8ff;
text-decoration:none;

}

.breadcrumbs a:hover{

text-decoration:underline;

}

.breadcrumb-separator{

opacity:.5;

}


/* =========================================================
   World Atlas v3 - Stable Layout Reset
   Replaces old duplicate World Atlas blocks.
========================================================= */

/* Global containment */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
}

/* Navigation fit fix */
.hq-nav {
  flex-wrap: wrap;
  justify-content: center;
  overflow-x: hidden;
  gap: 4px;
  padding: 6px 12px 8px;
}

.hq-nav a {
  margin-right: 0;
  padding: 12px 11px 10px;
  font-size: 0.88rem;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .hq-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}

/* Page shell containment */
.hq-page-shell {
  width: min(1500px, calc(100% - 32px));
  max-width: 1500px;
  margin-left: auto;
  margin-right: auto;
  overflow-x: visible;
}

@media (max-width: 700px) {
  .hq-page-shell {
    width: min(100%, calc(100% - 20px));
  }
}

/* World Atlas root */
.world-atlas-page.world-atlas-v3 {
  display: grid;
  gap: 18px;
  max-width: 1500px;
  min-width: 0;
}

/* Hero */
.world-atlas-v3 .world-atlas-hero,
.world-atlas-v3 .atlas-hero-v3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  overflow: hidden;
}

.world-atlas-v3 .atlas-hero-copy {
  min-width: 0;
}

.world-atlas-v3 .atlas-hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
}

.world-atlas-v3 .atlas-hero-copy p {
  max-width: 820px;
}

.world-atlas-v3 .world-atlas-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.world-atlas-v3 .atlas-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.world-atlas-v3 .atlas-hero-metrics div {
  min-width: 120px;
  padding: 11px 13px;
  border-radius: 13px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.10);
}

.world-atlas-v3 .atlas-hero-metrics span,
.world-atlas-v3 .atlas-hero-metrics strong {
  display: block;
}

.world-atlas-v3 .atlas-hero-metrics span {
  color: #aeb4c4;
  font-size: 0.78rem;
  font-weight: 800;
}

.world-atlas-v3 .atlas-hero-metrics strong {
  color: #fff;
  font-size: 1.25rem;
  margin-top: 3px;
}

/* Main layout */
.world-atlas-v3 .world-atlas-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.world-atlas-v3 .world-atlas-sidebar,
.world-atlas-v3 .world-atlas-main {
  min-width: 0;
  max-width: 100%;
}

.world-atlas-v3 .world-atlas-sidebar {
  display: grid;
  gap: 14px;
  align-self: start;
  position: sticky;
  top: 16px;
}

.world-atlas-v3 .world-atlas-main {
  display: grid;
  gap: 16px;
}

/* Cards and panels */
.world-atlas-v3 .content-card,
.world-atlas-v3 .world-panel,
.world-atlas-v3 .stat-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.world-atlas-v3 .compact-section-head {
  margin-bottom: 12px;
}

.world-atlas-v3 .compact-section-head h2,
.world-atlas-v3 .world-panel h2 {
  margin-top: 0;
}

/* Search and world list */
.world-atlas-v3 .atlas-search-label {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.world-atlas-v3 .atlas-search-label span {
  color: #aeb4c4;
  font-size: 0.82rem;
  font-weight: 900;
}

.world-atlas-v3 #worldSearch {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border-radius: 11px;
  background: rgba(255,255,255,0.075);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
}

.world-atlas-v3 .world-list {
  display: grid;
  gap: 9px;
  max-height: none;
}

.world-atlas-v3 .world-list-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 10px;
  text-align: left;
  border-radius: 13px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.09);
  color: #f4f4f7;
}

.world-atlas-v3 .world-list-button.is-active,
.world-atlas-v3 .world-list-button:hover {
  background: rgba(127,73,255,0.18);
  border-color: rgba(185,145,255,0.55);
}

.world-atlas-v3 .world-list-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(127,73,255,0.18);
}

.world-atlas-v3 .world-list-copy {
  min-width: 0;
}

.world-atlas-v3 .world-list-copy strong,
.world-atlas-v3 .world-list-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-atlas-v3 .world-list-copy strong {
  font-size: 0.9rem;
}

.world-atlas-v3 .world-list-copy em {
  color: #aeb4c4;
  font-size: 0.78rem;
  font-style: normal;
}

/* Selected world hero card */
.world-atlas-v3 .selected-world-card-v3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.world-atlas-v3 .selected-world-art-wrap {
  width: 100%;
  height: 220px;
  min-height: 220px;
  max-height: 220px;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
}

.world-atlas-v3 .selected-world-art-wrap img,
.world-atlas-v3 #selectedWorldArt {
  display: block;
  width: 100%;
  height: 220px;
  max-height: 220px;
  object-fit: cover;
  object-position: center;
}

.world-atlas-v3 .selected-world-content {
  min-width: 0;
}

.world-atlas-v3 .selected-world-content h2 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.05;
}

.world-atlas-v3 .world-difficulty {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  margin: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.world-atlas-v3 .world-difficulty span {
  color: #aeb4c4;
  font-weight: 800;
}

/* Stat grid */
.world-atlas-v3 .world-stat-grid-v3 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.world-atlas-v3 .atlas-stat-card {
  padding: 16px;
}

.world-atlas-v3 .atlas-stat-card span {
  font-size: 0.82rem;
  font-weight: 900;
}

.world-atlas-v3 .atlas-stat-card strong {
  font-size: 1.65rem;
}

/* Book rows - only these scroll horizontally */
.world-atlas-v3 .atlas-cover-row,
.world-atlas-v3 .world-cover-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 14px;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.world-atlas-v3 .atlas-book-card,
.world-atlas-v3 .world-book-card {
  flex: 0 0 138px;
  width: 138px;
  max-width: 138px;
  min-width: 138px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.world-atlas-v3 .atlas-book-card:hover,
.world-atlas-v3 .world-book-card:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.world-atlas-v3 .world-book-cover {
  display: block;
  width: 100%;
  text-decoration: none;
}

.world-atlas-v3 .world-book-cover img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  border-radius: 10px;
  background: #111827;
}

.world-atlas-v3 .world-book-copy {
  min-width: 0;
}

.world-atlas-v3 .world-book-copy h3 {
  margin: 8px 0 4px;
  font-size: 0.82rem;
  line-height: 1.18;
}

.world-atlas-v3 .world-book-copy h3 a,
.world-atlas-v3 .world-book-copy p a {
  color: inherit;
  text-decoration: none;
}

.world-atlas-v3 .world-book-copy p {
  margin: 0 0 6px;
  color: #aeb4c4;
  font-size: 0.75rem;
  line-height: 1.25;
}

.world-atlas-v3 .world-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.world-atlas-v3 .world-book-meta span {
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(127,73,255,0.16);
  color: #eee8ff;
  font-size: 0.68rem;
  font-weight: 800;
}

/* Series grid */
.world-atlas-v3 .atlas-series-grid,
.world-atlas-v3 .world-series-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 100%;
}

.world-atlas-v3 .atlas-series-card,
.world-atlas-v3 .world-series-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.world-atlas-v3 .atlas-series-card:hover,
.world-atlas-v3 .world-series-card:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.world-atlas-v3 .atlas-series-card img,
.world-atlas-v3 .world-series-card img {
  width: 58px;
  height: 86px;
  border-radius: 8px;
  object-fit: cover;
}

.world-atlas-v3 .atlas-series-card span,
.world-atlas-v3 .world-series-card span,
.world-atlas-v3 .atlas-series-card em,
.world-atlas-v3 .world-series-card em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-atlas-v3 .atlas-series-card span,
.world-atlas-v3 .world-series-card span {
  color: #f4f4f7;
  font-weight: 900;
  line-height: 1.2;
}

.world-atlas-v3 .atlas-series-card em,
.world-atlas-v3 .world-series-card em {
  color: #aeb4c4;
  font-size: 0.78rem;
  font-style: normal;
  margin-top: 4px;
}

/* Lower grids */
.world-atlas-v3 .world-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.world-atlas-v3 .atlas-tag-cloud,
.world-atlas-v3 .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.world-atlas-v3 .atlas-pill {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.25);
  color: #eee8ff;
  font-size: 0.82rem;
  font-weight: 800;
}

.world-atlas-v3 .atlas-pill em {
  color: #aeb4c4;
  font-style: normal;
}

.world-atlas-v3 .similar-world-grid {
  display: grid;
  gap: 9px;
}

.world-atlas-v3 .similar-world-button {
  width: 100%;
  margin: 0;
  padding: 11px 12px;
  border-radius: 13px;
  text-align: left;
  color: #f4f4f7;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.world-atlas-v3 .similar-world-button strong,
.world-atlas-v3 .similar-world-button span {
  display: block;
}

.world-atlas-v3 .similar-world-button span {
  color: #aeb4c4;
  font-size: 0.78rem;
  margin-top: 3px;
}

/* Responsive */
@media (max-width: 1200px) {
  .world-atlas-v3 .world-atlas-layout,
  .world-atlas-v3 .selected-world-card-v3 {
    grid-template-columns: 1fr;
  }

  .world-atlas-v3 .world-atlas-sidebar {
    position: static;
  }

  .world-atlas-v3 .world-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .world-atlas-v3 .atlas-series-grid,
  .world-atlas-v3 .world-series-grid,
  .world-atlas-v3 .world-stat-grid-v3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .world-atlas-v3 .world-atlas-hero,
  .world-atlas-v3 .atlas-hero-v3,
  .world-atlas-v3 .world-two-column,
  .world-atlas-v3 .atlas-series-grid,
  .world-atlas-v3 .world-series-grid,
  .world-atlas-v3 .world-stat-grid-v3,
  .world-atlas-v3 .world-list {
    grid-template-columns: 1fr;
  }

  .world-atlas-v3 .world-atlas-actions,
  .world-atlas-v3 .world-atlas-actions a {
    width: 100%;
  }

  .world-atlas-v3 .world-atlas-actions a {
    text-align: center;
  }

  .world-atlas-v3 .selected-world-art-wrap,
  .world-atlas-v3 .selected-world-art-wrap img,
  .world-atlas-v3 #selectedWorldArt {
    height: 170px;
    min-height: 170px;
    max-height: 170px;
  }

  .world-atlas-v3 .atlas-book-card,
  .world-atlas-v3 .world-book-card {
    flex-basis: 126px;
    width: 126px;
    max-width: 126px;
    min-width: 126px;
  }

  .world-atlas-v3 .world-book-cover img {
    height: 180px;
  }
}

/* =========================================================
   System Codex v2 - scoped systems.php styles
   Paste at the bottom of css/style.css
========================================================= */

.system-codex-page,
.system-codex-page * {
  box-sizing: border-box;
}

.system-codex-page {
  max-width: 1500px;
  overflow-x: clip;
}

.system-codex-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
  padding: clamp(24px, 4vw, 42px);
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.24), transparent 38%),
    rgba(15,20,31,0.92);
}

.system-codex-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.1rem);
  line-height: 1;
  margin: 0 0 12px;
}

.system-codex-hero p {
  max-width: 850px;
  color: #c7ccda;
  line-height: 1.65;
}

.system-codex-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.system-codex-actions a {
  text-decoration: none;
}

.system-codex-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.system-codex-sidebar,
.system-codex-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.system-codex-sidebar {
  position: sticky;
  top: 90px;
}

.system-panel {
  padding: clamp(18px, 3vw, 26px);
  min-width: 0;
}

.system-panel h2,
.selected-system-card h2 {
  margin-top: 0;
}

.codex-system-list {
  display: grid;
  gap: 9px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.system-list-button {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  border-radius: 14px;
  padding: 11px 12px;
  color: #f4f4f7;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  margin: 0;
}

.system-list-button:hover,
.system-list-button.is-active {
  border-color: rgba(185,145,255,0.58);
  background: rgba(127,73,255,0.16);
}

.system-list-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(127,73,255,0.18);
  border: 1px solid rgba(185,145,255,0.25);
}

.system-list-copy strong,
.system-list-copy em {
  display: block;
}

.system-list-copy strong {
  overflow-wrap: anywhere;
}

.system-list-copy em {
  color: #aeb4c4;
  font-style: normal;
  font-size: 0.86rem;
  margin-top: 2px;
}

.selected-system-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: clamp(22px, 4vw, 36px);
  min-width: 0;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.22), transparent 38%),
    rgba(15,20,31,0.92);
}

.selected-system-icon {
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  font-size: 3.2rem;
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.30);
  box-shadow: 0 18px 38px rgba(0,0,0,0.28);
}

.selected-system-content {
  min-width: 0;
}

.selected-system-content h2 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
  margin-bottom: 10px;
}

.selected-system-content p {
  line-height: 1.65;
}

.system-difficulty {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.system-difficulty span {
  color: #aeb4c4;
  font-weight: 800;
}

.system-difficulty strong {
  color: #d9b3ff;
  letter-spacing: 1px;
}

.system-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.system-stat-grid .stat-card {
  padding: 18px;
}

.system-stat-grid .stat-card strong {
  font-size: clamp(1.35rem, 3vw, 2rem);
  overflow-wrap: anywhere;
}

.system-cover-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  padding: 6px 2px 16px;
  scroll-snap-type: x proximity;
}

.system-book-card {
  flex: 0 0 140px;
  max-width: 140px;
  min-width: 140px;
  scroll-snap-align: start;
}

.system-book-cover {
  display: block;
  width: 120px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 12px 26px rgba(0,0,0,0.32);
}

.system-book-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.system-book-copy h3 {
  margin: 9px 0 4px;
  font-size: 0.88rem;
  line-height: 1.22;
}

.system-book-copy h3 a,
.system-book-copy p a {
  color: inherit;
  text-decoration: none;
}

.system-book-copy p {
  margin: 0;
  color: #aeb4c4;
  font-size: 0.8rem;
  line-height: 1.35;
}

.system-book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.system-book-meta span {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.22);
  color: #eee8ff;
  font-size: 0.74rem;
}

.system-series-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.system-series-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  min-width: 0;
}

.system-series-card:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.system-series-card img {
  width: 70px;
  height: 105px;
  object-fit: cover;
  border-radius: 10px;
  background: #111827;
}

.system-series-card span,
.system-series-card em {
  display: block;
  min-width: 0;
}

.system-series-card span {
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.system-series-card em {
  color: #aeb4c4;
  font-style: normal;
  margin-top: 6px;
  font-size: 0.86rem;
}

.system-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.system-codex-page .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.codex-pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 999px;
  padding: 8px 10px;
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.24);
  color: #eee8ff;
  font-weight: 800;
  font-size: 0.88rem;
}

.codex-pill em {
  color: #c7ccda;
  font-style: normal;
  font-weight: 900;
}

.similar-system-grid {
  display: grid;
  gap: 9px;
}

.similar-system-button {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0;
  color: #f4f4f7;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}

.similar-system-button:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.10);
}

.similar-system-button strong,
.similar-system-button span {
  display: block;
}

.similar-system-button span {
  color: #aeb4c4;
  font-size: 0.84rem;
  margin-top: 3px;
}

.system-codex-page .clean-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.system-codex-page .clean-stat-row:last-child {
  border-bottom: 0;
}

.system-codex-page .clean-stat-row span {
  color: #aeb4c4;
}

.system-codex-page .clean-stat-row strong {
  color: #f4f4f7;
  text-align: right;
}

@media (max-width: 1200px) {
  .system-codex-layout {
    grid-template-columns: 1fr;
  }

  .system-codex-sidebar {
    position: static;
  }

  .codex-system-list {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-series-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .system-codex-hero,
  .selected-system-card,
  .system-two-column,
  .system-stat-grid,
  .system-series-grid,
  .codex-system-list {
    grid-template-columns: 1fr;
  }

  .selected-system-icon {
    width: 86px;
    height: 86px;
    font-size: 2.4rem;
  }

  .system-codex-actions {
    width: 100%;
  }

  .system-codex-actions a {
    width: 100%;
    text-align: center;
  }
}

/* Laptop zoom/layout fix */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
}

.hq-page-shell {
  width: min(1320px, calc(100% - 28px));
}

/* Books + book detail pages: reduce sidebars sooner */
@media (max-width: 1350px) {
  .books-page .library-layout,
  .book-detail-page .book-detail-layout {
    grid-template-columns: 260px minmax(0, 1fr) 260px;
    gap: 14px;
  }
}

@media (max-width: 1180px) {
  .books-page .library-layout,
  .book-detail-page .book-detail-layout {
    grid-template-columns: 1fr;
  }

  .library-sidebar,
  .book-detail-sidebar {
    position: static;
  }
}

/* Stop button groups overlapping */
.book-actions,
.library-actions,
.next-read-actions,
.card-actions,
.world-atlas-actions,
.quest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.book-actions a,
.book-actions button,
.library-actions a,
.library-actions button,
.next-read-actions a,
.next-read-actions button,
.card-actions a,
.card-actions button {
  white-space: normal;
  min-width: 0;
}

/* Book cards fit better on laptops */
.books-page .book-row {
  grid-template-columns: repeat(auto-fill, minmax(118px, 145px));
}

.books-page .netflix-book-card {
  max-width: 145px;
}

@media (max-width: 1350px) {
  .books-page .netflix-book-card,
  .books-page .cover-wrap {
    width: 125px;
  }

  .books-page .cover-wrap {
    height: 188px;
  }

  .books-page .netflix-book-card h3 {
    font-size: 0.82rem;
  }

  .books-page .netflix-book-card p {
    font-size: 0.76rem;
  }
}

/* =========================================================
   Books Library v4 - 6 item shelves + load more
   Paste at bottom of css/style.css
========================================================= */

.books-page .expandable-book-shelf {
  position: relative;
}

.books-page .expandable-shelf-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.books-page .expandable-shelf-header h2 {
  margin: 0;
}

.books-page .shelf-subtitle {
  margin: 4px 0 0;
}

.books-page .shelf-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(127,73,255,0.16);
  border: 1px solid rgba(185,145,255,0.26);
  color: #eee8ff;
  font-weight: 900;
  font-size: 0.82rem;
  white-space: nowrap;
}

.books-page .expandable-shelf-row {
  animation: shelfFadeIn .18s ease both;
}

.books-page .book-row.expandable-shelf-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 145px));
  gap: 16px;
  overflow: visible;
  padding: 4px 0 12px;
}

.books-page .book-cover-grid.expandable-shelf-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 145px));
  gap: 16px;
}

.books-page .shelf-load-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.books-page .shelf-load-btn,
.books-page .shelf-less-btn {
  border: 1px solid rgba(255,255,255,0.12);
  cursor: pointer;
}

.books-page .shelf-load-btn:hover,
.books-page .shelf-less-btn:hover {
  border-color: rgba(185,145,255,0.52);
  background: rgba(127,73,255,0.16);
}

@keyframes shelfFadeIn {
  from {
    opacity: 0.7;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 700px) {
  .books-page .expandable-shelf-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .books-page .book-row.expandable-shelf-row,
  .books-page .book-cover-grid.expandable-shelf-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Books v5 - curated shelves + genre gateway */
.genre-gateway-card {
  margin-bottom: 28px;
}

.genre-gateway-card .expandable-shelf-header {
  align-items: center;
}

.genre-see-all {
  white-space: nowrap;
}

.genre-gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.genre-gateway-tile {
  width: 100%;
  min-height: 128px;
  margin: 0;
  padding: 15px;
  text-align: left;
  border-radius: 16px;
  color: #f4f4f7;
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.22), transparent 42%),
    rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}

.genre-gateway-tile:hover {
  border-color: rgba(185,145,255,0.55);
  background:
    radial-gradient(circle at top left, rgba(127,73,255,0.30), transparent 42%),
    rgba(127,73,255,0.10);
  transform: translateY(-2px);
}

.genre-gateway-tile .genre-icon,
.genre-gateway-tile strong,
.genre-gateway-tile em,
.genre-gateway-tile small {
  display: block;
}

.genre-gateway-tile .genre-icon {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.genre-gateway-tile strong {
  font-size: 0.98rem;
  line-height: 1.2;
}

.genre-gateway-tile em {
  margin-top: 6px;
  color: #aeb4c4;
  font-style: normal;
  font-size: 0.85rem;
}

.genre-gateway-tile small {
  margin-top: 10px;
  color: #d9b3ff;
  font-weight: 900;
}

.expandable-shelf-header .shelf-count {
  white-space: nowrap;
}

@media (max-width: 700px) {
  .genre-gateway-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .genre-gateway-tile {
    min-height: 112px;
    padding: 12px;
  }

  .genre-see-all {
    width: 100%;
    text-align: center;
  }
}

/* =========================
   Book Page Affiliate Card
========================= */

.book-detail-page .affiliate-buy-card {
  background:
    radial-gradient(circle at top left, rgba(255, 184, 77, 0.14), transparent 40%),
    rgba(15, 20, 31, 0.94);
  border-color: rgba(255, 184, 77, 0.28);
}

.affiliate-format-list {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.affiliate-format-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
  border: 1px solid rgba(255,255,255,0.08);
}

.affiliate-format-row span {
  color: #d9ddec;
  font-weight: 800;
}

.affiliate-format-row.is-unavailable {
  opacity: 0.55;
}

.amazon-buy-button {
  display: grid;
  gap: 3px;
  text-align: center;
  text-decoration: none;
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 14px;
  color: #111827;
  background: linear-gradient(135deg, #ffd15c, #ff9900);
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(255, 153, 0, 0.18);
}

.amazon-buy-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.amazon-buy-button small {
  font-size: 0.78rem;
  opacity: 0.82;
}

.affiliate-disclosure-small {
  color: #aeb4c4;
  font-size: 0.78rem;
  line-height: 1.45;
  margin: 12px 0 0;
}
