* {
  margin: 0;
  padding: 0;
  touch-action: none;
  pointer-events: none;
}

body {
  overflow: hidden;
}

.touchable {
  pointer-events: all;
}

.position-absolute {
  position: absolute;
}

.movable-stamp {
  pointer-events: all;
}

/* Moveableの操作用 */
.moveable-control {
  pointer-events: all;
}

/* Moveableの操作用 */
.moveable-rotation {
  pointer-events: all;
}

/* Moveableの操作用 */
.moveable-area {
  pointer-events: all;
}

#background {
  position: absolute;
  width: 100vw;
  height: 100vh;
  background-color: var(--white);
}

.root {
  position: absolute;
  width: 100%;
  height: 100%;
}

#pc-root {
  display: none;
}

#pc-qrcode {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20%;
  height: auto;
  max-width: 200px;
}

#pc-text {
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -70%);
  font-size: 1rem;
  text-align: center;
}

#photo-root {
  display: none;
}

/*　画像の短い方を引き伸ばしてフルスクリーン表示にする */
#camera-stream {
  position: absolute;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* 9:16のアスペクト比にする為のマージン */
.camera-margin {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(1em);
  backdrop-filter: blur(1em);
}

#stamps {
  position: absolute;
  width: 100%;
  height: 100%;
}

/* フッター */
#footer {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  display: flex;              /* Flexbox レイアウトを使用 */
  justify-content: center;    /* 横方向の中央揃え */
  align-items: center;  
}

#footer > .spacer {
  display: inline-block;
  margin-right: 30px;
  width: 70px;
  height: 70px;
  max-width: 15vw;
}

#capture-btn {
  width: 100px;
  height: auto;
  max-width: 20vw;
  z-index: 4000;
}

#flip-camera-btn {
  margin-left: 30px;
  width: 60px;
  height: auto;
  max-width: 15vw;
  z-index: 4000;
}

.loading {
  position: absolute;
  top: calc(50% - 32px);
  left: calc(50% - 32px);
  width: 64px;
  height: 64px;
  transition: opacity 0.5s ease-out;
  transition-delay: 0.5s;
  opacity: 0;
}
.loading div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-sizing: border-box;
  opacity: .8;
}
.loading-one {
  border-top: 2px solid var(--primary-color);
  animation: rotate-left 1s linear infinite;
}
.loading-two {
  border-bottom: 2px solid var(--secondary-color);
  animation: rotate-right 1s linear infinite;
}
  @keyframes rotate-left {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes rotate-right {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loading-text {
  position: absolute;
  top: calc(50% + 32px + 1em);
  left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  font-size: 1rem;
  text-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5);
  transition: opacity 0.5s ease-out;
  transition-delay: 1.0s;
  opacity: 0;
}

#modal-root {
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(2em);
  backdrop-filter: blur(2em);
  z-index: 5000;
  transition: opacity 0.3s;
  opacity: 0;
}

#modal-close-btn {
  position: absolute;
  color: var(--white);
  top: 20px;
  right: 20px;
  width: auto;
  height: 40px;
  max-height: 15vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5002;
  transition: opacity 0.3s;
}

#modal-window {
  position: relative;
  aspect-ratio: 9 / 16;
  height: 70%;
  max-width: 80%;
  padding: 1em;
  background-color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5001;
  box-shadow: 0.3em 0.3em 0.5em rgba(0, 0, 0, 0.5);
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);;
  transition-delay: 0.3s;
  left: -10vh;
  top: -10vh;
  opacity: 0;
  rotate: -10deg;
}

#modal-word {
  position: absolute;
  color: var(--white);
  bottom: 20px;
  width: auto;
  height: 40px;
  max-height: 5vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5002;
}

@media (orientation: landscape) {
  #modal-window {
    aspect-ratio: 16 / 9;
  }
  #modal-word {
    bottom: 10px;
    width: auto;
    height: 100px;
    max-height: 5vh;
    display: flex;
    justify-content: center;
  }
}

#photo-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

#save-description {
  position: absolute;
  width: 200px;
  top: 92%;
  transform: translateY(-50%);
  text-align: center;
  color: var(--white);
  animation: blink 3s infinite; /* アニメーションの設定 */
}

.drop-shadow {
  filter: drop-shadow(0 0 0.2em rgba(0, 0, 0, 0.5));
}

.fade-in-enabled {
  opacity: 1;
  pointer-events: all;
}

#permission-denied-root {
  display: none;
}

#permission-denied-text {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  text-align: center;
}

#not-open-root {
  display: none;
}

#not-open-text {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  text-align: center;
}

#error-root {
  display: none;
}

#error-text {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  text-align: center;
}

#select-preset-open-btn {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  aspect-ratio: 1;
  max-width: 20vw;
}

#select-preset-open-btn img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  height: auto;
}

#select-preset-root {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--light-gray);
  --header-height: 50px;
  z-index: 6000;
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
}

.select-preset-root-enabled {
  transform: translateX(0) !important;
}

#select-preset-header {
  position: absolute;
  text-align: center;
  width: 100vw;
  height: var(--header-height);
  background-color: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(1em);
  backdrop-filter: blur(1em);
}

#select-preset-title {
  position: absolute;
  font-size: 1rem;
  color: var(--white);
  font-weight: 600;
  width: 80%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#select-preset-close-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: calc(var(--header-height));
  height: calc(var(--header-height));
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0);
  border: 0;
}

.close-icon {
  width: 50%;
  height: auto;
}

#select-preset-box {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  max-width: 400px;
  height: 100%;
  padding-left: 10px;
  padding-right: 10px;
}

#select-preset-contents {
  height: 100%;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  pointer-events: all;
  touch-action: pan-y;
}

.border-radius-top {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.border-radius-bottom {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  margin-bottom: 10px;
}

.border-radius-bottom::after {
  background-color: rgba(0, 0, 0, 0) !important;
}

.select-preset-item-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translateX(5%);
  width: 90%;
  height: 60px;
  background-color: var(--white);
  border: 0;
  transition: background-color 0.2s;
  touch-action: pan-y;
}

.select-preset-item-btn:active {
  background-color: var(--light-gray-2);
}

.select-preset-item-btn::after {
  content: '';
	display: block;
	position: absolute;
  right: 0;
  bottom: 0;
	width: 80%;
	height: 1px;
	background-color: var(--light-gray-2);
}

.select-preset-item-offset {
  background-color: rgba(0, 0, 0, 0);
}

.select-preset-item-offset::after {
 background-color: rgba(0, 0, 0, 0); 
}

.select-preset-thumbnail {
  position: absolute;
  left: 10px;
  width: 50px;
  height: 50px;
}

.select-preset-name {
  position: relative;
  margin-left: 60px;
  margin-right: 10px;
  width: 100%;
  max-height: 100%;
  font-size: 1rem;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.select-preset-selected {
  background-color: var(--light-gray-2);
}

.select-preset-selected::after {
  background-color: rgba(0, 0, 0, 0) !important;
 }

#restrict-landscape-root {
  top: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(2em);
  backdrop-filter: blur(2em);
  z-index: 5000;
  transition: opacity 0.3s;
  opacity: 0;
}

#restrict-landscape-text {
  position: absolute;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  text-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5);
  transition: opacity 0.5s ease-out;
  text-align: center;
  color: var(--white);
}