body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: 'Noto Sans JP', sans-serif;
    touch-action: pan-y pinch-zoom;
}

.red-text {
    color: #E14661;
}

/* フロー画面のスタイル */
.flow-screen {
    background-color: #F4C11D;
    min-height: 100vh;
    max-width: 768px;
    margin: 0 auto;
    position: relative;
    padding-bottom: 80px;
    opacity: 0;
    touch-action: pan-y pinch-zoom;
}

/* カメラ画面の余白調整 */
#camera-screen .w-full.max-w-\[95\%\].mx-auto.mb-2 {
    margin-bottom: 0.5rem !important;
}

#camera-screen .flex-1.flex.items-center.justify-center.mb-2 {
    margin-bottom: 0.5rem !important;
}

/* 縦長端末での最適化 */
@media (min-height: 800px) {
    .flow-screen .mb-1,
    .flow-screen .mb-2 {
        margin-bottom: 0.25rem !important;
    }
    
    #camera-screen .mb-2 {
        margin-bottom: 0.25rem !important;
    }
}

/* カメラ画面のスタイル */
#camera-container {
    position: relative;
    width: 350px;
    height: 350px;
    max-width: 350px;
    max-height: 350px;
    margin: 0 auto;
    overflow: hidden;
    background: black;
}

@media (min-width: 769px) {
    #camera-container {
        width: 350px;
        height: 350px;
        max-width: 350px;
        max-height: 350px;
    }
}

#camera-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
}

#frame-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#canvas {
    display: none;
}

/* 結果画面のコンテナ - カメラ画面と同じサイズ */
#result-container {
    width: 100vw;
    height: 100vw;
    max-width: 350px;
    max-height: 350px;
    margin: 0 auto;
    position: relative;
}

#result-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 769px) {
    #result-container {
        width: 350px;
        height: 350px;
        max-width: 350px;
        max-height: 350px;
    }
}

@media (orientation: landscape) {
    #camera-container {
        width: 100vh;
        height: 100vh;
    }
    
    #result-container {
        width: 100vh;
        height: 100vh;
        max-width: 350px;
        max-height: 350px;
    }
}

.screen {
    display: none;
}

.screen.active {
    display: flex;
}

/* 横持ち禁止オーバーレイのスタイル */
.landscape-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.landscape-warning.hidden {
    display: none;
}

.landscape-warning-content {
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.landscape-icon {
    margin-bottom: 1.5rem;
}

.landscape-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    white-space: nowrap;
}

.landscape-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.4;
}

/* PC表示の最適化 */
@media (min-width: 769px) {
    body {
        background-color: #666;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
    
    .flow-screen {
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
        border-radius: 20px;
        overflow: hidden;
        min-height: 90vh;
        max-height: 90vh;
    }
    
    /* PCでは横持ち警告を表示しない */
    .landscape-warning {
        display: none !important;
    }
} 