/* ========================================================
   魔法少女的魔女审判 (Magical Girl Witch Trial)
   Witch Trial Courtroom Theme
   Courthouse-oak browns + Verdict-gavel golds
   Magical scales-of-justice motifs on light judicial bg
   ======================================================== */

/* ========== FONT IMPORTS ========== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ========== CSS VARIABLES ========== */
:root {
  /* Backgrounds — judicial parchment */
  --bg: #faf6f0;
  --bg-card: #ffffff;
  --bg-warm: #f7f2ea;
  --bg-alt: #f0ebe0;

  /* Text */
  --text: #2c1810;
  --text-soft: #6b5a4a;
  --text-muted: #8c7b6b;
  --text-inverse: #f5efe6;

  /* Accent — oak browns & verdict golds */
  --accent: #7a4e2c;
  --accent-light: #a0714a;
  --accent-pale: #e8dcc8;
  --accent-dark: #3d2010;

  /* Verdict gold */
  --gold: #c9a84c;
  --gold-light: #dcc070;
  --gold-pale: #f5eed8;

  /* Secondary accents */
  --judicial-red: #8b2020;
  --crimson-accent: #6b1520;
  --deep-purple: #4a2554;
  --success-green: #3d6b3d;
  --danger-red: #8b2020;

  /* Header */
  --header-bg: #2c1810;
  --header-border: #c9a84c;

  /* Shadows & borders */
  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.06);
  --shadow-md: 0 4px 12px rgba(44, 24, 16, 0.08);
  --shadow-lg: 0 8px 30px rgba(44, 24, 16, 0.1);
  --border: #d4c8b4;
  --border-light: #e8dcc8;

  /* Fonts */
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  --font-sans: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* Spacing */
  --max-width: 1120px;
  --content-width: 820px;
}

/* ========== 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.8;
  min-height: 100vh;
  /* Subtle parchment texture via pseudo-element on body would need a fixed bg, skip for clarity */
}

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

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

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

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 3px solid var(--header-border);
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.15);
}

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

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

.logo-icon {
  font-size: 1.8rem;
  line-height: 1;
}

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

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav a {
  color: var(--text-inverse);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.2s;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--gold);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* CTA button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gold) !important;
  color: var(--header-bg) !important;
  padding: 8px 20px !important;
  border-radius: 4px;
  font-weight: 700 !important;
  font-size: 0.92rem !important;
  letter-spacing: 0.5px;
  transition: background 0.2s, transform 0.15s !important;
}

.btn-cta:hover {
  background: var(--gold-light) !important;
  transform: translateY(-1px);
}

.btn-cta::before {
  content: '⚖';
  font-size: 0.9rem;
}

/* Hamburger */
.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(--text-inverse);
  border-radius: 1px;
  transition: transform 0.25s, opacity 0.25s;
}

/* ========== HERO ========== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  overflow: hidden;
  background: var(--header-bg);
}

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

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(44, 24, 16, 0.35) 0%,
    rgba(44, 24, 16, 0.55) 60%,
    rgba(44, 24, 16, 0.75) 100%
  );
}

/* Decorative scales-of-justice divider at hero bottom */
.hero::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  z-index: 2;
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 60px 24px;
  max-width: 700px;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--gold-light);
  line-height: 1.8;
  opacity: 0.92;
}

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

/* Sub-page hero — reduced height */
.hero-subpage {
  min-height: 260px;
}

.hero-subpage-title {
  font-size: 2.2rem !important;
}

/* ========== MAIN LAYOUT ========== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.content-narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 60px 0;
}

.section-alt {
  background: var(--bg-warm);
  padding: 60px 0;
}

/* ========== DECORATIVE DIVIDERS ========== */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 12px auto 40px;
  max-width: 400px;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.section-divider::before {
  background: linear-gradient(to left, var(--gold), transparent);
}
.section-divider::after {
  background: linear-gradient(to right, var(--gold), transparent);
}

.section-divider-icon {
  font-size: 1.4rem;
  color: var(--gold);
}

/* ========== SECTION HEADINGS ========== */
.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto 44px;
}

/* ========== GAME INFO CARDS (index) ========== */
.game-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.info-card {
  background: var(--bg-card);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.info-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.info-card-value {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

/* ========== FEATURE CARDS (index) ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.feature-icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}

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

/* ========== SCREENSHOT GALLERY ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-grid img {
  border-radius: 4px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.gallery-grid img:hover {
  box-shadow: var(--shadow-lg);
  transform: scale(1.03);
}

/* ========== REVIEW CARDS (index) ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.review-card::before {
  content: '\201C';
  display: block;
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1;
  color: var(--gold);
  margin-bottom: 8px;
}

.review-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 14px;
  font-style: italic;
}

.review-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== CTA BANNER (index only) ========== */
.cta-banner {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  padding: 52px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(201,168,76,0.08), transparent 60%),
    radial-gradient(circle at 80% 50%, rgba(201,168,76,0.08), transparent 60%);
}

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

.cta-banner p {
  position: relative;
  font-size: 1.05rem;
  color: var(--gold-light);
  margin-bottom: 28px;
}

.cta-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  background: var(--gold);
  color: var(--accent-dark) !important;
  padding: 14px 40px;
  border-radius: 4px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  transition: background 0.2s, transform 0.15s;
}

.cta-big:hover {
  background: var(--gold-light) !important;
  transform: translateY(-2px);
}

.cta-big::before {
  content: '⚖';
  font-size: 1.2rem;
}

/* ========== CONTENT SECTION (sub-pages) ========== */
.content-section {
  padding: 60px 0;
}

.content-section h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 12px;
  border-left: 4px solid var(--gold);
  padding-left: 16px;
}

.content-section h2:first-of-type {
  margin-top: 0;
}

.content-section h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin: 28px 0 10px;
}

.content-section p {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.9;
  margin-bottom: 16px;
}

/* ========== GUIDE PAGE ========== */
.guide-step {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--gold);
  border-radius: 4px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.guide-step-number {
  display: inline-block;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 3px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.tip-box {
  background: var(--gold-pale);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 16px 20px;
  margin: 20px 0;
}

.tip-box strong {
  color: var(--accent);
}

/* ========== STORY PAGE ========== */
.chapter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.theme-section {
  background: var(--bg-warm);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 0 4px 4px 0;
}

/* ========== CHARACTERS PAGE ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.char-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.char-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 4px;
}

.char-card .char-va {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 8px;
}

.char-card .char-sin {
  display: inline-block;
  background: var(--accent-pale);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
}

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

.section-subheading {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--accent);
  margin: 40px 0 24px;
}

/* ========== FAQ PAGE ========== */
.faq-list {
  max-width: var(--content-width);
  margin: 0 auto;
}

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

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  line-height: 1.5;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-icon {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--gold);
  transition: transform 0.25s;
  margin-left: 12px;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

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

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

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

.faq-answer-inner p {
  margin-bottom: 10px;
}

/* ========== SYSTEM REQUIREMENTS TABLE ========== */
.table-scroll {
  overflow-x: auto;
  margin: 24px 0;
}

.sys-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.sys-table thead {
  background: var(--accent-dark);
  color: #ffffff;
}

.sys-table th {
  padding: 14px 16px;
  font-family: var(--font-serif);
  font-weight: 600;
  text-align: left;
}

.sys-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.sys-table tbody tr:nth-child(even) {
  background: var(--bg-warm);
}

.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--accent);
  margin: 32px 0 12px;
}

.sys-reqs-h3:first-of-type {
  margin-top: 0;
}

/* ========== UTILITY CLASSES ========== */
/* Lists */
.content-list {
  list-style: disc;
  padding-left: 24px;
  margin: 12px 0;
}

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

.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-gold { color: var(--gold); }
.strong-red { color: var(--danger-red); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--accent-dark); }

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

/* Chapter sub-headings (for story page) */
.chapter-subheading {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 16px 0 8px;
}

/* Guide intro & route desc */
.guide-intro {
  font-size: 1rem;
  color: var(--text-soft);
  line-height: 1.8;
  margin-bottom: 24px;
}

.route-desc {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 16px;
}

.route-heading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 20px 0 8px;
}

/* Feature / content intro */
.hero-tagline {
  font-family: var(--font-serif);
}

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

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 2rem;
  color: #ffffff;
  cursor: pointer;
  z-index: 1;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--header-bg);
  border-top: 3px solid var(--header-border);
  padding: 24px;
  text-align: center;
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 14px;
    border-top: 1px solid var(--header-border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  .main-nav.open {
    display: flex;
  }

  .hero-tagline {
    font-size: 2rem;
  }

  .hero {
    min-height: 340px;
  }

  .hero-subpage {
    min-height: 200px;
  }

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

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

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

  .section {
    padding: 40px 0;
  }

  .section-alt {
    padding: 40px 0;
  }
}

@media (max-width: 480px) {
  .hero-tagline {
    font-size: 1.6rem;
  }

  .hero {
    min-height: 280px;
  }

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

  .game-info-grid {
    grid-template-columns: 1fr;
  }

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

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