/* ==========================================
   1. 基本設定 & 背景レイヤー (style.css)
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    /* 100% ではなく、Tauriで指定したサイズを基準にする */
    width: 1300px;
    height: 800px;
    
    /* これより小さい画面で開いた時のために、はみ出しを隠す設定 */
    overflow: auto;
    overflow-y: hidden;
    
    background-color: #000;
    margin: 0;
    padding: 0;
    
    /* もし画面が1300pxより大きい場合でも、
       中身を「左上」に固定したいならこのままでOKです。
    */
    position: relative; 
}

#video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; 
    background-image: url('../assets/copilot_image_1774523714927.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block !important;
}

#ui-layer {
    position: relative;
    z-index: 5; 
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ==========================================
   2. ピアノ演奏エリア
   ========================================== */
#view-piano {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    z-index: 200;
    display: flex;
    flex-direction: column;
    pointer-events: none;
    background: #000; 
}

#view-piano * {
    pointer-events: auto;
}

#piano-viewport {
    flex: 1;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    background: #000;
}

.piano-keyboard {
    height: 100%;
    display: flex;
}

/* ==========================================
   3. モード別 UI 設定 (Perform/Studio)
   ========================================== */
.perform-controls {
    position: absolute;
    top: 130px; 
    left: 100px;
    display: flex;
    align-items: center;
    gap: 20px; 
    pointer-events: auto;
}

.yt-import-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.yt-url-display {
    font-size: 11px;
    padding: 5px 12px;
    width: 220px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.key.guide-active {
    background-color: var(--color-gold-bright) !important;
    box-shadow: 0 0 15px 5px rgba(255, 215, 0, 0.7); 
}

#tag-studio .play-stamp.paused {
    background-color: var(--color-gold-bright) !important;
    color: #000 !important;
}



.modal-content-wrapper {
    min-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    position: relative;
    font-family: 'Times New Roman', Times, serif;
}





/* ==========================================
   4. オープニング・ローダー演出（静止・文字明滅のみ）
   ========================================== */

/* 画面全体を覆う黒い幕 */
.piano-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0c0c0c; /* 常に一定の黒 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    transition: opacity 2.0s ease-in-out; 
    pointer-events: auto;
}

/* 幕を上げるためのクラス */
.loader-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ピアノ線画（SVG）コンテナ */
.piano-svg {
    width: 300px;
    height: 300px;
    margin-bottom: -30px;
}

/* ピアノは最初から、等速描画なしで表示 */
#chalk-path {
    fill: none;
    stroke: #fff;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-dashoffset: 0; /* 常に全表示 */
    opacity: 0.8;
}

/* テキスト：その場で明滅（パルス）のみ */
#loader-status-text {
    color: rgba(255, 215, 0, 0.7);
    font-family: 'Lobster', cursive;
    font-size: 18px;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    
    /* 3秒周期で無限に明滅（浮き上がり演出なし） */
    animation: pulseText 3s ease-in-out infinite;
}

/* Studio REC ボタン（通常） */
#studio-rec-btn {
    transition: 
        color 0.2s ease,
        background-color 0.2s ease,
        text-shadow 0.2s ease;
}

/* ★ 録音中（● RECORDING のとき） */
#studio-rec-btn.active {
    color: #ffdddd;                 /* 少し白寄りの赤で読みやすく */
    background-color: #b30000;      /* 深い赤（銅色の上でも強く目立つ） */
    text-shadow: 0 0 8px #ff4444;   /* ほんのり光る */
    font-weight: bold;
}


/* アニメーションの中身を定義 */
@keyframes modalSlideDown {
    from { 
        opacity: 0; 
        transform: translateY(-10px); /* 少し上から */
    }
    to { 
        opacity: 1; 
        transform: translateY(0);    /* 定位置へ */
    }
}