/* =====================================================
   車体形状共通モジュール (train-shapes.css)
   ===================================================== */

/* -----------------------------------------------------
   1. 在来線 (shape-local)
   ----------------------------------------------------- */
.shape-local .train-car {
    border-radius: 4px;
}

/* -----------------------------------------------------
   2. 特急 (shape-express)
   ----------------------------------------------------- */
.shape-express .train-car {
    border-radius: 4px;
}

/* 先頭車両の傾斜ノーズ */
.shape-express .train-car:first-child {
    border-radius: 20% 0 4px 4px;
    overflow: hidden;
    position: relative;
}

/* 特急の「耳」や「ひさし」のベース構造 */
.shape-express .train-car:first-child::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 60px;
    height: 20px;
    border-radius: 5px 5px 0 0;
    z-index: 5;
}

/* -----------------------------------------------------
   3. 新幹線 (shape-shinkansen)
   ----------------------------------------------------- */
.shape-shinkansen .train-car {
    border-radius: 8px;
    box-shadow: 4px 10px 10px rgba(0, 0, 0, 0.3);
}

/* 新幹線 先頭車両 (ロングノーズ) */
.shape-shinkansen .train-car:first-child {
    width: 450px;
    margin-left: -90px;
    border-radius: 100% 10px 10px 10px / 90% 10px 10px 10px;
    position: relative;
    overflow: visible;
}

/* 先頭車両の窓の非表示（運転席用の調整） */
.shape-shinkansen .train-car:first-child .window:first-child,
.shape-shinkansen .train-car:first-child .window:nth-child(2) {
    visibility: hidden;
}

/* 新幹線 後尾車両 */
.shape-shinkansen .train-car:last-child {
    width: 450px;
    margin-right: -90px;
    border-radius: 10px 100% 10px 10px / 10px 90% 10px 10px;
    box-shadow: 4px 10px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: visible;
}

/* 後尾車両の窓の非表示 */
.shape-shinkansen .train-car:last-child .window:last-child {
    visibility: hidden;
}

/* デフォルトのテールライト表示を非表示に */
.shape-shinkansen .train-car:last-child::before {
    display: none;
}

/* -----------------------------------------------------
   4. 蒸気機関車 (shape-steam)
   ----------------------------------------------------- */
/* 機関車（1両目） */
.shape-steam .train-car:first-child {
    background: none;
    box-shadow: none;
    border: none;
    overflow: visible;
    height: 140px;
    margin-top: 20px;
    position: relative;
    z-index: 5;
}

/* 蒸気機関車のアニメーション */
@keyframes slWheelTurn {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes slRodMove {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(-5px, -5px) rotate(2deg);
    }
    50% {
        transform: translate(-10px, 0) rotate(0deg);
    }
    75% {
        transform: translate(-5px, 5px) rotate(-2deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* アラーム鳴動中のアニメーション再生制御 */
.shape-steam .train-set.passing .train-car:first-child .window:nth-child(2)::before,
.shape-steam .train-set.passing .train-car:first-child .window:nth-child(2)::after,
.shape-steam .train-set.passing .train-car:first-child .window:nth-child(3)::before,
.shape-steam .train-set.passing .train-car:first-child .window:nth-child(3)::after {
    animation-play-state: running;
}
