/* style_cutin_adjusted.css - カットイン右寄せ対応 */

:root {
  /* Z-index階層定義 */
  --z-background: 1;
  --z-content: 10;
  --z-character: 50;
  --z-modal: 100;
  --z-menu: 800;
  --z-footer: 900;
  --z-overlay: 1000;
  --z-notification: 5000;
}

body {
  margin: 0;
  background: #ffffff; /* 白で統一 */
  font-family: 'Arial Black', sans-serif;
  overflow-x: hidden; /* 横スクロールのみ無効、縦スクロールは有効 */
  color: #333;
  transition: background 0.8s ease-in-out;
}

.background-char-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: var(--z-background);
}

.background-char-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom right;
  opacity: 0;
  transition: opacity 0.5s ease-out;
  z-index: var(--z-background);
  filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.menu-wrapper {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 335px;
  max-width: 25vw;
  background: rgba(0, 0, 0);
  overflow-y: auto;
  padding: 0rem 1rem 1rem 1rem; /* 上部パディングを目次ボタンの下まで調整 */
  z-index: var(--z-menu);
  pointer-events: auto;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
}


.menu-item {
  position: relative;
  font-size: clamp(14px, 1.6vw, 16px);
  font-weight: normal;
  cursor: pointer;
  user-select: none;
  transition: color 0.3s, transform 0.3s, text-shadow 0.3s, opacity 0.3s;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
  color: #eee;
  padding: 6px 0 6px 1.2em;
  width: auto;
  text-align: left;
  z-index: var(--z-character);
  pointer-events: auto;
    white-space: normal;        /* 折り返しを許可 */
  word-break: break-word;     /* 長い単語も折り返す */
  overflow-wrap: break-word;  /* より互換性の高い折り返し設定 */
  opacity: 0.8;
}

.menu-item.selected {
  color: #ff3333;
  font-weight: bold;
  transform: translateX(8px);
  opacity: 1;
}
.submenu-item {
  cursor: pointer;
}
.manual-card h3 {
  margin-top: 0;
  font-size: 1.4em;
  color: #cc0000;
}

.manual-card p {
  font-size: 1.2em;
  line-height: 1.6;
  color: #333;
}

.cutin-effect-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--z-modal);
}

#slashEffect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: var(--z-content);
  fill: #ff3333;
}

.cutin-face-image {
  position: absolute;
  top: 50%;
  left: 80%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 40vw;
  height: auto;
  opacity: 1;
  object-fit: contain;
  z-index: var(--z-character);
  pointer-events: auto;
  
  /* かっこいい枠デザイン */
  border: 5px solid #333333;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: relative;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  
  cursor: pointer;
  transition: all 0.3s ease;
  
  /* クリック可能であることを示すラベル */
  position: relative;
}

.cutin-face-image::after {
  content: "🔍 クリックで拡大";
  position: absolute;
  bottom: -8px;
  right: -8px;
  background: rgba(60, 60, 60, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cutin-face-image:hover {
  transform: translate(-50%, -50%) scale(1.05);
  border-color: #555555;
  background: rgba(255, 255, 255, 1);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 1);
}

.cutin-face-image:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* 右ページのカットイン画像もクリック可能に */
.cutin-face-right-page {
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.cutin-face-right-page:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 15px rgba(0,0,0,0.6));
}

.cutin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: var(--z-overlay);
}

.cutin-modal img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(255,255,255,0.5);
  cursor: zoom-out;
}

#dev-width-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  z-index: var(--z-overlay);
  font-family: monospace;
  border-radius: 4px;
  pointer-events: none;
}
.menu-category-label {
  font-size: clamp(16px, 1.7vw, 20px);
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 4px;
  padding-left: 10px;
  color: #ffffff;
  opacity: 1;
  pointer-events: none;
}

.menu-item {
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-item:hover {
  opacity: 1;
  color: #ff3333;
}
/* .tablet-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  font-size: 2rem;
  z-index: var(--z-overlay);
  color: #fff;
  background: rgba(0,0,0,0.4);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.tablet-side-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  overflow-y: auto;
  z-index: var(--z-overlay);
  padding: 1rem;
}

.tablet-side-menu.show {
  display: block;
} */


.menu-wrapper {
  transition: transform 0.3s ease;
  transform: translateX(-100%);
  overflow-y: auto; /* ✅ スクロール可能に */
}

.menu-wrapper.active {
  transform: translateX(0);
}

.menu-toggle-button {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: var(--z-overlay); /* メニューラッパーより確実に前面に表示 */
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 14px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
/* スクロールバーのカスタムスタイル（Webkit系） */
.menu-wrapper::-webkit-scrollbar {
  width: 8px;
}

.menu-wrapper::-webkit-scrollbar-track {
  background: transparent;
}

.menu-wrapper::-webkit-scrollbar-thumb {
  background-color: #ff3333;
  border-radius: 4px;
  border: none;
}

.menu-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #ff5555;
}

/* Firefox用 */
.menu-wrapper {
  scrollbar-width: thin;
  scrollbar-color: #ff3333 transparent;
}

/* 横スクロールが必要な場合の明示 */
.menu-wrapper {
  overflow-y: auto;
  overflow-x: hidden; /* 横スクロールを防止 */
  max-height: 100vh;
}
#manualTitleHeader {
 
  padding: 10px;
  color: #fff;
  font-weight: bold;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

#cutinModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: var(--z-overlay);
}

#cutinModalImage {
  max-width: 80%;
  max-height: 60%;
  margin-bottom: 16px;
}

/* 吹き出し風に表示されるカットインモーダルテキスト */
#cutinModalText {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 1.1em;
  padding: 12px 18px;
  border-radius: 16px;
  font-weight: bold;
  max-width: 80%;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: var(--z-overlay);
}

/* 吹き出し用の三角形 */
#cutinModalText::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0 10px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.75) transparent transparent transparent;
  z-index: var(--z-overlay);
}

/* 表示時に適用 */
#cutinModalText.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  z-index: var(--z-overlay);
}

.cutin-next-button {
  position: absolute;
  bottom: 10px;
  right: 200px;
  background: #00c2ff;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
  cursor: pointer;
  z-index: var(--z-overlay);
}
