/* 撮影（カメラ）エリア */
.capture {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #000;
  display: none;
}

/* ステージ */
.capture__stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.capture__stage--prestart #canvas_main,
.capture__stage--prestart .capture__ar,
.capture__stage--prestart .capture__camera,
.capture__stage--prestart .capture__actions {
  visibility: hidden;
}

.capture__stage--started {
  background: #000;
}

.capture__stage--started #canvas_main,
.capture__stage--started .capture__ar,
.capture__stage--started .capture__camera,
.capture__stage--started .capture__actions {
  visibility: visible;
}
.capture__stage--started .capture__camera {
  display: block;
}

/* 背景キャンバス */
#canvas_main,
#logo {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* カメラプレビュー */
.capture__camera {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 10;
  overflow: hidden;
  background: #d1b277;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capture__video-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #d1b277;
  width: 100%;
  height: 100svh;
  max-width: 100%;
  max-height: none;
  overflow: hidden;
}

.capture__video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mirror {
  transform: scale(-1, 1);
}

.capture__radio-wrapper {
  align-self: center;
  text-align: center;
}

/* ARレイヤー */
.capture__ar {
  display: none;
}

.capture__ar-canvas {
  display: none;
}

/* 操作ボタン */
.capture__actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  z-index: 200;
  height: 120px;
  pointer-events: none;
}

.capture__actions button {
  margin: 0;
  pointer-events: auto;
}

#capture {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: #ffffff;
  border: 5px solid #2b2b2b;
  box-shadow: 0 0 0 2px #ffffff, 0 8px 18px rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

#switch {
  position: absolute;
  right: 8px;
  bottom: 20px;
  background: #0088ff;
  color: #ffffff;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 600;
  border: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  font-size: 18px;
}

.capture__actions .end {
  position: fixed;
  top: 16px;
  left: 16px;
  background: #0088ff;
  color: #ffffff;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  border: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  min-height: auto;
  height: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.capture__back-icon {
  font-size: 18px;
  line-height: 1;
}

/* レイアウト（縦横） */
@media (max-height: 400px) and (orientation: landscape) {
  /* no-op: video is full screen */
}

@media (orientation: landscape) {
  .capture__actions {
    top: 0;
    bottom: 0;
    left: auto;
    right: 0;
    width: 180px;
    height: auto;
    pointer-events: none;
  }

  #capture {
    left: auto;
    right: 32px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  #switch {
    right: 32px;
    top: auto;
    bottom: 32px;
  }

  /* 横向きは縦いっぱい＆センター */
  .capture__video-frame {
    width: 100%;
    height: 100svh;
    max-width: 100%;
    max-height: none;
  }
}

@media (orientation: portrait) {
  /* 縦向きは横いっぱい＆センター */
  .capture__video-frame {
    width: 100%;
    height: 100svh;
    max-height: none;
  }
}

/* スタートオーバーレイ（未使用） */
.capture__start {
  position: absolute;
  inset: 0;
  margin: auto;
  background-color: #dddddd;
  display: none;
  z-index: 500;
}

.capture__start-inner {
  position: absolute;
  inset: 0;
  margin: auto;
  display: table;
  width: 100%;
  height: 100svh;
}

.capture__start-text {
  display: table-cell;
  vertical-align: middle;
  text-align: center;
  color: #222222;
  font-weight: bold;
  font-size: 20px;
  max-width: 480px;
  padding: 0 50px;
}

.capture__loader {
  position: absolute;
  inset: 0;
  margin: auto;
  display: none;
  pointer-events: none;
}
