:root {
  /* Night (default) */
  --bg-dark: #2d2a24;
  --bg-card: #3a3530;
  --bg-hover: #454038;
  --text-primary: #e8e4df;
  --text-secondary: #a09890;
  --accent-gold: #c9a96e;
  --accent-blue: #6ba3d9;
  --accent-purple: #c084fc;
  --border: #8a7a5a;
  --nav-bg: rgba(58, 53, 48, 0.9);
  --modal-bg: rgba(0,0,0,0.85);
  --font-title: 'ZCOOL KuaiLe', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
}

body.day-mode {
  /* Day warm palette */
  --bg-dark: #f5f0e8;
  --bg-card: #faf6f0;
  --bg-hover: #ede7dc;
  --text-primary: #2d3a2d;
  --text-secondary: #6b7a6b;
  --accent-gold: #8b6f4e;
  --accent-blue: #4a7a9a;
  --accent-purple: #8a6aaa;
  --border: #c4b8a0;
  --nav-bg: rgba(245, 240, 232, 0.92);
  --modal-bg: rgba(30,30,30,0.75);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: background 1.5s ease, color 1.5s ease;
}

/* ===== Sky ===== */
.sky-container {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.sky-layer {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  transition: opacity 1.5s ease;
}
.sky-night {
  background: linear-gradient(180deg, #1a1814 0%, #2a2420 40%, #2d2a24 100%);
  opacity: 1;
}
.sky-night.hidden { opacity: 0; }
.sky-day {
  background: linear-gradient(180deg, #87CEEB 0%, #B0E0E6 40%, #E0F0E8 70%, #F5F0E0 100%);
  opacity: 0;
}
.sky-day.visible { opacity: 1; }

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: white; border-radius: 50%;
  animation: twinkle 3s infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.moon {
  position: absolute; top: 8%; right: 12%;
  width: 60px; height: 60px;
  background: #f0e6d2; border-radius: 50%;
  box-shadow: 0 0 40px rgba(240,230,210,0.3), 0 0 80px rgba(240,230,210,0.1);
  transition: opacity 1.5s ease;
}
.moon::after {
  content: ''; position: absolute;
  top: 12px; left: 18px; width: 12px; height: 12px;
  background: rgba(200,190,170,0.3); border-radius: 50%;
}
.moon::before {
  content: ''; position: absolute;
  top: 28px; left: 10px; width: 8px; height: 8px;
  background: rgba(200,190,170,0.2); border-radius: 50%;
}
.moon.hidden { opacity: 0; }

.sun {
  position: absolute; top: 8%; right: 12%;
  width: 70px; height: 70px;
  background: radial-gradient(circle, #fff5e6 0%, #ffd700 50%, #ffcc00 100%);
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(255,215,0,0.4), 0 0 120px rgba(255,200,0,0.2);
  transition: opacity 1.5s ease;
  opacity: 0;
}
.sun.visible { opacity: 1; }

.cloud, .cloud-night {
  position: absolute; border-radius: 100px;
  opacity: 0; transition: opacity 1.5s ease;
}
.cloud.visible, .cloud-night.visible { opacity: 1; }
.cloud::before, .cloud::after, .cloud-night::before, .cloud-night::after {
  content: ''; position: absolute; border-radius: 100px;
}
.cloud { background: rgba(255,255,255,0.85); }
.cloud-night { background: rgba(100,100,130,0.15); }

.cloud-1 { width: 120px; height: 40px; top: 15%; left: -150px; animation: floatCloud1 40s linear infinite; }
.cloud-1::before { width: 50px; height: 50px; top: -25px; left: 15px; }
.cloud-1::after { width: 60px; height: 40px; top: -15px; left: 50px; }
.cloud-2 { width: 100px; height: 35px; top: 25%; left: -120px; animation: floatCloud2 55s linear infinite; animation-delay: -15s; }
.cloud-2::before { width: 45px; height: 45px; top: -22px; left: 12px; }
.cloud-2::after { width: 55px; height: 35px; top: -12px; left: 40px; }
.cloud-3 { width: 140px; height: 45px; top: 10%; left: -180px; animation: floatCloud3 50s linear infinite; animation-delay: -30s; }
.cloud-3::before { width: 55px; height: 55px; top: -28px; left: 20px; }
.cloud-3::after { width: 65px; height: 45px; top: -18px; left: 60px; }
.cloud-4 { width: 90px; height: 30px; top: 35%; left: -110px; animation: floatCloud1 45s linear infinite; animation-delay: -5s; }
.cloud-4::before { width: 40px; height: 40px; top: -20px; left: 10px; }
.cloud-4::after { width: 50px; height: 30px; top: -10px; left: 35px; }

.cloud-night-1 { width: 120px; height: 40px; top: 20%; left: -150px; animation: floatCloud1 60s linear infinite; }
.cloud-night-1::before { width: 50px; height: 50px; top: -25px; left: 15px; }
.cloud-night-1::after { width: 60px; height: 40px; top: -15px; left: 50px; }
.cloud-night-2 { width: 100px; height: 35px; top: 40%; left: -120px; animation: floatCloud2 70s linear infinite; animation-delay: -25s; }
.cloud-night-2::before { width: 45px; height: 45px; top: -22px; left: 12px; }
.cloud-night-2::after { width: 55px; height: 35px; top: -12px; left: 40px; }

@keyframes floatCloud1 { 0% { left: -150px; } 100% { left: 110%; } }
@keyframes floatCloud2 { 0% { left: -120px; } 100% { left: 110%; } }
@keyframes floatCloud3 { 0% { left: -180px; } 100% { left: 110%; } }

/* ===== Nav ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  z-index: 1000;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 1.5s ease, border-color 1.5s ease;
  min-height: 56px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.logo-moon { font-size: 1.3rem; }

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--bg-hover);
  border-radius: 8px;
  padding: 3px;
  border: 1px solid var(--border);
  transition: background 1.5s ease, border-color 1.5s ease;
}
.lang-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 28px;
  min-width: 32px;
}
.lang-btn.active {
  background: var(--accent-gold);
  color: var(--bg-dark);
}
.lang-btn:hover:not(.active) {
  color: var(--accent-gold);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  background: none; border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
  cursor: pointer;
  font-size: 0.92rem;
  padding: 0.4rem 0;
  min-height: 44px;
  display: flex; align-items: center;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--accent-gold);
}

@media (max-width: 768px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 56px; left: 0; right: 0;
    background: var(--nav-bg);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    display: none;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .nav-links li:last-child a { border-bottom: none; }
}

/* ===== Main & Sections ===== */
main { position: relative; z-index: 1; padding-top: 72px; }
.section {
  display: none;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease;
}
.section.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Typography ===== */
h1, h2, h3 {
  font-family: var(--font-title);
  color: var(--accent-gold);
  margin-bottom: 1rem;
  transition: color 1.5s ease;
}
h1 { font-size: 2.5rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }

.section-kicker {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.4rem;
  transition: color 1.5s ease;
}

/* ===== Card ===== */
.card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s, background 1.5s ease, border-color 1.5s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
body.day-mode .card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}
.hero h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(201, 169, 110, 0.3);
  transition: text-shadow 1.5s ease;
}
body.day-mode .hero h1 {
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.hero .subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  transition: color 1.5s ease;
}

.time-display {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--bg-card);
  padding: 0.5rem 1.2rem;
  border-radius: 25px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.2rem;
  transition: background 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}
.time-display span { color: var(--accent-gold); font-weight: 600; transition: color 1.5s ease; }
.time-sep { opacity: 0.4; }
.sky-status { margin-left: 0.3rem; }

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .time-display { font-size: 0.8rem; gap: 0.4rem; padding: 0.4rem 0.8rem; }
  .time-sep { display: none; }
}

/* ===== Intro ===== */
.intro-text {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
  transition: color 1.5s ease;
}

/* ===== Life Event Card ===== */
.life-event-card { border-left: 4px solid var(--accent-gold); transition: border-color 1.5s ease; }
.life-event-scene {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-hover);
  border-radius: 12px;
  transition: background 1.5s ease;
}
.scene-visual {
  font-size: 3rem;
  flex-shrink: 0;
}
.scene-desc {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.95rem;
  transition: color 1.5s ease;
}
.life-event-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  transition: color 1.5s ease;
}

/* v9: life event fade animation */
.life-event-card {
  transition: opacity 0.6s ease, transform 0.6s ease, border-color 1.5s ease;
}
.life-event-card.life-event-fading {
  opacity: 0;
  transform: translateY(8px);
}
.btn-primary {
  background: var(--accent-gold);
  color: var(--bg-dark);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 44px;
}
.btn-primary:hover {
  background: #d4b87a;
  transform: translateY(-1px);
}
body.day-mode .btn-primary:hover {
  background: #a08060;
}

/* ===== Map Tabs ===== */
.map-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.map-tab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1.2rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  min-height: 40px;
}
.map-tab:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.map-tab.active {
  background: var(--accent-gold);
  color: var(--bg-dark);
  border-color: var(--accent-gold);
}

/* ===== Map ===== */
.map-intro { margin-bottom: 1.2rem; }
.map-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 0.5rem;
  transition: color 1.5s ease;
}
.world-map-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 2rem;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: background 1.5s ease, border-color 1.5s ease;
}
.world-map {
  position: relative;
  width: 100%;
  height: 500px;
  background: linear-gradient(135deg, #2a2030 0%, #3a2840 30%, #203828 70%, #383020 100%);
  transition: background 1.5s ease;
}
body.day-mode .world-map {
  background: linear-gradient(135deg, #d4c8b8 0%, #c8d4c0 30%, #c0d0c8 70%, #d0c8b8 100%);
}

.map-zone-wrapper {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 1rem;
}
.map-zone-wrapper.active {
  opacity: 1;
  pointer-events: auto;
}

.map-zone {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 2px solid rgba(255,255,255,0.15);
  transition: all 0.3s, border-color 1.5s ease;
  overflow: hidden;
}
.map-zone:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 0 30px rgba(201, 169, 110, 0.2);
}
body.day-mode .map-zone:hover {
  box-shadow: 0 0 30px rgba(139, 111, 78, 0.15);
}
.map-zone-label {
  position: absolute;
  top: 8px; left: 12px;
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  z-index: 3;
  pointer-events: none;
}
body.day-mode .map-zone-label {
  text-shadow: 0 1px 3px rgba(255,255,255,0.8);
  color: var(--text-primary);
}

.zone-underground {
  background: linear-gradient(180deg, rgba(100,84,116,0.4), rgba(70,60,90,0.4));
}
.zone-snowdin {
  background: linear-gradient(180deg, rgba(132,168,194,0.4), rgba(100,140,180,0.4));
}
.zone-surface {
  background: linear-gradient(180deg, rgba(126,178,100,0.4), rgba(100,150,80,0.4));
}
body.day-mode .zone-underground {
  background: linear-gradient(180deg, rgba(140,130,160,0.25), rgba(120,110,140,0.25));
}
body.day-mode .zone-snowdin {
  background: linear-gradient(180deg, rgba(180,200,220,0.35), rgba(160,190,210,0.35));
}
body.day-mode .zone-surface {
  background: linear-gradient(180deg, rgba(170,200,150,0.3), rgba(150,180,130,0.3));
}

.sub-zone {
  position: absolute;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.3rem;
  min-height: 44px;
  touch-action: manipulation;
  color: #fff;
}
body.day-mode .sub-zone {
  border-color: rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.35);
  color: var(--text-primary);
}
.sub-zone:hover, .sub-zone.active {
  background: rgba(0,0,0,0.45);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(201,169,110,0.25);
}
body.day-mode .sub-zone:hover, body.day-mode .sub-zone.active {
  background: rgba(255,255,255,0.55);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(139,111,78,0.2);
}
.sub-zone-name {
  font-weight: 600;
  font-size: 0.78rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
body.day-mode .sub-zone-name {
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}

.character-marker {
  position: absolute;
  width: 40px; height: 40px;
  cursor: pointer;
  z-index: 10;
  transition: left 2s ease-in-out, top 2s ease-in-out;
}
.character-marker.moving {
  transition: left 3s ease-in-out, top 3s ease-in-out;
  z-index: 15;
}
.character-marker:hover { transform: scale(1.15); z-index: 20; }
.character-marker.flash {
  animation: spriteFlash 1s ease-in-out 3;
}
@keyframes spriteFlash {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.4); filter: brightness(1.5) drop-shadow(0 0 10px var(--accent-gold)); }
}

.character-sprite {
  width: 100%; height: 100%;
  object-fit: contain;
  animation: spriteIdle 2s ease-in-out infinite;
}
@keyframes spriteIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.character-marker .tooltip {
  position: absolute;
  bottom: 100%; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  margin-bottom: 5px;
  border: 1px solid var(--border);
}
.character-marker:hover .tooltip { opacity: 1; }

.character-status-bubble {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  white-space: nowrap;
  margin-top: 3px;
  opacity: 0;
  transition: opacity 0.3s;
  border: 1px solid var(--border);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.character-marker:hover .character-status-bubble { opacity: 1; }

@media (max-width: 768px) {
  .world-map { height: 380px; }
  .character-marker { width: 32px; height: 32px; }
  .sub-zone-name { font-size: 0.7rem; }
  .map-tabs { gap: 0.4rem; }
  .map-tab { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
}

/* ===== Modals ===== */
.modal-overlay {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--modal-bg);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  transition: background 1.5s ease;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  border: 2px solid var(--border);
  position: relative;
  text-align: center;
  animation: modalPop 0.3s ease;
  transition: background 1.5s ease, border-color 1.5s ease;
}
@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 0.8rem; right: 0.8rem;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  min-height: 44px; min-width: 44px;
  transition: color 0.3s;
}
.modal-close:hover { color: var(--accent-gold); }

.detail-sprite { width: 70px; height: 70px; margin: 0 auto 0.8rem; }
.detail-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.3rem; font-family: var(--font-title); }
.detail-location { color: var(--accent-blue); font-size: 0.92rem; margin-bottom: 0.6rem; transition: color 1.5s ease; }
.detail-status {
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 1rem;
  margin: 0.8rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-align: left;
  transition: background 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}

.detail-profile {
  text-align: left;
  margin: 1rem 0;
}
.profile-section {
  margin-bottom: 0.8rem;
  padding: 0.8rem;
  background: var(--bg-hover);
  border-radius: 10px;
  border: 1px solid rgba(138,122,90,0.2);
  transition: background 1.5s ease, border-color 1.5s ease;
}
body.day-mode .profile-section {
  border-color: rgba(139,111,78,0.15);
}
.profile-section-title {
  font-family: var(--font-title);
  color: var(--accent-gold);
  font-size: 1rem;
  margin-bottom: 0.4rem;
  transition: color 1.5s ease;
}
.profile-section-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  transition: color 1.5s ease;
}

.btn-goto-map {
  background: transparent;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: all 0.3s;
  min-height: 44px;
}
.btn-goto-map:hover {
  background: var(--accent-gold);
  color: var(--bg-dark);
}

/* Location Modal */
.location-modal-content { text-align: left; }
.location-icon { font-size: 3rem; text-align: center; margin-bottom: 0.5rem; }
.location-name { font-size: 1.4rem; font-weight: 700; color: var(--accent-gold); font-family: var(--font-title); text-align: center; transition: color 1.5s ease; }
.location-zone { text-align: center; color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 1rem; transition: color 1.5s ease; }
.location-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; margin-bottom: 1rem; transition: color 1.5s ease; }
.location-section { margin-bottom: 0.8rem; }
.location-section strong { color: var(--accent-gold); font-size: 0.9rem; display: block; margin-bottom: 0.3rem; transition: color 1.5s ease; }
.location-residents, .location-memories, .location-events {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  transition: color 1.5s ease;
}
.location-residents span {
  display: inline-block;
  background: var(--bg-hover);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  margin: 0.15rem;
  border: 1px solid rgba(138,122,90,0.25);
  transition: background 1.5s ease, border-color 1.5s ease;
}
body.day-mode .location-residents span {
  border-color: rgba(139,111,78,0.15);
}

/* ===== Character Grid ===== */
.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.character-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.2rem;
  border: 2px solid var(--border);
  transition: all 0.3s, background 1.5s ease, border-color 1.5s ease;
  cursor: pointer;
}
.character-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-gold);
}
.character-card-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.character-card-icon {
  font-size: 2.2rem;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.character-card-info h3 {
  margin: 0;
  font-size: 1.15rem;
  font-family: var(--font-title);
}
.character-card-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 1.5s ease;
}
.character-card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.6rem;
  transition: color 1.5s ease;
}
.character-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.character-card-tags span {
  background: var(--bg-hover);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  border: 1px solid rgba(138,122,90,0.2);
  transition: background 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}
body.day-mode .character-card-tags span {
  border-color: rgba(139,111,78,0.15);
}

@media (max-width: 768px) {
  .character-grid { grid-template-columns: 1fr; }
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}
.gallery-item {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: all 0.3s, background 1.5s ease, border-color 1.5s ease;
  cursor: pointer;
}
.gallery-item:hover { transform: scale(1.02); border-color: var(--accent-gold); }
.gallery-item-img {
  width: 100%; height: 160px;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  transition: background 1.5s ease;
}
.gallery-item-info { padding: 0.8rem; }
.gallery-item-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; color: var(--accent-gold); transition: color 1.5s ease; }
.gallery-item-desc { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.5; transition: color 1.5s ease; }
.gallery-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.gallery-item-meta span {
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  transition: background 1.5s ease, color 1.5s ease;
}
.gallery-links {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.gallery-links a {
  font-size: 0.75rem;
  color: var(--accent-blue);
  text-decoration: none;
  background: rgba(107,163,217,0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.gallery-links a:hover {
  background: rgba(107,163,217,0.2);
}

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent-gold), var(--accent-purple));
  border-radius: 2px;
  transition: background 1.5s ease;
}
.timeline-item { position: relative; margin-bottom: 1.8rem; padding-left: 1.5rem; }
.timeline-item::before {
  content: '';
  position: absolute; left: -2.1rem; top: 0.3rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 3px solid var(--bg-dark);
  transition: background 1.5s ease, border-color 1.5s ease;
}
.timeline-date { color: var(--accent-gold); font-weight: 600; font-size: 0.85rem; margin-bottom: 0.3rem; transition: color 1.5s ease; }
.timeline-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; font-family: var(--font-title); }
.timeline-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; transition: color 1.5s ease; }
.timeline-affected {
  margin-top: 0.5rem;
}
.timeline-affected strong {
  color: var(--accent-gold);
  font-size: 0.8rem;
  transition: color 1.5s ease;
}
.timeline-affected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}
.timeline-affected-tags span {
  font-size: 0.75rem;
  background: var(--bg-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  color: var(--text-secondary);
  border: 1px solid rgba(138,122,90,0.2);
  cursor: pointer;
  transition: all 0.2s, background 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}
body.day-mode .timeline-affected-tags span {
  border-color: rgba(139,111,78,0.15);
}
.timeline-affected-tags span:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.timeline-world-state {
  margin-top: 0.5rem;
  padding: 0.6rem;
  background: rgba(107,163,217,0.08);
  border-radius: 8px;
  border-left: 3px solid var(--accent-blue);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  transition: background 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}

/* ===== Connect / Music ===== */
.known-info-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  transition: background 1.5s ease, border-color 1.5s ease;
}
.known-info-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
}
.known-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.known-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-hover);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: background 1.5s ease, color 1.5s ease;
}
.known-info-item .ki-icon { flex-shrink: 0; font-size: 1.1rem; }
.known-empty { color: var(--text-secondary); font-size: 0.88rem; font-style: italic; transition: color 1.5s ease; }

.music-player {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid var(--border);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  transition: background 1.5s ease, border-color 1.5s ease;
}
.music-cover {
  width: 140px; height: 140px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 12px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  transition: background 1.5s ease;
}
.interaction-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.7;
  transition: color 1.5s ease;
}

@media (max-width: 768px) {
  .music-cover { width: 100px; height: 100px; }
}


/* ===== Connect Cards (v11) ===== */
.connect-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 1.5rem;
  border: 2px solid var(--border);
  text-align: center;
  max-width: 600px;
  margin: 1.5rem auto 0;
  transition: background 1.5s ease, border-color 1.5s ease, transform 0.3s, box-shadow 0.3s;
}
.connect-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
body.day-mode .connect-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.connect-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.connect-card-title {
  font-family: var(--font-title);
  color: var(--accent-gold);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  transition: color 1.5s ease;
}
.connect-card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  transition: color 1.5s ease;
}
.connect-card .btn-primary {
  display: inline-block;
  text-decoration: none;
}

/* Platform Links */
.connect-platforms {
  display: flex;
  gap: 1rem;
  justify-content: center;
  max-width: 600px;
  margin: 1.5rem auto 0;
  flex-wrap: wrap;
}
.platform-card {
  flex: 1;
  min-width: 140px;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 1.2rem;
  border: 2px solid var(--border);
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: background 1.5s ease, border-color 1.5s ease, transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.platform-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
body.day-mode .platform-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.platform-icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}
.platform-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: color 1.5s ease;
}
.platform-action {
  font-size: 0.78rem;
  color: var(--accent-blue);
  margin-top: 0.5rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.3s, color 1.5s ease;
}
.platform-card:hover .platform-action {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .connect-platforms { flex-direction: column; }
  .platform-card { width: 100%; }
}
