﻿@font-face {
  font-family: 'Rounded Mplus 1c';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/rounded-mplus-1c-400.ttf') format('truetype');
}

@font-face {
  font-family: 'Rounded Mplus 1c';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/rounded-mplus-1c-500.ttf') format('truetype');
}

@font-face {
  font-family: 'Rounded Mplus 1c';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/rounded-mplus-1c-700.ttf') format('truetype');
}

@font-face {
  font-family: 'Rounded Mplus 1c';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/rounded-mplus-1c-800.ttf') format('truetype');
}

@font-face {
  font-family: 'Rounded Mplus 1c';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../assets/fonts/rounded-mplus-1c-900.ttf') format('truetype');
}
:root {
  /* キーカラー基溁E*/
  --color-key-main: #d63384;
  --color-key-soft: #ff8fb3;
  --color-key-bright: #ff6fa2;
  --color-key-tint: #ffd3e1;
  --color-key-tint-strong: #ffc2d8;
  /* 進行用ブルー */
  --color-progress-base: #2c3e50;
  --color-progress-dark: #234157;
  --color-progress-darker: #1a2c3f;
  --color-progress-overlay: #101428;
  --color-progress-overlay-strong: #1b2140;
  /* 補助・背景 */
  --color-bg-base: #ffe6f0;
  --color-surface-base: #f8f8fa;
  --color-support-base: #8c96a0;
  --color-overlay-dark: rgba(10, 8, 19, 0.72);
  /* チE��スチE*/
  --color-text-light: #ffffff;
  --color-text-dark: #000000;
  --color-text-secondary: #666666;
  --color-text-muted: #cccccc;
  --color-neutral-dark: #333333;
  /* アクセンチE*/
  --color-accent-gold: #ffd86e;
  --color-accent-orange: #ff8c00;
  --color-result-lose: #ff7b92;
  --color-result-draw: #d5dcff;
  --color-success-start: #4caf50;
  --color-success-end: #45a049;
  --color-error-start: #f44336;
  --color-error-end: #da190b;
  --color-danger-soft: #ff6b6b;
  --color-danger-strong: #ff4757;
  --color-danger-text: #ff6666;
  --color-info-border: #667eea;
  --color-info-accent: #8b9af5;
  --color-info-accent-strong: #764ba2;
}

/* JANKEN_TEMPLATE:START */
#janken-screen {
  width: 1200px;
  height: 800px;
}

#janken-screen .game-container {
  position: relative;
  width: 1200px;
  height: 800px;
  background: #faebf2;
  overflow: hidden;
}

#janken-screen .character-area {
  position: absolute;
  left: -39px;
  top: -10px;
  width: 585px;
  height: 779px;
  pointer-events: none;
}

#janken-screen .character-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(0.95);
  transform-origin: bottom center;
}

#janken-screen .game-area {
  position: absolute;
  inset: 0;
  width: 1200px;
  height: 800px;
}

#janken-screen .ending-transition-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 48px;
  box-sizing: border-box;
  background: transparent;
  z-index: 15000;
  cursor: pointer;
}

#janken-screen .ending-transition-overlay.is-visible {
  display: flex;
}

#janken-screen .ending-transition-overlay:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.7);
  outline-offset: 4px;
}

#janken-screen .ending-transition-inner {
  display: none;
}

#janken-screen .ending-transition-message {
  margin: 0;
}

@keyframes ending-transition-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

#janken-screen .title {
  position: absolute;
  left: 474px;
  top: 30px;
  font-size: 40px;
  font-weight: 500;
  color: #2c3e50;
  white-space: nowrap;
  text-shadow: 0 4px 4px rgba(44, 62, 80, 0.25);
}

#janken-screen #current-difficulty {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

#janken-screen .top-buttons {
  position: absolute;
  right: 37px;
  top: 24px;
  display: flex;
  gap: 19px;
  align-items: flex-end;
}

#janken-screen .icon-button {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: #9da3ab;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  position: relative; /* z-indexを有効にする */
  z-index: 9991; /* ブロッカー(9990)より前面 */
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#janken-screen .settings-button {
  width: 72px !important;
  height: 72px !important;
}

#janken-screen .settings-button .button-icon,
#janken-screen .settings-button img {
  width: 40px !important;
  height: 40px !important;
}

#janken-screen .icon-button:hover {
  background: #b3b9c1;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

#janken-screen .icon-button:active {
  background: #8f959d;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transform: translateY(0);
}

#janken-screen .icon-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.6);
  outline-offset: 4px;
}

#janken-screen .icon-button .button-icon,
#janken-screen .icon-button img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

#janken-screen .hp-area {
  position: absolute;
  right: 111px;
  top: 124px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#janken-screen .hp-row {
  display: flex;
  align-items: center;
}

#janken-screen .hp-row:last-child {
  margin-top: -10px;
}

#janken-screen .hp-label {
  font-size: 40px;
  font-weight: 500;
  color: #2c3e50;
  width: 140px;
  text-align: right;
  margin-right: 24px;
  white-space: nowrap;
}

#janken-screen .hp-hearts {
  display: flex;
  gap: 5px;
}
#janken-screen .hp-hearts .heart,
#janken-screen .hp-heart {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #df5e9d;
}

#janken-screen .hp-hearts .heart::before,
#janken-screen .hp-heart::before {
  content: "\2665";
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  font-family: 'Noto Sans JP', sans-serif;
}

#janken-screen .hp-hearts .heart.empty::before,
#janken-screen .hp-heart.is-empty::before {
  content: "\2661";
  color: #df5e9d;
  opacity: 0.7;
}

@keyframes janken-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

#janken-screen .message-box {
  position: absolute;
  left: 509px;
  top: 310px;
  width: 605px;
  height: 166px;
  background-color: #f8f8fa;
  border: 6px solid rgba(140, 150, 160, 0.7);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 27px 15px;
  box-sizing: border-box;
}

#janken-screen .message-text {
  font-size: 37px;
  font-weight: 800;
  color: #2c3e50;
  white-space: pre-line;
  letter-spacing: -1px;
}

#janken-screen .janken-buttons {
  position: absolute;
  left: 550px;
  top: 498px;
  display: flex;
  gap: 16px;
}

#janken-screen .janken-button {
  width: 171px;
  height: 171px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

#janken-screen .janken-button:hover {
  transform: translateY(-4px);
}

#janken-screen .janken-button:focus-visible {
  outline: 3px solid rgba(214, 51, 132, 0.4);
  outline-offset: 6px;
}

#janken-screen .janken-button:active {
  transform: scale(0.95);
}

#janken-screen .janken-button {
  position: relative;
}

#janken-screen .janken-button.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  transform: none;
  filter: grayscale(35%);
}

/* アイテム発動時: ボタン本体の脈動アニメーション */
#janken-screen .janken-button.invincible {
  animation: invincible-pulse 1s infinite;
}

/* アイテム発動時ベース: ピンクの光エフェクト */
#janken-screen .janken-button.invincible::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 152px;
  height: 152px;
  transform: translate(-50%, -50%);
  background: #FF3EA9;
  opacity: 0.5;
  border-radius: 50%;
  filter: blur(1px);
  z-index: 0;
  pointer-events: none;
}

/* アイテム発動時上層: 青の光エフェクト */
#janken-screen .janken-button.invincible::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 152px;
  height: 152px;
  transform: translate(-50%, -50%);
  background: #CFE5FF;
  opacity: 1;
  border-radius: 50%;
  filter: blur(7px);
  z-index: 0;
  pointer-events: none;
  transition: background 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

/* アイテム発動ホバー時: 白の光エフェクトに変化 */
#janken-screen .janken-button.invincible:hover::after {
  background: #FFFFFF;
  opacity: 0.65;
  filter: blur(1px);
}

/* アイコンをエフェクトの上に表示 */
#janken-screen .janken-icon {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#janken-screen .item-area {
  position: absolute;
  left: 636px;
  top: 669px;
  display: flex;
  gap: 22px;
}

#janken-screen .item {
  position: relative;
}

#janken-screen .item-slot,
#janken-screen .item-button {
  position: relative;
  width: 110px;
  height: 110px;
  border: none;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s ease;
  pointer-events: auto; /* クリックイベントを受け取る */
}

#janken-screen .item-slot:hover,
#janken-screen .item-button:hover {
  transform: translateY(-4px);
}

#janken-screen .item-slot:active,
#janken-screen .item-button:active {
  transform: scale(0.95);
}

#janken-screen .item-slot .item-icon,
#janken-screen .item-button .item-icon,
#janken-screen .item-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

#janken-screen .item-slot .remaining-badge {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(214, 51, 132, 0.92), rgba(255, 143, 179, 0.95));
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 10px 18px rgba(214, 51, 132, 0.35);
  animation: janken-badge-pulse 1.8s ease-in-out infinite;
}

/* 発動中: ピンクの光エフェクト */
#janken-screen .item-slot.active::before,
#janken-screen .item-button.active::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  transform: translate(-50%, -50%);
  background: #FF1493;
  opacity: 0.34;
  border-radius: 50%;
  filter: blur(5px);
  z-index: 0;
  pointer-events: none;
}

/* アイコンをエフェクトの上に表示 */
#janken-screen .item-slot.active .item-icon,
#janken-screen .item-button.active .item-icon {
  position: relative;
  z-index: 1;
}

#janken-screen .item-slot.is-disabled,
#janken-screen .item-button.is-disabled {
  opacity: 0.35;
  pointer-events: none;
  transform: none;
  filter: grayscale(40%);
}

#janken-screen .item-slot.has-icon,
#janken-screen .item-button.has-icon {
  padding: 0;
  background: none;
  background-image: none;
}

#janken-screen .item-count {
  position: absolute;
  right: -12px;
  bottom: 8px;
  transform: none;
  font-size: 32px;
  font-weight: 400;
  color: #FFF7FB;
  text-shadow: 0 0 4px rgba(255, 100, 150, 0.8);
  pointer-events: none;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  z-index: 2; /* エフェクトとアイコンより前面に表示 */
}

#janken-screen .item-count.is-zero {
  color: rgba(255, 247, 251, 0.45);
  text-shadow: 0 0 4px rgba(255, 100, 150, 0.4);
  gap: 0;
}

#janken-screen .item-count-symbol {
  font-weight: 400;
  line-height: 1;
  display: inline-flex;
  align-items: flex-end;
  transform: translateY(3px);
}

#janken-screen .item-count-number {
  font-weight: 800;
  line-height: 1;
}

#janken-screen .item-count.is-zero .item-count-symbol {
  display: none;
}

#janken-screen .item-slot.is-zero .item-icon,
#janken-screen .item-button.is-zero .item-icon,
#janken-screen .item-icon.is-zero {
  opacity: 0.3;
}

/* 発動中は0個でも薄くしない */
#janken-screen .item-slot.active.is-zero .item-icon,
#janken-screen .item-button.active.is-zero .item-icon {
  opacity: 1 !important;
}

#janken-screen .item-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(28, 24, 44, 0.9);
  color: #ffffff;
  font-size: 14px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 16px 32px rgba(28, 24, 44, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#janken-screen .item:hover .item-tooltip,
#janken-screen .item-slot:hover .item-tooltip,
#janken-screen .item-button:hover .item-tooltip {
  opacity: 1;
  transform: translate(-50%, -6px);
}

#janken-screen .item-invincible-indicator {
  position: absolute;
  inset: -20%;
  border-radius: 50%;
  border: 2px solid rgba(102, 126, 234, 0.65);
  box-shadow: 0 0 18px rgba(102, 126, 234, 0.55);
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}

#janken-screen .item-invincible-indicator.is-active {
  opacity: 1;
  animation: janken-invincible-glow 1s ease-in-out infinite alternate;
}

#janken-screen .janken-result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 11, 26, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 15000;
}

#janken-screen .janken-result-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

#janken-screen .janken-result-card {
  width: 740px;
  max-width: 95%;
  padding: 40px 44px;
  background: #f8f8fa;
  border-radius: 28px;
  border: 5px solid #8c96a0;
  box-shadow: 0 18px 36px rgba(26, 44, 63, 0.18);
  display: flex;
  flex-direction: column;
  gap: 32px;
  color: var(--color-neutral-dark);
}

#janken-screen .janken-result-hands {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 48px;
}

#janken-screen .result-hand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  padding: 50px 0 8px 0;
  overflow: visible;
  transition: transform 0.45s ease, filter 0.45s ease;
}

#janken-screen .result-hand::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

#janken-screen .result-hand img {
  width: 262.5px;
  min-width: 262.5px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  transform: translateY(0) scale(1) rotate(0deg);
  will-change: transform;
  transition: transform 0.45s ease, filter 0.45s ease;
}

#janken-screen .result-hand-label {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #3c4450;
  text-transform: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#janken-screen .result-hand-divider {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #c7cbd1;
}

#janken-screen .result-text {
  display: none;
}

#janken-screen .result-hand.is-winner::after {
  opacity: 0;
  transform: scale(1.1);
}

#janken-screen .result-hand.is-winner img {
  animation: janken-hand-win 1.1s ease-out forwards;
}

#janken-screen .result-hand.is-winner img[data-hand="rock"] {
  animation: janken-hand-win-rock 1.1s ease-out forwards;
}

#janken-screen .result-hand.is-loser img {
  animation: janken-hand-lose 0.7s ease-in forwards;
}

#janken-screen .result-hand.is-draw::after {
  opacity: 0;
  transform: scale(1.04);
}

#janken-screen .result-hand.is-draw img {
  animation: janken-hand-draw 0.9s ease-in-out forwards;
}
#janken-screen .janken-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 16000;
}

#janken-screen .janken-modal.is-open,
#janken-screen .janken-modal[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

#janken-screen .janken-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 30, 30, 0.6);
}

#janken-screen .janken-modal-dialog {
  position: relative;
  width: 540px;
  max-width: calc(100% - 120px);
  padding: 40px 44px 36px;
  background: linear-gradient(135deg, rgba(255, 247, 252, 0.97), rgba(245, 248, 255, 0.96));
  border-radius: 28px;
  border: 1px solid rgba(214, 51, 132, 0.16);
  box-shadow: 0 28px 50px rgba(20, 24, 46, 0.35);
  color: rgba(44, 62, 80, 0.94);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#janken-screen .janken-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

#janken-screen .janken-modal-headline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#janken-screen .janken-modal-label {
  align-self: flex-start;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  border-radius: 999px;
  color: rgba(214, 51, 132, 0.78);
  background: rgba(214, 51, 132, 0.12);
  box-shadow: 0 4px 10px rgba(214, 51, 132, 0.2);
}

#janken-screen .janken-modal-header h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.08em;
  color: var(--color-key-main);
}

#janken-screen .janken-modal-subtitle {
  margin: 0;
  font-size: 14px;
  color: rgba(44, 62, 80, 0.72);
  line-height: 1.6;
}

#janken-screen .janken-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(214, 51, 132, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(214, 51, 132, 0.85);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 10px 20px rgba(44, 62, 80, 0.18);
}

#janken-screen .janken-modal-close:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 26px rgba(44, 62, 80, 0.24);
}

#janken-screen .janken-modal-close:focus-visible {
  outline: 3px solid rgba(214, 51, 132, 0.4);
  outline-offset: 3px;
}

#janken-screen .janken-modal-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#janken-screen .modal-setting {
  display: flex;
  width: 100%;
  max-width: 420px;
  padding: 18px 0;
  padding-left: 4px;
  padding-right: 4px;
  border-radius: 18px;
  border: 1px solid rgba(214, 51, 132, 0.16);
  background: rgba(248, 244, 248, 0.92);
  box-shadow: 0 16px 28px rgba(44, 62, 80, 0.12);
  align-items: center;
  gap: 6px;
  margin: 0 auto;
  box-sizing: border-box;
}

#janken-screen .modal-setting-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

#janken-screen .modal-setting-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-key-main);
}

#janken-screen .modal-setting-description {
  font-size: 13px;
  color: rgba(44, 62, 80, 0.7);
  line-height: 1.5;
}

#janken-screen .modal-setting .toggle-slider {
  margin-left: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

#janken-screen .janken-modal-footer {
  font-size: 13px;
  color: rgba(44, 62, 80, 0.68);
  line-height: 1.6;
}

#janken-screen .janken-modal-note {
  margin: 0;
}

  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

#janken-screen .skip-checkbox:checked + .toggle-slider {
  background: linear-gradient(135deg, rgba(214, 51, 132, 0.85), rgba(255, 143, 179, 0.8));
}

#janken-screen .skip-checkbox:checked + .toggle-slider::after {
  transform: translateX(24px);
}

#janken-screen .invincible-indicator {
  position: absolute;
  top: 30px;
  right: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(102, 126, 234, 0.12);
  border: 1px solid rgba(102, 126, 234, 0.32);
  color: rgba(44, 62, 80, 0.92);
  font-size: 14px;
  letter-spacing: 0.06em;
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.18);
}

#janken-screen .invincible-indicator svg {
  width: 24px;
  height: 24px;
  color: rgba(102, 126, 234, 0.85);
}

@keyframes janken-invincible-glow {
  0% {
    opacity: 0.55;
    transform: scale(0.94);
  }
  100% {
    opacity: 0.9;
    transform: scale(1.04);
  }
}

@keyframes janken-badge-pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 10px 18px rgba(214, 51, 132, 0.35);
  }
  50% {
    transform: translateX(-50%) scale(1.08);
    box-shadow: 0 14px 22px rgba(214, 51, 132, 0.45);
  }
}
/* JANKEN_TEMPLATE:END */

;

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

/* スクロールバ�Eを完�Eに非表示 */
::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html, body {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;  /* JS動的スケールでフィット、スクロール不要 */
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #1a1a2e;
}

body {
  width: 1200px;
  height: 800px;
  overflow: hidden;
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  background-color: var(--color-bg-base);
  color: var(--color-text-light);
  position: relative;
  margin: 0;
  padding: 0;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 入力系コンポーネントは必要に応じて選択を許可する */
input,
textarea,
button,
label,
select {
  -webkit-user-select: auto;
  -moz-user-select: auto;
  -ms-user-select: auto;
  user-select: auto;
}

/* スクリーン管琁E*/
.screen {
  position: absolute;
  width: 1200px;
  height: 800px;
  display: none;
  top: 0;
  left: 0;
  overflow: hidden;
}

.screen.active {
  display: block;
}

#settings-screen .screen-header {
  position: relative;
  top: 20px;
  left: 20px;
  right: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 980px;
  padding: 0 8px;
  z-index: 1;
}

#settings-screen .screen-header h2 {
  color: #2C3E50;
  text-shadow: none;
  font-size: 50px;
  letter-spacing: 0.05em;
  font-weight: 900;
  margin: 0;
  position: relative;
  left: 10px;
  top: 10px;
}

/* タイトル画面 */
.fullscreen-background {
  position: absolute;
  width: 100%;
  height: 100%;
  min-width: 1200px;
  min-height: 800px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: 100% 100%;  /* 画像を確実に画面全体に拡大 */
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.title-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

/* 難易度選択画面 */
.difficulty-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background: transparent; /* Figma背景を表示 */
}

/* 難易度選択画面の背景設宁E*/
#difficulty-screen {
  background-color: #ffe6f0; /* 薁E��ンク背景 */
}

.title-header {
  margin-bottom: 50px;
}

.game-title {
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  font-size: 48px;
  color: var(--color-text-light);
  text-shadow: 3px 3px 6px var(--color-text-dark);
  font-weight: bold;
  text-align: center;
}

/* 刁E��レイアウチE*/
.split-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.character-panel {
  width: 50%;
  height: 100%;
  position: relative;
  background: linear-gradient(135deg, var(--color-key-soft) 0%, var(--color-key-bright) 100%);
}

.ui-panel {
  width: 50%;
  height: 100%;
  background-color: var(--color-progress-darker);
  padding: 100px 50px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* キャラクター画僁E*/
.character-image {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
}

/* メニューボタン */
.menu-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 50px;
  align-items: center;
}

.menu-button {
  width: 250px;
  height: 60px;
  background: linear-gradient(135deg, var(--color-key-tint) 0%, var(--color-key-tint-strong) 100%);
  border: none;
  border-radius: 10px;
  color: var(--color-text-light);
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transform-origin: center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: none;
  position: relative;
  will-change: transform, box-shadow;
}

.menu-button:hover {
  transform: translate3d(0, -6px, 0);
  box-shadow: 0 14px 28px rgba(26, 44, 63, 0.2);
}

.menu-button:active {
  transform: translate3d(0, -2px, 0);
}

.new-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: var(--color-key-main);
  color: var(--color-text-light);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  animation: pulse 1s infinite;
}

/* スチE�Eタス表示 */
.status-display {
  text-align: center;
  color: var(--color-text-light);
  text-shadow: 2px 2px 4px var(--color-text-dark);
}

/* タイトル画面ではポインチEコレクションのスチE�Eタスを非表示にする */
#title-screen .status-display {
  display: none;
}

.total-points, .collection-progress {
  font-size: 18px;
  font-weight: bold;
  margin: 10px 0;
}

/* 難易度選択画面 */
.screen-header {
  position: absolute;
  top: 50px;
  width: 100%;
  text-align: center;
}

/* 難易度選択画面専用のヘッダー位置 */
#difficulty-screen .screen-header {
  top: -5px;
  left: 280px;
  width: auto;
  text-align: left;
}

/* ------------- タイトル画面: CSV制御用 ------------- */
/* タイトルロゴ�E�画像！E CSVでimage_path/座標が設定されたときに使用 */
.title-logo {
  position: absolute;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 2;
}

/* タイトルキャラクター�E�画像！E*/
.title-character {
  position: absolute;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

/* CSV座標適用時に付与する�E通クラス */
.csv-absolute {
  position: absolute !important;
}

/* 画像�Eタン化したメニュー�E�ESVでimage_pathが設定された場合に付与！E*/
.menu-button.image-button {
  background: none;                       /* 既定�EグラチE�Eション無効�E�Eimportantは付けなぁE��E*/
  background-image: var(--btn-img-default);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;               /* 画像比率を保持して収めめE*/
  border: none;
  border-radius: 0;                       /* 角丸をリセット */
  color: transparent;                     /* チE��スト�E隠す（アクセシビリチE��用にaria-label利用を推奨�E�E*/
  text-shadow: none;
  box-shadow: none;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);  /* ふわっとした動き */
  will-change: transform, box-shadow;     /* GPUアクセラレーション有効化 */
}

#title-screen .menu-button.image-button:hover {
  background-image: var(--btn-img-hover, var(--btn-img-default)) !important;
  transform: translate3d(0, -6px, 0) !important;
}

.menu-button.image-button:active {
  background-image: var(--btn-img-active, var(--btn-img-hover, var(--btn-img-default)));
  transform: translate3d(0, -2px, 0);
}

.menu-button.image-button:focus-visible {
  outline: none;
}

/* じゃんけん�EタンをCSV画像指定可能に�E�Eitle_layout.jsのbutton適用と統一�E�E*/
.janken-button.image-button {
  background: none;
  background-image: var(--btn-img-default);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  color: transparent;
  text-shadow: none;
  border: none;
  box-shadow: none;
}

.janken-button.image-button:hover {
  background-image: var(--btn-img-hover, var(--btn-img-default));
}

.janken-button.image-button:active {
  background-image: var(--btn-img-active, var(--btn-img-hover, var(--btn-img-default)));
}

/* ------------- タイトル画面: アニメーション ------------- */
@keyframes titleFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes titleSlideFromLeft {
  from { transform: translateX(-30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

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

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

.title-anim-hidden { opacity: 0; }

/* レイアウト適用までの一瞬のチラ見え防止 */
.title-prehide { opacity: 0 !important; visibility: hidden !important; }

/* 初期状態！Eeadyが付与されるまで�E��Eタイトル要素を隠ぁE*/
#title-screen:not(.ready) #title-text,
#title-screen:not(.ready) #title-logo,
#title-screen:not(.ready) #title-character,
#title-screen:not(.ready) .menu-container .menu-button {
  opacity: 0 !important;
  visibility: hidden !important;
}


.screen-header h2 {
  font-size: 28px;
  color: var(--color-text-light);
  text-shadow: 2px 2px 4px var(--color-text-dark);
}

/* 難易度選択画面専用のタイトルスタイル */
#difficulty-screen .screen-header h2 {
  font-size: 64px;
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  color: var(--color-key-main);
  font-weight: 500;
  text-shadow: 0 2px 9px rgba(255, 255, 255, 0.85);
  letter-spacing: 2px;
}

.difficulty-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.difficulty-card {
  position: absolute;
  top: 170px;
  width: 296px;
  height: 482px;
  background: #f8f8fa;
  border: 5px solid #8c96a0;
  border-radius: 28px;
  padding: 0;
  color: var(--color-neutral-dark);
  box-shadow: 0 4px 12px rgba(26, 44, 63, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

/* �e�J�[�h�̉��ʒu */
.difficulty-card[data-difficulty="easy"] {
  left: 79px;
}

.difficulty-card[data-difficulty="normal"] {
  left: 446px;
}

.difficulty-card[data-difficulty="hard"] {
  left: 813px;
}

.difficulty-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 18px 36px rgba(26, 44, 63, 0.22);
}

.difficulty-card.resume-available {
  border-color: var(--color-key-bright);
  box-shadow: 0 0 0 6px rgba(255, 143, 179, 0.4);
}

.difficulty-card.resume-available::after {
  content: '続きから';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 36px;
  border-radius: 999px;
  background: rgba(255, 143, 179, 0.88);
  color: var(--color-text-light);
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(26, 44, 63, 0.45);
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
}

.difficulty-card h3 {
  position: absolute;
  top: 1.56%;
  left: 0;
  right: 0;
  font-size: 32px;
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  margin: 0;
  color: #d63384;
  font-weight: 400;
  white-space: nowrap;
  letter-spacing: 0.5px;
  text-align: center;
}

/* ��Փx���x���\�L�i���}�[�N + �p��j */
.difficulty-level {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 32px;
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  font-weight: 400;
  color: #4a5568;
  white-space: nowrap;
  letter-spacing: 1px;
}

.difficulty-thumbnail {
  position: absolute;
  left: 0;
  top: 90px;
  width: 296px;
  height: 397px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  overflow: hidden;
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
}



.difficulty-info {
  flex: 1;
  text-align: center;
}

.difficulty-info p {
  margin: 15px 0;
  font-size: 16px;
  color: var(--color-text-muted);
}

.select-difficulty-btn {
  display: none; /* FigmaチE��インには選択�Eタンが表示されてぁE��ぁE��めE��表示 */
}

/* 100%負けるモードトグル */
.always-lose-toggle-container {
  position: absolute;
  top: 683px;
  left: 50%;
  transform: translateX(-50%);
  width: 330px;
  height: 70px;
  background: rgba(255, 220, 232, 0.5);
  border-radius: 12px;
  box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  padding: 0;
  pointer-events: auto;
  z-index: 10;
}

.always-lose-icon {
  position: absolute;
  left: 15px;
  top: 13px;
  width: 28px;
  height: 23.4px;
  transform: scale(1.2);
  transform-origin: left center;
  pointer-events: none;
}

.always-lose-title {
  position: absolute;
  left: 46px;
  top: 13px;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: #333333;
  letter-spacing: 0.38px;
  margin: 0;
  line-height: 24px;
  pointer-events: none;
}

.always-lose-description {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 35px;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 19px;
  color: #777777;
  letter-spacing: 0.38px;
  margin: 0;
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
}

.always-lose-switch {
  position: absolute;
  left: 278px;
  top: 13px;
  width: 37.5px;
  height: 22.5px;
  cursor: pointer;
  z-index: 11;
}

.always-lose-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.always-lose-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 37.5px;
  height: 22.5px;
  background: #cccccc;
  border-radius: 11.25px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.always-lose-slider::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18.5px;
  height: 18.5px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.always-lose-checkbox:checked + .always-lose-slider {
  background: #d63384;
}

.always-lose-checkbox:checked + .always-lose-slider::before {
  transform: translateX(15px);
}

.always-lose-slider:hover {
  background: #b8b8b8;
}

.always-lose-checkbox:checked + .always-lose-slider:hover {
  background: #c42a77;
}

/* 難易度選択画面専用の戻る�Eタン�E�右上�E置�E�E*/
.title-return-button {
  position: absolute;
  top: 24px;
  right: 37px;
  width: 80px;
  height: 80px;
  padding: 0;
  background: rgba(140, 150, 160, 0.8);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.title-return-button svg {
  width: 48px;
  height: 48px;
  color: #ffffff;
  display: block;
}

.title-return-button svg path {
  fill: currentColor;
}

.title-return-button:hover {
  transform: scale(1.1);
  background: rgba(140, 150, 160, 0.8);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.conversation-back-button {
  background: rgba(140, 150, 160, 0.7);
}

.conversation-back-button:hover {
  background: rgba(140, 150, 160, 0.7);
}

/* 会話シーン */
.conversation-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  overflow: hidden;
}

.conversation-background img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.conversation-background-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  display: none;
}

.conversation-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 1);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
  transition: opacity 0.3s ease, background 0.3s ease;
}

.conversation-overlay.is-dark {
  opacity: 0.6;
}

.conversation-overlay.is-blackout {
  opacity: 1;
}

.conversation-overlay.is-flash {
  background: rgba(255, 255, 255, 0.95);
  opacity: 0;
  animation: conversation-flash 0.4s ease both;
}

@keyframes conversation-flash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.character-container {
  position: absolute;
  width: 100%;
  height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dialogue-box {
  position: absolute;
  bottom: 120px;
  left: 50px;
  right: 50px;
  height: 120px;
  background-color: rgba(15, 52, 96, 0.9);
  border-radius: 8px;
  padding: 20px;
  border: 2px solid var(--color-key-soft);
}

.character-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--color-accent-gold);
  margin-bottom: 10px;
}

.dialogue-text {
  font-size: 18px;
  color: var(--color-text-light);
  line-height: 1.4;
  text-shadow: 1px 1px 2px var(--color-text-dark);
  white-space: pre-line;
  min-height: 48px;
}
.dialogue-controls {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  z-index: 10;
}

.dialogue-button {
  padding: 10px 20px;
  background-color: rgba(255, 143, 179, 0.8);
  border: none;
  border-radius: 5px;
  color: var(--color-text-light);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dialogue-button:hover {
  background-color: rgba(102, 126, 234, 1);
}

/* じゃんけん画面 */
.hp-display {
  position: absolute;
  top: 15px;
  left: 50px;
  right: 50px;
  display: flex;
  justify-content: space-between;
  z-index: 10;
}

.enemy-hp, .player-hp {
  font-size: 20px;
  font-weight: bold;
}

/* 難易度表示 */
.difficulty-indicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 20px;
  background: linear-gradient(135deg, var(--color-key-soft) 0%, var(--color-key-bright) 100%);
  border-radius: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#current-difficulty {
  font-size: 18px;
  font-weight: bold;
  color: var(--color-text-light);
}

.heart {
  display: inline-block;
  font-size: 32px;
  color: var(--color-key-main);
  animation: pulse 1s infinite;
  margin: 0 4px;
}

.heart.empty {
  color: var(--color-neutral-dark);
  animation: none;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* セリフエリア */
.dialogue-area {
  margin-bottom: 40px;
  text-align: center;
}

.character-dialogue {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(22, 33, 62, 0.9) 100%);
  border: 2px solid var(--color-key-soft);
  border-radius: 15px;
  padding: 20px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(255, 143, 179, 0.3);
}

.dialogue-character-name {
  font-size: 16px;
  color: var(--color-accent-gold);
  font-weight: bold;
  margin-bottom: 10px;
  text-align: left;
}

.dialogue-text {
  font-size: 18px;
  color: var(--color-text-light);
  line-height: 1.5;
  text-align: left;
  min-height: 50px;
  display: flex;
  align-items: center;
  white-space: pre-line;
}

/* じゃんけん画面専用のセリフテキスト色 */
#janken-screen .dialogue-text {
  color: #3C3C48;
}


.janken-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
}

.janken-button {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--color-key-soft) 0%, var(--color-key-bright) 100%);
  border: none;
  border-radius: 50%;
  color: var(--color-text-light);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.janken-button:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 143, 179, 0.8);
}

.janken-button:active {
  transform: scale(0.95);
}

/* 無敵モード表示 - じゃんけん画面は#janken-screen専用スタイルを使用 */


/* アイチE�� */
.item-container {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
}

.item-container h3 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--color-accent-gold);
}

.item-slots {
  display: flex;
  justify-content: space-around;
}

.item-slot {
  text-align: center;
  padding: 10px;
  background-color: rgba(255, 143, 179, 0.2);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  border: 2px solid transparent;
}

/* アイチE��スロチE��にアイコンを重ねる場合�E余白調整 */
.item-slot.has-icon {
  padding-top: 58px; /* アイコンぶん�E上余白 */
  background-position: 50% 8px;
  background-repeat: no-repeat;
  background-size: 48px 48px;
}

.item-slot:hover {
  background-color: rgba(255, 143, 179, 0.4);
}

/* アイテム使用中の表示 - じゃんけん画面は#janken-screen専用スタイルを使用 */

.item-name {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
  white-space: pre-line;
}

.item-count {
  display: block;
  font-size: 16px;
  font-weight: bold;
  color: var(--color-accent-gold);
}

/* フルスクリーン演�E */
.fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-text-dark);
  display: none;
  z-index: 9999;
}

.fullscreen-overlay.active {
  display: block;
}

.fullscreen-image {
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  animation: zoomIn 1s ease-out;
}
.undressing-control-panel {
  position: absolute;
  top: 24px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 18px;
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

.undressing-auto-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.undressing-toggle-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-key-soft);
  cursor: pointer;
}

.undressing-toggle-label {
  font-size: 13px;
  user-select: none;
}

.undressing-auto-indicator {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  user-select: none;
}

.undressing-manual-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.4);
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.undressing-manual-hint.is-hidden {
  opacity: 0;
}

.undressing-placeholder {
  color: var(--color-text-light);
  font-size: 24px;
  text-align: center;
  padding-top: 300px;
  line-height: 1.6;
}

.undressing-placeholder span {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  opacity: 0.75;
}


@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


/* 設定画面 */
#settings-screen {
  background: transparent;
  padding: 50px 100px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}

#settings-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 82px;
}

.settings-content {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 5px 160px 80px;
  display: flex;
  flex-direction: column;
  gap: 60px;
  background: transparent;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateZ(0);
  will-change: transform;
  touch-action: auto;
}

.settings-content:focus-visible {
  outline: 2px solid rgba(102, 126, 234, 0.65);
  outline-offset: 8px;
}

.settings-content::before,
.settings-content::after {
  content: '';
  position: absolute;
  pointer-events: none;
  opacity: 0.45;
  background-repeat: no-repeat;
  filter: blur(0.2px);
}

.settings-content::before {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -80px;
  background-image:
    radial-gradient(120px 120px at 40% 35%, rgba(255, 143, 179, 0.18), transparent 65%),
    radial-gradient(150px 150px at 75% 60%, rgba(102, 126, 234, 0.18), transparent 65%);
}

.settings-content::after {
  width: 360px;
  height: 360px;
  bottom: -120px;
  right: -60px;
  background-image:
    radial-gradient(130px 130px at 70% 30%, rgba(255, 214, 112, 0.15), transparent 70%),
    radial-gradient(160px 160px at 35% 70%, rgba(214, 51, 132, 0.12), transparent 70%);
}

#settings-background {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: saturate(1.05);
  background-image: url('../assets/title/background_images_title.jpg');
}

.settings-section {
  width: 100%;
  max-width: 720px;
  align-self: center;
  padding: 28px 36px;
  background: rgba(248, 248, 250, 0.92);
  border: 1px solid rgba(214, 51, 132, 0.15);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--color-progress-base);
  box-shadow: 0 18px 36px rgba(44, 62, 80, 0.08);
  position: relative;
}

.settings-section--audio {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.settings-section--audio::before {
  display: none;
}

.audio-volume-container {
  position: relative;
  width: 800px;
  height: 252px;
  background: #F8F8FA;
  border: 2px solid #8C96A0;
  border-radius: 30px;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.audio-volume-title {
  position: absolute;
  top: 11px;
  left: 37px;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: normal;
  color: #D63384;
  margin: 0;
  letter-spacing: -0.16px;
}

.audio-volume-card {
  position: absolute;
  left: 85px;
  right: 85px;
  height: 73px;
  background: #FFF8FB;
  border: 2px solid #EE88B4;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.audio-volume-card:first-of-type {
  top: 70px;
}

.audio-volume-card:last-of-type {
  top: 153px;
}

.audio-card-label {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 19px;
  line-height: normal;
  color: #333333;
  letter-spacing: -0.095px;
}

.audio-card-value {
  position: absolute;
  top: 35px;
  right: 27px;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: normal;
  color: #D63384;
  letter-spacing: -0.1px;
}

.audio-card-slider {
  position: absolute;
  top: 48px;
  left: 70px;
  right: 100px;
  height: 6px;
  display: flex;
  align-items: center;
}

.audio-card-slider .slider-line {
  display: none;
}

.audio-card-slider input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 6px;
  background: #B8BCC4;
  border-radius: 3px;
  outline: none;
  z-index: 2;
  cursor: pointer;
}

.audio-card-slider input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: #B8BCC4;
}

.audio-card-slider input[type='range']::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: #B8BCC4;
}

.audio-card-slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667E99;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
  margin-top: -5px;
}

.audio-card-slider input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.audio-card-slider input[type='range']::-webkit-slider-thumb:active {
  transform: scale(1.25);
}

.audio-card-slider input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667E99;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
  margin-top: -5px;
}

.audio-card-slider input[type='range']::-moz-range-thumb:hover {
  transform: scale(1.15);
}

.audio-card-slider input[type='range']::-moz-range-thumb:active {
  transform: scale(1.25);
}

.audio-card-slider input[type='range']::-moz-range-track {
  background: transparent;
  border: none;
}

.audio-card-slider input[type='range']::-webkit-slider-runnable-track {
  background: transparent;
  border: none;
}

.settings-card {
  width: 800px;
  max-width: 800px;
  align-self: center;
  padding: 11px 40px 32px;
  background: #F8F8FA;
  border: 2px solid #8C96A0;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  color: var(--color-progress-base);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.settings-card-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-card-title {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  color: #D63384;
  letter-spacing: -0.2px;
}

.settings-card-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card-description {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-progress-base);
}


.settings-card--game .settings-toggle {
  gap: 15px;
  padding-left: 50px;
  justify-content: flex-start;
  position: relative;
}

.settings-card--game .skip-label {
  color: #D63384;
  font-size: 26px;
  font-weight: 500;
  flex: 0 0 auto;
}

.settings-card--game .toggle-slider {
  position: absolute;
  right: 250px;
}

.settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  cursor: pointer;
  user-select: none;
}

.skip-label {
  font-size: 16px;
  color: var(--color-progress-base);
  line-height: 1.5;
  flex: 1;
}


.settings-reset-button {
  padding: 16px 28px;
  background: #FF4444;
  border: none;
  border-radius: 18px;
  color: #FEFEFE;
  font-size: 32px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 280px;
}

.settings-reset-button:hover {
  transform: translateY(-2px);
}

.settings-reset-button:active {
  transform: translateY(0);
}

/* �M�������[�S�J���J�[�h��p�X�^�C�� */
.settings-card--gallery {
  margin-bottom: 20px;
}

.settings-card--gallery .settings-toggle {
  gap: 15px;
  padding-left: 50px;
  justify-content: flex-start;
  position: relative;
}

.settings-card--gallery .skip-label {
  font-size: 26px;
  font-weight: 500;
  color: #D63384;
  flex: 0 0 auto;
}

.settings-card--gallery .toggle-slider {
  position: absolute;
  right: 250px;
}

/* �������J�[�h��p�X�^�C�� */
.settings-card--reset {
  background: #F8F8FA;
  border: 5px solid #F5B5C3;
  border-radius: 30px;
}

.settings-card--reset .settings-card-description {
  text-align: center;
  text-align-last: center;
  max-width: 100%;
  font-size: 26px;
  font-weight: 500;
  color: #D63384;
}

.settings-card--reset .settings-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* �������m�F�_�C�A���O�iFigma���S�����j */
.reset-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 1200px;
  height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 30, 30, 0.6);
  z-index: 15000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.reset-confirm-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.reset-confirm-dialog {
  position: relative;
  width: 600px;
  height: 400px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.reset-confirm-close {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #8C96A0;
  border: none;
  color: #FEFEFE;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(140, 150, 160, 0.4);
  z-index: 1;
}

.reset-confirm-close svg {
  width: 36px;
  height: 36px;
}

.reset-confirm-close:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(140, 150, 160, 0.5);
}

.reset-confirm-close:active {
  transform: scale(0.95);
}

.reset-confirm-message {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 40px;
  color: #D63384;
  text-align: center;
  line-height: 1.4;
  margin: 0;
  padding: 0 40px;
}

.reset-confirm-buttons {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
}

.reset-confirm-btn {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 40px;
  padding: 12px 40px;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 180px;
  text-align: center;
}

.reset-confirm-btn--yes {
  background: #FEFEFE;
  border: 2px solid #EE88B4;
  color: #8C96A0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.reset-confirm-btn--yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(238, 136, 180, 0.3);
}

.reset-confirm-btn--yes:active {
  transform: translateY(0);
}

.reset-confirm-btn--no {
  background: #D63384;
  border: 2px solid #D63384;
  color: #FEFEFE;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.reset-confirm-btn--no:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 51, 132, 0.4);
}

.reset-confirm-btn--no:active {
  transform: translateY(0);
}

/* ��b�X�L�b�v�m�F�_�C�A���O�iFigma�����j */
.conversation-skip-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.conversation-skip-confirm-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.conversation-skip-confirm-dialog {
  position: relative;
  width: 564px;
  height: 342px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 28px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}

.conversation-skip-confirm-close {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #8C96A0;
  border: none;
  color: #FEFEFE;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(140, 150, 160, 0.4);
  z-index: 1;
}

.conversation-skip-confirm-close svg {
  width: 46px;
  height: 46px;
}

.conversation-skip-confirm-close:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(140, 150, 160, 0.5);
}

.conversation-skip-confirm-close:active {
  transform: scale(0.95);
}

.conversation-skip-confirm-message {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 40px;
  color: #D63384;
  text-align: center;
  line-height: 1.4;
  margin: 0;
  padding: 46px 40px 0;
}

.conversation-skip-confirm-buttons {
  display: flex;
  gap: 42px;
  align-items: center;
  justify-content: center;
  padding-bottom: 46px;
  margin-top: auto;
}

.conversation-skip-confirm-btn {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 40px;
  padding: 9.5px 40px;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 180px;
  text-align: center;
}

.conversation-skip-confirm-btn--yes {
  background: #FEFEFE;
  border: 2px solid #EE88B4;
  color: #8C96A0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.conversation-skip-confirm-btn--yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(238, 136, 180, 0.3);
}

.conversation-skip-confirm-btn--yes:active {
  transform: translateY(0);
}

.conversation-skip-confirm-btn--no {
  background: #D63384;
  border: 2px solid #D63384;
  color: #FEFEFE;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.conversation-skip-confirm-btn--no:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 51, 132, 0.4);
}

.conversation-skip-confirm-btn--no:active {
  transform: translateY(0);
}

/* �|�[�Y���j���[ �^�C�g���ɖ߂�m�F�_�C�A���O�iFigma�����j */
.pause-quit-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 30, 30, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 13000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.pause-quit-confirm-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.pause-quit-confirm-dialog {
  position: relative;
  width: 600px;
  height: 400px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 50px;
}

.pause-quit-confirm-close {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #8C96A0;
  color: #FEFEFE;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(140, 150, 160, 0.4);
  z-index: 1;
}

.pause-quit-confirm-close svg {
  width: 36px;
  height: 36px;
}

.pause-quit-confirm-close:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(140, 150, 160, 0.5);
}

.pause-quit-confirm-close:active {
  transform: scale(0.95);
}

.pause-quit-confirm-message {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 40px;
  color: #D63384;
  text-align: center;
  line-height: 1.4;
  margin: 0;
  padding: 0 40px;
}

.pause-quit-confirm-buttons {
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: center;
}

.pause-quit-confirm-btn {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 40px;
  padding: 12px 40px;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 180px;
  text-align: center;
}

.pause-quit-confirm-btn--yes {
  background: #FEFEFE;
  border: 2px solid #EE88B4;
  color: #8C96A0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.pause-quit-confirm-btn--yes:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(238, 136, 180, 0.3);
}

.pause-quit-confirm-btn--yes:active {
  transform: translateY(0);
}

.pause-quit-confirm-btn--no {
  background: #D63384;
  border: 2px solid #D63384;
  color: #FEFEFE;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.pause-quit-confirm-btn--no:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(214, 51, 132, 0.4);
}

.pause-quit-confirm-btn--no:active {
  transform: translateY(0);
}

/* �e�L�X�g�\���J�[�h��p�X�^�C���iFigma�����j */
.settings-card--text {
  background: #f8f8fa;
  border: 2px solid #8c96a0;
  border-radius: 30px;
}

.settings-card--text .settings-card-title {
  font-weight: 800;
  font-size: 32px;
  color: #d63384;
  letter-spacing: -0.16px;
}

.settings-card--text .settings-radio-group {
  width: 100%;
  display: flex;
  gap: 30px;
  flex-wrap: nowrap;
  justify-content: center;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
}

.settings-radio-group {
  background: rgba(255, 143, 179, 0.08);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(214, 51, 132, 0.18);
}

.settings-radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-radio-option {
  position: relative;
  flex: 1;
}

/* �e�L�X�g�\���J�[�h��̃��W�I�I�v�V�����iFigma�����̌Œ蕝�j */
.settings-card--text .settings-radio-option {
  flex: 0 0 auto;
}

.settings-radio-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-radio-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--color-progress-base);
  background: #fefefe;
  color: var(--color-progress-base);
  font-size: 16px;
  font-weight: 700;
  min-width: 96px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* �e�L�X�g�\���J�[�h��̃��W�I�{�^����p�X�^�C���iFigma�����j */
.settings-card--text .settings-radio-label {
  width: 150px;
  height: 30px;
  padding: 10px 18px;
  border-radius: 25px;
  border: 2px solid #ee88b4;
  background: #fefefe;
  color: #c8216c;
  font-size: 24px;
  font-weight: 500;
  min-width: auto;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-card--text .settings-radio-option input:checked + .settings-radio-label {
  background: #ffd9e8;
  border: 5px solid #d63384;
  border-radius: 28px;
  color: #c8216c;
  box-shadow: 0 2px 6px #d63384;
}

.settings-card--text .settings-radio-option input:focus-visible + .settings-radio-label {
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.35);
}

.settings-radio-option input:checked + .settings-radio-label {
  background: var(--color-key-main);
  border-color: var(--color-key-main);
  color: var(--color-text-light);
  box-shadow: 0 0 0 4px rgba(214, 51, 132, 0.25);
}

.settings-radio-option input:focus-visible + .settings-radio-label {
  outline: none;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.35);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ギャラリー */
#gallery-screen {
  padding: 50px 100px;
  background: url('../assets/title/background_images_title.jpg') center / cover no-repeat;
  background-color: var(--color-bg-base);
  color: var(--color-progress-base);
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}

#gallery-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 82px;
}

#gallery-screen .screen-header {
  position: relative;
  top: 20px;
  left: 20px;
  right: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 980px;
  padding: 0 8px;
  z-index: 1;
}

#gallery-screen .screen-header h2 {
  color: #2C3E50;
  text-shadow: none;
  font-size: 50px;
  letter-spacing: 0.05em;
  font-weight: 900;
  margin: 0;
  position: relative;
  left: 10px;
  top: 10px;
}

#credits-screen {
  background: url('../assets/title/background_images_title.jpg') center / cover no-repeat;
  background-color: var(--color-bg-base);
  color: var(--color-progress-base);
  box-sizing: border-box;
  position: relative;
  padding: 50px 100px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
}

#credits-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 82px;
}

#credits-screen .screen-header {
  position: relative;
  top: 20px;
  left: 20px;
  right: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 980px;
  padding: 0 8px;
  z-index: 10;
  flex-shrink: 0;
}

#credits-screen .screen-header h2 {
  color: #2C3E50;
  text-shadow: none;
  font-size: 50px;
  letter-spacing: 0.05em;
  font-weight: 900;
  margin: 0;
  position: relative;
  left: 10px;
  top: 10px;
}

.credits-cards-container {
  display: flex;
  flex-direction: column;
  gap: 60px;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateZ(0);
  will-change: transform;
  touch-action: auto;
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 0 0 50px 0;
  box-sizing: border-box;
}

.credits-card {
  position: relative;
  width: 800px;
  height: 440px;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.credits-card-background {
  position: absolute;
  background: #f8f8fa;
  border: 2px solid #8c96a0;
  border-radius: 30px;
  inset: 0;
  z-index: 0;
}

.credits-header-title {
  position: absolute;
  top: 2.46%;
  left: 4.63%;
  right: 43.5%;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 32px;
  line-height: normal;
  color: #d63384;
  letter-spacing: -0.16px;
  white-space: nowrap;
  margin: 0;
  z-index: 1;
}

.credits-main-text {
  position: absolute;
  top: 14.29%;
  left: 4.63%;
  right: 5%;
  bottom: 5.36%;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1.5;
  color: #000000;
  letter-spacing: -0.15px;
  z-index: 1;
}

.credits-name {
  position: absolute;
  top: 245px;
  left: 57%;
  width: 150px;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: normal;
  color: #000000;
  letter-spacing: -0.15px;
  white-space: nowrap;
  text-align: center;
  z-index: 1;
}

.credits-ririum-icon {
  position: absolute;
  left: 57%;
  top: 77px;
  width: 150px;
  height: 150px;
  object-fit: cover;
  z-index: 1;
}

.credits-ririum-qr {
  position: absolute;
  left: 78.38%;
  top: 79px;
  width: 150px;
  height: 150px;
  object-fit: cover;
  z-index: 1;
}

.credits-x-logo {
  position: absolute;
  left: 85.5%;
  top: 238px;
  width: auto;
  height: auto;
  max-width: 35px;
  object-fit: contain;
  z-index: 1;
}

.collection-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 17px;
  font-size: 28px;
  font-weight: 500;
  color: #999999;
  background: #FFF4F7;
  border-radius: 24px;
  border: 2px solid rgba(214, 51, 132, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  margin-right: 40px;
}

.collection-heart {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.collection-status span {
  font-size: 28px;
  color: #999999;
  font-weight: 500;
}

#gallery-count {
  color: #D63384;
}

.collection-separator,
.collection-unit {
  color: #999999;
}

.shop-points {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 17px;
  font-size: 28px;
  font-weight: 500;
  color: #999999;
  background: #FEFEFE;
  border-radius: 24px;
  border: 2px solid rgba(214, 51, 132, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
  margin-right: 40px;
}

.shop-diamond-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  fill: #8C96A0;
}

.shop-points span {
  font-size: 28px;
  color: #999999;
  font-weight: 500;
}

.shop-points .points-unit {
  color: #D63384;
  font-weight: 400;
}

.gallery-content {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 920px;
  padding: 40px;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  -webkit-transform: translateZ(0);
  will-change: transform;
  touch-action: auto;
  position: relative;
  z-index: 1;
  margin: 0 auto 35px;
}

.gallery-content::-webkit-scrollbar {
  width: 10px;
}

.gallery-content::-webkit-scrollbar-track {
  background: rgba(44, 62, 80, 0.08);
  border-radius: 6px;
}

.gallery-content::-webkit-scrollbar-thumb {
  background: rgba(214, 51, 132, 0.3);
  border-radius: 6px;
}

.gallery-content::-webkit-scrollbar-thumb:hover {
  background: rgba(214, 51, 132, 0.5);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
  justify-content: center;
}

.gallery-item {
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 180px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(214, 51, 132, 0.14);
  border-radius: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 16px 30px rgba(44, 62, 80, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.gallery-item svg {
  opacity: 0.8;
}

.gallery-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 143, 179, 0.12), rgba(102, 126, 234, 0.08));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 36px rgba(44, 62, 80, 0.14);
  border-color: rgba(214, 51, 132, 0.28);
}

.gallery-item:hover::before {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 3px solid rgba(102, 126, 234, 0.65);
  outline-offset: 4px;
}

.gallery-item.unlocked {
  background-size: cover;
  background-position: center;
  color: transparent;
}

.gallery-item.unlocked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gallery-item.unlocked:hover::after {
  opacity: 1;
}
/* =========================================
   ギャラリービューア（洗練されたUI）
   ========================================= */

.image-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1200px;
  height: 800px;
  background-color: #ffeff5;
  display: none;
  z-index: 10000;
}

.image-viewer.active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewer-media {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  display: none;
  border-radius: 8px;
  transition: transform 0.2s ease;
  transform-origin: center center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.viewer-media.zoomable {
  cursor: grab;
  user-select: none;
}

.viewer-media.zoomable.dragging {
  cursor: grabbing;
  user-select: none;
}

.viewer-media.zoomed {
  max-width: none;
  max-height: none;
}

#viewer-video {
  background-color: rgba(0, 0, 0, 0.85);
}

/* ズーム倍率表示 */
.viewer-zoom-indicator {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background-color: rgba(140, 150, 160, 0.9);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  z-index: 11;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.viewer-zoom-indicator.visible {
  opacity: 1;
}

/* 右上のコントロールボタン群 - 個別配置で下端揃え */
.viewer-top-controls {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.viewer-top-controls > * {
  pointer-events: auto;
}

/* ビューアボタン共通スタイル */
.viewer-btn {
  position: absolute;
  border-radius: 50%;
  border: none;
  background-color: rgba(140, 150, 160, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.viewer-btn:hover {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.viewer-btn:active {
  transform: scale(0.95);
}

/* 閉じるボタン（ギャラリー専用に調整 - 画像に被らないよう余白内に配置） */
.viewer-btn--close {
  top: 5px;
  right: 5px;
  width: 38px;
  height: 38px;
  opacity: 0.5;
}

.viewer-btn--close .viewer-icon {
  width: 27px;
  height: 27px;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

/* 左右のナビゲーションボタン（ギャラリー専用に調整） */
.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background-color: rgba(242, 164, 198, 0.85);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.viewer-nav:hover {
  background-color: rgba(242, 164, 198, 0.85);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

.viewer-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.viewer-nav--prev {
  left: 10px;
}

.viewer-nav--next {
  right: 10px;
}

.viewer-nav .viewer-icon {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
  pointer-events: none;
}

/* 最終お披露目 */
.final-reveal-content {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
}

/* エンチE��ング画面 */
.ending-title {
  position: absolute;
  top: 50px;
  width: 100%;
  text-align: center;
  z-index: 10;
}

#ending-title-text {
  font-size: 32px;
  color: var(--color-accent-gold);
  text-shadow: 2px 2px 4px var(--color-text-dark);
}

.ending-dialogue {
  margin-bottom: 30px;
  text-align: center;
}

.ending-dialogue p {
  font-size: 20px;
  margin: 15px 0;
  color: var(--color-text-light);
  text-shadow: 1px 1px 2px var(--color-text-dark);
}

.ending-reward {
  font-size: 24px;
  color: var(--color-accent-gold);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

.ending-action-gallery-message,
.ending-action-special-message {
  text-align: center;
  margin: 15px 0;
  font-size: 18px;
  color: var(--color-accent-pink);
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

.ending-action-gallery-message.is-visible,
.ending-action-special-message.is-visible {
  opacity: 1;
}

.ending-action-special-message {
  color: #FFD700;
  font-size: 20px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.ending-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

/* ショチE�E画面 */
#shop-screen {
  padding: 50px 100px;
  background: url('../assets/title/background_images_title.jpg') center / cover no-repeat;
  background-color: var(--color-bg-base);
  color: var(--color-progress-base);
  box-sizing: border-box;
  position: relative;
}

#shop-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 105px;
}

#shop-screen::before,
#shop-screen::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
  filter: blur(0.4px);
  opacity: 0.45;
  background-repeat: no-repeat;
}

#shop-screen::before {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -60px;
  background-image:
    radial-gradient(120px 120px at 38% 35%, rgba(255, 143, 179, 0.18), transparent 65%),
    radial-gradient(150px 150px at 75% 60%, rgba(102, 126, 234, 0.18), transparent 65%);
}

#shop-screen::after {
  width: 360px;
  height: 360px;
  bottom: -120px;
  right: -80px;
  background-image:
    radial-gradient(130px 130px at 70% 30%, rgba(255, 214, 112, 0.15), transparent 70%),
    radial-gradient(160px 160px at 35% 70%, rgba(214, 51, 132, 0.12), transparent 70%);
}

#shop-screen .screen-header {
  position: relative;
  top: 20px;
  left: 20px;
  right: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: 980px;
  padding: 0 8px;
  z-index: 1;
}

#shop-screen .screen-header h2 {
  color: #2C3E50;
  text-shadow: none;
  font-size: 50px;
  letter-spacing: 0.05em;
  font-weight: 900;
  margin: 0;
  position: relative;
  left: 10px;
  top: 10px;
}

#shop-current-points {
  color: #D63384;
}

.shop-container {
  position: relative;
  width: 100%;
  max-width: 1080px;
  padding: 0;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  z-index: 1;
  color: var(--color-progress-base);
}

.shop-item {
  position: relative;
  width: 280px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 16px;
  padding: 24px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.13);
}

/* �A�C�R���~�`�w�i */
.shop-item .shop-icon {
  order: 1;
  align-self: center;
  width: 125px;
  height: 125px;
  border-radius: 50%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  margin: -6px 0 -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.shop-item .shop-count {
  position: absolute;
  right: -42px;
  bottom: 6px;
  font-size: 32px;
  font-weight: 700;
  color: #FFF7FB;
  text-shadow: 0 0 4px rgba(255, 100, 150, 0.8);
  pointer-events: none;
  display: none;
}

.shop-item .item-name {
  order: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  font-weight: 800;
  color: #2E3A44;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin: 0 0 2px;
  min-height: calc(36px * 2.6); /* 2�s�Ԃ�̍�����펞�m�� */
  text-align: center;
  white-space: pre-line;
}

/* win5�A�C�e�����͍����� */
.shop-item[data-item="win5"] .item-name {
  align-items: flex-start;
  text-align: left;
}

.shop-item .item-description {
  order: 3;
  font-size: 30px;
  line-height: 1.35;
  color: #7B8893;
  margin: 0 0 14px;
}

.shop-item .item-price {
  order: 4;
  font-size: 30px;
  font-weight: 800;
  color: #FF6496;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0 0 6px;
}

.buy-button {
  order: 5;
  width: 179px;
  padding: 0;
  height: 59px;
  background: #D63384;
  border: 2px solid transparent;
  border-radius: 9999px;
  color: #FFFFFF;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  text-align: center;
  margin-top: 15px;
  margin-bottom: 25px;
}

.buy-button:hover {
  transform: scale(1.05);
  background: #C23071;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.buy-button:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.buy-button:disabled {
  background: linear-gradient(to right, rgba(140, 150, 160, 0.4), rgba(140, 150, 160, 0.26));
  color: rgba(248, 248, 250, 0.88);
  border-color: #DD99B4;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  cursor: not-allowed;
  transform: none;
}

.buy-button:focus-visible {
  outline: 2px solid rgba(102, 126, 234, 0.6);
  outline-offset: 3px;
}

/* 通知 */
.notification {
  position: fixed;
  top: 20px;
  right: 50px;
  background-color: var(--color-accent-gold);
  color: var(--color-neutral-dark);
  padding: 10px 20px;
  border-radius: 5px;
  font-weight: bold;
  display: none;
  z-index: 10001;
  animation: slideIn 0.3s ease-out;
}

.notification.active {
  display: block;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 共通�Eタン */
.back-button {
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 40px;
  background: linear-gradient(135deg, var(--color-key-soft) 0%, var(--color-key-bright) 100%);
  border: none;
  border-radius: 8px;
  color: var(--color-text-light);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 100;
}

.back-button:hover {
  transform: translateX(-50%) scale(1.05);
}

/* タイプライターエフェクチE*/
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

.typewriter {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(30, end);
}

.collection-status,
.shop-points {
  position: absolute;
  top: 50%;
  right: 50px;
  transform: translateY(-50%) scale(1.2);
  font-size: 22px;
  color: var(--color-accent-gold);
}

/* 購入モーダル */
.purchase-modal, .error-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10002;
  opacity: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.28s ease;
}

.purchase-modal.active, .error-modal.active {
  opacity: 1;
}

.purchase-modal-content, .error-modal-content {
  position: relative;
  background: rgba(248, 248, 250, 0.96);
  border: 1px solid rgba(214, 51, 132, 0.16);
  border-radius: 24px;
  padding: 36px 44px 40px;
  text-align: center;
  box-shadow: 0 28px 48px rgba(44, 62, 80, 0.18);
  transform: translateY(18px) scale(0.92);
  transition: transform 0.28s ease, opacity 0.28s ease;
  min-width: 420px;
  color: var(--color-progress-base);
  overflow: hidden;
}

.purchase-modal-content::before,
.error-modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 143, 179, 0.18), rgba(118, 75, 162, 0.12));
  opacity: 0.8;
  mix-blend-mode: lighten;
}

.purchase-modal-content::after,
.error-modal-content::after {
  content: '';
  position: absolute;
  inset: 16px 20px auto;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 143, 179, 0.45), rgba(102, 126, 234, 0.32));
  opacity: 0.7;
}

.purchase-modal-content.purchase-card {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  height: 440px;
  padding: 24px 20px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  color: #2E3A44;
}

.purchase-modal-content.purchase-card::before,
.purchase-modal-content.purchase-card::after {
  content: none;
}

.error-modal-content::after {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.5), rgba(255, 144, 144, 0.32));
}

.purchase-modal.active .purchase-modal-content,
.error-modal.active .error-modal-content {
  transform: translateY(0) scale(1);
}

.purchase-success-icon {
  width: 154.79px;
  height: 154.79px;
  margin: -8px 0 -14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: successPulse 0.5s ease;
}

.purchase-success-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.error-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--color-error-start) 0%, var(--color-error-end) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--color-text-light);
  animation: errorShake 0.5s ease;
  box-shadow: 0 16px 26px rgba(255, 107, 107, 0.28);
}

@keyframes successPulse {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

/* 脱衣演�E用アニメーション */
@keyframes zoom_in {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes flash {
  0%, 100% {
    opacity: 1;
  }
  25% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
    filter: brightness(1.5);
  }
  75% {
    opacity: 0.5;
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.8),
                0 0 60px rgba(255, 192, 203, 0.6),
                0 0 80px rgba(255, 105, 180, 0.4);
  }
  100% {
    box-shadow: 0 0 20px rgba(255, 255, 255, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

@keyframes rotate360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* スライドアニメーション - 上から下へ */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* スライドアニメーション - 下から上へ */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* スライドアニメーション - 左から右へ */
@keyframes slideRight {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* スライドアニメーション - 右から左へ */
@keyframes slideLeft {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* カーチE��風演�E - 上から要E��被さる */
@keyframes curtainDown {
  0% {
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    opacity: 1;
  }
}

/* カーチE��風演�E - 横から要E��被さる */
@keyframes curtainRight {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    opacity: 1;
  }
}

/* 渦巻き演�E */
@keyframes spiral {
  from {
    transform: rotate(0deg) scale(0);
    opacity: 0;
  }
  to {
    transform: rotate(720deg) scale(1);
    opacity: 1;
  }
}

/* 波打つ演�E */
@keyframes wave {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }
  25% {
    transform: translateY(-20px) scaleY(0.9);
  }
  50% {
    transform: translateY(0) scaleY(1.1);
  }
  75% {
    transform: translateY(20px) scaleY(0.9);
  }
}

.purchase-modal-content h2, .error-modal-content h2 {
  position: relative;
  color: var(--color-key-main);
  font-size: 26px;
  margin-bottom: 18px;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.error-modal-content h2 {
  color: var(--color-danger-soft);
}

.purchase-item-name {
  font-size: 24px;
  color: var(--color-progress-base);
  font-weight: bold;
  margin: 10px 0;
}

.purchase-price {
  font-size: 20px;
  color: var(--color-danger-text);
  margin: 10px 0;
}

.purchase-message, .error-message {
  font-size: 16px;
  color: rgba(44, 62, 80, 0.7);
  margin: 18px 0 4px;
  line-height: 1.6;
}

.purchase-ok-btn, .error-ok-btn {
  padding: 12px 44px;
  background: linear-gradient(135deg, var(--color-key-main) 0%, var(--color-key-soft) 100%);
  border: none;
  border-radius: 999px;
  color: var(--color-text-light);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-top: 26px;
  box-shadow: 0 14px 26px rgba(214, 51, 132, 0.22);
}

.purchase-ok-btn:hover, .error-ok-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(214, 51, 132, 0.3);
}

.purchase-ok-btn:active, .error-ok-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 18px rgba(214, 51, 132, 0.18);
}

.purchase-ok-btn:focus-visible, .error-ok-btn:focus-visible {
  outline: 2px solid rgba(102, 126, 234, 0.65);
  outline-offset: 4px;
}

.purchase-modal-content.purchase-card h2 {
  color: #E04480;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 2px;
  letter-spacing: 0.06em;
}

.purchase-modal-content.purchase-card .purchase-item-name {
  font-size: 36px;
  font-weight: 800;
  color: #333333;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin: 0 0 2px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(36px * 2.6);
  white-space: pre-line;
  text-align: left;
}

.purchase-modal-content.purchase-card .purchase-price {
  font-size: 30px;
  font-weight: 800;
  color: #FF6496;
  letter-spacing: 0.01em;
  line-height: 1;
  margin: 0 0 5px;
}

.purchase-modal-content.purchase-card .purchase-message {
  font-size: 18px;
  color: #7B8893;
  margin: 0 0 12px;
}

.purchase-modal-content.purchase-card .purchase-ok-btn {
  width: 179px;
  height: 59px;
  padding: 0;
  background: #D63384;
  border-radius: 9999px;
  color: #FFFFFF;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 15px 0 15px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.purchase-modal-content.purchase-card .purchase-ok-btn:hover {
  transform: scale(1.05);
  background: #C23071;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.purchase-modal-content.purchase-card .purchase-ok-btn:active {
  transform: scale(0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* スキチE�E設定トグル */
.skip-setting {
  position: absolute;
  top: 100px;
  right: 50px;
  background: linear-gradient(135deg, var(--color-progress-dark) 0%, var(--color-progress-darker) 100%);
  border: 2px solid var(--color-key-soft);
  border-radius: 10px;
  padding: 15px 20px;
}

.skip-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.skip-label {
  color: var(--color-progress-base);
  font-size: 16px;
  line-height: 1.5;
  flex: 1;
  margin-right: 0;
}

.skip-checkbox {
  display: none;
}

.toggle-slider {
  width: 60px;
  height: 30px;
  background-color: var(--color-support-base);
  border-radius: 15px;
  position: relative;
  transition: background-color 0.3s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: var(--color-text-light);
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
}

.skip-checkbox:checked + .toggle-slider {
  background-color: var(--color-key-main);
}

.skip-checkbox:checked + .toggle-slider::after {
  transform: translateX(30px);
}

.skip-toggle:hover .toggle-slider {
  box-shadow: 0 0 10px rgba(255, 143, 179, 0.5);
}

/* =============================
   会話シーン: ビジュアルノ�Eル風UI
   - フル幁E�E半透�E帯状セリフエリア
   - グラスモーフィズムの操作�Eタン
   ============================= */
#conversation-screen { 
  /* 会話帯の高さ�E�他要素の位置計算にも使用�E�E*/
  --conv-band-height: 180px;
  position: relative;
  overflow: hidden;
}

#conversation-screen .dialogue-box {
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--conv-band-height);
  background: rgba(0, 0, 0, 0.75);
  border: none;
  border-radius: 0;
  padding: 24px 32px;
  z-index: 9;
}

#conversation-screen .character-name {
  color: var(--color-text-light);
  opacity: 1;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 32px;
}

#conversation-screen #conversation-dialogue-text {
  color: #222222;
  text-shadow: none;
  font-size: 30px;
  line-height: 1.5;
  white-space: pre-line;
}

/* セリフ�E容の表示幁E��中央寁E��に制限（読みめE��さ�Eため�E�E*/
#conversation-screen .dialogue-box .character-name,
#conversation-screen .dialogue-box #conversation-dialogue-text {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

#conversation-screen .dialogue-controls {
  position: absolute;
  /* 半透�Eエリアの上墁E��付近に配置�E�少しだけ�E側に入れる�E�E*/
  bottom: calc(var(--conv-band-height) - 12px);
  right: 32px;
  left: auto;
  transform: none;
  display: flex;
  gap: 12px;
  z-index: 11;
}

#conversation-screen .dialogue-button {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#conversation-screen .dialogue-button:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

#conversation-screen .dialogue-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.2);
}

/* 右上コントロールコンチE�� */
#conversation-screen .top-right-controls {
  position: absolute;
  top: 16px;
  right: 24px;
  display: flex;
  gap: 10px;
  z-index: 12;
}

/* 右上�Eタン�E�グラス風�E�E*/
#conversation-screen .top-right-controls .top-right-button {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

#conversation-screen .top-right-controls .top-right-button:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

#conversation-screen .top-right-controls .top-right-button:active {
  transform: translateY(0);
}

/* UIを隠す状態（会話帯とボタン群のみ非表示�E�E*/
#conversation-screen.conversation-ui-hidden .dialogue-box,
#conversation-screen.conversation-ui-hidden .dialogue-controls {
  display: none;
}
#conversation-screen.conversation-ui-hidden .name-box,
#conversation-screen.conversation-ui-hidden .message-box,
#conversation-screen.conversation-ui-hidden .control-buttons {
  opacity: 0;
  visibility: hidden;
}
#conversation-screen.conversation-ui-hidden .hide-ui-button {
  opacity: 0.8;
}

/* ��b�V�[���iFigma���C�A�E�g�Ή��j */
#conversation-screen {
  --conv-band-height: 180px;
  position: relative;
  width: 1200px;
  height: 800px;
}

#conversation-screen .conversation-layout {
  position: absolute;
  inset: 0;
  width: 1200px;
  height: 800px;
  background-color: #faebf2;
  overflow: hidden;
}

#conversation-screen .conversation-background {
  z-index: 1;
}

#conversation-screen .conversation-click-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: transparent;
  pointer-events: auto;
}

#conversation-screen .conversation-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.3s ease;
}

#conversation-screen .conversation-overlay.is-dark {
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.6);
}

#conversation-screen .conversation-overlay.is-blackout {
  opacity: 1;
  background: rgba(0, 0, 0, 0.85);
}

#conversation-screen .conversation-overlay.is-flash {
  background: rgba(255, 255, 255, 0.95);
  opacity: 0;
  animation: conversation-flash 0.4s ease both;
}

#conversation-screen .character-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

#conversation-screen .character-layer .character-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#conversation-screen .character-layer .character-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: none;
}

#conversation-screen .hide-ui-button {
  position: absolute;
  top: 32px;
  left: 993px;
  width: 72px;
  height: 72px;
  background-color: #8c96a0;
  opacity: 0.7;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
}

#conversation-screen .hide-ui-button:hover {
  opacity: 1;
  transform: scale(1.05);
}

#conversation-screen .hide-ui-button .eye-open,
#conversation-screen .hide-ui-button .eye-slash {
  position: absolute;
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#conversation-screen .hide-ui-button .eye-open {
  opacity: 1;
  transform: scale(1);
}

#conversation-screen .hide-ui-button .eye-slash {
  opacity: 0;
  transform: scale(0.8);
}

#conversation-screen .hide-ui-button.ui-hidden .eye-open {
  opacity: 0;
  transform: scale(0.8);
}

#conversation-screen .hide-ui-button.ui-hidden .eye-slash {
  opacity: 1;
  transform: scale(1);
}

#conversation-screen .name-box {
  position: absolute;
  left: 115px;
  top: 560px;
  width: 162px;
  height: 57px;
  background-color: #d63384;
  border-radius: 10px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#conversation-screen .name-box.hidden {
  opacity: 0;
  visibility: hidden;
}

#conversation-screen .character-name {
  font-size: 32px;
  font-weight: 500;
  color: #fefefe;
  text-align: center;
  line-height: 1;
  position: relative;
  top: 4px;
}

#conversation-screen .message-box {
  position: absolute;
  left: 80px;
  right: 80px;
  top: 588px;
  height: 160px;
  background-color: rgba(248, 248, 250, 0.75);
  border-radius: 10px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  z-index: 5;
  padding: 35px 50px 35px 50px;
  box-sizing: border-box;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#conversation-screen .message-box.hidden {
  opacity: 0;
  visibility: hidden;
}

#conversation-screen .message-text {
  font-size: 30px;
  font-weight: 500;
  color: #222222;
  line-height: normal;
  white-space: pre-wrap;
  margin: 0;
  opacity: 1;
}

#conversation-screen .control-buttons {
  position: absolute;
  top: 533px;
  right: 80px;
  z-index: 6;
  display: flex;
  gap: 9px;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#conversation-screen .control-buttons.hidden {
  opacity: 0;
  visibility: hidden;
}

#conversation-screen .control-btn {
  width: 46px;
  height: 46px;
  background-color: #f8f8fa;
  opacity: 0.8;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  color: #1e1e1e;
  transition: all 0.3s ease;
}

#conversation-screen .control-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

#conversation-screen .control-btn:active {
  transform: scale(0.95);
}

#conversation-screen .control-btn svg {
  width: 32px;
  height: 32px;
}

#conversation-screen .control-btn.active {
  background-color: #5a6570;
  opacity: 1;
}

#conversation-screen .control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

#conversation-screen #btn-auto svg {
  width: 36px;
  height: 36px;
}

#conversation-screen #btn-back {
  margin-left: 46px;
}

/* タブレット以上のみに適用（スマホは除外） */
@media screen and (min-width: 901px) and (max-width: 1199px) {
  #conversation-screen .conversation-layout {
    transform: scale(0.9);
    transform-origin: center;
  }
}

@media screen and (min-width: 901px) and (max-width: 1079px) {
  #conversation-screen .conversation-layout {
    transform: scale(0.8);
  }
}

/* スマホ（900px以下）では追加スケールを適用しない */
@media screen and (max-width: 900px) {
  #conversation-screen .conversation-layout {
    transform: none;  /* body のスケールのみ適用 */
  }
}

/* Ending screen custom layout */
#ending-screen .ending-ui {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 56px 48px;
  box-sizing: border-box;
  z-index: 2;
}

#ending-screen .ending-action-panel {
  width: 100%;
  max-width: 800px;
  display: none;
  padding: 20px;
  box-sizing: border-box;
}

#ending-screen .ending-action-card {
  position: relative;
  background: rgba(248, 248, 250, 0.95);
  border: 5px solid #8c96a0;
  border-radius: 28px;
  padding: 56px 60px 60px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  box-sizing: border-box;
}

#ending-screen .ending-action-title {
  margin: 0;
  font-size: 36px;
  letter-spacing: 1.44px;
  font-weight: 400;
  color: #d63384;
  line-height: 1.3;
  text-align: center;
  font-family: 'Rounded Mplus 1c', sans-serif;
}

#ending-screen .ending-action-points {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

#ending-screen .ending-action-diamond-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#ending-screen .ending-action-diamond-icon svg {
  display: block;
  width: 32px;
  height: 32px;
}

#ending-screen .ending-action-points-label {
  font-size: 32px;
  font-weight: 400;
  color: #8c96a0;
  font-family: 'Rounded Mplus 1c', sans-serif;
  white-space: nowrap;
}

#ending-screen .ending-action-points-value {
  font-size: 36px;
  font-weight: 500;
  color: #d63384;
  font-family: 'Rounded Mplus 1c', sans-serif;
  white-space: nowrap;
  animation: pointsPopIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform: scale(0.3);
  position: relative;
}

#ending-screen .ending-action-points-value::before,
#ending-screen .ending-action-points-value::after {
  content: '✨';
  position: absolute;
  font-size: 20px;
  opacity: 0;
  animation: sparkle 1.2s ease-out forwards;
}

#ending-screen .ending-action-points-value::before {
  top: -10px;
  right: -25px;
  animation-delay: 0.3s;
}

#ending-screen .ending-action-points-value::after {
  bottom: -10px;
  left: -25px;
  animation-delay: 0.5s;
}

#ending-screen .ending-action-gallery-message {
  display: none;
  margin: -8px 0 8px;
  font-size: 24px;
  line-height: 1.5;
  color: #5a6370;
  text-align: center;
  font-family: 'Rounded Mplus 1c', sans-serif;
}

#ending-screen .ending-action-gallery-message.is-visible {
  display: block;
  animation: pointsPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#ending-screen .ending-action-gallery-message {
  display: none;
  margin: -8px 0 8px;
  font-size: 24px;
  line-height: 1.5;
  color: #5a6370;
  text-align: center;
  font-family: 'Rounded Mplus 1c', sans-serif;
}

#ending-screen .ending-action-gallery-message.is-visible {
  display: block;
  animation: pointsPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 体験版限定イラスト初回解放通知（初回のみ表示） */
.ending-action-trial-unlock {
  display: none;
  margin: -36px 0 0 0;
  font-size: 28px;
  line-height: 1.5;
  color: #d63384;
  text-align: center;
  font-family: 'Rounded Mplus 1c', sans-serif;
}

.ending-action-trial-unlock.is-visible {
  display: block;
  animation: pointsPopIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 体験版限定イラスト常設セクション（毎回表示） */
.ending-action-trial-permanent {
  display: none;
  margin: 0;
  text-align: center;
}

.ending-action-trial-permanent.is-visible {
  display: block;
}

.trial-permanent-text {
  font-size: 26px;
  line-height: 1.6;
  color: #d63384;
  margin: 0 0 10px 0;
  font-family: 'Rounded Mplus 1c', sans-serif;
}

/* ボタン */
.trial-download-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.trial-download-btn {
  flex: 1;
  min-width: 240px;
  max-width: 300px;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: bold;
  background: #d63384;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: 'Rounded Mplus 1c', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.trial-download-btn.view-btn {
  background: #d63384;
}

.trial-download-btn.download-btn {
  background: #d63384;
}

.trial-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  filter: brightness(1.08);
}

.trial-download-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* モーダル */
.trial-illustration-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.trial-illustration-modal.is-visible {
  display: flex;
}

.trial-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.trial-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.trial-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 40px;
  height: 40px;
  font-size: 32px;
  line-height: 1;
  color: white;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.trial-modal-close:hover {
  transform: scale(1.2);
}

.trial-modal-image {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.trial-modal-image.zoomable {
  cursor: grab;
}

.trial-modal-image.zoomable.dragging {
  cursor: grabbing;
}

.trial-modal-image.zoomed {
  max-width: none;
  max-height: none;
}

/* 特典画像モーダル用ズーム倍率表示 */
.trial-zoom-indicator {
  position: absolute;
  bottom: 60px;
  right: 16px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10001;
  pointer-events: none;
}

.trial-zoom-indicator.visible {
  opacity: 1;
}

@keyframes pointsPopIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: scale(0) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(180deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.5) rotate(360deg);
  }
}

#ending-screen .ending-action-retry-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

#ending-screen .ending-action-retry-button {
  width: 100%;
  max-width: 380px;
  padding: 16px 0;
  border-radius: 30px;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: 0.02em;
  background: #d63384;
  color: white;
  border: 2px solid #d63384;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: 'Rounded Mplus 1c', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#ending-screen .ending-action-retry-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  filter: brightness(1.08);
}

#ending-screen .ending-action-retry-button:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

#ending-screen .ending-action-bottom-buttons {
  display: flex;
  gap: 24px;
  justify-content: center;
}

#ending-screen .ending-action-bottom-button {
  flex: 1;
  max-width: 180px;
  padding: 4px 24px;
  border-radius: 25px;
  font-weight: 400;
  font-size: 24px;
  background: #fefefe;
  color: #d63384;
  border: 2px solid #d63384;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: 'Rounded Mplus 1c', sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#ending-screen .ending-action-bottom-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
  background: #fff;
}

#ending-screen .ending-action-bottom-button:active {
  transform: translateY(0);
  background: #f8f8fa;
}

#ending-screen .ending-dialogue-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 180px;
  display: none;
  padding: 0;
  box-sizing: border-box;
  pointer-events: none;
}

#ending-screen .ending-dialogue-inner {
  width: 100%;
  height: 180px;
  background: rgba(0, 0, 0, 0.75);
  border: none;
  border-radius: 0;
  padding: 24px 32px;
  color: var(--color-text-light);
  pointer-events: auto;
  box-sizing: border-box;
}

#ending-screen .ending-dialogue-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-light);
  opacity: 0.9;
  margin-bottom: 8px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

#ending-screen .ending-dialogue-text {
  font-size: 20px;
  line-height: 1.6;
  color: var(--color-text-light);
  text-shadow: none;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

#ending-screen .ending-dialogue-controls {
  position: absolute;
  bottom: calc(180px - 12px);
  right: 32px;
  display: flex;
  justify-content: flex-end;
  z-index: 11;
}

#ending-screen .ending-dialogue-next {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  color: var(--color-text-light);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

#ending-screen .ending-dialogue-next:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

#ending-screen .ending-dialogue-next:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.2);
}

.janken-top-right-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  z-index: 5;
}

.janken-top-right-controls .top-right-button {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  color: var(--color-text-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.janken-top-right-controls .top-right-button:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.janken-top-right-controls .top-right-button:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.16);
}

.pause-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(30, 30, 30, 0.6);
  z-index: 12000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pause-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.dialog-panel {
  position: relative;
  padding: 40px 44px;
  background: rgba(248, 248, 250, 0.96);
  border-radius: 28px;
  border: 1px solid rgba(214, 51, 132, 0.16);
  box-shadow: 0 28px 50px rgba(12, 16, 32, 0.35);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  color: var(--color-progress-base);
}

.dialog-panel::before,
.dialog-panel::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(0.4px);
  opacity: 0.55;
}

.dialog-panel::before {
  width: 320px;
  height: 320px;
  top: -140px;
  left: -90px;
  background: radial-gradient(120px 120px at 58% 58%, rgba(255, 143, 179, 0.35), transparent 72%);
}

.dialog-panel::after {
  width: 260px;
  height: 260px;
  bottom: -120px;
  right: -80px;
  background: radial-gradient(110px 110px at 42% 38%, rgba(102, 126, 234, 0.26), transparent 70%);
}

.dialog-panel--compact {
  width: 540px;
  max-width: calc(100% - 120px);
  padding: 36px 40px;
  gap: 20px;
}

.dialog-panel--center {
  width: 640px;
  max-width: calc(100% - 120px);
  gap: 28px;
}

.dialog-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  width: 100%;
}

.dialog-header--center {
  align-items: center;
  text-align: center;
}

.dialog-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(214, 51, 132, 0.85);
  background: rgba(214, 51, 132, 0.15);
  box-shadow: 0 6px 14px rgba(214, 51, 132, 0.18);
}

.dialog-title {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0.05em;
  color: var(--color-key-main);
}

.dialog-subtitle {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(44, 62, 80, 0.8);
}

.dialog-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(214, 51, 132, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-key-main);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: 0 8px 18px rgba(44, 62, 80, 0.18);
}

.dialog-close:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 24px rgba(44, 62, 80, 0.22);
}

.dialog-close:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 5px 14px rgba(44, 62, 80, 0.15);
}

.dialog-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.dialog-action-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dialog-action-title {
  font-size: 20px;
  font-weight: 700;
  color: inherit;
}

.dialog-action-icon {
  font-size: 24px;
  color: inherit;
  margin-left: 18px;
}

.dialog-panel--compact::before,
.dialog-panel--compact::after {
  opacity: 0.35;
  filter: blur(0.3px);
}

/* Figma�f�U�C���x�[�X�̃|�[�Y���j���[ */
.pause-card {
  position: relative;
  width: 600px;
  height: 400px;
  background: #f8f8fa;
  border: 5px solid #8c96a0;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.pause-close {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #8c96a0;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.pause-close svg {
  width: 36px;
  height: 36px;
}

.pause-close:hover {
  transform: scale(1.05);
}

.pause-close:active {
  transform: scale(0.98);
}

.pause-buttons {
  position: absolute;
  inset: 46px 65px 46px 65px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pause-button {
  border-radius: 30px;
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-size: 40px;
  font-weight: 500;
  line-height: normal;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
}

.pause-button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
  box-shadow: 0px 6px 8px rgba(0, 0, 0, 0.3);
}

.pause-button:active {
  transform: translateY(0);
  opacity: 1;
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.2);
}

.pause-button--primary {
  height: 80px;
  background: #d63384;
  color: #ffffff;
  border: 2px solid #d63384;
}

.pause-button--secondary {
  height: 80px;
  background: #fefefe;
  color: #d63384;
  border: 2px solid #ee88b4;
}

.pause-button--ghost {
  height: 80px;
  background: #fefefe;
  color: #8c96a0;
  border: 2px solid #ee88b4;
}

@media (min-width: 720px) {
  .dialog-actions-grid {
    gap: 22px;
  }
}

.difficulty-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(0.95);
}





/* じゃんけん結果オーバ�Eレイ */
.janken-result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1200px;
  height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-overlay-dark);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 13000;
}

.janken-result-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.janken-result-card {
  width: 740px;
  max-width: 95%;
  padding: 40px 44px;
  background: #f8f8fa;
  border-radius: 28px;
  border: 5px solid #8c96a0;
  box-shadow: 0 18px 36px rgba(26, 44, 63, 0.18);
  color: var(--color-neutral-dark);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.janken-result-card .janken-result-hands {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  gap: 48px;
}

.janken-result-card .result-hand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
  padding: 50px 0 8px 0;
  overflow: visible;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.janken-result-card .result-hand::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.janken-result-card .result-hand img {
  width: 262.5px;
  min-width: 262.5px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
  transform: translateY(0) scale(1) rotate(0deg);
  will-change: transform;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.janken-result-card .result-hand-label {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #3c4450;
  text-transform: none;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.janken-result-card .result-hand-label,
.janken-result-card .result-hand-name {
  color: var(--color-neutral-dark);
}

.janken-result-card .result-hand-divider {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0.4px;
  color: #c7cbd1;
}

.janken-result-card .result-text {
  display: none;
}

.janken-result-card .result-hand.is-winner::after {
  opacity: 0;
  transform: scale(1.1);
}

.janken-result-card .result-hand.is-winner img {
  animation: janken-hand-win 1.1s ease-out forwards;
}

.janken-result-card .result-hand.is-winner img[data-hand="rock"] {
  animation: janken-hand-win-rock 1.1s ease-out forwards;
}

.janken-result-card .result-hand.is-loser img {
  animation: janken-hand-lose 0.7s ease-in forwards;
}

.janken-result-card .result-hand.is-draw::after {
  opacity: 0;
  transform: scale(1.04);
}

.janken-result-card .result-hand.is-draw img {
  animation: janken-hand-draw 0.9s ease-in-out forwards;
}

@keyframes janken-hand-win {
  0% {
    transform: scale(1) rotate(0deg);
  }
  35% {
    transform: scale(1.28) rotate(-8deg);
  }
  55% {
    transform: scale(1.16) rotate(5deg);
  }
  70% {
    transform: scale(1.24) rotate(-3deg);
  }
  100% {
    transform: scale(1.2) rotate(0deg);
  }
}

@keyframes janken-hand-win-rock {
  0% {
    transform: scale(1) rotate(0deg);
  }
  35% {
    transform: scale(1.38) rotate(-8deg);
  }
  55% {
    transform: scale(1.28) rotate(5deg);
  }
  70% {
    transform: scale(1.34) rotate(-3deg);
  }
  100% {
    transform: scale(1.314) rotate(0deg);
  }
}

@keyframes janken-hand-lose {
  0% {
    transform: scale(1) rotate(0deg);
  }
  20% {
    transform: scale(0.98) rotate(2deg);
  }
  100% {
    transform: scale(0.714) rotate(-5deg);
  }
}

@keyframes janken-hand-draw {
  0% {
    transform: translateX(0) rotate(0deg);
  }
  15% {
    transform: translateX(-8px) rotate(-12deg);
  }
  35% {
    transform: translateX(8px) rotate(12deg);
  }
  50% {
    transform: translateX(-6px) rotate(-10deg);
  }
  65% {
    transform: translateX(6px) rotate(10deg);
  }
  80% {
    transform: translateX(-3px) rotate(-5deg);
  }
  100% {
    transform: translateX(0) rotate(0deg);
  }
}

/* �E�ߐݒ胁�j���[�iFigma�f�U�C�������j */
.undressing-settings-card {
  position: relative;
  width: 540px;
  background: #f8f8fa;
  border: 5px solid #8c96a0;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 26px 45px;
  gap: 24px;
}

.undressing-close {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: #8c96a0;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.undressing-close svg {
  width: 38px;
  height: 38px;
}

.undressing-close:hover {
  transform: scale(1.05);
}

.undressing-close:active {
  transform: scale(0.98);
}

.undressing-settings-title {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  color: #d63384;
  margin: 0;
  letter-spacing: -0.18px;
}

.undressing-option-box {
  width: 480px;
  height: 60px;
  background: #ffffff;
  border: 2px solid #ee88b4;
  border-radius: 25px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  user-select: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  gap: 0;
}

.undressing-option-box:first-of-type {
  margin-top: 12px;
  margin-bottom: 0;
}

.undressing-option-box + .undressing-option-box {
  margin-top: 11px;
}

.undressing-option-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.undressing-option-box:active {
  transform: translateY(0);
}

.undressing-option-box--with-icon {
  padding: 0 18px;
}

.undressing-option-icon {
  width: 26px;
  height: 29px;
  flex-shrink: 0;
  margin-left: 4px;
  margin-right: 18px;
}

.undressing-option-text {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-size: 26px;
  font-weight: 500;
  line-height: normal;
  color: #d63384;
  white-space: nowrap;
  flex: 0 1 auto;
}

.undressing-option-box--with-icon .undressing-option-text {
  margin-right: 0;
}

.undressing-option-box:not(.undressing-option-box--with-icon) .undressing-option-text {
  margin-right: 16px;
}

.undressing-option-box .skip-checkbox {
  display: none;
}

.undressing-option-box .toggle-slider {
  width: 60px;
  height: 30px;
  background-color: #c4c4c4;
  border-radius: 15px;
  position: relative;
  transition: background-color 0.3s ease;
  margin-left: auto;
}

.undressing-option-box .toggle-slider::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  background-color: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.undressing-option-box .skip-checkbox:checked + .toggle-slider {
  background: linear-gradient(135deg, #d63384 0%, #ff8fb3 100%);
}

.undressing-option-box .skip-checkbox:checked + .toggle-slider::after {
  transform: translateX(30px);
}

/* アイテム発動時のボタン脈動アニメーション */
@keyframes invincible-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ========================================
   体験版制限ダイアログ
   ======================================== */
.trial-restriction-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.trial-restriction-overlay[aria-hidden="true"] {
  display: none;
  opacity: 0;
}

.trial-restriction-dialog {
  position: relative;
  width: 500px;
  height: 260px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.trial-restriction-close {
  position: absolute;
  top: -25px;
  right: -25px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #8C96A0;
  color: #FEFEFE;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(140, 150, 160, 0.4);
}

.trial-restriction-close:hover {
  background: #6D7782;
  transform: scale(1.1);
}

.trial-restriction-close:active {
  transform: scale(0.95);
}

.trial-restriction-message {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 36px;
  color: #D63384;
  text-align: center;
  line-height: 1.5;
  padding: 0 30px;
}

.trial-restriction-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
}

.trial-restriction-btn {
  font-family: 'Rounded Mplus 1c', sans-serif;
  font-weight: 500;
  font-size: 36px;
  padding: 12px 40px;
  border-radius: 30px;
  min-width: 240px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.trial-restriction-btn--ok {
  background: #D63384;
  border: 2px solid #D63384;
  color: #FEFEFE;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.trial-restriction-btn--ok:hover {
  background: #C02A72;
  border-color: #C02A72;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.trial-restriction-btn--ok:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ------------- ローディング画面 ------------- */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

#loading-screen.ready {
  cursor: pointer;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 30px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: #ffffff;
  font-size: 3rem;
  font-weight: bold;
  margin: 0;
  letter-spacing: 0.15em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#loading-screen.ready .loading-text {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Click/Tap 拡大縮小アニメーション */
.action-word-glow {
  color: #ff69b4;
  font-weight: bold;
  animation: scale-pulse 2s ease-in-out infinite;
}

@keyframes scale-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.loading-progress-bar {
  width: 300px;
  height: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 20px auto 0;
  overflow: hidden;
}

.loading-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #ff6fa2, #d63384);
  border-radius: 4px;
  transition: width 0.3s ease;
  box-shadow: 0 0 10px rgba(255, 111, 162, 0.5);
}

/* 注意文確認ダイアログ（プリロード完了後） */
.age-notice-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.age-notice-content {
  width: 700px;
  height: 330px;
  background: #F8F8FA;
  border: 5px solid #8C96A0;
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 35px;
  gap: 35px;
}

.age-notice-text {
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  font-size: 32px;
  font-weight: 500;
  color: #D63384;
  text-align: center;
  line-height: 1.7;
  margin: 0;
}

.age-notice-btn {
  background: #D63384;
  border: 2px solid #D63384;
  color: #FEFEFE;
  font-family: 'Rounded Mplus 1c', 'Kosugi Maru', sans-serif;
  font-size: 34px;
  font-weight: 500;
  padding: 12px 50px;
  border-radius: 30px;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: all 0.2s ease;
}

.age-notice-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.age-notice-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ------------- スマホ対応 ------------- */

/* スマホ縦向き：90度回転してゲーム画面を横向き表示 */
@media screen and (max-width: 900px) and (orientation: portrait) {
  html {
    display: block;  /* flexboxを無効化 */
    overflow: visible;  /* 見切れを防ぐ */
    background: #1a1a2e;
  }

  body {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1200px;
    height: 800px;
    transform-origin: center center;
    /* 90度回転 + スマホサイズに合わせてスケールダウン */
    transform: translate(-50%, -50%) rotate(90deg) scale(0.52);
    overflow: visible;  /* 見切れを防ぐ */
  }
}

/* Screen Orientation API 成功時：ネイティブ横向きレイアウト */
/* サイズとスケールはJavaScriptで動的に計算・適用 */
@media screen and (max-width: 900px) {
  body.native-landscape {
    /* 基本的な配置のみCSS で指定 */
    /* transform, width, height は removeCSSRotation() で動的設定 */
  }
}

/* 小さいスマホ（iPhone SE, 古い Android など） */
@media screen and (max-width: 900px) and (orientation: portrait) and (max-height: 700px) {
  body {
    transform: translate(-50%, -50%) rotate(90deg) scale(0.48);
  }
}

/* 超小型スマホ */
@media screen and (max-width: 900px) and (orientation: portrait) and (max-height: 600px) {
  body {
    transform: translate(-50%, -50%) rotate(90deg) scale(0.45);
  }
}

/* スマホ横向き：スケールダウンして画面に収める */
@media screen and (max-width: 900px) and (orientation: landscape) {
  html {
    display: block;  /* flexboxを無効化 */
    overflow: visible;  /* 見切れを防ぐ */
    background: #1a1a2e;
  }

  body {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1200px;
    height: 800px;
    transform-origin: center center;
    /* 横持ちでも縦持ちと完全に同じ表示 */
    transform: translate(-50%, -50%) rotate(90deg) scale(0.52);
    overflow: visible;  /* 見切れを防ぐ */
  }
}

/* タブレット・デスクトップ：通常表示 */
@media screen and (min-width: 901px) {
  /* デフォルトの html/body スタイルが適用される */
}
