.tab,
.tab2,
.br-sp {
  display: none;
}

.br-pc {
  display: block;
}

html,
body {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

body {
  width: 100svw;
  height: 100svh;
  background: transparent !important;
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  margin: 0;
}

body::after {
  content: "";
  width: 100%;
  height: 100%;
  background: white;
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  animation: fadeOut 2s forwards;
  pointer-events: none;
}

.fade-back {
  width: 100%;
  height: 100%;
  background: white;
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  animation: fadeOut 2s forwards;
  pointer-events: none;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

p {
  font-size: 14px;
}

video#recording {
  width: auto !important;
  height: 100svh !important;
  aspect-ratio: 9/16;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: -1;
  touch-action: none;
  pointer-events: none;
}

/* プレイヤーコントロールを非表示にする */
video#recording::-webkit-media-controls {
  display: none;
}

video#recording.mirror {
  transform: translateX(-50%) rotateY(180deg);
  -webkit-transform: translateX(-50%) rotateY(180deg);
  -moz-transform: translateX(-50%) rotateY(180deg);
}

.camera-container {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

#video-load {
  content: "";
  width: 100%;
  height: 100%;
  background: black;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.spinner {
  width: 100px;
  height: 100px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: load-spin 1s ease-out infinite;
}

@keyframes load-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.spinner i {
  width: 20px;
  height: 20px;
  background: #ddd;
  box-shadow: 0 0 3px rgba(255, 255, 255, .7);
  border-radius: 100%;
  margin-left: -10px;
  position: absolute;
  left: 50%;
  transform-origin: center 50px;
}

.spinner i:nth-child(1) {
  opacity: 0.167;
}

.spinner i:nth-child(2) {
  opacity: 0.334;
  transform: rotate(60deg);
}

.spinner i:nth-child(3) {
  opacity: 0.501;
  transform: rotate(120deg);
}

.spinner i:nth-child(4) {
  opacity: 0.668;
  transform: rotate(180deg);
}

.spinner i:nth-child(5) {
  opacity: 0.835;
  transform: rotate(240deg);
}

.spinner i:nth-child(6) {
  opacity: 1;
  transform: rotate(300deg);
}

#countdown-wrapper {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: none;
}

#countdown-wrapper p {
  width: 100%;
  color: #339944;
  font-size: 40px;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-weight: 400;
  font-style: normal;
  text-align: center;
  text-indent: 0.3em;
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  animation: text-bounce 0.5s ease-in-out infinite;
}

#countdown-wrapper p::before {
  content: "撮影スタンバイ！";
  width: 100%;
  color: white;
  -webkit-text-stroke: 3px white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

@keyframes text-bounce {
  0% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.1);
  }

  100% {
    transform: translateX(-50%) scale(1);
  }
}

#countdown-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

#countdown-ring circle {
  stroke: white;
  stroke-width: 5;
  fill: transparent;
  stroke-dasharray: 283;
  /* 2πr ≈ 2*3.14*45 (円の半径により調整) */
  stroke-dashoffset: 283;
  transform-origin: 50% 50%;
}

.ring-animate {
  animation: ring-animate 0.95s linear forwards;
}

@keyframes ring-animate {
  from {
    stroke-dashoffset: 283;
  }

  to {
    stroke-dashoffset: 0;
  }
}

#countdown-text {
  display: none;
  color: white;
  font-size: 40px;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  user-select: none;
}

#lottieOverlay {
  display: none;
  width: auto;
  height: 100svh !important;
  aspect-ratio: 9/16;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  z-index: 2;
  pointer-events: none;
}

#lottieOverlay canvas {
  width: auto !important;
  height: 100% !important;
  background: transparent !important;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  will-change: transform;
}

p#notice {
  width: 220px;
  background: white;
  font-size: 16px;
  text-align: center;
  border: 2px solid #f6f000;
  border-radius: 10px;
  padding: 20px;
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.terms {
  max-width: 100%;
  height: 100%;
  aspect-ratio: 9/16;
  display: none;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  margin: 0 auto;
  position: relative;
}

.top-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.top-title img {
  width: 45%;
}

.top-title h1 {
  color: #339944;
  font-size: 30px;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-weight: normal;
  position: relative;
}

.top-title h1::before,
.top-title h1::after {
  content: "";
  width: 15px;
  height: 80%;
  background: #339944;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: rotate(333deg);
  position: absolute;
  bottom: 0;
  left: -12%;
}

.top-title h1::after {
  transform: rotate(-333deg);
  left: auto;
  right: -12%;
}

.explanation {
  text-align: center;
  margin-top: 20px;
}

.explanation p {
  font-size: 16px;
}

.explanation span {
  display: block;
  color: #339944;
  font-size: 18px;
  font-weight: bold;
}

img.fumin {
  width: 15%;
  position: absolute;
  top: 11%;
  right: 1%;
  opacity: 0;
  animation: fumin-R 0.5s 0.5s forwards;
  z-index: -1;
}

img.fumin.fumin-L {
  top: 20%;
  right: auto;
  left: 1%;
  animation: fumin-L 0.5s 1s forwards;
}

@keyframes fumin-R {
  0% {
    top: 11%;
    opacity: 0;
  }

  100% {
    top: 16%;
    opacity: 1;
  }
}

@keyframes fumin-L {
  0% {
    top: 20%;
    opacity: 0;
  }

  100% {
    top: 25%;
    opacity: 1;
  }
}

.term-section {
  width: 100%;
  height: 47%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}

.term-section>p {
  text-align: center;
}

.term-box {
  width: 90%;
  height: 100%;
  background: white;
  border: 2px solid #339944;
  border-radius: 10px;
  overflow-y: scroll;
  padding: 10px;
  margin: 10px auto 15px;
}

button#consent {
  background: #339944;
  color: yellow;
  font-size: 20px;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  border-radius: 999px;
  padding: 10px 40px;
  transition: 0.5s;
}

button#consent:hover {
  opacity: 0.5;
}

small.copyright {
  width: max-content;
  font-size: 10px;
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
}

.stand-by {
  max-width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  display: none;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  position: relative;
}

.info-sub {
  text-align: center;
  margin: 20% auto 20px;
}

.info-sub p {
  position: relative;
}

.info-sub p::after {
  content: "";
  width: 100%;
  border: 1px dashed #339944;
  position: absolute;
  bottom: -5px;
  left: 0;
}

.info-sub i {
  width: 25px;
  height: 25px;
  background: rgb(222 222 222 / 50%);
  color: rgb(0 0 0 / 50%);
  border-radius: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  vertical-align: bottom;
  margin-right: 3px;
}

.ex-movie {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  margin: 0 auto;
}

.ex-movie p {
  color: #339944;
  font-size: 26px;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-weight: 400;
  font-style: normal;
  text-align: center;
  text-indent: 0.3em;
}

.reference {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.reference video {
  max-width: 100%;
  width: 335px;
  height: auto;
  aspect-ratio: 16/9;
}

.reference-controls,
.custom-controls {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  position: absolute;
  inset: 0;
}

.reference-controls::before,
.custom-controls::before {
  content: "";
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 50%);
  position: absolute;
  top: 0;
  left: 0;
}

.reference-controls button,
.custom-controls button {
  color: #fff;
  font-size: 2.5rem;
  z-index: 1;
}

p.attention {
  text-align: center;
}

button#returnTerms {
  color: #339944;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid;
  position: absolute;
  bottom: 7%;
  left: 50%;
  transform: translateX(-50%);
}

button#playButton {
  width: 70%;
  background: #339944;
  color: yellow;
  font-size: 24px;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-weight: 400;
  font-style: normal;
  border-radius: 999px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 10px;
  margin: 30px auto 10px;
  transition: 0.5s;
}

button#playButton i {
  font-size: 1.1em;
  padding-top: 3px;
}

button#snap,
button#switchCameraButton,
button#infoButton {
  width: 80px;
  height: 80px;
  background: rgb(222 222 222 / 50%);
  border: none;
  border-radius: 50%;
  position: absolute;
  z-index: 100;
  transition: 0.5s;
  cursor: pointer;
}

button#snap {
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
  display: none;
}

button#switchCameraButton {
  width: 60px;
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  top: 5px;
  right: 5px;
  transition: transform 0.6s ease;
  transform-style: preserve-3d;
  display: none;
}

#switchCameraButton.flip {
  transform: rotateY(180deg);
}

#switchCameraButton.flip i,
#switchCameraButton.flip span {
  display: inline-block;
  /* transform の対象にする */
  transform: rotateY(180deg);
}

button#switchCameraButton span {
  font-size: 0.8em;
}

.hidden {
  display: none !important;
}

.hidden button {
  display: none;
  z-index: 200 !important;
  pointer-events: none;
}

button#infoButton {
  width: 60px;
  height: 60px;
  bottom: 2%;
  right: 37%;
  display: none;
}

button#snap:hover,
button#playButton:hover,
button#infoButton:hover {
  opacity: 0.5;
}

button#snap i,
button#switchCameraButton i,
button#infoButton i {
  color: rgb(0 0 0 / 50%);
  font-size: 40px;
}

button#switchCameraButton i,
button#infoButton i {
  font-size: 30px;
}

.result {
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
}

.video-result {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  flex-direction: column;
  display: none;
}

.video-result .video-preview {
  height: 90%;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  position: relative;
}

#video-modal {
  display: none;
}

.modal-open #video-modal {
  width: 100svw;
  height: 100svh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal-open #video-modal::before {
  content: "";
  width: 100%;
  height: 100%;
  background: black;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
}

#recordedVideo {
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
}

#video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

button#close-preview {
  width: 60px;
  height: 60px;
  background: rgb(222 222 222 / 50%);
  border: none;
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 100;
  transition: 0.5s;
  cursor: pointer;
}

button#close-preview i {
  color: rgb(0 0 0 / 50%);
  font-size: 40px;
}

#video-thumbnail {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.video-result .preview-overlay {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.video-result .preview-overlay button {
  width: 80px;
  height: 80px;
  background: rgb(72 206 95 / 80%);
  color: white;
  border: none;
  font-size: 0.9rem;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 0.5em 1em;
  cursor: pointer;
}

button#retakeButton {
  background: rgb(206 72 72 / 80%);
}

.video-result .preview-overlay button i {
  font-size: 2em;
}

.video-result .video-actions {
  height: 10%;
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.video-actions button {
  width: 50%;
  color: white;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
}

#downloadButton {
  background: linear-gradient(to right, #4864ce 0%, #a7b9ff 0%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  transition: background 0.15s linear;
}

#tiktokButton {
  background: black;
  /* pointer-events: none; */
  position: relative;
}

#tiktokButton::after {
  content: "準備中";
  width: 100%;
  height: 100%;
  background: rgb(255 255 255 / 80%);
  color: #333;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
}

.video-actions button i {
  font-size: 1.1em;
}

.video-actions button img {
  height: 20px;
}

@keyframes slideIn {
  0% {
    top: 100%;
  }

  100% {
    top: 0%;
  }
}



/* 音声許可 */
div#audioNotice {
  width: 100svw;
  height: 100svh;
  background: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 100;
}

.audio-notice-box {
  width: 80%;
  background: white;
  font-size: 16px;
  text-align: center;
  border: 3px solid #339944;
  border-radius: 10px;
  box-shadow: 0 0 10px rgb(0 0 0 / 20%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

button#audioOkButton {
  background: #339944;
  color: white;
  font-size: 1.2rem;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3px 50px;
  cursor: pointer;
}




/* 操作説明 */
.popup-info {
  display: none;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 70%);
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
}

.info-div {
  display: none;
  width: 22%;
  height: 140px;
  background: white;
  font-size: 16px;
  text-align: center;
  border: 3px solid #339944;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.info-div::before {
  content: "";
  width: 100%;
  height: 100%;
  background: white;
  border-radius: 10px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.info-div.info2 {
  height: 180px;
}

.info-div.info4 {
  height: 220px;
}

.bubble {
  width: 20px;
  height: 60px;
  background: #339944;
  clip-path: polygon(50% 45%, 0 0, 100% 0);
  position: absolute;
  bottom: -85px;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

.info-div.info2 .bubble {
  display: none;
}

.info-content {
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.info-div.info1 p {
  line-height: 2;
}

.info-div.info1 span {
  background: #339944;
  color: yellow;
  font-size: 16px;
  font-family: "Dela Gothic One", "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-weight: 400;
  font-style: normal;
  border-radius: 999px;
  padding: 3px 10px;
  margin-right: 5px;
}

.info-div.info1 span i {
  font-size: 1.1em;
  padding-right: 3px;
}

span.i-back {
  width: 30px;
  height: 30px;
  background: rgb(222 222 222 / 50%);
  border-radius: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-right: 3px;
}

.i-back i {
  color: rgb(0 0 0 / 50%);
  font-size: 18px !important;
}

.button-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
  gap: 10px;
}

.button-container button {
  width: 80px;
  height: 30px;
  background: #339944;
  color: white;
  border-radius: 999px;
  transition: 0.5s;
}

.button-container button:hover {
  opacity: 0.5;
}

button#infoClose {
  background: none;
  color: white;
  position: absolute;
  top: -20px;
  right: -24px;
  transition: 0.5s;
}

button#infoClose:hover {
  opacity: 0.5;
}

button#infoClose i {
  font-size: 22px !important;
}

.info3 {
  top: 20%;
  left: auto;
  right: -10%;
}

.info3 .bubble {
  transform: translate(-50%, -50%) scaleY(-1);
  bottom: auto;
  top: -26px;
  left: auto;
  right: -3px;
}

.info3 button#infoClose {
  right: auto;
  left: -24px;
}

.info4 img {
  width: 20%;
  margin: 10px auto 20px;
}





@media screen and (max-width: 1500px) {
  button#closeButton {
    top: 9px;
  }

  button#infoButton {
    right: 34%;
  }
}





@media screen and (max-width: 1200px) {

  .br-pc,
  .tab2,
  .br-sp {
    display: none;
  }

  .tab {
    display: block;
  }

  button#closeButton {
    top: 10px;
    right: 15px;
  }

  button#infoButton {
    right: 30%;
  }

  .info-div {
    width: 26%;
    top: 34%;
  }

  .info3 {
    right: -12%;
  }
}





@media screen and (max-width: 1024px) {

  .br-pc,
  .tab,
  .br-sp {
    display: none;
  }

  .tab2 {
    display: block;
  }

  button#closeButton {
    top: 5px;
    right: 5px;
  }

  button#infoButton {
    right: 13%;
  }

  .info-div {
    width: 40%;
    top: 28%;
  }

  .info3 {
    top: 16%;
    right: -18%;
  }
}





@media screen and (max-width: 767px) {

  .br-pc,
  .tab,
  .tab2 {
    display: none;
  }

  .br-sp {
    display: block;
  }

  button#closeButton {
    top: 0;
    right: 0;
  }

  button#infoButton {
    right: 1%;
  }

  .info-div {
    width: 75%;
    top: 30%;
  }

  .info3 {
    top: 18%;
    right: -34%;
  }

  .info3 .bubble {
    right: -5px;
  }

  .info3 button#infoClose {
    left: -30px;
  }

  button#infoClose {
    right: -30px;
  }

  button#infoClose i {
    font-size: 30px !important;
  }
}





@media screen and (max-width: 400px) {
  button#closeButton {
    top: -10px;
    right: -10px;
  }

  .info-div {
    width: 80%;
    top: 35%;
  }

  .info3 {
    top: 24%;
    right: -36%;
  }
}