/* =====================================================
   阪急 PRiVACE (2300系) テーマ (theme-privace.css)

   実車デザイン準拠:
   - マルーン車体（阪急伝統 #4a0e1f）
   - 車体上部 アイボリー帯（8〜18%）
   - 上側ゴールドライン（アイボリー帯下端）
   - 窓下 水平ゴールドライン（車体の約55%位置）
   - 裾ゴールドボーダー
   - シルバー窓枠（独立した縦長窓）
   - 3両目中央に1か所の乗降扉（ステンドグラス風ゴールド枠）
   ===================================================== */

/* -----------------------------------------------
   PRiVACE カラー変数
   ----------------------------------------------- */
body.theme-privace {
    --train-body-color: #4a0e1f;
    --train-roof-color: #5a5a5a;
    --train-window-frame: #c0c0c0;
    --train-gold: #c8a84b;
    --train-gold-bright: #e0c060;
    --train-gold-light: #ecd080;
    --train-ivory: #ece8da;
    --train-ivory-dark: #cec9bb;
}

/* -----------------------------------------------
   PRiVACE 共通車体スタイル
   構造（上→下）:
     0–7%   : 屋根（グレー）
     7–18%  : アイボリー帯
     18–20% : ゴールドライン（帯下端）
     20–55% : マルーン（窓上部〜窓まで）
     55–57% : 窓下ゴールドライン
     57–100%: マルーン（裾）
   ----------------------------------------------- */
body.theme-privace .train-car {
    background: linear-gradient(to bottom,
        var(--train-roof-color)    0%,
        var(--train-roof-color)    7%,
        var(--train-ivory)         7%,
        var(--train-ivory-dark)    18%,
        var(--train-gold)          18%,
        var(--train-gold)          20%,
        var(--train-body-color)    20%,
        var(--train-body-color)    55%,
        var(--train-gold)          55%,
        var(--train-gold)          57%,
        var(--train-body-color)    57%,
        var(--train-body-color)    100%
    );
    border-radius: 6px 6px 2px 2px;
    border: 1.5px solid #2a0812;
    border-bottom: 3px solid var(--train-gold);
    box-shadow:
        4px 8px 20px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 0 30px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

/* -----------------------------------------------
   PRiVACE 窓スタイル（独立縦長窓・シルバー枠）
   ----------------------------------------------- */
body.theme-privace .window {
    width: 52px;
    height: 60px;
    background: linear-gradient(
        160deg,
        #2a3a45 0%,
        #182530 40%,
        #0d1820 70%,
        #182530 100%
    );
    border: 3px solid var(--train-window-frame);
    border-radius: 2px;
    box-shadow:
        inset 0 0 14px rgba(0, 0, 0, 0.95),
        inset 0 2px 4px rgba(255, 255, 255, 0.04),
        0 0 0 1px rgba(160, 160, 160, 0.25);
    margin-top: 28px;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

/* 窓の映り込み光（反射ハイライト） */
body.theme-privace .window::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    width: 30%;
    height: 35%;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.10) 0%,
        transparent 100%);
    pointer-events: none;
}

/* -----------------------------------------------
   先頭車両 (1両目 — 2300号車)
   なだらかな湾曲した鼻先・楕円形ヘッドライト
   ----------------------------------------------- */
body.theme-privace .train-car:first-child {
    border-radius: 20px 6px 2px 16px;
    justify-content: flex-end;
    padding-right: 25px;
    padding-left: 65px;
}

/* 先頭部フロントマスク（::before = ライト類） */
body.theme-privace .train-car:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 60px;
    height: 100%;
    background:
        /* ヘッドライト上段（大・楕円） */
        radial-gradient(ellipse 9px 6px at 30px 65%,
            rgba(255, 255, 230, 1.0) 0%,
            rgba(255, 255, 200, 0.5) 60%,
            transparent 100%),
        /* ヘッドライト下段（小） */
        radial-gradient(circle 4px at 30px 77%,
            rgba(255, 255, 220, 0.75) 0%,
            transparent 100%),
        /* テールランプ（赤） */
        radial-gradient(ellipse 6px 4px at 30px 87%,
            rgba(210, 15, 15, 0.9) 0%,
            rgba(160, 5, 5, 0.4) 70%,
            transparent 100%),
        /* フロントマスク */
        linear-gradient(to right,
            #380c16 0%,
            #4a0e1f 55%,
            transparent 100%);
    z-index: 6;
    pointer-events: none;
}

/* 先頭車の車番 */
body.theme-privace .train-car:nth-child(1)::after {
    content: '2300';
    position: absolute;
    bottom: 11px;
    left: 70px;
    right: auto;
    transform: none;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: rgba(236, 232, 218, 0.5);
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
}

/* -----------------------------------------------
   2両目 — 中間車 2320号車
   ----------------------------------------------- */
body.theme-privace .train-car:nth-child(2)::after {
    content: '2320';
    position: absolute;
    bottom: 11px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: rgba(236, 232, 218, 0.5);
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
}

/* -----------------------------------------------
   3両目 — PRiVACE専用車 (2350号車)
   乗降扉: 中央の窓を扉として表現
   ゴールド枠・ステンドグラス風ガラス
   ----------------------------------------------- */
body.theme-privace .train-car:nth-child(3) {
    box-shadow:
        4px 8px 20px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        inset 0 0 30px rgba(0, 0, 0, 0.25),
        0 0 35px rgba(200, 168, 75, 0.18);
}

/* 中央の窓(2番目)をドアに変換 */
body.theme-privace .train-car:nth-child(3) .window:nth-child(2) {
    width: 50px;
    height: 90px;
    margin-top: 15px;
    /* ステンドグラス風（斜め格子 + 暗いガラス） */
    background:
        repeating-linear-gradient(
            45deg,
            rgba(200, 168, 75, 0.07) 0px,
            rgba(200, 168, 75, 0.07) 1px,
            transparent 1px,
            transparent 13px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(200, 168, 75, 0.07) 0px,
            rgba(200, 168, 75, 0.07) 1px,
            transparent 1px,
            transparent 13px
        ),
        linear-gradient(170deg,
            #1a2830 0%,
            #0d1820 60%,
            #162430 100%);
    /* ゴールド枠（二重） */
    border: 2px solid var(--train-gold-bright);
    border-radius: 1px;
    box-shadow:
        0 0 0 3px var(--train-body-color),
        0 0 0 5px var(--train-gold),
        inset 0 0 12px rgba(0, 0, 0, 0.9),
        0 0 10px rgba(200, 168, 75, 0.35);
}

/* ドアのステンドグラス中央ライン */
body.theme-privace .train-car:nth-child(3) .window:nth-child(2)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(to right,
        transparent,
        rgba(200, 168, 75, 0.4),
        transparent);
    transform: translateY(-50%);
    pointer-events: none;
}

/* PRiVACEサイドエンブレム */
body.theme-privace .train-car:nth-child(3)::after {
    content: 'PRiVACE';
    position: absolute;
    bottom: 11px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--train-gold-light);
    letter-spacing: 4px;
    text-shadow:
        0 0 10px rgba(200, 168, 75, 0.7),
        0 1px 2px rgba(0, 0, 0, 0.9);
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

/* 3両目のサイド窓（小さめ独立窓） */
body.theme-privace .train-car:nth-child(3) .window:nth-child(1),
body.theme-privace .train-car:nth-child(3) .window:nth-child(3) {
    width: 45px;
    height: 52px;
    margin-top: 34px;
}

/* -----------------------------------------------
   4両目 — 中間車 2370号車
   ----------------------------------------------- */
body.theme-privace .train-car:nth-child(4)::after {
    content: '2370';
    position: absolute;
    bottom: 11px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: rgba(236, 232, 218, 0.5);
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
}

/* -----------------------------------------------
   最後尾車両 (5両目 — 2400号車)
   先頭と左右対称
   ----------------------------------------------- */
body.theme-privace .train-car:last-child {
    border-radius: 6px 20px 16px 2px;
    justify-content: flex-start;
    padding-left: 25px;
    padding-right: 65px;
}

/* 最後尾 テールライト（::before） */
body.theme-privace .train-car:last-child::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 100%;
    background:
        /* テールライト上段（大・赤） */
        radial-gradient(ellipse 9px 6px at 30px 65%,
            rgba(210, 15, 15, 1.0) 0%,
            rgba(160, 5, 5, 0.5) 60%,
            transparent 100%),
        /* テールライト下段（小） */
        radial-gradient(circle 4px at 30px 77%,
            rgba(200, 10, 10, 0.75) 0%,
            transparent 100%),
        /* リアマスク */
        linear-gradient(to left,
            #380c16 0%,
            #4a0e1f 55%,
            transparent 100%);
    z-index: 6;
    pointer-events: none;
}

/* 最後尾の車番 */
body.theme-privace .train-car:nth-child(5)::after {
    content: '2400';
    position: absolute;
    bottom: 11px;
    right: 70px;
    left: auto;
    transform: none;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: bold;
    color: rgba(236, 232, 218, 0.5);
    letter-spacing: 2px;
    z-index: 10;
    pointer-events: none;
}
