/* ==========================================================================
   🍄 페이퍼 마리오 어드벤처 가이드 - 스타일시트
   종이 공예 (Paper Craft & Origami) 및 팝업북 테마 디자인 시스템
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@700&family=Jua&family=Outfit:wght@400;600;800&family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

:root {
  /* 테마 컬러 팔레트 */
  --bg-craft: #f6f1e7;
  --bg-paper: #fdfbf7;
  --bg-paper-warm: #fff9e6;
  --color-mario-red: #e52521;
  --color-mario-red-dark: #b81b18;
  --color-olivia-yellow: #fcd116;
  --color-olivia-yellow-dark: #e5b900;
  --color-bobby-navy: #243342;
  --color-bobby-blue: #34495e;
  --color-luigi-green: #2ecc71;
  --color-purple-royale: #8e44ad;
  --color-card-border: #e0d5c1;
  --color-stitch: #d4c5a9;
  --text-main: #2c3e50;
  --text-muted: #62727b;
  --text-light: #ffffff;
  
  /* 그림자 & 종이 질감 효과 */
  --shadow-paper-sm: 0 4px 10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-paper-md: 0 8px 24px rgba(60, 40, 20, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-paper-lg: 0 16px 36px rgba(60, 40, 20, 0.16), 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-origami-pop: 0 12px 28px rgba(229, 37, 33, 0.25);
  
  /* 폰트 패밀리 */
  --font-headline: 'Jua', 'Gaegu', 'Noto Sans KR', sans-serif;
  --font-body: 'Outfit', 'Noto Sans KR', sans-serif;
  --font-fun: 'Gaegu', cursive, sans-serif;
}

/* 리셋 & 기본 설정 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-craft);
  background-image: 
    radial-gradient(#e6dbca 1px, transparent 1px),
    linear-gradient(to bottom, #fcf8f0, #f2ece0);
  background-size: 20px 20px, 100% 100%;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================================================
   앱 프레임: 헤더, 탭 내비게이션, 섹션 표시
   ========================================================================== */
.main-header {
  position: relative;
  background: linear-gradient(135deg, #e52521 0%, #b81b18 100%);
  color: var(--text-light);
  border-bottom: 6px solid var(--color-olivia-yellow);
  box-shadow: var(--shadow-paper-md);
  overflow: hidden;
}

.header-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.22));
  flex: 0 0 auto;
}

.brand-title {
  font-family: var(--font-headline);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.1;
  color: #ffffff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.brand-subtitle {
  font-family: var(--font-fun);
  font-size: 1.25rem;
  color: #fff8c8;
  margin-top: 4px;
}

.sound-toggle-btn {
  border: 3px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-radius: 14px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-headline);
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease, background 0.2s ease;
}

.sound-toggle-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.26);
}

.header-cutout {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 16px;
  background-image: linear-gradient(135deg, transparent 50%, var(--bg-craft) 50%),
    linear-gradient(225deg, transparent 50%, var(--bg-craft) 50%);
  background-position: 0 0, 12px 0;
  background-size: 24px 16px;
}

.nav-tabs-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 231, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px dashed var(--color-stitch);
}

.nav-tabs {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-btn {
  flex: 0 0 auto;
  background: var(--bg-paper);
  border: 3px dashed var(--color-stitch);
  border-radius: 14px 14px 8px 8px;
  padding: 10px 16px;
  font-family: var(--font-headline);
  font-size: 1.05rem;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-paper-sm);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-mario-red);
}

.tab-btn.active {
  background: var(--color-olivia-yellow);
  color: #453400;
  border-color: #d4a000;
  box-shadow: 0 5px 14px rgba(212, 160, 0, 0.25);
}

.main-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 20px;
}

.content-section {
  display: none;
  animation: fadeIn 0.28s ease both;
}

.content-section.active {
  display: block;
}

.section-header {
  text-align: center;
  margin-bottom: 28px;
}

.section-title {
  font-family: var(--font-headline);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
  color: var(--text-main);
}

.section-desc {
  max-width: 760px;
  margin: 10px auto 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ==========================================================================
   종이 공예 장식 요소 (Stitch, Tape, Fold)
   ========================================================================== */
.paper-card {
  background: var(--bg-paper);
  border-radius: 16px;
  border: 3px dashed var(--color-stitch);
  box-shadow: var(--shadow-paper-md);
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.paper-card:hover {
  transform: translateY(-5px) rotate(0.5deg);
  box-shadow: var(--shadow-paper-lg);
  border-color: var(--color-mario-red);
}

/* 와시 테이프 장식 효과 (잘림 방지 및 여백 확보) */
.washi-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  background: rgba(252, 209, 22, 0.95);
  color: #554400;
  padding: 4px 28px;
  font-family: var(--font-headline);
  font-size: 0.95rem;
  border-left: 3px dashed rgba(0, 0, 0, 0.15);
  border-right: 3px dashed rgba(0, 0, 0, 0.15);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  z-index: 10;
  user-select: none;
  white-space: nowrap;
}

.tape-red {
  background: rgba(229, 37, 33, 0.95);
  color: #ffffff;
}

.tape-blue {
  background: rgba(52, 152, 219, 0.95);
  color: #ffffff;
}

.tape-purple {
  background: rgba(142, 68, 173, 0.95);
  color: #ffffff;
}

/* ==========================================================================
   섹션 1: 종이접기 킹 메인 특집
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, #fff9e6 0%, #fff1c4 100%);
  border-radius: 20px;
  border: 4px solid var(--color-olivia-yellow);
  padding: 40px 35px 35px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 30px;
  align-items: center;
  box-shadow: var(--shadow-paper-lg);
  margin-top: 25px;
  margin-bottom: 45px;
  position: relative;
  overflow: visible; /* 와시 테이프 잘림 방지 */
}

.hero-tag {
  display: inline-block;
  background: var(--color-mario-red);
  color: #fff;
  font-family: var(--font-headline);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-headline);
  font-size: 2.4rem;
  color: #8e1815;
  line-height: 1.25;
  margin-bottom: 15px;
}

.hero-story {
  font-size: 1.05rem;
  color: #4a3c28;
  margin-bottom: 20px;
}

.hero-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-highlights li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 1rem;
}

.hero-origami-badge {
  background: #ffffff;
  border: 3px dashed #e67e22;
  border-radius: 16px;
  padding: 25px;
  text-align: center;
  box-shadow: var(--shadow-paper-md);
  transform: rotate(2deg);
}

/* 360도 링 배틀 완전 정복 가이드 스타일 */
.battle-system-card {
  background: #ffffff;
  padding: 35px;
  margin-bottom: 45px;
  margin-top: 25px;
}

.battle-mechanism-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.battle-mech-box {
  background: #fdfaf3;
  border: 2px dashed #e0d5c1;
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.battle-mech-box:hover {
  transform: translateY(-3px);
  border-color: var(--color-mario-red);
}

.mech-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mech-icon {
  font-size: 2.2rem;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  border: 2px dashed #cbd5e1;
}

.mech-title {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  color: var(--text-main);
}

.mech-desc {
  font-size: 0.95rem;
  color: #4a5568;
  line-height: 1.55;
}

.mech-diagram {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  text-align: center;
  font-family: var(--font-headline);
  font-size: 0.9rem;
}

.battle-tips-banner {
  background: linear-gradient(135deg, #ebf8ff 0%, #dbeafe 100%);
  border: 2px dashed #3b82f6;
  border-radius: 16px;
  padding: 24px;
  margin-top: 25px;
}

.battle-tips-title {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  color: #1e40af;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.battle-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.battle-tips-list li {
  font-size: 0.95rem;
  color: #1e3a8a;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}


.battle-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.battle-summary-card {
  background: #fffdf7;
  border: 2px solid #e7d9bc;
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-paper-sm);
}

.summary-kicker {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  color: #b45309;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.battle-summary-card h4,
.battle-flow-title {
  font-family: var(--font-headline);
  font-size: 1.15rem;
  color: var(--color-mario-red-dark);
  margin-bottom: 8px;
}

.battle-summary-card p,
.battle-flow-list {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.battle-flow-box {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 2px dashed #c7d2fe;
  background: #f8fbff;
}

.battle-flow-list {
  margin-left: 20px;
  display: grid;
  gap: 8px;
}

/* ==========================================================================
   섹션 2: 페이퍼 마리오 시리즈 연대기 (History Timeline)
   ========================================================================== */
.timeline-filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.filter-chip {
  background: #ffffff;
  border: 2px solid var(--color-stitch);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: var(--font-headline);
  font-size: 0.95rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip.active, .filter-chip:hover {
  background: var(--color-bobby-navy);
  color: #ffffff;
  border-color: var(--color-bobby-navy);
}

.timeline-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
}

.history-card {
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.history-year {
  background: var(--color-mario-red);
  color: #fff;
  font-family: var(--font-headline);
  font-size: 1.1rem;
  padding: 4px 10px;
  border-radius: 8px;
}

.history-platform {
  background: #eef2f7;
  color: #2c3e50;
  font-weight: bold;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
}

.history-title {
  font-family: var(--font-headline);
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 6px;
}

.history-genre {
  font-size: 0.9rem;
  color: #e67e22;
  font-weight: 700;
  margin-bottom: 12px;
}

.history-summary {
  font-size: 0.95rem;
  color: #4a5568;
  margin-bottom: 15px;
  line-height: 1.5;
}

.history-features-list {
  list-style: none;
  border-top: 1px dashed #e2e8f0;
  padding-top: 12px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-features-list li {
  font-size: 0.88rem;
  color: #556980;
  position: relative;
  padding-left: 18px;
}

.history-features-list li::before {
  content: "✂️";
  position: absolute;
  left: 0;
  font-size: 0.75rem;
}

.history-highlight {
  background: #fdf6e2;
  border-left: 4px solid #f39c12;
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #78350f;
  border-radius: 0 8px 8px 0;
}

/* ==========================================================================
   섹션 3: 캐릭터 & 빌런 도감
   ========================================================================== */
.dex-tab-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
}

.dex-tab-btn {
  background: #ffffff;
  border: 3px solid var(--color-stitch);
  border-radius: 12px;
  padding: 10px 24px;
  font-family: var(--font-headline);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dex-tab-btn.active {
  background: var(--color-olivia-yellow);
  color: #453400;
  border-color: #d4a000;
  box-shadow: 0 4px 10px rgba(212, 160, 0, 0.3);
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.character-card {
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* 캐릭터 이미지 스타일 */
.char-img-container {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.char-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.character-card:hover .char-img {
  transform: scale(1.15) translateY(-4px);
}

.char-icon-circle,
.image-fallback {
  width: 110px;
  height: 110px;
  margin: 0 auto 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff8db;
  border: 3px dashed var(--color-stitch);
  border-radius: 50%;
  font-size: 3rem;
  box-shadow: var(--shadow-paper-sm);
}

.hero-origami-badge .image-fallback,
.bobby-hero-img-box .image-fallback {
  margin: 0 auto 10px;
}

.modal-char-icon .image-fallback {
  width: 78px;
  height: 78px;
  margin: 0;
  font-size: 2.8rem;
  box-shadow: none;
}

.modal-char-img {
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

.bobby-hero-img-box {
  width: 160px;
  height: 160px;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bobby-hero-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(252, 209, 22, 0.6));
  animation: pulseGlow 3s ease-in-out infinite;
}

.hero-art-img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
  animation: pulseRotate 4s ease-in-out infinite;
}


.char-name {
  font-family: var(--font-headline);
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

.char-role-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  background: #fee2e2;
  color: #991b1b;
  margin-bottom: 12px;
}

.char-quote {
  font-family: var(--font-fun);
  font-size: 1.15rem;
  color: #555;
  margin-bottom: 15px;
  min-height: 48px;
}

.char-click-hint {
  font-size: 0.85rem;
  color: var(--color-mario-red);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ==========================================================================
   섹션 4: [스페셜] 폭탄병(바비) 메모리얼 관
   ========================================================================== */
.bobby-memorial-wrapper {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
  border-radius: 24px;
  padding: 45px 35px;
  border: 4px solid #fcd116;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.4);
  position: relative;
  overflow: hidden;
}

/* 밤하늘 캔버스 */
#starCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.bobby-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.bobby-hero-icon {
  font-size: 5rem;
  display: inline-block;
  animation: pulseGlow 2.5s infinite;
  margin-bottom: 15px;
}

.bobby-main-title {
  font-family: var(--font-headline);
  font-size: 2.5rem;
  color: #fcd116;
  text-shadow: 0 0 15px rgba(252, 209, 22, 0.5);
  margin-bottom: 12px;
}

.bobby-quote-banner {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 14px 20px;
  font-family: var(--font-fun);
  font-size: 1.5rem;
  color: #fef08a;
  margin-bottom: 35px;
}

.bobby-story-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  margin-bottom: 40px;
}

.bobby-story-box {
  background: rgba(255, 255, 255, 0.08);
  border-left: 4px solid #fcd116;
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
}

.bobby-story-box h4 {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  color: #93c5fd;
  margin-bottom: 6px;
}

.bobby-story-box p {
  font-size: 1rem;
  color: #e2e8f0;
  line-height: 1.6;
}

/* 별 보내기 인터랙션 버튼 */
.bobby-action-box {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 25px;
  border: 2px dashed rgba(252, 209, 22, 0.4);
}

.send-star-btn {
  background: linear-gradient(135deg, #fcd116 0%, #f59e0b 100%);
  color: #1e293b;
  border: none;
  border-radius: 30px;
  padding: 14px 32px;
  font-family: var(--font-headline);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.send-star-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 26px rgba(245, 158, 11, 0.6);
}

.star-count-badge {
  margin-top: 12px;
  font-size: 1rem;
  color: #cbd5e1;
}

.star-count-badge strong {
  color: #fcd116;
  font-size: 1.2rem;
}

/* ==========================================================================
   섹션 5: 추천 위키 & 공략 탐험 허브
   ========================================================================== */
.wiki-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 25px;
}

.wiki-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.wiki-card-top {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.wiki-icon {
  font-size: 2.8rem;
  background: #f8fafc;
  border-radius: 12px;
  padding: 8px;
  border: 2px dashed #cbd5e1;
}

.wiki-category {
  font-size: 0.85rem;
  color: var(--color-mario-red);
  font-weight: 700;
}

.wiki-title {
  font-family: var(--font-headline);
  font-size: 1.35rem;
  color: var(--text-main);
}

.wiki-desc {
  font-size: 0.95rem;
  color: #4a5568;
  margin-bottom: 20px;
  line-height: 1.5;
}

.wiki-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-paper-warm);
  color: #92400e;
  border: 2px solid #fcd116;
  border-radius: 10px;
  padding: 10px 18px;
  text-decoration: none;
  font-family: var(--font-headline);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.wiki-link-btn:hover {
  background: var(--color-olivia-yellow);
  color: #451a03;
  transform: translateY(-2px);
}

/* ==========================================================================
   모달 팝업 (캐릭터 상세 정보 팝업북)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

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

.modal-paper-book {
  background: var(--bg-paper);
  border: 4px solid var(--color-olivia-yellow);
  border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.35);
  max-width: 600px;
  width: 100%;
  padding: 35px;
  position: relative;
  animation: popBookOpen 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #fee2e2;
  color: #b91c1c;
  border: 2px solid #f87171;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.1);
}

.modal-char-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-char-icon {
  font-size: 3.8rem;
  background: #f1f5f9;
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px dashed var(--color-stitch);
}

.modal-char-title {
  font-family: var(--font-headline);
  font-size: 1.8rem;
  color: var(--text-main);
}

.modal-char-series {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-char-quote {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 10px 15px;
  font-family: var(--font-fun);
  font-size: 1.3rem;
  color: #78350f;
  margin-bottom: 20px;
  border-radius: 0 8px 8px 0;
}

.modal-char-desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #334155;
  margin-bottom: 20px;
}

.modal-tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-tag {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.char-role-badge {
  display: inline-block;
  background: #f1f2f6;
  color: #57606f;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 12px;
  margin-top: 4px;
  font-weight: 500;
}

.char-series-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 8px;
  margin-top: 6px;
  font-weight: 600;
}

/* ==========================================================================
   푸터
   ========================================================================== */
.main-footer {
  background: #243342;
  color: #94a3b8;
  text-align: center;
  padding: 35px 20px;
  margin-top: 60px;
  border-top: 6px solid #fcd116;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-title {
  font-family: var(--font-headline);
  font-size: 1.3rem;
  color: #f8fafc;
}

.footer-sub {
  font-size: 0.9rem;
}

/* ==========================================================================
   키프레임 애니메이션
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popBookOpen {
  from { opacity: 0; transform: scale(0.8) rotate(-3deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulseRotate {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.1) rotate(5deg); }
}

@keyframes bounceCenter {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(252, 209, 22, 0.4)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(252, 209, 22, 0.8)); }
}

/* ==========================================================================
   반응형 미디어 쿼리
   ========================================================================== */
@media (max-width: 768px) {
  .header-container {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px 18px 28px;
  }

  .sound-toggle-btn {
    align-self: flex-start;
  }

  .brand-wrapper {
    align-items: flex-start;
  }

  .hero-banner {
    grid-template-columns: 1fr;
    padding: 25px;
  }
  
  .brand-title {
    font-size: 1.8rem;
  }
  
  .section-title {
    font-size: 1.7rem;
  }
  
  .tab-btn {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .dex-tab-controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  .timeline-cards-grid,
  .character-grid,
  .wiki-hub-grid {
    grid-template-columns: 1fr;
  }

  .battle-mechanism-grid {
    grid-template-columns: 1fr;
  }
  
  .bobby-main-title {
    font-size: 1.8rem;
  }
}
