/* 基本的なhtml, bodyスタイル（全ページ共通） */
html {
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  overflow-x: hidden;
  box-sizing: border-box;
  background-color: #000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border: none;
  outline: none;
}

body.wp-theme-smilecap.home {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  border: none;
  outline: none;
  box-sizing: border-box;
  background: #000;
}

/* 基本的な見出しスタイル（全ページ共通） */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: "Helvetica", "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* front-page専用のbodyスタイル */
body.front-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100dvh;
  margin: 0;
  padding: 0;
  background-color: #1b1e46;
  color: #ffffff;
  touch-action: pan-y;
  /* 縦方向のスクロールを有効化 */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  font-family: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
  /* 横方向のスクロールを無効化 */
}

#app {
  margin: -5px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  width: 100%;
  height: 100vh;
  background-color: #1b1e46;
  border: none;
  outline: none;
  padding: 0;
}

/* タブナビゲーション */
.tab-navigation {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 8px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 280px;
}

.tab-button {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: 20px;
  font-family: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
  min-width: 80px;
  text-align: center;
  touch-action: manipulation; /* ダブルタップズーム防止 */
}

.tab-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.tab-button:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.tab-button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  box-shadow: 0 4px 20px rgba(0, 122, 255, 0.4);
  transform: translateY(0px);
}

.tab-button.active::before {
  opacity: 1;
}

.tab-button:not(.active):hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* タブコンテンツ */
.tab-content {
  display: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* iOSでのスムーズスクロール */
}

.tab-content.active {
  display: flex;
  gap: 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* カメラタブのレイアウト */
#cameraTab {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  width: 100%;
  border: none;
  outline: none;
  margin: 0;
  padding: 0;
}

/* ギャラリータブのレイアウト */
#galleryTab {
  justify-content: flex-start;
  margin-top: 80px;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 80px);
  border: none;
  outline: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* 設定タブのレイアウト */
#settingsTab {
  justify-content: flex-start;
  margin-top: 80px;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 80px);
}



.settings-content {
  padding: 40px 20px;
  min-width: 300px;
  color: rgba(255, 255, 255, 0.5);
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

body.front-page .settings-content h3 {
  text-align: center;
  color: #ffffff;
  font-family: "Helvetica", "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 22px;
}

.sound-selection {
  text-align: center;
  margin-bottom: 0;
  padding: 10px 30px;
}

body.front-page .sound-selection h4 {
  color: #ffffff;
  margin-bottom: 20px;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
}

.stamp-selection {
  text-align: center;
  padding: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

body.front-page .stamp-selection h4 {
  color: #ffffff;
  margin-bottom: 25px;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
}

.stamp-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.current-sound-display {
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.current-sound-display span:first-child {
  font-weight: normal;
}

#currentSoundName {
  color: #4CAF50;
  font-weight: normal;
}

.sound-select-button {
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 25px;
  font-family: "Itim", cursive;
  font-size: 16px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.sound-select-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.sound-select-button:active {
  transform: translateY(0);
}


.sound-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.sound-list .sound-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.sound-list .sound-option:hover {
  transform: translateY(-2px);
}



.sound-list .sound-image {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;

}

.sound-list .sound-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sound-list .sound-name {
  font-size: 14px;
  font-weight: normal;
  color: #fff;
}

/* 音声選択ダイアログ */
.sound-dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.sound-dialog.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sound-dialog-content {
  background: #1a1a1a;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: dialogSlideIn 0.3s ease-out;
  border: 2px solid #ffffff;
}

@keyframes dialogSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sound-dialog-header {
  background: linear-gradient(45deg, #2196F3, #1976D2);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.front-page .sound-dialog-header h3 {
  margin: 0;
  font-size: 20px;
  font-family: "Helvetica", "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sound-dialog-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.sound-option {
  display: flex;
  align-items: center;
  padding: 15px;
  margin: 4px 0;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 4px solid transparent;
  color: rgba(255, 255, 255, 0.5);
}

.sound-option:hover {
  border-color: #2196F3;
  transform: translateX(5px);
}

.sound-option.selected {
  border-color: #2196F3;
}

.sound-icon {
  font-size: 24px;
  margin-right: 15px;
  width: 30px;
  text-align: center;
}

.sound-name {
  font-family: "Itim", cursive;
  font-size: 16px;
  color: #ffffff;
}

#video,
#canvas {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  z-index: 1;
  min-width: 100%;
  min-height: 100vh;
  /* サイズを統一するための設定 */
  max-width: 100%;
  max-height: 100vh;
}

.webcam {
  position: relative;
  width: 100%;
  height: 100vh;
  /* JavaScriptで動的に調整される */
  height: calc(var(--vh, 1vh) * 100);
  /* フォールバック */
  overflow: hidden;
}

.camera-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

/* PWAモード時の全画面表示 */
/*
@media (display-mode: standalone) {
  #app {
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
  }
  
  html, body {
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }
}*/

/* 画面を右に90度傾けた時（横向き）: 撮影ボタンとロゴを左に60px寄せる */
@media (orientation: landscape) {
  .mode-pwa .camera-controls {
    left: calc(50% - 60px);
  }
}

.shutter-button {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: transparent;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shutter-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.shutter-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

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

.shutter-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: scale(1);
}

.shutter-button:disabled:hover {
  transform: scale(1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.photo-gallery {
  padding: 20px 20px 0 20px;
  overflow-y: auto;
  width: 100%;
  color: #ffffff;
  border: none;
  outline: none;
  margin-bottom: 0;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

body.front-page .gallery-header h3 {
  text-align: left;
  margin: 0;
  color: #ffffff;
  font-family: "Helvetica", "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 22px;
  padding-bottom: 0;
}

.sort-controls {
  display: flex;
  gap: 10px;
}

.sort-dropdown {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-size: 12px;
  font-weight: normal;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  outline: none;
  min-width: 120px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255, 255, 255, 0.9)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
  transform: none;
}

.sort-dropdown:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: none;
}

.sort-dropdown:focus {
  border-color: rgba(0, 122, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
}

.sort-dropdown option {
  background: #1b1e46;
  color: white;
  padding: 8px;
}

.delete-all-btn {
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-all-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.delete-all-btn:active {
  transform: translateY(0);
}

/* Google Material Icons */
.delete-all-btn .material-icons {
  font-size: 18px;
  transition: all 0.3s ease;
}


/* 複数選択ボタン */
.batch-select-btn {
  padding: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: none;
  /* 複数選択ボタンを非表示にする */
  align-items: center;
  justify-content: center;
  position: relative;
}

.batch-select-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.batch-select-btn.active {
  background: rgba(0, 122, 255, 0.3);
  color: rgba(255, 255, 255, 1);
  border-color: rgba(0, 122, 255, 0.5);
}

/* Google Material Icons */
.batch-select-btn .material-icons {
  font-size: 18px;
  transition: all 0.3s ease;
}

/* 選択モード時のアイコン変化 */
.batch-select-btn.active .material-icons {
  transform: scale(1.1);
}

/* アイコンの変化アニメーション */
.batch-select-btn .material-icons {
  opacity: 1;
  transform: rotate(0deg);
}

.batch-select-btn.active .material-icons {
  opacity: 1;
  transform: rotate(0deg) scale(1.1);
}

/* 一括保存ボタン */
.batch-save-btn {
  padding: 8px 16px;
  background: rgba(76, 175, 80, 0.8);
  color: rgba(255, 255, 255, 1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: normal;
  gap: 6px;
}

.batch-save-btn:hover {
  background: rgba(76, 175, 80, 1);
  border-color: rgba(76, 175, 80, 0.5);
  transform: translateY(-1px);
}

.batch-save-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
  transform: none;
}

.batch-save-btn svg {
  width: 16px;
  height: 16px;
}

/* 選択モード時の写真アイテム */
.photo-item.select-mode {
  cursor: pointer;
}

.photo-item.select-mode:hover {
  transform: scale(1.02);
}

.photo-item.select-mode.selected {
  border: 3px solid rgba(0, 122, 255, 0.8);
  transform: scale(1.05);
}

/* 選択チェックボックス */
.photo-item .selection-checkbox {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.3s ease;
}

.photo-item.select-mode .selection-checkbox {
  display: flex;
}

.photo-item .selection-checkbox.checked {
  background: rgba(0, 122, 255, 0.9);
  border-color: rgba(0, 122, 255, 1);
}

.photo-item .selection-checkbox::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: normal;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.photo-item .selection-checkbox.checked::after {
  opacity: 1;
}

/* 選択カウンター */
.selection-counter {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 122, 255, 0.9);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: normal;
  z-index: 1000;
  display: none;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.selection-counter.show {
  display: flex;
}

.selection-counter svg {
  width: 16px;
  height: 16px;
}

/* 「写真がありません」メッセージ */
.no-photos-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  width: 100%;
  min-height: 60vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.no-photos-icon {
  font-size: 48px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.no-photos-text {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.8);
}

.no-photos-subtext {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.gallery-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* PWAモード: カメラ画面のサイズ調整 */
.mode-pwa #cameraTab {
  width: 100%;
  height: 100vh;
  min-width: 100%;
  min-height: 100vh;
  max-width: none;
  max-height: none;
}

.mode-pwa #app {
  width: 100%;
  height: 100vh;
  min-width: 100%;
  min-height: 100vh;
  max-width: none;
  max-height: none;
}

/* PWAモード: 左右セーフエリア内に収める（ギャラリー） */
.mode-pwa #galleryTab .photo-gallery,
.mode-pwa #galleryTab .gallery-container {
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-top: 60px;
  /* PWAモードでナビゲーション分の上部余白 */
  box-sizing: border-box;
}

.photo-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  width: 100%;
}

.photo-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* PWAモード: 左右セーフエリア内に収める（設定） */
.mode-pwa #settingsTab .settings-content {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-top: 60px;
  /* PWAモードでナビゲーション分の上部余白 */
  box-sizing: border-box;
}



.photo-item .delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255, 0, 0, 0.8);
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 写真情報表示 */
.photo-info {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 10;
}



/* カウントダウン表示 */
.countdown-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 20px;
  padding: 30px 50px;
  text-align: center;
}



/* モバイルデバイスでのスクロール改善 */
@media (max-width: 768px) {
  .tab-content.active {
    gap: 20px;
  }

  .settings-content {
    padding: 20px 15px;
    min-width: 280px;
  }

  .sound-selection,
  .stamp-selection {
    padding: 0px 0px;
  }

  /* モバイルでの見出し間隔調整 */
  body.front-page .settings-content>h3 {
    margin-top: 50px;
    margin-bottom: 20px;
  }

  /* 最初の見出し（撮影スタイル）は上のマージンを少なくする */
  body.front-page .settings-header h3 {
    margin-top: 0;
  }

  .photo-gallery {
    padding: 15px 15px 0 15px;
    margin-bottom: 0;
  }

  .gallery-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .sound-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .sound-list .sound-option {
    padding: 15px;
  }

  .sound-list .sound-image {
    width: 60px;
    height: 60px;
  }


}

.countdown-text {
  font-size: 80px;
  font-weight: normal;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-family: "Sniglet", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.shutter-effect {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  transition: opacity 0.1s ease;
}

.shutter-effect.active {
  opacity: 1;
}

/* BETA ラベル（スマホ用） */
.beta-label-mobile {
  display: none !important;
  background: linear-gradient(135deg, #007AFF, #0056CC);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-family: "Sniglet", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: normal;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.beta-label-mobile:hover {
  background: linear-gradient(135deg, #0056CC, #003d99);
  box-shadow: 0 3px 12px rgba(0, 122, 255, 0.4);
  transform: translateY(-1px);
}

/* BETA ラベル（PC用） */
.beta-label-pc {
  display: none !important;
  background: linear-gradient(135deg, #007AFF, #0056CC);
  color: white;
  padding: 3px 8px;
  border-radius: 8px;
  font-family: "Sniglet", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 10px;
  font-weight: normal;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 122, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  white-space: nowrap;
  margin-top: 100px;
  margin-left: 0px;
}

/* PC用BETAラベルのホバー効果 */
.beta-label-pc {
  transition: all 0.2s ease;
}

.beta-label-pc:hover {
  background: linear-gradient(135deg, #0056CC, #003d99);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.4);
  transform: translateY(-1px);
}

/* PC画面専用スタイル */
@media (min-width: 769px) {
  .beta-label-mobile {
    display: none !important;
  }

  .logo-beta-container {
    padding-left: 60px !important;
  }

  .camera-switch-container {
    padding-right: 60px !important;
  }
}

/* 左側ロゴ（PC用） */
.logo-display-left {
  height: 90px;
  width: auto;
}

/* スマホ画面ではPC用BETAラベルと左側ロゴを非表示 */
@media (max-width: 768px) {
  .beta-label-pc {
    display: none !important;
  }

  .logo-display-left {
    display: none !important;
  }
}

/* PC画面ではスマホ用BETAラベルを非表示 */
@media (min-width: 769px) {
  .beta-label-mobile {
    display: none !important;
  }
}

/* スマホ画面でのサイズ調整 */
@media (max-width: 480px) {
  .beta-label-mobile {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
  }
}

.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0 20px;
}

.buttonList {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 20px;
  width: 100%;
  max-width: 400px;
}

.buttonList-item {
  width: 120px;
  height: 140px;
  border: solid #333333 2px;
  border-radius: 4px;
  background-color: #ffffff;
  box-shadow: 2px 2px 0 rgb(51 51 51);
}

.button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  filter: drop-shadow(2px 2px 1px #c4c4c4);
}

.current {
  border-radius: 2px;
  outline: solid #fcacf1 3px;
}

.button-white {
  filter: drop-shadow(2px 2px 1px #888888);
}

.button>img {
  height: auto;
}

.stamp-container .buttonList {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 15px;
  justify-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stamp-container .buttonList-item {
  margin: 0;
}

.stamp-container .button {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stamp-container .button:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.05);
}

.stamp-container .button.current {
  border-color: #4CAF50;
  background: rgba(76, 175, 80, 0.2);
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

/* 写真拡大表示モーダル */
.photo-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  margin: 0;
}

.photo-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
  margin: 0;
}

/* ナビゲーションボタン */
.nav-btn {
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.nav-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.prev-btn {
  left: -50px;
  /* より外側に配置 */
}

.next-btn {
  right: -50px;
  /* より外側に配置 */
}

/* スマホでのナビゲーションボタン位置調整 */
@media (max-width: 700px) {
  .nav-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .prev-btn {
    left: -10px;
    /* スマホでは適度に外側に */
  }

  .next-btn {
    right: -10px;
    /* スマホでは適度に外側に */
  }
}



#modalImage {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.photo-modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
}


/* Mobile adjustments for modal action buttons (ensure no overflow) */
@media (max-width: 480px) {
  .photo-modal-content {
    max-width: 95%;
    max-height: 90vh;
  }

  .photo-modal-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 0 15px;
    margin-top: 15px;
  }

  .share-btn {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 非常に小さな画面での対応 */
@media (max-width: 320px) {
  .photo-modal-content {
    max-width: 98%;
    max-height: 95vh;
  }

  .photo-modal-actions {
    padding: 0 10px;
    margin-top: 10px;
  }

  .share-btn {
    max-width: 280px;
    padding: 10px 12px;
    font-size: 14px;
  }
}

/* 写真ギャラリーの写真をクリック可能にする */
.photo-item {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.photo-item:hover {
  transform: scale(1.05);
}

.photo-item-img {
  cursor: pointer;
}

@media (max-width: 700px) {
  body.front-page {
    display: block;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  #app {
    position: relative;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
    height: 100vh;
    max-width: 100%;
    width: 100%;
  }

  .tab-navigation {
    order: 1;
    margin-bottom: 0;
    padding: 6px;
    gap: 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    top: 15px;
    min-width: 260px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .tab-button {
    padding: 10px 16px;
    font-size: 13px;
    min-width: 70px;
    border-radius: 16px;
  }

  .tab-content.active {
    flex-direction: column;
    gap: 15px;
    width: 100%;
  }

  #cameraTab {
    order: 2;
    width: 100%;
    padding: 0;
  }

  #galleryTab {
    order: 3;
    width: 100%;
    margin-top: 70px;
  }

  #settingsTab {
    order: 3;
    width: 100%;
    margin-top: 70px;
  }

  .webcam {
    order: 1;
    width: 100%;
    max-width: 100%;
  }

  .buttons {
    order: 2;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
  }



  .photo-gallery {
    order: 3;
    width: 100%;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .gallery-container {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .settings-content {
    order: 3;
    min-width: auto;
    padding: 20px;
    width: 100%;
  }

  .camera-controls {
    bottom: 20px;
  }

  .shutter-button {
    width: 60px;
    height: 60px;
  }

  .shutter-button img {
    width: 100%;
    height: 100%;
  }

  .sound-dialog-content {
    width: 95%;
    margin: 20px;
  }
}

@media (max-width: 480px) {
  #app {
    padding: 5px;
    gap: 10px;
  }

  .tab-navigation {
    margin-bottom: 0;
    padding: 4px;
    border-radius: 50px;
    top: 10px;
    min-width: 240px;
    gap: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .tab-button {
    padding: 8px 12px;
    font-size: 12px;
    min-width: 60px;
    border-radius: 14px;
  }

  #galleryTab {
    margin-top: 60px;
  }

  #settingsTab {
    margin-top: 60px;
  }

  .buttons {
    padding: 0 5px;
  }



  .webcam {
    margin: 0;
  }

  .camera-controls {
    top: calc(100vh - 120px);
    bottom: auto;
  }

  .shutter-button {
    width: 60px;
    height: 60px;
  }

  .shutter-button img {
    width: 100%;
    height: 100%;
  }
}

/* 表情検出表示 */
.expression-display {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 20px;
  padding: 15px 25px;
  text-align: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 150px;
  font-size: 18px;
  font-weight: normal;
  color: #4CAF50;
  transition: all 0.3s ease;
}

/* モバイルでの表情表示調整 */
@media (max-width: 768px) {
  .expression-display {
    bottom: 100px;
    padding: 12px 20px;
    min-width: 130px;
    font-size: 16px;
  }
}

/* デフォルト音声設定 */
.default-sound-setting {
  margin-top: 40px;
  padding: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.default-sound-info {
  margin-bottom: 20px;
}

.default-sound-info p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.default-sound-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.default-sound-btn {
  padding: 12px 20px;
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #4CAF50;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: normal;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 150px;
}

.default-sound-btn:hover {
  background: rgba(76, 175, 80, 0.3);
  border-color: #4CAF50;
  transform: translateY(-1px);
}

.default-sound-btn.reset {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.5);
  color: #F44336;
}

.default-sound-btn.reset:hover {
  background: rgba(244, 67, 54, 0.3);
  border-color: #F44336;
}

.default-sound-status {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.default-sound-status span:first-child {
  color: rgba(255, 255, 255, 0.7);
}

.default-sound-status span:last-child {
  color: #4CAF50;
  font-weight: normal;
}

/* モバイルでのデフォルト音声設定調整 */
@media (max-width: 768px) {
  .default-sound-setting {
    padding: 20px;
    margin-top: 30px;
  }

  .default-sound-controls {
    flex-direction: column;
    gap: 10px;
  }

  .default-sound-btn {
    min-width: auto;
  }
}

/* 音声テストセクション */
.sound-test-section {
  margin: 15px 0;
  text-align: center;
}

.test-sound-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  margin-right: 10px;
}

.test-sound-btn:hover {
  background: #45a049;
}

.test-note {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* ===== Hide Smile Rate/Expression Display ===== */
.expression-display {
  display: none !important;
}

/* ===== Logo Removal Dialog ===== */
.logo-removal-dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo-removal-dialog.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-removal-dialog-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border-radius: 20px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: dialogSlideIn 0.3s ease-out;
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.logo-removal-dialog-body {
  padding: 40px 20px 30px 20px;
  text-align: center;
  color: #ffffff;
}

.premium-feature-icon {
  font-size: 48px;
  margin-bottom: 15px;
  display: block;
}

.premium-message {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 20px;
  line-height: 1.4;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #ffffff;
}

.pricing-info {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  margin: 20px 0;
}

.price {
  font-size: 32px;
  font-weight: normal;
  color: #4CAF50;
  font-family: "Sniglet", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.price-note {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: normal;
}

.feature-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
  margin-top: 15px;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.logo-removal-dialog-footer {
  padding: 20px;
  display: flex;
  gap: 15px;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
}

.dialog-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-width: 120px;
  text-align: center;
}

.cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cancel-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.confirm-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.confirm-btn:hover {
  background: linear-gradient(135deg, #764ba2, #667eea);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* モバイル対応 */
@media (max-width: 480px) {
  .logo-removal-dialog-content {
    width: 95%;
    margin: 20px;
  }

  .logo-removal-dialog-body {
    padding: 25px 15px;
  }

  .premium-message {
    font-size: 16px;
  }

  .price {
    font-size: 28px;
  }

  .logo-removal-dialog-footer {
    flex-direction: column;
    gap: 10px;
  }

  .dialog-btn {
    width: 100%;
  }
}

/* ===== Account Information ===== */
.account-info {
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.account-status {
  color: #ffffff;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-icon {
  font-size: 32px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.status-icon.free-plan-icon {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

.status-icon.free-plan-icon .material-icons {
  font-size: 28px;
}

.status-info {
  flex: 1;
}

.plan-name {
  font-size: 18px;
  font-weight: normal;
  margin-bottom: 5px;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.plan-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.plan-features {
  margin: 20px 0;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.feature-icon.material-icons {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.9);
}

.feature-text {
  flex: 1;
  font-size: 14px;
  font-weight: normal;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.feature-status {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: normal;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.feature-status.available {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
  border: 1px solid rgba(76, 175, 80, 0.3);
}

.feature-status.unavailable {
  background: rgba(255, 152, 0, 0.2);
  color: #FF9800;
  border: 1px solid rgba(255, 152, 0, 0.3);
}

.upgrade-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.upgrade-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: normal;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.upgrade-btn:hover {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.upgrade-icon {
  font-size: 16px;
}

.upgrade-note {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  font-family: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 有料プラン時のスタイル */
.account-status.premium .status-icon {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
}

.account-status.premium .plan-name {
  color: #FFD700;
}

.account-status.premium .upgrade-section {
  display: none;
}

/* モバイル対応 */
@media (max-width: 480px) {
  .status-header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .feature-item {
    padding: 10px 0;
  }

  .feature-text {
    font-size: 13px;
  }

  .feature-status {
    font-size: 11px;
    padding: 3px 8px;
  }

  .upgrade-btn {
    width: 100%;
    justify-content: center;
  }
}