html {
  font-size: 3.077vw;
}
body {
  line-height: 150%;
  letter-spacing: 0.04rem;
  font-family: 'Noto Sans Japanese', sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  font-variation-settings: 'wdth' 100;
  color: #333333;
}

ol,
ul {
  list-style-position: inside;
  padding-left: 0;
}
li {
  margin-bottom: 0.8em;
}

/* ローディング画面 */
#loadBackground {
  background-color: #000000 !important;
}

#requestingCameraPermissions {
  background-color: #000000 !important;
  color: #ffffff !important;
  font-size: 0.8rem !important;
}

.loading-error-header {
  font-size: 1rem !important;
}

#cameraPermissionsErrorAndroid,
#microphonePermissionsErrorAndroid {
  padding: 1.25em !important;
}

.loading-error-instructions {
  font-size: 1rem !important;
}

#cameraPermissionsErrorAppleMessage {
  font-size: 1rem !important;
}

/* カラーコンフィギュレーター */
#configurator-ui {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 25px;
}

#configurator-ui button {
  width: 3.5rem;
  height: 3.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  transition: transform 0.3s ease;
  position: relative;
}

#configurator-ui button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#configurator-ui button.active {
  transform: scale(1.1);
}

#configurator-ui button.active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  height: 85%;
  background: url('./assets/ui/configurator-icon-active.svg') no-repeat center center;
  background-size: contain;
  pointer-events: none;
}

#configurator-ui button:hover {
  transform: scale(1.05);
}

#configurator-ui .color-circle {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#configurator-ui .green {
  background: #2e4a3e;
}
#configurator-ui .gray {
  background: #676767;
}
#configurator-ui .red {
  background: #c41e3a;
}
#configurator-ui .blue {
  background: #1b50ff;
}
#configurator-ui .yellow {
  background: #fffa78;
}

/* コーチングオーバーレイ */
.coaching-overlay-prompt-container {
  height: 8rem;
  transform: translate(-50%, -80%);
}
.coaching-overlay-animation {
  width: 50vmin;
}
.coaching-overlay-prompt-status {
  font-size: 1rem !important;
}

/* タッププロンプト */
#tap-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -33%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  z-index: 10;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
}

/* リセットボタン */
#reset-btn {
  position: absolute;
  z-index: 21;
  width: 3.5rem;
  height: 3.5rem;
  left: calc(50% + 4rem);
  bottom: 2.25rem;
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#reset-btn img {
  width: 100%;
  height: 100%;
  display: block;
}

/* 回転UI */
#rotation-ui {
  position: absolute;
  bottom: 8.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 1.25rem;
}

#rotation-ui button {
  width: 3.5rem;
  height: 3.5rem;
  background-color: transparent;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#rotation-ui button img {
  width: 100%;
  height: 100%;
  display: block;
}

/* シャッターボタン */
.recorder-container {
  width: 7rem !important;
  height: 7rem !important;
}

.recorder-container .progress-container .progress-track,
.recorder-container .progress-container .progress-bar,
.recorder-container .progress-container .loading-circle {
  stroke-width: 1.5px !important;
}

#recorder-button {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  transform: scale(0.65) !important;
}

#recorder-mode-icon {
  width: 50%;
  height: 50%;
}

/* キャプチャモード切替 */
#capture-mode-btn {
  position: absolute;
  z-index: 21;
  width: 3.5rem;
  height: 3.5rem;
  left: calc(50% - 7.5rem);
  bottom: 2.2rem;
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#capture-mode-icon {
  width: 100%;
  height: 100%;
  display: block;
}

/* フラッシュエフェクト */
#flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: white;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
}

.flash-effect {
  animation: flash-animation 0.5s ease-out;
}

@keyframes flash-animation {
  from {
    opacity: 0.8;
  }
  to {
    opacity: 0;
  }
}

/* プレビューコンテナ */
#previewContainer {
  position: fixed !important;
  top: 49% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 83svw !important;
  height: 86.57svh !important;
  background-color: #fff !important;
  border-radius: 0 !important;
  overflow: hidden !important;
  z-index: 1000 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 1rem !important;
  padding: 2rem !important;
}

#previewContainer #imagePreview,
#previewContainer #videoPreview {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  border: 0px !important;
  filter: none !important;
  margin: auto !important;
}

#previewContainer #closePreviewButton {
  display: none !important;
}

#previewContainer .top-bar {
  flex: 1 !important;
  display: flex !important;
  position: relative !important;
  overflow: hidden !important;
  min-height: 0 !important;
}

#previewContainer .preview-box {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

#previewContainer .bottom-bar {
  flex: 0 0 auto !important;
  max-height: 35% !important;
  padding: 0 !important;
  overflow: auto !important;
  box-sizing: border-box !important;
  font-size: 0.8rem !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
  align-items: center !important;
}

#previewContainer .bottom-bar > div,
#previewContainer .bottom-bar > button {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* ボタン行コンテナ */
#previewContainer .button-container,
#previewContainer .button-row,
#previewContainer .button-row-close {
  display: flex !important;
  justify-content: center !important;
  gap: 0.7rem !important;
  align-items: center !important;
  width: 100% !important;
  position: relative !important;
  z-index: 10 !important;
}

#previewContainer .button-row-close {
  margin-top: 0 !important;
}

#previewContainer .button-row-close button {
  flex: 1 !important;
  min-width: 0 !important;
  max-width: none !important;
}

#previewContainer .bottom-bar div,
#previewContainer #finalizeText,
#previewContainer #tapAndHoldText {
  color: #333 !important;
  font-size: 1.166rem !important;
  text-shadow: none !important;
  filter: none !important;
  -webkit-filter: none !important;
  box-shadow: none !important;
  -webkit-text-stroke: none !important;
}

/* ボタン共通スタイル */
#previewContainer #unified-download-btn,
#previewContainer #unified-share-btn,
#previewContainer #unified-copy-btn,
#previewContainer #ios-download-btn,
#previewContainer #unified-close-btn {
  color: white !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  border: none !important;
  padding: 1em 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

#previewContainer #unified-copy-btn {
  background-color: #d9d9d9 !important;
  color: #333 !important;
  width: 100% !important;
}

#previewContainer #unified-download-btn,
#previewContainer #ios-download-btn {
  background-color: #007dba !important;
}

#previewContainer #unified-share-btn {
  background-color: #0098d8 !important;
}

#previewContainer #unified-close-btn {
  background-color: #404040 !important;
}

#previewContainer #unified-close-btn:active {
  background-color: #555 !important;
}

#previewContainer #unified-download-btn span,
#previewContainer #unified-share-btn span,
#previewContainer #ios-download-btn span,
#previewContainer #unified-close-btn span {
  color: #fff !important;
  font-size: 1rem !important;
}

#previewContainer #unified-copy-btn span {
  color: #333 !important;
  font-size: 1rem !important;
}

/* 8th Wall元要素を非表示 */
#previewContainer #downloadButton,
#previewContainer #actionButton,
#previewContainer #openSafariText {
  display: none !important;
}

.sp-br {
  display: block;
}

/* 横向きレイアウト */
@media (orientation: landscape) {
  html {
    font-size: 4svh;
  }
  
  /* コーチングオーバーレイ */
  .coaching-overlay-prompt-container {
    height: 8rem;
    transform: translate(-50%, -100%);
  }

  #previewContainer .bottom-bar {
    /* max-width: 50rem !important; */
    margin: auto !important;
    gap: 0.5rem !important;
  }

  #previewContainer #tapAndHoldText {
    padding: 0 !important;
  }
  #previewContainer #tapAndHoldText #hashtag-message {
    font-size: 1rem !important;
  }

  #configurator-ui {
    top: 0.1rem;
  }

  #rotation-ui {
    bottom: 2.5rem;
    left: auto;
    right: calc(50% - 20rem);
    transform: none;
    gap: 1rem;
  }

  #rotation-ui button {
    width: 3rem;
    height: 3rem;
  }

  .coaching-overlay-prompt-container {
    height: 8rem;
  }

  .coaching-overlay-animation {
    width: 50vmin;
  }

  .coaching-overlay-prompt-status {
    font-size: 0.5rem !important;
  }

  #tap-prompt {
    font-size: 0.5rem;
  }

  #experience-guide-modal > div {
    width: 95dvw !important;
    height: 85svh !important;
  }

  #carousel-container {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  #carousel-wrapper {
    height: auto !important;
    min-height: 100% !important;
  }

  .carousel-page {
    padding: 1rem 10% !important;
    height: auto !important;
    min-height: 100% !important;
  }

  .carousel-page h2 {
    font-size: 0.8rem !important;
    margin-top: 0 !important;
    margin-bottom: 0.5em !important;
  }

  .carousel-page div {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.8em !important;
    padding: 0 8rem !important;
  }

  .carousel-page img {
    max-width: 10rem !important;
    width: 60% !important;
  }

  #carousel-prev,
  #carousel-next {
    top: 40% !important;
    font-size: 0.8rem !important;
  }

  #carousel-dots {
    margin-bottom: 1rem !important;
  }

  .carousel-dot {
    width: 0.5rem !important;
    height: 0.5rem !important;
  }

  #carousel-close-btn {
    width: 2rem !important;
    height: 2rem !important;
  }

  .sp-br {
    display: none;
  }
}

/* 小さいスマホ横向き：カルーセルテキストを小さく */
@media (max-width: 767px) and (orientation: landscape) {
  .carousel-page div {
    font-size: 0.55rem !important;
  }

  #previewContainer #unified-download-btn,
  #previewContainer #unified-share-btn,
  #previewContainer #unified-copy-btn,
  #previewContainer #ios-download-btn,
  #previewContainer #unified-close-btn {
    font-size: 0.8rem !important;
    padding: 1em 0 !important;
    height: 2rem !important;
  }
  #previewContainer #unified-download-btn span,
  #previewContainer #unified-share-btn span,
  #previewContainer #unified-copy-btn span,
  #previewContainer #ios-download-btn span,
  #previewContainer #unified-close-btn span,
  #previewContainer #tapAndHoldText div {
    font-size: 0.8rem !important;
  }
}

/* スマホ・小型タブレット横向き：top/bottom 50:50 */
@media (max-width: 1024px) and (orientation: landscape) {
  #previewContainer .top-bar {
    flex: 1 !important;
  }
  #previewContainer .bottom-bar {
    flex: 1 !important;
  }
}

/* タブレット */
@media (min-width: 768px) {
  html {
    font-size: 2.5vw;
  }
}

/* タブレット横向き */
@media (min-width: 768px) and (orientation: landscape) {
  html {
    font-size: 2.5vh;
  }
}
