/* ===============================
   Image Score Container
================================ */
.image-score-container {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-repeat: no-repeat;
    background-color: #f0f0f0;
    background-image: url("{{ image_url }}");
    /* 背景画像を設定 */
    background-size: cover;
    /* ← これが自動ズーム！ */
}

/* ===============================
   上半分: 日付表示 (背景: 透明)
================================ */
.date-container {
    flex: 1;
    background: transparent;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 10px;
}

.date-overlay {
    color: #333;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 3px 6px;
    border-radius: 3px;
}

/* ===============================
   下半分: 横3分割 (背景: 半透明)
   ※ 下揃えに変更、15pxのマージン追加
================================ */
.calc-result-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 20px 15px 20px;
    /* ← 上だけ20px, 下15px */
    background: rgba(255, 255, 255, 0.3);
    box-sizing: border-box;

    /* 追加 ↓↓↓ */
    height: auto;
    /* ← 中身に合わせる */
    flex: none;
    /* ← flex拡張を無効に */
}

.prameter-overlay {
    flex: 4;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* 下揃えに変更 */
    gap: 10px;
    color: #333;
    margin-bottom: 10px;
    /* マージン追加 */
}

.prameter-item {
    flex: 1;
    display: flex;
    align-items: center;
}

.prameter-title-group {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    text-align: right;
    padding-right: 10px;
    border-right: 2px solid DarkOrange;
    width: 80px;
    box-sizing: border-box;
}

.prameter-title {
    font-size: 12px;
    font-weight: bold;
}

.prameter-sub {
    font-size: 10px;
    margin-top: -2px;
}

.prameter-bar {
    flex: 5;
    height: 4px;
    background: black;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    margin-left: 10px;
}

.prameter-item-value {
    flex: 2;
    text-align: left;
    /* ← 左詰め */
    color: red;
    /* ← 赤文字 */
    font-size: 10px;
    align-self: center;
    /* ← 高さの中央に揃える */
    margin-left: 5px;
    /* ← 左に間隔を空ける */
}

.prameter-fill {
    height: 100%;
    background: DarkOrange;
    border-radius: 3px;
}

/* ===============================
   中央: スコアタイトル
================================ */
.score-title-overlay {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* 下揃えに変更 */
    text-align: right;
    color: #333;
    margin-bottom: 10px;
    /* マージン追加 */
}

.score-title {
    font-size: 20px;
    font-weight: bold;
}

.score-subtitle {
    font-size: 20px;
}

/* ===============================
   右: スコア値
================================ */
.score-value-overlay {
    flex: 3;
    display: flex;
    flex-direction: row;
    /* 横並びに変更 */
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
    color: #333;
    position: relative;
    gap: 5px;
    /* スコア値とスコアバーの間隔 */
    padding-right: 15px;
    /* 右に余白追加 */
    margin-bottom: 10px;
    /* マージン追加 */
}

.score-value {
    font-size: 60px;
    font-weight: bold;
    line-height: 1;
    display: inline-block;
}

.score-unit {
    font-size: 20px;
    display: inline-block;
    margin-left: 5px;
    margin-right: 5px;
    align-self: flex-end;
}

/* スコアバー */
.score-bar {
    width: 6px;
    height: 100px;
    background: #333;
    border-radius: 3px;
    position: absolute;
    bottom: 0;
    right: 0;
    margin-right: 10px;
    margin-left: 10px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.score-bar-fill {
    width: 100%;
    background: DarkOrange;
    border-radius: 3px;
    transition: height 0.3s ease;
}

/* デフォルト（PC表示） */
.image-score-mobile {
    display: none;
}

/* ===============================
   レスポンシブ対応
================================ */
@media (max-width: 768px) {
    .image-score-container {
        display: none;
    }

    .image-score-mobile {
        display: block;
    }

    .score-image-mobile {
        width: 100%;
        height: auto;
        display: block;
        border-radius: 10px;
        margin-bottom: 10px;
    }

    .prameter-bar {
        height: 6px;
        /* 明示的な高さ */
        min-width: 40px;
        /* 短すぎて見えないのを防ぐ */
        background: #ccc;
    }

    .prameter-fill {
        height: 100%;
        background: DarkOrange;
        min-width: 1px;
        /* 消失防止の安全策 */
    }

    .date-container {
        position: static;
        background: none;
        padding: 10px;
    }

    .calc-result-container {
        flex-direction: row;
        /* 縦並びに */
        gap: 10px;
        padding: 15px 10px;
        background: transparent;
    }

    .prameter-overlay,
    .score-title-overlay,
    .score-value-overlay {
        margin-bottom: 10px;
        align-items: flex-start;
        text-align: left;
    }

    .prameter-list {
        width: 100%;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .prameter-title-group {
        flex: none;
        width: 70px;
        min-width: 70px;
        padding-right: 8px;
    }

    .prameter-title {
        font-size: 11px;
        white-space: nowrap;
    }

    .prameter-sub {
        font-size: 9px;
    }

    .score-value {
        font-size: 36px;
        font-weight: bold;
        line-height: 1;
        display: inline-block;
    }

    .score-unit {
        font-size: 14px;
        white-space: nowrap;
    }

    .score-value-overlay {
        flex-wrap: nowrap;
        padding-right: 10px;
    }

}