/* ========== CSS Variables — Shadow Gothic Theme ========== */
:root {
  --deep-purple: #4A148C;
  --blood-red: #C62828;
  --bone-white: #F5F0EB;
  --dark-gold: #FFA000;
  --purple-dark: #311B5C;
  --purple-mid: #7B1FA2;
  --purple-light: #CE93D8;
  --red-dark: #8E0000;
  --gold-light: #FFD54F;
  --bg: #FAF8F5;
  --bg-warm: #F5F0EB;
  --bg-card: #FFFFFF;
  --text: #1a1a2e;
  --text-soft: #5a5470;
  --text-muted: #8a8490;
  --accent: #4A148C;
  --accent-alt: #C62828;
  --accent-gold: #FFA000;
  --border: #e0d8d0;
  --shadow-soft: 0 2px 12px rgba(74,20,140,0.08);
  --shadow-card: 0 4px 20px rgba(74,20,140,0.12);
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Georgia', 'Noto Serif SC', serif;
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

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(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-alt);
}

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

/* ========== Utility Classes ========== */

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

/* Prose centered */
.prose-centered {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 32px;
  color: var(--text-soft);
  line-height: 1.85;
  font-size: 0.95rem;
}
.prose-centered:last-of-type {
  margin-bottom: 40px;
}

/* Game info desc */
.game-info-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0;
}

/* Content lists */
.content-list {
  list-style: disc;
  padding-left: 20px;
}
.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);
}

/* Colored strong tags */
.strong-purple { color: var(--deep-purple); }
.strong-red { color: var(--blood-red); }
.strong-gold { color: var(--dark-gold); }
.strong-muted { color: var(--text-muted); }

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

/* Table scroll */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

/* Section sub-heading (characters page) */
.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text);
}

/* Section title group spaced */
.section-title-group-spaced {
  margin-top: 48px;
}

/* Section no-padding */
.section-no-padding {
  padding: 0;
}

/* Hero title main (visible title on index) */
.hero-title-main {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 12px;
  line-height: 1.3;
}
.hero-title-main .en-subtitle {
  display: block;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--gold-light);
  margin-top: 6px;
  letter-spacing: 0.05em;
}

/* Hero subpage */
.hero-subpage {
  padding: 40px 24px 48px;
}
.hero-subpage-title {
  font-size: 2rem;
  font-weight: 700;
}

/* Chapter title */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--deep-purple);
  margin-top: 24px;
  margin-bottom: 8px;
}

/* Guide classes */
.guide-intro {
  color: var(--text-soft);
  margin-bottom: 24px;
  font-size: 0.98rem;
}
.route-desc {
  color: var(--text-soft);
  margin-bottom: 16px;
}
.route-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--deep-purple);
  margin-top: 28px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--purple-light);
}

/* Guide steps wrapper */
.guide-steps-wrapper {
  counter-reset: guide-step;
}

/* FAQ intro */
.faq-intro {
  color: var(--text-soft);
  margin-bottom: 32px;
}
.faq-note {
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* System requirements */
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--deep-purple);
  margin-top: 24px;
  margin-bottom: 12px;
}
.sys-reqs-h3:first-of-type {
  margin-top: 8px;
}
.sys-note {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ========== Header ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--purple-dark);
  border-bottom: 3px solid var(--dark-gold);
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bone-white);
  text-decoration: none;
}
.site-logo img {
  width: 28px;
  height: 28px;
}
.site-logo span {
  color: var(--dark-gold);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--bone-white);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  background: rgba(255,255,255,0.1);
  color: var(--dark-gold);
}
.nav-cta {
  background: var(--blood-red) !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 9px 20px !important;
  margin-left: 4px;
  letter-spacing: 0.02em;
}
.nav-cta:hover {
  background: var(--red-dark) !important;
  color: var(--gold-light) !important;
}
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--bone-white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(74,20,140,0.85) 0%, rgba(26,26,46,0.92) 100%);
  z-index: 1;
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 80px 24px;
}
.hero-tagline {
  color: var(--bone-white);
  font-size: 1.15rem;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 8px;
  line-height: 1.7;
}

/* Per-page hero backgrounds */
.hero-home .hero-bg {
  background: url('../img/hero.webp') center/cover no-repeat;
}
.hero-guide .hero-bg {
  background: url('../img/screenshot-04.jpg') center/cover no-repeat;
}
.hero-story .hero-bg {
  background: url('../img/screenshot-05.jpg') center/cover no-repeat;
}
.hero-characters .hero-bg {
  background: url('../img/screenshot-06.jpg') center/cover no-repeat;
}
.hero-faq .hero-bg {
  background: url('../img/hero.webp') center/cover no-repeat;
}

/* ========== Sections ========== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 24px;
}
.section-alt {
  background: var(--bg-warm);
  padding: 64px 24px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 12px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.95rem;
  margin-bottom: 40px;
}
.section-title-group {
  margin-bottom: 40px;
}

/* ========== Info Cards (index) ========== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 16px;
}
.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border-top: 3px solid var(--deep-purple);
  transition: transform 0.2s, box-shadow 0.2s;
}
.info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.info-card-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.info-card-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.info-card-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--deep-purple);
}

/* ========== Feature Cards (index) ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--blood-red);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 8px;
}
.feature-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.7;
}
.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  display: block;
}

/* ========== Screenshot Gallery ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.gallery-item {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s, box-shadow 0.25s;
}
.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-card);
}
.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* ========== Lightbox ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox.active {
  display: flex;
}
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius);
  box-shadow: 0 4px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: var(--bone-white);
  cursor: pointer;
  z-index: 2001;
  background: none;
  border: none;
  line-height: 1;
}

/* ========== Reviews (index) ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-soft);
  border-top: 3px solid var(--dark-gold);
  position: relative;
}
.review-card::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--purple-light);
  opacity: 0.3;
  position: absolute;
  top: 8px;
  left: 16px;
  line-height: 1;
}
.review-text {
  color: var(--text-soft);
  font-size: 0.93rem;
  line-height: 1.8;
  padding-top: 12px;
  margin-bottom: 12px;
}
.review-author {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
}

/* ========== CTA Banner (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--deep-purple), var(--purple-dark));
  border-top: 3px solid var(--dark-gold);
  padding: 60px 24px;
  text-align: center;
}
.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: #fff;
  margin-bottom: 12px;
}
.cta-banner p {
  color: var(--bone-white);
  opacity: 0.85;
  margin-bottom: 28px;
  font-size: 1.05rem;
}
.cta-btn {
  display: inline-block;
  background: var(--blood-red);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px 48px;
  border-radius: var(--radius);
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
  text-decoration: none;
}
.cta-btn:hover {
  background: var(--red-dark);
  color: var(--gold-light);
  transform: translateY(-2px);
}

/* ========== Content Section (sub-pages) ========== */
.content-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}
.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.35rem;
  font-weight: 700;
  color: var(--deep-purple);
  margin-top: 28px;
  margin-bottom: 10px;
}
.content-section p {
  color: var(--text-soft);
  line-height: 1.85;
  margin-bottom: 16px;
  font-size: 0.97rem;
}
.content-section ul,
.content-section ol {
  margin-bottom: 20px;
}

/* ========== Story Page ========== */
.story-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--deep-purple);
}
.story-block h3 {
  margin-top: 0;
}

/* ========== Character Cards ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.char-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}
.char-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.char-card-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.char-card-body {
  padding: 20px;
}
.char-card-body h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 6px;
}
.char-card-body .char-role {
  display: inline-block;
  background: var(--deep-purple);
  color: #fff;
  font-size: 0.78rem;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.char-card-body p {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}
.char-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.char-trait {
  background: var(--bg-warm);
  color: var(--text-soft);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ========== FAQ Accordion ========== */
.faq-list {
  margin-top: 8px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 48px 18px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  position: relative;
  line-height: 1.5;
  font-family: var(--font-sans);
}
.faq-question::after {
  content: '+';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--deep-purple);
  transition: transform 0.3s;
}
.faq-item.open .faq-question::after {
  content: '\2212';
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}
.faq-item.open .faq-answer {
  max-height: 800px;
  padding: 0 20px 20px;
}
.faq-answer p {
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.93rem;
}
.faq-answer ul,
.faq-answer ol {
  color: var(--text-soft);
  margin-bottom: 12px;
}

/* ========== System Requirements Table ========== */
.sys-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 0.92rem;
}
.sys-table th,
.sys-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.sys-table th {
  background: var(--deep-purple);
  color: #fff;
  font-weight: 600;
  width: 30%;
}
.sys-table td {
  color: var(--text-soft);
}
.sys-table tr:nth-child(even) td {
  background: var(--bg-warm);
}
.sys-table caption {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 8px;
  text-align: left;
}

/* ========== Footer ========== */
.site-footer {
  background: var(--purple-dark);
  text-align: center;
  padding: 24px;
  border-top: 3px solid var(--dark-gold);
}
.site-footer p {
  color: var(--bone-white);
  opacity: 0.75;
  font-size: 0.85rem;
}

/* ========== Footer decoration (pseudo-element) ========== */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--deep-purple), var(--blood-red), var(--dark-gold), var(--blood-red), var(--deep-purple));
  z-index: 9999;
  pointer-events: none;
}

/* ========== Responsive: 768px ========== */
@media (max-width: 768px) {
  .hero-title-main {
    font-size: 2rem;
  }
  .hero-title-main .en-subtitle {
    font-size: 0.9rem;
  }
  .hero-subpage-title {
    font-size: 1.6rem;
  }
  .hero-inner {
    padding: 60px 20px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .reviews-grid {
    grid-template-columns: 1fr;
  }
  .char-grid {
    grid-template-columns: 1fr;
  }
  .info-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .section-title {
    font-size: 1.8rem;
  }
  .content-section h2 {
    font-size: 1.8rem;
  }
  .hamburger {
    display: flex;
  }
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--purple-dark);
    flex-direction: column;
    padding: 12px 0;
    border-top: 2px solid var(--dark-gold);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  .site-nav.open {
    display: flex;
  }
  .site-nav a {
    padding: 12px 24px;
    border-radius: 0;
  }
  .nav-cta {
    margin: 8px 16px;
    border-radius: var(--radius) !important;
    text-align: center;
  }
}

/* ========== Responsive: 480px ========== */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
  .hero-title-main {
    font-size: 1.6rem;
  }
  .hero-title-main .en-subtitle {
    font-size: 0.8rem;
  }
  .hero-subpage-title {
    font-size: 1.35rem;
  }
  .hero-inner {
    padding: 48px 16px;
  }
  .hero-tagline {
    font-size: 0.95rem;
  }
  .info-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .info-card {
    padding: 16px 10px;
  }
  .info-card-value {
    font-size: 1.2rem;
  }
  .section {
    padding: 40px 16px;
  }
  .section-alt {
    padding: 40px 16px;
  }
  .feature-grid {
    gap: 16px;
  }
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .gallery-item img {
    height: 180px;
  }
  .char-card-img {
    height: 220px;
  }
  .cta-banner {
    padding: 40px 16px;
  }
  .cta-banner h2 {
    font-size: 1.5rem;
  }
  .cta-btn {
    padding: 12px 32px;
    font-size: 1rem;
  }
  .content-section {
    padding: 32px 16px 48px;
  }
}
