body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

/* --- 背景ビデオ関連 --- */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* Three.jsのCanvasより後ろに配置 */
}

#video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    transform: translateZ(0);
}

#video-container video.active {
    opacity: 1;
}

#video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent; /* 初期は透明 */
    transition: background-color 0.5s ease;
}

/* --- Three.jsのCanvas --- */
#canvas-container canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1; /* 背景とUIの間に配置 */
}

/* --- UI関連 --- */
#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('水星通信.jpg');
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;.
    align-items: flex-end;
    padding-bottom: 10%;
    box-sizing: border-box;
    z-index: 10;
}

#instruction {
    font-size: 2em;
    color: white;
    text-shadow: 2px 2px 4px #000;
    font-family: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'MS PMincho', serif;
}

#ui-overlay {
    position: fixed;
    top: 20px;
    left: 20px;
    color: white;
    display: none; /* 初期状態では非表示 */
    z-index: 5;
    font-family: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'MS PMincho', serif;
}

#wind-power-display {
    position: relative;
    font-size: 2em;
    text-shadow: 2px 2px 4px #000;
}

.wind-power-number {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 0.8em;
    color: white;
    text-shadow: 1px 1px 2px #000;
}

#return-instruction {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 1.2em;
    text-shadow: 1px 1px 3px #000;
    color: white;
    font-family: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'MS PMincho', serif;
}

#recognized-text-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* 下の要素をクリックできるようにする */
    overflow: hidden; /* 画面外の文字を隠す */
    z-index: 10; /* 他のUIより手前に表示 */
}

#recognized-text-display span {
    position: absolute;
    color: white;
    text-shadow: 2px 2px 4px #000;
    transition: opacity 5s ease-in; /* フェードインのみ残す */
    pointer-events: auto; /* 文字自体はイベントを受け取る（もし必要なら） */
}

/* --- レスポンシブ対応 (スマートフォン向け) --- */
@media screen and (max-width: 768px) {
    #instruction {
        font-size: 1.5em; /* スマートフォンでは少し小さく */
    }

    #wind-power-display {
        font-size: 1.5em; /* スマートフォンでは少し小さく */
    }

    #return-instruction {
        font-size: 1em;
        margin-top: 10px;
    }

    #ui-overlay {
        top: 15px;
        left: 15px;
    }
}

#wind-power-display img {
    height: 240px;
    width: auto; /* 幅は自動で調整 */
}

/* --- 音量ゲージのスタイル --- */
.gauge-row {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.gauge-label {
    font-size: 1.2em;
    margin-right: 10px;
    width: 40px; /* ラベルの幅を固定して揃える */
    text-align: right;
    font-family: 'Yu Gothic', 'Meiryo UI', sans-serif; /* ゴシック体に変更 */
}

.volume-gauge-container {
    width: 200px; /* ゲージの幅 */
    height: 20px; /* ゲージの高さ */
    background-color: rgba(255, 255, 255, 0.2); /* 背景色 */
    border-radius: 10px;
    overflow: hidden;
}

.volume-bar {
    height: 100%;
    width: 0%; /* 初期幅は0 */
    transition: width 0.8s ease-out; /* 滑らかな変化 */
}

#volume-bar-1 {
    background-color: #AEC6CF; /* 固体（氷）: 薄い水色 */
}

#volume-bar-2 {
    background-color: #6495ED; /* 液体（水）: 通常の水色 */
}

#volume-bar-3 {
    background-color: #E0FFFF; /* 気体（水蒸気）: 非常に薄い水色 */
}

#listening-status {
    margin-top: 20px;
    font-size: 1.5em;
    color: white;
    text-shadow: 2px 2px 4px #000;
    font-family: 'Yu Gothic', 'Meiryo UI', sans-serif; /* ゴシック体に変更 */
    text-align: center; /* 中央揃え */
    width: 250px; /* ゲージの幅に合わせて調整 */
}