/* ═══════════════════════════════════════════
   キャプチャーボタン（参考デザインの白丸＋リング）
   ═══════════════════════════════════════════ */
.capture-btn-wrapper {
    position: fixed;
    display: none;
    width: 100%;
    bottom: 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 10px));
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 200;
    -webkit-touch-callout: none;
    user-select: none;
    pointer-events: none;
}

.capture-btn-wrapper.active {
    display: flex;
}

.capture-btn-wrapper.preview {
    display: none;
}

.capture-buttons-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ヒントテキスト（赤背景・白文字ピル） */
.capture-hint-text {
    background-color: #A4000F;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 20px;
    border-radius: 100px;
    letter-spacing: 1px;
    pointer-events: none;
}

/* ─── シャッターボタン本体（透明＋SVGリング＋白丸） ─── */
#capture-btn {
    border: none;
    background: transparent;
    border-radius: 100%;
    width: 88px;
    height: 88px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    pointer-events: auto;
    transition: transform 0.2s ease;
    box-shadow: none;
}

#stop-btn {
    border: none;
    background: transparent;
    border-radius: 100%;
    width: 88px;
    height: 88px;
    padding: 0;
    display: none;
    position: relative;
    pointer-events: auto;
    box-shadow: none;
}

/* SVGリング */
.capture-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    pointer-events: none;
}

.capture-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 5;
}

#capture-ring-fg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.0);
    stroke-width: 5;
    stroke-dasharray: 276;
    stroke-dashoffset: 276;
    stroke-linecap: round;
    transition: stroke 0.3s ease, stroke-dashoffset 0.5s ease;
}

/* 白い中丸（参考デザインのw-14 h-14） */
.capture-btn-inner {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 100%;
    transition: all 0.2s ease;
    background: #ffffff;
    box-shadow: 0 2px 15px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

/* ボタン押下アニメーション */
#capture-btn.btn-pressed {
    animation: btnPressScale 0.3s ease-out;
}

@keyframes btnPressScale {
    0%   { transform: scale(1);   }
    50%  { transform: scale(1.15); }
    100% { transform: scale(1);   }
}

#stop-btn.now-recording {
    display: block;
    opacity: 0;
    position: absolute;
    z-index: 2;
    pointer-events: none;
}

/* 録画中：ボタン少し縮小＋内円が赤＋リング赤 */
.capture-btn-inner.rec-start {
    width: 60px;
    height: 60px;
    background: #ef4444;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.7);
}

.capture-btn-inner.now-recording {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #ef4444;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.capture-btn-inner.preview {
    width: 50px;
    height: 50px;
}

.capture-btn-inner.now-capture {
    width: 56px;
    height: 56px;
}

/* capture-btn-inner-wrapper は不要だが後方互換のため */
.capture-btn-inner-wrapper {
    display: contents;
}


/* ═══════════════════════════════════════════
   プレビューボタンバー（参考デザインの下部バー）
   やり直し ｜ 保存 ｜ シェア
   ═══════════════════════════════════════════ */
.pic-preview-btn-wrapper,
.movie-preview-btn-wrapper {
    display: none;
}

.pic-preview-btn-wrapper.preview,
.movie-preview-btn-wrapper.preview {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    justify-content: center;
    align-items: center;
    z-index: 4;
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-sizing: border-box;
    gap: 10px;
    pointer-events: auto;
}

/* やり直し（戻るボタン） */
#pic-preview-back-btn,
#movie-preview-back-btn {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    width: auto;
    height: auto;
    border-radius: 100px;
    border: none;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    pointer-events: auto !important;
    cursor: pointer;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    box-shadow: none;
    z-index: 5;
    /* ::before, ::afterの×マーク無効化 */
}

/* ×マーク無効化 */
#pic-preview-back-btn::before,
#movie-preview-back-btn::before,
#pic-preview-back-btn::after,
#movie-preview-back-btn::after {
    display: none;
}

#pic-preview-back-btn:active,
#movie-preview-back-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

/* 保存ボタン（赤系） */
#pic-preview-save-btn,
#movie-preview-save-btn {
    background: #A4000F;
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.15s ease;
    box-shadow: 0 4px 15px rgba(164, 0, 15, 0.3);
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

#pic-preview-save-btn:active,
#movie-preview-save-btn:active {
    transform: scale(0.95);
}

/* シェアボタン（赤背景・白文字） */
#pic-preview-share-btn,
#movie-preview-share-btn {
    background: #A4000F;
    border: none;
    color: #fff;
    border-radius: 100px;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 15px rgba(164, 0, 15, 0.3);
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    white-space: nowrap;
}

#pic-preview-share-btn:active,
#movie-preview-share-btn:active {
    transform: scale(0.95);
}


/* ═══════════════════════════════════════════
   カメラ切り替えボタン（右上・小さめ・半透明）
   ═══════════════════════════════════════════ */
.camera-switcher-btn-wrapper {
    position: fixed;
    display: none;
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    right: 20px;
    bottom: auto;
    justify-content: flex-end;
    z-index: 201;
    transform: none;
    pointer-events: none;
}

.camera-switcher-btn-wrapper.active {
    display: flex;
    pointer-events: auto;
}

.camera-switcher-btn-wrapper.preview {
    display: none;
}

#camera-switcher {
    border: none;
    background: transparent;
    margin-right: 0;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

#camera-switcher:active .camera-switcher-inner {
    transform: scale(0.9);
}

.camera-switcher-inner {
    display: inline-block;
    vertical-align: middle;
    color: #fff;
    line-height: 1;
    position: relative;
    width: 48px;
    height: 48px;
    background: rgba(164, 0, 15, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: none;
    transition: all 0.2s ease;
}

.camera-switcher-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.camera-switch-icon {
    width: 55%;
    height: 55%;
    color: #fff;
}


/* ═══════════════════════════════════════════
   横向き調整
   ═══════════════════════════════════════════ */
@media (orientation: landscape) {
    .capture-btn-wrapper {
        bottom: 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 5px));
    }

    #capture-btn {
        width: 64px;
        height: 64px;
    }

    .capture-btn-inner {
        width: 46px;
        height: 46px;
    }

    #stop-btn {
        width: 64px;
        height: 64px;
    }

    .capture-hint-text {
        font-size: 11px;
        padding: 4px 14px;
    }

    .camera-switcher-btn-wrapper {
        top: calc(env(safe-area-inset-top, 0px) + 12px);
        right: 12px;
    }

    .camera-switcher-inner {
        width: 40px;
        height: 40px;
    }

    #pic-preview-back-btn,
    #movie-preview-back-btn,
    #pic-preview-save-btn,
    #movie-preview-save-btn,
    #pic-preview-share-btn,
    #movie-preview-share-btn {
        font-size: 12px;
        padding: 10px 18px;
    }
}

#spare-btn {
    visibility: hidden;
}
