@charset "utf-8";
/* CSS Document */
* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            min-height: 100svh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0px;
            color: #fff;
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            letter-spacing: -1px;
        }

        .subtitle {
            font-size: 1rem;
            opacity: 0.9;
            margin-bottom: 30px;
        }

        .container {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            padding: 30px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            max-width: 1200px;
            width: 100%;
        }

        .controls {
            display: flex;
            gap: 15px;
            margin-bottom: 25px;
            justify-content: center;
            flex-wrap: wrap;
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
        }

        button {
            padding: 14px 30px;
            font-size: 16px;
            font-weight: 600;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        #shutterBtn {
            width: 80px;
            height: 80px;
            padding: 0;
            border: 10px solid #000;
            border-radius: 50%;
            background: #fff;
            color: transparent;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        #shutterBtn:hover:not(:disabled) {
            transform: translateY(-2px);
        }

        #shutterBtn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        #resetBtn {
            background: none;
            color: #000;
            width: 48px;
            height: 48px;
            padding: 0;
            position: fixed;
            top: 15px;
            left: 15px;
            z-index: 100;
            font-size: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            cursor: pointer;
            transition: opacity 0.3s ease;
        }

        #resetBtn:hover {
            opacity: 0.8;
        }

        #downloadBtn {
            background: none;
            color: #000;
            width: 48px;
            height: 48px;
            padding: 0;
            position: fixed;
            top: 15px;
            right: 15px;
            z-index: 100;
            font-size: 24px;
            display: none;
            align-items: center;
            justify-content: center;
            border: none;
            cursor: pointer;
            transition: opacity 0.3s ease;
        }

        #downloadBtn:hover {
            opacity: 0.8;
        }

        #downloadBtn .material-symbols-outlined {
            font-size: 24px;
        }

        #playBtn {
            background: #FFF;
            color: #000;
            width: 80px;
            height: 80px;
            padding: 0;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 60px;
            transition: opacity 0.3s ease;
        }

        #playBtn:hover {
            opacity: 0.8;
        }

        #stopBtn {
            background: #FFF;
            color: #000;
            width: 80px;
            height: 80px;
            padding: 0;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 60px;
            transition: opacity 0.3s ease;
        }

        #stopBtn:hover {
            opacity: 0.8;
        }

        .material-symbols-outlined {
            font-family: 'Material Symbols Outlined';
            font-weight: 400;
            font-style: normal;
            font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

        /* ボタン内アイコンを上下左右中央に */
        button .material-symbols-outlined {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }

        #playBtn .material-symbols-outlined,
        #stopBtn .material-symbols-outlined {
            font-size: 60px;
        }

        .video-container {
            position: relative;
            justify-content: center;
            margin-bottom: 25px;
            background: #000;
            overflow: hidden;
            display: none;
            position: fixed;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
            width: 100%;
        }

        .video-container.active {
            display: flex;
        }

        .canvas-container {
            display: none;
            position: fixed;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
            width: 100%;
        }

        .canvas-container.active {
            display: flex;
        }

        #video {
            max-width: 100%;
            display: block;
        }

        #overlay {
            position: absolute;
            top: 0;
            left: 0;
            pointer-events: none;
            width: 100%;
            height: 100%;
            object-fit: contain;
        }

        .canvas-container {
            display: flex;
            justify-content: center;
            background: #ffffff;
            border-radius: 0;
            overflow: hidden;
            min-height: 400px;
            align-items: center;
        }

        #canvasA {
            max-width: 100%;
            display: block;
        }

        .status {
            text-align: center;
            margin-top: 0px;
            height: 78px;
            line-height: 78px;
            padding: 0 78px;
            background: #fff;
            z-index: 100;
            border-radius: 0px;
            color: #000;
            font-weight: 600;
            width: 100%;
            position: fixed;
            top: 0;
            left: 0;
            box-sizing: border-box;
            font-size: 80%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        #pageTitle {
            position: fixed;
            top: 78px;
            left: 0;
            padding: 0.5em 0.75em;
            z-index: 99;
            color: #000;
            font-size: 10vw;
            font-weight: 600;
            margin: 0;
            display: none;
        }

        .loading {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 9999;
            text-align: center;
            padding: 20px;
            color: #fff;
            justify-content: center;
            align-items: center;
            flex-direction: column;
        }

        .loading.active {
            display: flex;
        }

        .spinner {
            border: 4px solid rgba(255, 255, 255, 0.1);
            border-left-color: #FFF;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 10px;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* 描画中のライン型ローディング（status の直下） */
        /* transform アニメーションでGPU合成 → メインスレッド負荷時もカクつきにくい */
        .status-loading-line {
            display: none;
            position: fixed;
            top: 78px;
            left: 0;
            width: 100%;
            height: 4px;
            background: #eee;
            z-index: 100;
            overflow: hidden;
        }

        .status-loading-line.active {
            display: block;
        }

        .status-loading-line::after {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            width: 100%;
            height: 100%;
            background: #000;
            will-change: transform;
            transform-origin: center;
            transform: translateZ(0) translateX(-50%) scaleX(0);
            animation: loadingLineExpand 1.5s ease-in-out infinite;
        }

        @keyframes loadingLineExpand {
            0%, 100% { transform: translateZ(0) translateX(-50%) scaleX(0); }
            50% { transform: translateZ(0) translateX(-50%) scaleX(1); }
        }

        /* デスクトップ: pageTitle */
        @media (min-width: 768px) {
            #pageTitle {
                font-size: 5vw;
                color: #ccc;
            }
        }

