/* ===== 프리렌 외전 웹툰 리더 ===== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&family=Noto+Serif+KR:wght@400;700&display=swap');

:root {
  --bg-primary: #0d0d14;
  --bg-secondary: #16162a;
  --bg-card: #1e1e38;
  --bg-panel: #12121f;
  --text-primary: #e8e6f0;
  --text-secondary: #9d9bb8;
  --text-muted: #6b6987;
  --accent-gold: #c9a84c;
  --accent-purple: #8b5cf6;
  --accent-blue: #6366f1;
  --border-subtle: rgba(139, 92, 246, 0.15);
  --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.1);
  --max-width: 720px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(13, 13, 20, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-gold));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.logo-text {
  font-family: 'Noto Serif KR', serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 1px;
}

.nav-back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.nav-back:hover { color: var(--accent-gold); }

/* ===== Main Content ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 16px 40px;
}

/* ===== Index Page ===== */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  letter-spacing: 2px;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== Part Section ===== */
.part-section {
  margin: 40px 0 20px;
}

.part-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 16px;
}

/* ===== Episode Card ===== */
.episode-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.episode-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  cursor: pointer;
}

.episode-card:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-purple);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.episode-card.locked {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.ep-number {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.ep-number.locked-num {
  background: linear-gradient(135deg, #3a3a5c, #2a2a44);
}

.ep-info { flex: 1; }

.ep-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
}

.ep-logline {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 20px;
  background: rgba(139, 92, 246, 0.2);
  color: var(--accent-purple);
  white-space: nowrap;
}

.ep-badge.coming {
  background: rgba(107, 105, 135, 0.2);
  color: var(--text-muted);
}

/* ===== Episode Reader ===== */
.reader-header {
  text-align: center;
  padding: 30px 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 30px;
}

.reader-ep-num {
  font-size: 12px;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.reader-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 8px;
}

.reader-logline {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Panel ===== */
.panels-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 40px;
}

.panel {
  position: relative;
  width: 100%;
  background: var(--bg-panel);
  border-radius: 4px;
  overflow: hidden;
}

.panel img {
  width: 100%;
  height: auto;
  display: block;
}

.panel-dialogue {
  padding: 16px 20px;
  background: rgba(13, 13, 20, 0.85);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  text-align: center;
  font-family: 'Noto Serif KR', serif;
}

.panel-dialogue .speaker {
  color: var(--accent-gold);
  font-weight: 500;
}

.panel-caption {
  padding: 20px 24px;
  background: linear-gradient(180deg, transparent, rgba(13, 13, 20, 0.9));
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
}

/* ===== Episode Nav ===== */
.episode-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 20px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.nav-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-purple);
}

.nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.nav-home {
  padding: 12px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 20px;
  transition: var(--transition);
}

.nav-home:hover { color: var(--accent-gold); }

/* ===== Coming Soon ===== */
.coming-soon {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}

.coming-soon-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.coming-soon h3 {
  font-family: 'Noto Serif KR', serif;
  font-size: 20px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.coming-soon p {
  font-size: 14px;
  line-height: 1.6;
}

/* ===== Footer ===== */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}

/* ===== Scroll to Top ===== */
.scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--accent-purple);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 50;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .hero-title { font-size: 24px; }
  .reader-title { font-size: 22px; }
  .episode-card { padding: 12px; gap: 12px; }
  .ep-number { width: 40px; height: 40px; font-size: 16px; }
  main { padding: 72px 12px 30px; }
}
