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

body {
  font-family: "Noto Serif JP", "Hachi Maru Pop", serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  line-height: 1.8;
}

/* キャンバスコンテナ */
#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ヘッダー */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  z-index: 1000;
  background: transparent;
}

/* ナビゲーションメニュー（デスクトップ） */
.nav-menu {
  display: none;
  justify-content: center;
}

.menu-list {
  display: flex;
  list-style: none;
  gap: 30px;
}

.menu-item a {
  text-decoration: none;
  color: #ff6b9d;
  font-size: 20px;
  padding: 10px 20px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  display: block;
  border: 2px solid transparent;
  font-family: "Hachi Maru Pop", cursive;
}

.menu-item a:hover {
  background: #feca57;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(254, 202, 87, 0.4);
  border-color: #ff6b9d;
}

/* モバイルメニューボタン */
.mobile-menu-btn {
  display: block;
  position: fixed;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.3s ease;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background: #ff6b9d;
  margin: 5px auto;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
  background: #feca57;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

/* モバイルメニュー */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg, #feca57 0%, #feca57 100%);
  padding: 80px 30px;
  transition: right 0.3s ease;
  z-index: 999;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-list {
  list-style: none;
}

.mobile-menu-item {
  margin-bottom: 20px;
  animation: slideInRight 0.5s ease forwards;
  opacity: 0;
}

.mobile-menu.active .mobile-menu-item {
  opacity: 1;
}

.mobile-menu-item:nth-child(1) {
  animation-delay: 0.1s;
}
.mobile-menu-item:nth-child(2) {
  animation-delay: 0.2s;
}
.mobile-menu-item:nth-child(3) {
  animation-delay: 0.3s;
}
.mobile-menu-item:nth-child(4) {
  animation-delay: 0.4s;
}

.mobile-menu-item a {
  color: #ff6b9d;
  text-decoration: none;
  font-size: 22px;
  display: block;
  padding: 15px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  transition: all 0.3s ease;
  text-align: center;
  font-family: "Hachi Maru Pop", cursive;
}

.mobile-menu-item a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateX(-10px);
}

/* 小説コンテンツ */
.novel-container {
  position: relative;
  z-index: 100;
  padding: 100px 20px 50px;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.novel-content {
  width: 100%;
  max-width: 800px;
  /* background: rgba(255, 255, 255, 0.3); */
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.8s ease;
}

.novel-header {
  text-align: center;
  padding: 40px 20px;
  border-bottom: 1px solid rgba(255, 107, 157, 0.1);
}

.novel-title {
  font-size: clamp(2rem, 4vw, 3rem);
  color: #ff6b9d;
  font-weight: 600;
  margin-bottom: 20px;
  font-family: "Hachi Maru Pop", cursive;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.title-decoration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.decoration-line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, #feca57, transparent);
}

.decoration-dot {
  width: 10px;
  height: 10px;
  background: #ff6b9d;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

/* 小説本文 */
.novel-body {
  padding: 40px;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: #333;
}

/* 対話スタイル */
.dialogue {
  margin-bottom: 0.5em;
  font-weight: 500;
  padding: 10px 15px;
  border-radius: 10px;
  position: relative;
}

.dialogue.mama {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 157, 0.08),
    rgba(255, 107, 157, 0.05)
  );
  border-left: 3px solid #ff6b9d;
  color: #d1477a;
}

.dialogue.chi {
  background: linear-gradient(
    135deg,
    rgba(254, 202, 87, 0.08),
    rgba(254, 202, 87, 0.05)
  );
  border-left: 3px solid #feca57;
  color: #c69445;
}

.dialogue.long {
  line-height: 2.2;
}

.dialogue.cheerful {
  animation: bounce 0.5s ease;
}

/* ナレーション */
.narration {
  margin-bottom: 1.2em;
  text-indent: 1em;
  line-height: 2;
  color: #666;
  font-size: 0.95em;
}

/* エンディング */
.ending {
  margin-top: 3em;
  padding: 20px;
  text-align: center;
  font-style: italic;
  color: #888;
  background: linear-gradient(
    135deg,
    rgba(255, 251, 1, 0.05),
    rgba(255, 107, 157, 0.05)
  );
  border-radius: 15px;
  position: relative;
}

.ending::before,
.ending::after {
  content: "✦";
  position: absolute;
  color: #feca57;
  font-size: 1.5rem;
}

.ending::before {
  top: 10px;
  left: 20px;
}

.ending::after {
  bottom: 10px;
  right: 20px;
}

/* フッター */
.novel-footer {
  padding: 30px;
  text-align: center;
  border-top: 1px solid rgba(255, 107, 157, 0.1);
}

.back-button {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(135deg, #ff6b9d, #ff7bde);
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: "Hachi Maru Pop", cursive;
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3);
}

.back-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
}

/* スクロールバーのカスタマイズ */
.novel-body::-webkit-scrollbar {
  width: 8px;
}

.novel-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.novel-body::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #ff6b9d, #feca57);
  border-radius: 10px;
}

/* アニメーション */
@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-5px);
  }
  75% {
    transform: translateY(3px);
  }
}

/* レスポンシブデザイン */
@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }

  .mobile-menu-btn {
    display: none;
  }

  .mobile-menu {
    display: none;
  }

  .novel-body {
    padding: 50px 60px;
  }
}

/* タブレット対応 */
@media (max-width: 768px) {
  .novel-body {
    padding: 30px 35px;
  }

  .mobile-menu {
    width: 320px;
  }

  .mobile-menu-item a {
    font-size: 20px;
  }
}

/* スマートフォン対応 */
@media (max-width: 480px) {
  .header {
    padding: 15px;
  }

  .mobile-menu-btn {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
  }

  .mobile-menu {
    width: 250px;
    padding: 70px 20px;
  }

  .mobile-menu-item a {
    font-size: 18px;
    padding: 12px;
  }

  .novel-container {
    padding: 80px 10px 30px;
  }

  .novel-content {
    border-radius: 15px;
  }

  .novel-header {
    padding: 30px 15px;
  }

  .novel-title {
    font-size: 1.8rem;
  }

  .novel-body {
    padding: 25px 20px;
    font-size: 0.95rem;
  }

  .dialogue {
    padding: 8px 12px;
    font-size: 0.95rem;
  }

  .narration {
    font-size: 0.9rem;
  }

  .back-button {
    padding: 10px 25px;
    font-size: 0.95rem;
  }
}
