/* ========== CSS Variables ========== */
:root {
  /* Primary palette */
  --gold: #FFD54F;
  --gold-dark: #F9A825;
  --gold-glow: #FFE082;
  --purple: #6A1B9A;
  --purple-deep: #4A148C;
  --purple-light: #9C27B0;
  --blood: #C62828;
  --blood-dark: #8E0000;
  --blood-light: #EF5350;
  --parchment: #F5F0E0;
  --parchment-dark: #E8DCC8;
  --parchment-light: #FEF9EF;

  /* Neutrals */
  --bg: #FDFAF3;
  --bg-warm: #F9F3E6;
  --bg-card: #FFFFFF;
  --text: #2C1810;
  --text-soft: #5D4037;
  --text-muted: #8D6E63;
  --border: #D7CCC8;
  --border-light: #EFEBE0;

  /* Accent states */
  --accent-gold: #FF8F00;
  --accent-purple-bright: #AA00FF;
  --shadow-gold: rgba(255, 213, 79, 0.25);
  --shadow-purple: rgba(106, 27, 154, 0.15);
  --shadow-blood: rgba(198, 40, 40, 0.1);

  /* Typography */
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "STSong", "SimSun", serif;

  /* Layout */
  --max-width: 1200px;
  --header-height: 64px;
  --radius: 8px;
  --radius-lg: 12px;
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--purple-light);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== Screen Reader Only ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========== Utility Classes ========== */
.prose {
  max-width: 800px;
  margin: 0 auto;
}

.section-alt {
  background: var(--bg-warm);
}

.content-list {
  list-style: disc;
  padding-left: 24px;
}

.content-list-num {
  list-style: decimal;
  padding-left: 24px;
}

.content-li {
  margin-bottom: 5px;
  color: var(--text-soft);
}

.content-li-sm {
  margin-bottom: 4px;
  color: var(--text-soft);
}

.content-li-md {
  margin-bottom: 8px;
  color: var(--text-soft);
}

.content-li-lg {
  margin-bottom: 10px;
  color: var(--text-soft);
}

.strong-gold {
  color: var(--gold-dark);
}

.strong-red {
  color: var(--blood);
}

.strong-purple {
  color: var(--purple);
}

.strong-muted {
  color: var(--text-muted);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.td-highlight {
  color: var(--blood);
  font-weight: 700;
}

.guide-intro {
  color: var(--text-soft);
  margin-bottom: 20px;
  line-height: 1.8;
}

.route-desc {
  color: var(--text-soft);
  margin-bottom: 16px;
}

.route-heading {
  color: var(--purple);
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--gold);
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--purple-deep);
  margin: 20px 0 8px;
}

.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--purple-deep);
}

.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--purple);
  margin: 24px 0 12px;
}
.sys-reqs-h3:first-of-type {
  margin-top: 0;
}

/* ========== Header ========== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 12px var(--shadow-purple);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
}

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

.logo-img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 2px solid var(--gold);
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav a {
  display: block;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--purple-deep) !important;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px var(--shadow-gold);
  white-space: nowrap;
}

.btn-cta:hover {
  background: linear-gradient(135deg, var(--gold-glow), var(--gold));
  box-shadow: 0 4px 16px var(--shadow-gold);
  transform: translateY(-1px);
  color: var(--purple-deep) !important;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 24px 100px;
  text-align: center;
  background: linear-gradient(135deg, var(--purple-deep), #311B52, var(--purple));
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 213, 79, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(198, 40, 40, 0.06) 0%, transparent 50%);
  z-index: 1;
}

/* Page-specific hero backgrounds */
.hero-home .hero-bg { background-image: url('../img/header.jpg'); }
.hero-guide .hero-bg { background-image: url('../img/screenshot-01.jpg'); }
.hero-story .hero-bg { background-image: url('../img/screenshot-03.jpg'); }
.hero-characters .hero-bg { background-image: url('../img/screenshot-02.jpg'); }
.hero-faq .hero-bg { background-image: url('../img/header.jpg'); }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title-main {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 0.95rem;
  color: var(--parchment-dark);
  max-width: 600px;
  margin: 0 auto;
}

/* Sub-page hero (compact) */
.hero-subpage {
  padding: 50px 24px 60px;
}

.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

/* ========== Section ========== */
section {
  padding: 72px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--blood));
  border-radius: 2px;
}

.section-header p {
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 600px;
  margin: 12px auto 0;
}

/* ========== Feature Cards (Index) ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  border-left: 4px solid var(--gold);
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--shadow-purple);
  border-left-color: var(--purple);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ========== About / Game Intro Section ========== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: center;
}

.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow-purple);
  border: 3px solid var(--border-light);
}

.about-text h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 16px;
}

.about-text p {
  color: var(--text-soft);
  margin-bottom: 12px;
  line-height: 1.8;
}

.info-table {
  margin-top: 20px;
  border-collapse: collapse;
  width: 100%;
}

.info-table th,
.info-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.info-table th {
  color: var(--purple-deep);
  font-weight: 600;
  width: 100px;
}

.info-table td {
  color: var(--text-soft);
}

/* ========== Screenshot Gallery ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-light);
  transition: all 0.3s;
  aspect-ratio: 16/9;
}

.gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--gold);
  box-shadow: 0 4px 16px var(--shadow-gold);
}

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

/* ========== Reviews ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}

.review-card::before {
  content: '\201C';
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: Georgia, serif;
  font-size: 4rem;
  color: var(--gold-dark);
  opacity: 0.3;
  line-height: 1;
}

.review-text {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
  padding-top: 12px;
}

.review-author {
  font-weight: 600;
  color: var(--purple-deep);
  font-size: 0.9rem;
}

.review-rating {
  color: var(--gold-dark);
  font-size: 0.9rem;
}

/* ========== CTA Banner ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  text-align: center;
  padding: 64px 24px;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,213,79,0.1), transparent 70%);
}

.cta-banner h2 {
  position: relative;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

.cta-banner p {
  position: relative;
  color: rgba(255,255,255,0.8);
  margin-bottom: 24px;
  font-size: 1rem;
}

.cta-banner .btn-cta {
  position: relative;
  font-size: 1.05rem;
  padding: 14px 36px;
}

/* ========== Content Section (sub-pages) ========== */
.content-section {
  padding: 56px 24px;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--purple-deep);
  margin: 32px 0 12px;
}

.content-section p {
  color: var(--text-soft);
  margin-bottom: 16px;
  line-height: 1.85;
}

/* ========== Guide Steps ========== */
.guide-step {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--purple);
}

.guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50%;
  margin-bottom: 10px;
}

.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin: 0 0 8px 0;
}

.guide-tip {
  background: rgba(255, 213, 79, 0.12);
  border: 1px solid rgba(255, 213, 79, 0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.92rem;
  color: var(--text-soft);
}

.guide-tip strong {
  color: var(--gold-dark);
}

/* ========== Character Cards ========== */
.chars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}

.char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px var(--shadow-purple);
  border-color: var(--gold);
}

.char-img {
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--bg-warm);
}

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

.char-info {
  padding: 16px;
}

.char-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 4px;
}

.char-role {
  font-size: 0.82rem;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 8px;
}

.char-desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.char-tag {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(106, 27, 154, 0.08);
  color: var(--purple);
  font-size: 0.78rem;
  border-radius: 12px;
  border: 1px solid rgba(106, 27, 154, 0.15);
}

/* ========== Story Chapters ========== */
.chapter-block {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  border-left: 4px solid var(--gold);
}

.chapter-block h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--purple-deep);
  margin-bottom: 8px;
}

.chapter-block p {
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.7;
}

/* ========== FAQ Accordion ========== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.faq-question {
  width: 100%;
  padding: 16px 44px 16px 18px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: var(--purple-deep);
  position: relative;
  font-family: var(--font-sans);
  line-height: 1.5;
}

.faq-question::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--gold-dark);
  transition: transform 0.3s;
}

.faq-question[aria-expanded="true"]::after {
  content: '\2212';
  transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer.open {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 18px 18px;
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.8;
}

.faq-answer-inner p.mt-sm {
  margin-top: 10px;
}

.faq-answer-inner p.mt-md {
  margin-top: 12px;
}

/* ========== System Requirements Table ========== */
.sys-table {
  width: 100%;
  max-width: 700px;
  border-collapse: collapse;
  margin: 16px 0;
}

.sys-table th,
.sys-table td {
  padding: 10px 16px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 0.92rem;
}

.sys-table th {
  background: rgba(106, 27, 154, 0.06);
  color: var(--purple-deep);
  font-weight: 600;
  width: 120px;
}

.sys-table td {
  color: var(--text-soft);
}

/* ========== Lightbox ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
  border: 2px solid var(--gold);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 300;
}

/* ========== Series Timeline ========== */
.series-timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  padding-left: 30px;
}

.series-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold), var(--purple), var(--blood));
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding-left: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 8px;
  width: 14px;
  height: 14px;
  background: var(--gold);
  border: 2px solid var(--purple);
  border-radius: 50%;
}

.timeline-year {
  font-weight: 700;
  color: var(--purple-deep);
  font-size: 0.9rem;
}

.timeline-title {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.timeline-desc {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin-top: 4px;
}

/* ========== Footer ========== */
footer {
  background: var(--purple-deep);
  text-align: center;
  padding: 28px 24px;
  border-top: 3px solid var(--gold);
}

footer p {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
}

/* ========== Responsive: 768px ========== */
@media (max-width: 768px) {
  .hero-title-main {
    font-size: 2.2rem;
  }

  .hero-subpage-title {
    font-size: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .chars-grid {
    grid-template-columns: 1fr 1fr;
  }

  nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--purple-deep);
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 2px solid var(--gold);
    padding: 8px 0;
  }

  nav.open {
    display: flex;
  }

  nav a {
    padding: 12px 24px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .hamburger {
    display: flex;
  }

  section {
    padding: 48px 20px;
  }

  .content-section {
    padding: 36px 20px;
  }

  .content-section h2 {
    font-size: 1.8rem;
  }
}

/* ========== Responsive: 480px ========== */
@media (max-width: 480px) {
  .hero-title-main {
    font-size: 1.7rem;
  }

  .hero-subpage-title {
    font-size: 1.3rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .chars-grid {
    grid-template-columns: 1fr;
  }

  .header-inner {
    padding: 0 16px;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .cta-banner h2 {
    font-size: 1.5rem;
  }

  .btn-cta {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}
