@charset "utf-8";
/* CSS Document */
body {
            font-family: "PT Serif", serif;
            margin: 0;
            padding: 0;
            background-color: #f0f0f0;
            height: 100svh;
            overflow: hidden;
        }
        /* 日本語時は Zen Old Mincho（h1は layout で PT Serif のまま） */
        html[lang="ja"] body {
            font-family: "Zen Old Mincho", serif;
        }
h1 {
    font-family: "PT Serif", serif;
    color: #333;
    margin: 0;
    position: fixed;
    top: 2vw;
    left: 2vw;
    font-size: 10vw;
    font-weight: 700; line-height: 1; font-weight: 400;
}
        #videoContainer {
            width: 100%;
            height: 100%;
            display: flex;
            /*align-items: center;*/
            justify-content: center;
        }
        #video {
            max-width: 100%;
            max-height: 100%;
            width: auto;
            height: auto;
            object-fit: contain;
        }
        #captureBtn {
            position: fixed;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 80px;
            padding: 0;
            background-color: #f0f0f0;
            border: 10px solid #000;
            border-radius: 50%;
            cursor: pointer;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #captureBtn:hover {
            opacity: 0.8;
        }
        #captureBtn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .result-item {
            background-color: white;
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .result-item h3 {
            margin-top: 0;
            color: #555;
            text-align: center;
        }
        .result-item canvas {
            max-width: 100%;
            max-height: 100%;
        }
        #results {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .result-item {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0;
            background-color: transparent;
            box-shadow: none;
        }
        .result-item h3 {
            display: none;
        }
        #status {
            display: none;
        }
        #loadingOverlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }
        #loadingOverlay.show {
            display: flex;
        }
        .spinner {
            width: 50px;
            height: 50px;
            border: 5px solid rgba(255, 255, 255, 0.3);
            border-top: 5px solid #fff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }
        #loadingText {
            color: white;
            font-size: 14px;
            text-align: center;
            margin-top: 10px;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        /* 状態管理用のスタイル */
        .state-camera #results {
            display: none;
        }
        /* 初期画面（カメラ）以外ではh1を非表示 */
        .state-result h1 {
            display: none;
        }
        .state-result #videoContainer,
        .state-result #captureBtn {
            display: none;
        }
        #resetBtn {
            position: fixed;
            top: 20px;
            left: 20px;
            padding: 0;
            width: 48px;
            height: 48px;
            background-color: transparent;
            border: none;
            cursor: pointer;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #resetBtn .material-symbols-outlined {
            font-size: 24px;
            color: #000000;
            transition: color 1.8s ease-in-out;
        }
        #resetBtn:disabled {
            display: none;
        }
        .state-camera #resetBtn {
            display: none;
        }
        #downloadBtn {
            position: fixed;
            top: 20px;
            right: 20px;
            padding: 0;
            width: 48px;
            height: 48px;
            background-color: transparent;
            border: none;
            cursor: pointer;
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #downloadBtn .material-symbols-outlined {
            font-size: 24px;
            color: #000000;
            transition: color 1.8s ease-in-out;
        }
        #downloadBtn:disabled {
            display: none;
        }
        .state-camera #downloadBtn {
            display: none;
        }
        /* 音楽コントロール */
        #musicControls {
            position: fixed;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 15px;
            z-index: 1000;
        }
        .state-camera #musicControls {
            display: none;
        }
        /* セリフ風色読み上げナレーション */
        #colorNarration {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 500;
            overflow: hidden;
        }
        .state-camera #colorNarration {
            display: none;
        }
        .color-line {
            position: absolute;
            font-family: "Yu Mincho", "游明朝", "Hiragino Mincho Pro", serif;
            font-size: 18px;
            letter-spacing: 0.15em;
            white-space: nowrap;
            opacity: 0;
            animation: colorLineAppear 4s ease-in-out forwards;
            text-shadow:
                0 0 8px rgba(0,0,0,0.5),
                0 0 2px rgba(0,0,0,0.8);
        }
        .color-line.vertical {
            writing-mode: vertical-rl;
            font-size: 16px;
            letter-spacing: 0.3em;
        }
        @keyframes colorLineAppear {
            0%   { opacity: 0; transform: translateY(8px); }
            15%  { opacity: 0.9; transform: translateY(0); }
            70%  { opacity: 0.85; transform: translateY(0); }
            100% { opacity: 0; transform: translateY(-6px); }
        }
        /* セクション0（序奏）: ゆっくり静かに現れ、長く漂う */
        .color-line.section-0 {
            font-size: 13px;
            animation: lineAppear0 6s ease-in-out forwards;
        }
        @keyframes lineAppear0 {
            0%   { opacity: 0; transform: translateY(12px) scale(0.9); }
            25%  { opacity: 0.5; transform: translateY(0) scale(1); }
            75%  { opacity: 0.45; transform: translateY(-2px) scale(1); }
            100% { opacity: 0; transform: translateY(-8px) scale(0.95); }
        }
        /* セクション1（展開）: 通常のアニメーション（既存を流用） */
        .color-line.section-1 {
            font-size: 18px;
            animation: colorLineAppear 4s ease-in-out forwards;
        }
        /* セクション2（転回）: ゆらぎのある内省的な動き */
        .color-line.section-2 {
            font-size: 16px;
            animation: lineAppear2 5s ease-in-out forwards;
        }
        @keyframes lineAppear2 {
            0%   { opacity: 0; transform: translateX(-5px); }
            15%  { opacity: 0.7; transform: translateX(3px); }
            50%  { opacity: 0.65; transform: translateX(-2px); }
            80%  { opacity: 0.6; transform: translateX(1px); }
            100% { opacity: 0; transform: translateX(0) translateY(-4px); }
        }
        /* セクション3（クライマックス）: 素早く力強く出現 */
        .color-line.section-3 {
            font-size: 24px;
            letter-spacing: 0.25em;
            animation: lineAppear3 3s ease-out forwards;
            text-shadow:
                0 0 12px rgba(0,0,0,0.7),
                0 0 4px rgba(0,0,0,0.9);
        }
        .color-line.vertical.section-3 {
            font-size: 22px;
        }
        @keyframes lineAppear3 {
            0%   { opacity: 0; transform: scale(1.2); }
            8%   { opacity: 1; transform: scale(1); }
            60%  { opacity: 0.95; transform: scale(1); }
            100% { opacity: 0; transform: scale(0.95) translateY(-10px); }
        }
        #playBtn, #stopBtn {
            padding: 0;
            width: 80px;
            height: 80px;
            background-color: #000;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        #playBtn .material-symbols-outlined,
        #stopBtn .material-symbols-outlined {
            font-size: 60px;
            color: #FFF;
            transition: color 1.8s ease-in-out;
        }
        #playBtn:disabled,
        #stopBtn:disabled {
            display: none;
        }
        /* 幕間オーバーレイ（場面転換の暗転） */
        #curtainOverlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #000;
            opacity: 0;
            pointer-events: none;
            z-index: 400;
            transition: opacity 1.8s ease-in-out;
        }
        #curtainOverlay.closing {
            opacity: 1;
            transition: opacity 1.8s ease-in;
        }
        #curtainOverlay.opening {
            opacity: 0;
            transition: opacity 2.0s ease-out;
        }
        .state-camera #curtainOverlay {
            display: none;
        }
        /* 幕間中のUIアイコン白化 */
        .curtain-active #resetBtn .material-symbols-outlined,
        .curtain-active #downloadBtn .material-symbols-outlined,
        .curtain-active #playBtn .material-symbols-outlined,
        .curtain-active #stopBtn .material-symbols-outlined {
            color: #ffffff;
        }

