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

.br-pc {
  display: block;
}

body {
  background: transparent!important;
  font-family: sans-serif;
  margin: 0;
}

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

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

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

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

video#video, canvas#canvas {
  width: 100%!important;
  height: 100%!important;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

video#video {
  object-fit: cover;
  z-index: -1;
  touch-action: none;
  pointer-events: none;
}

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

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

.camera-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

#video-load {
  content: "";
  width: 100%;
  height: 100%;
  background: black;
  display: block;
  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: spin 1s ease-out infinite;
}

@keyframes 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;
  /* animation: fadeOut 1s ease infinite; */
}

.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);
}

img#overlay {
  width: auto;
  height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  z-index: 2;
}

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

button#snap, button#playButton, button#switchCameraButton, button#hidden_snap, button#hidden_playButton, button#hidden_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, button#hidden_snap {
  bottom: 1%;
  left: 50%;
  transform: translateX(-50%);
}

button#playButton, button#hidden_playButton {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

button#switchCameraButton, button#hidden_switchCameraButton {
  width: 60px;
  height: 60px;
  top: 5px;
  right: 5px;
}

.hidden {
  display: none;
}

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

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

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

i.fas.fa-camera, i.fas.fa-play, i.fas.fa-sync, i.fas.fa-question {
  color: rgb(0 0 0 / 50%);
  font-size: 40px;
}

i.fas.fa-play {
  padding-left: 7%;
}

i.fas.fa-sync, i.fas.fa-question {
  font-size: 30px;
}

.result {
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease;
}

.result.show {
  visibility: visible;
  opacity: 1;
  animation: slideIn 0.5s forwards;
}

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

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

.result div {
  width: auto;
  height: 95%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.result .img {
  height: 95%;
}

.result img {
  width: auto;
  height: 100%;
}

.result p {
  color: white;
  font-size: 16px;
}

button#closeButton {
  width: 50px;
  height: 50px;
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
}

button#closeButton:hover {
  color: #ccc;
}

canvas#canvas {
  width: 80%;
  height: auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}


/* 操作説明 */
.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 #329844;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
  position: absolute;
  top: 33%;
  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%);
}

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

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

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 {
  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: #329844;
  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;
}

.info2 {
  top: auto;
  bottom: 6%;
}

.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 {
  height: 200px;
  top: 50%;
}

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





@media screen and (max-width: 1500px) {
  .result div {
    height: 90%;
  }

  button#closeButton {
    top: 9px;
  }

  button#infoButton {
    right: 34%;
  }
}





@media screen and (max-width: 1200px) {
  .br-pc, .tab2, .br-sp {
    display: none;
  }
  
  .tab {
    display: block;
  }

  .result div {
    height: 95%;
  }

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

  button#infoButton {
    right: 30%;
  }

  .info-div {
    width: 26%;
  }

  .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%;
  }

  .info1 {
    top: 36%;
  }

  .info2 {
    bottom: 5%;
  }

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

  .info4 {
    height: 220px;
  }
}





@media screen and (max-width: 767px) {
  .br-pc, .tab, .tab2 {
    display: none;
  }
  
  .br-sp {
    display: block;
  }

  .result {
    padding: 10px;
  }

  .result div {
    gap: 10px;
  }

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

  button#infoButton {
    right: 1%;
  }

  .info-div {
    width: 75%;
  }

  .info1 {
    top: 35%;
  }

  .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%;
  }

  .info1 {
    top: 30%;
  }

  .info2 {
    bottom: 6%;
  }

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