﻿        :root {
            /* 配色定義 */
            --color-bg: #000000;
            --color-scope: #00FF41; /* レーダーグリーン */
            --color-text: #E0E0E0;
            --color-btn-link: #1C39BB; /* ペルシアンブルー */
            --color-btn-stop: #D32F2F; /* オペラレッドに近い視認性の良い赤 */
            --color-overlay: rgba(0, 0, 0, 0.6);
        }

        * {
            box-sizing: border-box;
            touch-action: manipulation; /* ダブルタップズーム防止 */
        }

        body {
            margin: 0;
            padding: 0;
            font-family: 'Share Tech Mono', monospace;
            background-color: var(--color-bg);
            color: var(--color-text);
            height: 100vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* ヘッダーエリア */
        header {
            padding: 10px;
            text-align: center;
            background: linear-gradient(180deg, #1a1a1a 0%, #000 100%);
            border-bottom: 1px solid #333;
            z-index: 10;
        }

        h1 {
            margin: 0;
            font-size: 1.2rem;
            letter-spacing: 2px;
            color: var(--color-scope);
            text-transform: uppercase;
        }

        /* メインエリア：カメラ表示部 */
        main {
            flex: 1;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #000;
        }

        /* html5-qrcodeのvideoコンテナ調整 */
        #reader {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        #reader video {
            object-fit: cover; /* 全画面表示 */
            width: 100% !important;
            height: 100% !important;
        }

        /* スコープオーバーレイ（ターゲットサイトのようなUI） */
        .scope-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 5;
        }

        /* 中央のフォーカス枠（サイズを拡大） */
        .reticle {
            width: 85vw; /* 70vwから拡大 */
            height: 85vw; /* 70vwから拡大 */
            max-width: 500px; /* 300pxから拡大 */
            max-height: 500px; /* 300pxから拡大 */
            border: 2px solid rgba(0, 255, 65, 0.4);
            position: relative;
            box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
        }

        /* レチクルの四隅の装飾 */
        .reticle::before, .reticle::after, 
        .reticle-inner::before, .reticle-inner::after {
            content: '';
            position: absolute;
            width: 30px; /* 装飾も少し大きく */
            height: 30px;
            border-color: var(--color-scope);
            border-style: solid;
            transition: all 0.3s ease;
        }

        .reticle::before { top: -2px; left: -2px; border-width: 4px 0 0 4px; }
        .reticle::after { top: -2px; right: -2px; border-width: 4px 4px 0 0; }
        
        .reticle-inner {
            width: 100%;
            height: 100%;
            position: absolute;
            top: 0;
            left: 0;
        }
        
        .reticle-inner::before { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; }
        .reticle-inner::after { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; }

        /* スキャン中のアニメーション */
        .scanning .reticle {
            border-color: rgba(0, 255, 65, 0.7);
            box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
        }

        /* スキャンライン */
        .scan-line {
            width: 100%;
            height: 3px;
            background: var(--color-scope);
            position: absolute;
            top: 0;
            opacity: 0.8;
            box-shadow: 0 0 10px var(--color-scope);
            animation: scan 2.5s infinite linear;
            display: none;
        }

        .scanning .scan-line {
            display: block;
        }

        @keyframes scan {
            0% { top: 0; opacity: 0; }
            10% { opacity: 1; }
            90% { opacity: 1; }
            100% { top: 100%; opacity: 0; }
        }

        /* ステータスバー */
        #status-bar {
            position: absolute;
            bottom: 25px;
            width: 100%;
            text-align: center;
            color: var(--color-scope);
            font-size: 1rem;
            text-shadow: 0 0 5px #000;
            z-index: 6;
            letter-spacing: 1px;
        }

        .warning {
            color: #FFEB3B !important;
            animation: blink 1s infinite;
        }

        @keyframes blink {
            0% { opacity: 1; }
            50% { opacity: 0.5; }
            100% { opacity: 1; }
        }

        /* 結果モーダル */
        #result-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 100;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        #result-modal.show {
            opacity: 1;
            pointer-events: auto;
        }

        .modal-content {
            background: linear-gradient(135deg, #2c3e50, #000000);
            border: 1px solid #444;
            padding: 2rem;
            border-radius: 8px;
            width: 85%;
            max-width: 400px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0,0,0,0.8);
        }

        .result-title {
            color: #ccc;
            font-size: 0.9rem;
            margin-bottom: 10px;
            border-bottom: 1px solid #555;
            padding-bottom: 5px;
        }

        #result-text {
            font-size: 1.2rem;
            margin: 20px 0;
            word-break: break-all;
            color: #fff;
            min-height: 3rem;
        }

        .btn-group {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-top: 20px;
        }

        button {
            border: none;
            padding: 15px;
            border-radius: 4px;
            font-size: 1rem;
            font-family: inherit;
            cursor: pointer;
            font-weight: bold;
            transition: transform 0.1s;
        }

        button:active {
            transform: scale(0.98);
        }

        #btn-link {
            background-color: var(--color-btn-link);
            color: white;
            display: none;
        }

        #btn-close, #btn-restart {
            background-color: var(--color-btn-stop);
            color: white;
        }
        
        /* 起動画面用オーバーレイ */
        #start-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 50;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        #btn-start {
            background: transparent;
            border: 2px solid var(--color-scope);
            color: var(--color-scope);
            padding: 20px 40px;
            font-size: 1.2rem;
            text-transform: uppercase;
            letter-spacing: 2px;
        }
        
        #btn-start:hover {
            background: rgba(0, 255, 65, 0.1);
        }

