:root {
  --bg: #0e0b08;
  --bg-2: #1a1410;
  --ink: #e8d9b8;
  --ink-soft: #a89876;
  --accent: #d4af37;
  --accent-2: #f0d878;
  --line: #3a2e1a;
  --danger: #b85a3a;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }

/* HERO */
.hero { text-align: center; padding: 64px 20px 40px; background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line); }
.hero .key { font-size: 64px; margin-bottom: 16px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero h1 { margin: 0 0 12px; font-size: 38px; color: var(--accent); letter-spacing: 2px; font-weight: 400; }
.hero .sub { margin: 0 0 8px; font-style: italic; color: var(--ink-soft); font-size: 17px; }
.hero .author { color: var(--ink-soft); font-size: 14px; letter-spacing: 1px; }
.hero .author strong { color: var(--accent); }

/* NAV */
nav.main { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 16px 12px; background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
nav.main button { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); padding: 8px 14px; border-radius: 20px; font-size: 13px; }
nav.main button.active { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: bold; }
nav.main button:hover { color: var(--accent); border-color: var(--accent); }

/* MAIN CONTENT */
main { max-width: 880px; margin: 0 auto; padding: 32px 20px 80px; }
section { display: none; animation: fadeIn 0.4s ease; }
section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
section h2 { color: var(--accent); font-weight: 400; font-size: 32px; margin: 0 0 24px; letter-spacing: 1px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
section h3 { color: var(--accent-2); font-weight: 400; font-size: 22px; margin: 32px 0 12px; }
section p { line-height: 1.7; color: var(--ink); font-size: 16px; margin: 0 0 16px; }
section blockquote { border-left: 3px solid var(--accent); padding: 12px 20px; margin: 24px 0; font-style: italic; color: var(--ink-soft); background: rgba(212, 175, 55, 0.05); }
section .card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin: 16px 0; }
section .card h4 { margin: 0 0 8px; color: var(--accent-2); font-size: 17px; }
section .card p { margin: 0; font-size: 14px; line-height: 1.5; }

/* FACT CARDS GRID */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0; }
.fact-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.fact-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.fact-card .num { font-size: 13px; color: var(--accent); margin-bottom: 6px; font-style: italic; }
.fact-card .text { font-size: 14px; line-height: 1.5; }

/* QUIZ */
.quiz-q { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 20px; margin: 16px 0; }
.quiz-q h4 { margin: 0 0 16px; color: var(--accent-2); font-size: 17px; line-height: 1.4; }
.quiz-options { display: grid; gap: 8px; }
.quiz-option { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; cursor: pointer; transition: all 0.15s; font-size: 15px; color: var(--ink); text-align: left; }
.quiz-option:hover { border-color: var(--accent); }
.quiz-option.correct { background: rgba(212, 175, 55, 0.15); border-color: var(--accent); color: var(--accent-2); }
.quiz-option.wrong { background: rgba(184, 90, 58, 0.15); border-color: var(--danger); color: #e8907a; }
.quiz-explain { margin-top: 12px; padding: 12px; background: rgba(212, 175, 55, 0.05); border-radius: 6px; font-size: 14px; color: var(--ink-soft); font-style: italic; display: none; }
.quiz-q.answered .quiz-explain { display: block; }
.score-bar { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 20px; text-align: center; }
.score-bar .score-num { font-size: 36px; color: var(--accent); font-weight: bold; }
.score-bar .score-label { color: var(--ink-soft); font-size: 14px; }

/* MAP */
.map-container { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 20px 0; }
.map-svg { width: 100%; height: auto; max-height: 500px; }
.map-legend { display: grid; gap: 8px; margin-top: 12px; }
.legend-item { display: flex; align-items: flex-start; gap: 8px; padding: 10px; background: var(--bg); border-radius: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.legend-text strong { display: block; color: var(--accent-2); font-size: 14px; margin-bottom: 2px; }
.legend-text span { font-size: 13px; color: var(--ink-soft); }

/* COMIC STRIP */
.comic { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: transform 0.2s; }
.panel:hover { transform: scale(1.02); }
.panel img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: var(--bg); }
.panel .caption { padding: 12px; font-size: 13px; color: var(--ink-soft); line-height: 1.4; border-top: 1px solid var(--line); }
.panel .num { display: inline-block; background: var(--accent); color: var(--bg); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: bold; margin-right: 6px; }

/* AUDIOBOOK */
.audiobook { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 24px; margin: 20px 0; }
.audiobook .player { background: var(--bg); border-radius: 6px; padding: 16px; margin: 16px 0; display: flex; align-items: center; gap: 12px; }
.audiobook audio { flex: 1; height: 40px; }
.audiobook .text-body { background: var(--bg); border-radius: 6px; padding: 20px; margin-top: 12px; line-height: 1.8; white-space: pre-wrap; font-size: 15px; color: var(--ink); max-height: 400px; overflow-y: auto; }
.audiobook .text-body::-webkit-scrollbar { width: 8px; }
.audiobook .text-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* GALLERY */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.gallery-item { position: relative; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--bg-2); border: 1px solid var(--line); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item .caption { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px; background: linear-gradient(transparent, rgba(0,0,0,0.85)); color: var(--ink); font-size: 13px; opacity: 0; transition: opacity 0.3s; }
.gallery-item:hover .caption { opacity: 1; }

/* EASTER EGG */
.secret-corner { position: fixed; bottom: 20px; right: 20px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--bg); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4); z-index: 50; transition: transform 0.2s; font-size: 20px; }
.secret-corner:hover { transform: rotate(180deg) scale(1.1); }
.secret-overlay { position: fixed; inset: 0; background: rgba(14, 11, 8, 0.95); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.secret-overlay.show { display: flex; }
.secret-box { background: var(--bg-2); border: 2px solid var(--accent); border-radius: 12px; padding: 32px; max-width: 500px; text-align: center; }
.secret-box h3 { color: var(--accent); margin: 0 0 16px; }
.secret-box p { color: var(--ink); line-height: 1.6; }
.secret-box button { margin-top: 16px; background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 8px 20px; border-radius: 20px; }

/* FOOTER */
footer { text-align: center; padding: 24px; color: var(--ink-soft); font-size: 13px; border-top: 1px solid var(--line); margin-top: 40px; }

@media (max-width: 600px) {
  .hero h1 { font-size: 28px; }
  .hero .sub { font-size: 15px; }
  nav.main button { font-size: 12px; padding: 6px 10px; }
  section h2 { font-size: 24px; }
}
