body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
    background: #000;
    font-family: sans-serif;
}

#video-container {
    position: absolute;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 1;
}

video {
    width: 100%; height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* ← 鏡反転 */
}

.frame-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: auto;
    z-index: 20;
    pointer-events: none; /* ← フレーム固定 */
}

.ui-container {
    position: fixed;
    left: 0;
    bottom: calc(40px + env(safe-area-inset-bottom));
    width: 100vw;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.btn {
    border: none;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    outline: none;
}

#shutter {
    width: 80px; height: 80px;
    background-image: url('img/shutter.PNG');
}

.btn:active { transform: scale(0.9); }

#flash-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: white; opacity: 0; pointer-events: none; z-index: 100;
}

.flash-active { animation: flash-animation 0.4s ease-out; }
@keyframes flash-animation { 0% { opacity: 1; } 100% { opacity: 0; } }

#preview-container {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 80; background: rgba(0,0,0,0.9);
    flex-direction: column; align-items: center; justify-content: center;
}

#preview-image { max-width: 90%; max-height: 70%; object-fit: contain; }

.preview-buttons {
    margin-top: 20px;
    display: flex;
    gap: 20px;
}

.btn-text {
    background: #eee;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: bold;
}

.highlight { background: #ffb6c1; }

#capture-canvas { display: none; }
