:root {
    --bg-speed: 3s;
    /* 初期値（カフェカラー） */
    --c1: rgba(44, 26, 18, 0.4);
    --c2: rgba(141, 64, 36, 0.1);
    --c3: rgba(224, 122, 95, 0.3);
    --c4: rgba(61, 44, 37, 0.9);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    /* ↓ background-color: #000; を削除して透明にする */
    background: transparent;
}

/* 1. 写真レイヤー（ここをしっかり表示させる） */
.background-photo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* 画面幅いっぱい */
    height: 100vh; /* 画面高さいっぱい */
    /* 赤色テスト用（これで赤くなれば成功！） */
    /* background-color: red !important; */
    /* 写真に戻す時は下の行のコメントアウトを外す */
    /* background: url('./images/aki-impact.jpg') no-repeat center center; */
    background: url('./images/LINE_ALBUM_20261_260206_3.jpg') no-repeat center
        center;

    background-size: cover;
    z-index: -2; /* 一番奥 */
}

/* 2. 動くグラデーションレイヤー */
.dynamic-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* 変数を適用する */
    background: linear-gradient(
        -80deg,
        var(--c1),
        var(--c2),
        var(--c3),
        var(--c4)
    );
    background-size: 400% 400%;
    animation: gradientBG var(--bg-speed) ease infinite;
    z-index: -1;
}

/* 以下、@keyframes と .content, .controls はそのままでOK */
@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.content {
    text-align: center;
    color: white;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8);
    z-index: 10;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* --- コントロール全体の枠 --- */
.controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 30px; /* 折り返しを考慮して少し角を調整 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 100;
    width: 90%; /* 画面幅の90%に収める */
    max-width: 500px; /* 広がりすぎ防止 */
}

/* --- 中の要素の並び --- */
.control-item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap; /* 入らない時に折り返す設定 */
    gap: 10px; /* 要素同士の隙間 */
}

.control-item label {
    font-size: 12px;
    color: white;
    font-weight: bold;
}

/* --- スライダー自体の幅調整 --- */
#speedRange {
    flex-grow: 1; /* 空いているスペースいっぱいに広がる */
    min-width: 100px; /* 極端に小さくなりすぎないように */
}

/* --- モード名（サイケなど）の調整 --- */
#mode-name {
    min-width: 4em; /* 文字が変わっても幅をある程度確保 */
    text-align: center;
}

/* ボタン自体のスタイル */
#toggle-color {
    background: rgba(255, 255, 255, 0.15); /* スライダーと同じ半透明 */
    backdrop-filter: blur(10px); /* 背景をぼかす */
    color: white; /* 文字色 */
    border: 1px solid rgba(255, 255, 255, 0.3); /* 細い境界線 */
    padding: 6px 15px; /* 内側の余白 */
    border-radius: 20px; /* カプセル型 */
    cursor: pointer; /* ホバー時に指マーク */
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease; /* 変化を滑らかに */
    outline: none;
}

/* マウスを乗せた時（ホバー） */
#toggle-color:hover {
    background: rgba(255, 255, 255, 0.3); /* 少し明るくする */
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px); /* ほんの少し浮き上がらせる */
}

/* ボタンを押した瞬間 */
#toggle-color:active {
    transform: translateY(1px); /* 押し込んだような動き */
    background: rgba(255, 255, 255, 0.1);
}

/* ボタン横のテキスト（モード名）の調整 */
#mode-name {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: normal;
    letter-spacing: 0.05em; /* 字間を少し広げて上品に */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* レスポンシブ (Oppo Reno 3A / スマホ全般) */
@media screen and (max-width: 480px) {
    /* 元々の設定を継承しつつ */
    h1 {
        font-size: 1.8rem;
    }

    /* よりスマホ向けに最適化した設定に上書き */
    .controls {
        width: 92%; /* 85%より少し広げて余裕を持たせる */
        padding: 12px;
        border-radius: 20px;
        bottom: 20px; /* 下端に少し寄せて画面を広く使う */
    }

    #toggle-color {
        font-size: 11px;
        padding: 5px 10px;
    }

    #mode-name {
        font-size: 12px;
    }

    .control-item label {
        font-size: 11px; /* Speedという文字も少し小さく */
    }
}
