/* ================================================================
   薇薇与魔法之岛 (Vivi and the Magical Island)
   Theme: Magic Island — fairy-dust sparkles, ocean-wave turquoises,
   magical-flora motifs on light tropical background
   ================================================================ */

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

/* ========== CSS VARIABLES ========== */
:root {
  /* Background */
  --bg: #f5faf8;
  --bg-warm: #fef9f0;
  --bg-card: #ffffff;

  /* Text */
  --text: #1a3c4a;
  --text-soft: #4a6a7a;
  --text-muted: #7a9aaa;

  /* Accent — Ocean Turquoise */
  --accent: #14a3a8;
  --accent-dark: #0d7377;
  --accent-light: #7dd3d8;

  /* Fairy Dust Gold */
  --gold: #f5d76e;
  --gold-dark: #c9a84c;

  /* Magical Flora */
  --pink-fierce: #ff7eb3;
  --danger-red: #e74c6f;
  --purple-magic: #8b5cf6;

  /* Header */
  --header-bg: #0a3a3a;
  --nav-hover: #14a3a8;

  /* Utility accents */
  --uniform-navy: #1a3c4a;
  --steel-light: #c9d8e0;

  /* Typography */
  --font-serif: 'Noto Serif SC', 'SimSun', 'Songti SC', serif;
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;

  /* Spacing */
  --section-padding: 60px;
  --max-width: 1200px;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-dark); }

/* ========== 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 & NAVIGATION ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-bg);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 2px 12px rgba(10,58,58,0.3);
}

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

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}
.logo img { width: 32px; height: 32px; border-radius: 4px; }

/* Nav */
.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}
.nav-links a {
  color: var(--accent-light);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(20,163,168,0.15);
}

/* Header CTA Button */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff !important;
  padding: 10px 22px !important;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s;
  box-shadow: 0 3px 10px rgba(13,115,119,0.3);
}
.btn-cta:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--text) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(245,215,110,0.4);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}
.hamburger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ========== HERO SECTION ========== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 24px 100px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #0a3a3a 0%, #0d7377 60%, #14a3a8 100%);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(245,215,110,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,126,179,0.10) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(139,92,246,0.08) 0%, transparent 60%);
  pointer-events: none;
}

/* Fairy-dust sparkle dots overlay */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 15% 20%, rgba(245,215,110,0.6) 50%, transparent 50%),
    radial-gradient(2px 2px at 25% 35%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(2px 2px at 60% 15%, rgba(245,215,110,0.5) 50%, transparent 50%),
    radial-gradient(2px 2px at 75% 25%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(2px 2px at 40% 60%, rgba(245,215,110,0.5) 50%, transparent 50%),
    radial-gradient(2px 2px at 85% 55%, rgba(255,126,179,0.4) 50%, transparent 50%),
    radial-gradient(2px 2px at 10% 75%, rgba(255,255,255,0.3) 50%, transparent 50%),
    radial-gradient(2px 2px at 90% 80%, rgba(245,215,110,0.4) 50%, transparent 50%),
    radial-gradient(2px 2px at 50% 85%, rgba(139,92,246,0.3) 50%, transparent 50%),
    radial-gradient(2px 2px at 30% 90%, rgba(255,255,255,0.2) 50%, transparent 50%);
  pointer-events: none;
}

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

.hero-title-main {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-bottom: 10px;
  line-height: 1.3;
}
.hero-title-main .jp-subtitle {
  display: block;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--accent-light);
  margin-top: 4px;
  letter-spacing: 0.05em;
}

.hero-tagline {
  font-size: 1.05rem;
  color: var(--steel-light);
  max-width: 600px;
  margin: 0 auto 8px;
  line-height: 1.7;
}

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

/* ========== SECTIONS ========== */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-padding) 24px;
}
.section-alt {
  background: var(--bg-warm);
}
.section-no-padding {
  padding: 0;
}

/* Section title group */
.section-title-group {
  text-align: center;
  margin-bottom: 36px;
}
.section-title-group-spaced {
  margin-top: 48px;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ========== PROSE UTILITIES ========== */
.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 CARDS (index) ========== */
.game-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.game-info-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(10,58,58,0.06);
  border-left: 3px solid var(--accent);
  transition: transform 0.2s;
}
.game-info-card:hover { transform: translateY(-3px); }
.game-info-card .info-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}
.game-info-card .info-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.game-info-card .info-value {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-dark);
}

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

/* ========== FEATURE CARDS (index) ========== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 2px 8px rgba(10,58,58,0.06);
  border-left: 3px solid var(--accent);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(10,58,58,0.1);
}
.feature-card .feat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}
.feature-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ========== SCREENSHOT GALLERY (index) ========== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.gallery-grid img {
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(10,58,58,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}
.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(10,58,58,0.15);
}

/* ========== LIGHTBOX ========== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
}

/* ========== REVIEWS (index) ========== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.review-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(10,58,58,0.06);
  border-top: 3px solid var(--gold);
}
.review-card .review-stars {
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.review-card p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 10px;
}
.review-card .review-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ========== CTA BANNER (index) ========== */
.cta-banner {
  text-align: center;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  padding: 60px 24px;
  color: #fff;
}
.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.cta-banner p {
  font-size: 1.05rem;
  color: var(--accent-light);
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.btn-cta-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--text) !important;
  padding: 14px 36px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(245,215,110,0.3);
}
.btn-cta-large:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255,255,255,0.3);
}

/* ========== CONTENT SECTION (sub-pages) ========== */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-padding) 24px;
}
/* Content-section H2 styled as H1 (since hero H1 is the page H1) */
.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: 700;
  color: var(--accent-dark);
  margin: 32px 0 12px;
}
.content-section p {
  margin-bottom: 16px;
  color: var(--text-soft);
  line-height: 1.85;
}
.content-section .highlight-box {
  background: linear-gradient(135deg, rgba(20,163,168,0.08), rgba(245,215,110,0.08));
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 24px 0;
}

/* ========== CHAPTER TITLES (story.html) ========== */
.chapter-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 32px 0 8px;
}

/* ========== TABLE STYLES ========== */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}
th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(10,58,58,0.1);
}
th {
  background: var(--accent-dark);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
}
td { color: var(--text-soft); }
tr:nth-child(even) td { background: rgba(20,163,168,0.04); }
.td-highlight {
  color: var(--pink-fierce);
  font-weight: 700;
}

/* ========== FAQ ACCORDION ========== */
.faq-list { margin-top: 24px; }
.faq-item {
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 6px rgba(10,58,58,0.05);
  overflow: hidden;
  border-left: 3px solid var(--accent);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 24px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: rgba(20,163,168,0.05); }
.faq-question .faq-arrow {
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s;
  flex-shrink: 0;
}
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 24px;
}
.faq-item.open .faq-answer {
  max-height: 800px;
  padding: 0 24px 20px;
}
.faq-answer p {
  margin-bottom: 12px;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ========== CHARACTER CARDS (characters.html) ========== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.char-card {
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(10,58,58,0.06);
  border-bottom: 4px solid var(--accent);
  transition: transform 0.2s, box-shadow 0.2s;
}
.char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(10,58,58,0.12);
}
.char-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}
.char-info {
  padding: 20px;
}
.char-info h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 4px;
}
.char-info .char-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.char-info .char-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.char-tag {
  background: rgba(20,163,168,0.1);
  color: var(--accent-dark);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.char-info p {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.7;
}

/* ========== GUIDE STEPS ========== */
.guide-steps-wrapper {
  counter-reset: guide-step;
}
.guide-step {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(10,58,58,0.05);
  border-left: 4px solid var(--accent);
  position: relative;
}
.guide-step h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 8px;
  counter-increment: guide-step;
}
.guide-step h3::before {
  content: '#' counter(guide-step) ' ';
  color: var(--accent);
  font-weight: 900;
}
.guide-step p {
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.8;
}
.guide-intro {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 20px;
}
.route-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--purple-magic);
  margin: 28px 0 8px;
}
.route-desc {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

/* ========== CONTENT LIST CLASSES ========== */
.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-pink { color: var(--pink-fierce); }
.strong-red { color: var(--danger-red); }
.strong-gold { color: var(--gold-dark); }
.strong-muted { color: var(--text-muted); }
.strong-navy { color: var(--uniform-navy); }

/* ========== SYSTEM REQUIREMENTS (faq.html) ========== */
.sys-reqs-h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--uniform-navy);
  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;
}
.faq-note {
  margin-top: 16px;
}

/* ========== SECTION SUBHEADING (characters.html) ========== */
.section-subheading {
  text-align: center;
  margin: 40px 0 24px;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--header-bg);
  color: var(--accent-light);
  text-align: center;
  padding: 30px 24px;
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  :root { --section-padding: 40px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--header-bg);
    padding: 16px;
    border-top: 2px solid var(--accent);
  }
  .nav-links.active { display: flex; }
  .hamburger { display: flex; }

  .hero { padding: 50px 20px 64px; }
  .hero-title-main { font-size: 2rem; }
  .hero-subpage-title { font-size: 1.6rem; }

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

  .feature-grid,
  .review-card,
  .char-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 36px 16px 48px; }
  .hero-title-main { font-size: 1.5rem; }
  .hero-title-main .jp-subtitle { font-size: 0.9rem; }
  .hero-tagline { font-size: 0.9rem; }

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

  .game-info-grid { grid-template-columns: repeat(2, 1fr); }
  .section-title { font-size: 1.4rem; }
  .content-section h2 { font-size: 1.4rem; }
  .cta-banner h2 { font-size: 1.4rem; }

  .char-card img { height: 220px; }
}
