/* layout */

nav#control {
  justify-content: space-between;
  font-size: 0;
}

nav#headerControl {
  padding-top: 30px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: end;
}

nav#footerControl {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: end;
}

@media only screen and (max-width: 480px) {
  nav#headerControl {
    padding-top: 0px;
  }
}

@media only screen and (max-height: 480px) {
  nav#headerControl {
    padding-top: 5px;
  }
}


/* backtosession */
#buttonBackToSession>a {
  display: flex;
  align-items: center;
}

#buttonBackToSession>a>span {
  font-size: 32px;
}

#buttonBackToSession {
  display: block;
  width: 15%;
  height: 50px;
  margin-left: 0%;
  cursor: pointer;
}

#buttonBackToSession:hover {
  transform: scale(1.05);
}

#buttonBackToSession:active {
  background-color: #f80;
  transform: scale(0.98);
}

@media only screen and (max-width: 480px) {
  #buttonBackToSession>a>span {
    font-size: 24px;
    padding-top: 0px;
  }
}

@media only screen and (max-height: 480px) {
  #buttonBackToSession>a>span {
    font-size: 24px;
    padding-top: 0px;
  }
}

#buttonProfileSettings a,
#buttonBackToSession a {
  display: block;
  width: 100%;
  height: 100%;
  text-align: center;
  line-height: 60px;
  color: #fff;
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9);
  line-height: 70px;
}

#buttonProfileSettings {
  display: block;
  width: 15%;
  height: 50px;
}

#buttonProfileSettings>a>span {
  font-size: 32px;
}

@media only screen and (max-width: 480px) {
  #buttonProfileSettings>a>span {
    font-size: 24px;
    padding-top: 0px;
  }
}

@media only screen and (max-height: 480px) {
  #buttonProfileSettings>a>span {
    font-size: 24px;
    padding-top: 0px;
  }
}

/* yourPhoto */

#buttonYourPhotos {
  position: relative;
  width: 100px;
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;

  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);
  background-color: transparent;
  margin-left: 6%;
  margin-bottom: 15px;
  cursor: pointer;
  text-align: center;

  border: 2px solid rgba(255, 255, 255);
  border-radius: 10px;
  transition: all 0.1s ease;

  position: fixed;
  left: 2%;
  bottom: 10px;
}

/* サムネイル画像をコンテナ(16/9 or 9/16)いっぱいに表示し、下に背景(#bbb)の余白が出ないようにする。 */
#buttonYourPhotos a {
  display: block;
  width: 100%;
  height: 100%;
}
#buttonYourPhotosCurrentPhoto {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media only screen and (max-height: 480px) {
  #buttonYourPhotos {
    left: 5%;
    height: 70px;
  }
}

@media only screen and (max-height: 480px) {
  #buttonYourPhotos.horizontal {
    left: auto;
    width: 70px;
    right: 20px;
    bottom: 5px;
  }
}

/* **強制回転では right が「画面の上端からの距離」になる**（-90deg で要素の +X が
   画面の上を向く）。仮想ページは viewport-fit=cover で描いているので、素の 25px だと
   ノッチ／ステータスバーの下に潜る（利用者の報告・2026-08-29「シャッターがみえない?」）。
   safe-area のぶんを足してその外へ出す。ノッチの無い端末では 0px なので位置は変わらない。 */
#buttonYourPhotos.modeForcedRotate.horizontal {
  left: auto;
  width: 70px;
  right: calc(25px + env(safe-area-inset-top, 0px));
  bottom: 55px;
}

#buttonYourPhotos.vertical {
  width: auto;
  height: 100px;
  aspect-ratio: 9 / 16;
}


@media only screen and (max-height: 480px) {
  #buttonYourPhotos {
    height: auto;
    width: 70px;
  }

  #buttonYourPhotos.vertical {
    width: auto;
    height: 70px;
    margin-right: 20px;
  }
}

#buttonYourPhotos a {
  display: flex;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-sizing: border-box;
}

#buttonYourPhotos a img {
  position: absolute;
  top: 0;
  left: 0;
}

#buttonYourPhotosCurrentPhoto {
  width: 100%;
  height: 100%;
  transition: all 0.1s ease;
  transform: scale(1.00);
}

#buttonYourPhotosCurrentPhoto:hover {
  transform: scale(1.05);
}

#buttonYourPhotosCurrentPhoto:active {
  background-color: #f80;
  transform: scale(0.98);
}


#buttonYourPhotosCurrentPhoto.vertical {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


#Spacer {
  display: block;
  width: 100px;
  height: 0px;
  background-color: #fff;
  margin-right: 50px;
}

@media only screen and (max-width: 480px) {
  #buttonYourPhotos {
    margin-left: 0;
  }
}

@media only screen and (max-height: 480px) {
  #buttonYourPhotos {
    margin-left: 0;
  }
}

#buttonYourPhotos a {
  width: 100%;
  position: relative;
}

#buttonYourPhotos a #imagemark {
  width: 100%;
  display: block;
  color: #fff;
  padding: 0;
  margin: 0;
}

/* timecode */

#timecode {
  flex: 1;
  color: #000;
  font-size: 24px;
  text-align: center;
  color: #fff;

  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.9);
  font-weight: 400;
  font-style: normal;
  letter-spacing: 2px;
  font-family: "Chakra Petch", sans-serif;
  user-select: none;
}

@media only screen and (max-width: 480px) {
  #timecode {
    font-size: 18px;
    padding-top: 0px;
  }
}

@media only screen and (max-height: 480px) {
  #timecode {
    font-size: 18px;
    padding-top: 0px;
  }
}


#timecode .monospace {
  display: inline-block;
  width: 0.7em;
  text-align: center;
}

#timecode.thin {
  font-size: 17px;
}

/* buttonCapture */

#buttonCapture {
  user-select: none;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  width: 70px;
  height: 70px;
  overflow: hidden;
  border-radius: 100px;
  margin-bottom: 15px;
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
  background-color: #fff;
  background-image: url(../images/sharter_icon.svg);
  background-size: 80%;
  background-repeat: no-repeat;
  background-position: center 6px;

  position: fixed;
  left: calc(50% - 35px);
  top: calc(100% - 95px);
}

#buttonCapture:hover {
  transform: scale(1.05);
}

#buttonCapture:active {
  background-color: #f80;
  transform: scale(0.98);
}


@media only screen and (max-height: 480px) {
  #buttonCapture.horizontal {
    /* 回転しているときの left は画面の上端からの距離（上の枠と同じ理屈）。 */
    left: calc(100% - 95px - env(safe-area-inset-top, 0px));
    top: calc(50% - 40px);
  }
}

/* userid */


#display-user-id {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 30%;
  height: auto;
  aspect-ratio: 16 / 9;

  font-size: 22px;
  font-weight: normal;
  letter-spacing: 4px;
  margin: 0;

  color: #fff;
  position: relative;
}

#display-user-id.vertical {
  width: auto;
  height: 30%;
  aspect-ratio: 9 / 16;
}

/* user id*/


.mark {
  position: absolute;
  display: block;
  width: 20%;
  height: 20%;
}

.mark.t {
  top: 0;
  border-top: 1.5px solid #fff;
}

.mark.b {
  bottom: 0;
  border-bottom: 1.5px solid #fff;
}

.mark.l {
  left: 0;
  border-left: 1.5px solid #fff;
}

.mark.r {
  right: 0;
  border-right: 1.5px solid #fff;
}

@media only screen and (max-width: 480px) {
  #display-user-id {
    font-size: 16px;
  }

  /* 縦の映像のときは、もうひと回り小さく（利用者の指示・2026-08-20
     「SP, Verticalのとき、ID表示を少し小さくする」）。

     縦だと ID はシャッターボタンと同じ帯に並ぶ。横の映像より画面の幅を
     使えないので、同じ大きさだとボタンのすぐ横まで文字が迫る。
     字間も一緒に詰める ―― 4px のままだと、字を小さくしても
     占める横幅があまり変わらない。 */
  #display-user-id.vertical {
    font-size: 13px;
    letter-spacing: 3px;
  }
}

@media only screen and (min-width: 480px) {
  .directlink_capturedby {
    display: none;
  }
}

/* tap to start */

#taptostart {
  color: #fff;
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.3);
  display: flex;
  font-size: 40px;
  letter-spacing: 4px;
  background: rgba(0, 0, 0, 0.7);
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

#taptostart:hover {
  color: rgba(255, 255, 255, 0.95);
}


#bg-no-copy {
  position: absolute;
  top: -150vh;
  left: -50vw;
  width: 300vw;
  height: 300vh;
  transform: rotate(-15deg);
}

@media only screen and (max-width: 480px) {
  #buttonYourPhotos.vertical {
    width: auto !important;
    height: 80px !important;
    aspect-ratio: 9 / 16 !important;
  }
}

/* サムネイル画像は向き/状態(縦横・class有無)に関わらずコンテナ全体を覆い、
   下に余白(背景#bbb/白)が出ないようにする。最後に定義して確実に優先させる。 */
#buttonYourPhotos a img#buttonYourPhotosCurrentPhoto {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* ============================================================
   操作の軸 ―― 撮影プレビュー / シャッター / 撮影画像を見る
   （利用者の指示・2026-09-08「…回転するごとに位置が微妙に変わるので
   丁寧に再設計して」／「重ならないように、一列にならぶように」）

   **使うのは、シャッターが画面の端に立っている2つの場面。**
     ・強制回転（縦持ちで横動画）… 映像ごと -90deg 回るので、軸は画面の上端
     ・横持ち（縦が短い画面）    … シャッターは画面の右端・縦中央
   印（body.hs-rail）を付けるのは player-ui.js。縦持ち（回転なし）は
   シャッターが下の中央に居る別の並びなので、この軸は使わない。

   **同じ宣言が両方に効く。** 3つとも #base の中に居るので、書く座標は
   いつも「要素の座標系」―― 回っているときはそれが画面では90度ぶん
   読み替わるだけで、軸から見た並びは変わらない。

     right  … 軸そのもの（回転時は画面の上端からの距離）
     top    … 軸に沿った手前（回転時は画面の左）… 撮影画像を見る
     50%    … 軸の中央                        … シャッター
     bottom … 軸に沿った奥（回転時は画面の右）  … 撮影プレビュー

   **中心を軸に乗せる。** 幅の分かる2つ（シャッター70／プレビュー88）は
   calc で半分だけ戻し、幅の決まらない添え書きだけ translateX(50%) を使う。
   シャッターに transform を使わないのは、そこが演出（揺れ・脈打ち・
   押した時の縮み）の持ち場で、軸を預けると演出のあいだ跳ねるため。

   **数字を足すときは --hs-rail だけを動かすこと。** 3つが同じ変数を見て
   いるので、片方だけずれることが起きない。 */
body.hs-rail {
  /* 横持ちでは画面の右端から。回転しているときは要素の右端＝画面の上端
     なので、逃がす先の safe-area も変わる。 */
  --hs-rail: calc(60px + env(safe-area-inset-right, 0px));
}
body.hs-rail.hs-rotated {
  --hs-rail: calc(60px + env(safe-area-inset-top, 0px));
}
body.hs-rail #buttonProfileSettings,
body.hs-rail #buttonCapture,
body.hs-rail #buttonYourPhotos {
  position: fixed !important;
  left: auto !important;
  margin: 0 !important;
}
/* 軸の手前（回転時は画面の左 / 横持ちは画面の上）: 撮影画像を見る。
   幅が文字で決まるので、自分の幅の半分だけ戻して中心を軸に乗せる。 */
body.hs-rail #buttonProfileSettings {
  right: var(--hs-rail) !important;
  /* 軸の端いっぱいまで寄せる。フキダシは軸に沿ってここへ伸びてくるので、
     手前を空けておくほど当たりにくい（下のフキダシの大きさと対の調整）。 */
  top: 8px !important;
  bottom: auto !important;
  width: auto !important;
  transform: translateX(50%) !important;
  z-index: 6;
}
/* 軸の中央: シャッター。70×70 の半分を calc で戻す。 */
body.hs-rail #buttonCapture {
  width: 70px !important;
  height: 70px !important;
  right: calc(var(--hs-rail) - 35px) !important;
  top: calc(50% - 35px) !important;
  bottom: auto !important;
}
/* **フキダシが出ているときは、シャッターをわずかに奥へ**（利用者の指示・
   2026-09-08「吹き出しがあるとき、シャッターボタンはわずかに下」）。

   フキダシは軸の**手前**（傾けて見たときの上）へ伸びるので、ボタンだけを
   軸の中央に置くと、フキダシを含めた見た目の重心が手前へ寄る。
   ボタンを少し奥（傾けて見たときの下）へ戻すと、全体で中央に見える。
   ここで言う「下」は要素の下 ―― 回転していれば画面では右、横持ちなら
   画面の下で、どちらも同じ宣言でよい。
   10px は**調整のつまみ**。フキダシの大きさを変えたらここも見る。 */
body.hs-rail #buttonCapture.fp-has-shots {
  top: calc(50% - 35px + 10px) !important;
}

/* 軸の奥（回転時は画面の右 / 横持ちは画面の下）: 撮影プレビュー。

   **大きさはシャッターより少し小さく**（利用者の指示・2026-09-08
   「サムネイルはシャッターの横幅よりも少し狭いぐらい」）。
   シャッターは70pxなので、それより少しだけ小さい 68px
   （2026-09-08「サムネイルはもう少し大きくてもよい」で 60px から）。
   軸に乗せる calc もこの変数から引くので、
   **大きさを変えるのは --hs-prev ひとつ**でよい。

   **背は計算で決め切る**（同・「サムネイルの下に隙間がある」）。
   `height:auto` ＋ `aspect-ratio` は、詳細度の高い height を持つ規則が
   どこかに居ると背だけが残って中身の下に空きができる ―― 幅と背の両方を
   書いてしまえば、そこに解釈の余地が無くなる。
   中身（a と img）は枠いっぱいに敷いてあるので、これで隙間は出ない。
   この軸に来る映像は必ず横位置なので 16:9 でよい（縦位置の映像は
   強制回転の別の枝へ行き、hs-rail は付かない）。 */
body.hs-rail #buttonYourPhotos {
  --hs-prev: 68px;
  width: var(--hs-prev) !important;
  height: calc(var(--hs-prev) * 9 / 16) !important;
  aspect-ratio: auto !important;
  overflow: hidden;
  right: calc(var(--hs-rail) - var(--hs-prev) / 2) !important;
  top: auto !important;
  bottom: 18px !important;
}
/* **回転しているときは、ヒートバーの軸に中心をそろえる**（利用者の指示・
   2026-09-08「高さはヒートバーの軸の上下中央にアライン」）。

   ヒートバー（#fp-heat）は #base の外に居て、画面の右端から 58px の線を
   軸に置いてある（fp-screens.css の body.fp-rotated #fp-heat）。
   プレビューは #base の中なので、要素の bottom がそのまま
   「画面の右端からの距離」になる ―― 軸から自分の背の半分だけ戻せば、
   バーと同じ線の上に中心が来る。
   **58px はあちらの値の写し。** バーの軸を動かすときはここも一緒に。 */
body.hs-rail.hs-rotated #buttonYourPhotos {
  --hs-heat-axis: 58px;
  bottom: calc(var(--hs-heat-axis) - (var(--hs-prev) * 9 / 16) / 2) !important;
}

/* **残数のフキダシはシャッターの「傾けて見たときの上」に置く**
   （利用者の指示・2026-09-08「シャッターの上というのは、90度かたむけた
   ところからみたときに、上になるように」）。

   それは**要素の真上**＝既定の置き方そのものなので、位置は上書きしない
   （画面では軸に沿って手前＝左へ伸びる）。いったん画面の上（要素の右）へ
   動かしたのは読み違いで、戻してある。

   **大きさだけ詰める。** 軸の手前には「撮影画像を見る」が居るので、
   フキダシが伸びるほどそこへ近づく。文字と余白を一段小さくして届かせない
   ―― 位置で逃がすと、こんどは軸から外れて一列でなくなる。
   **添え書きの置き場（上の #buttonProfileSettings の top）と対の調整**なので、どちらかを変えるときは
   もう一方も見ること。 */
body.hs-rail.hs-rotated #buttonCapture #fp-shots {
  padding: 4px 9px 5px;
  border-radius: 9px;
}
body.hs-rail.hs-rotated #buttonCapture #fp-shots .fp-shots-label { font-size: 8px; }
body.hs-rail.hs-rotated #buttonCapture #fp-shots .fp-shots-count { font-size: 9px; }
body.hs-rail.hs-rotated #buttonCapture #fp-shots .fp-shots-count b {
  font-size: 14px;
  padding-left: 2px;
}
