/* result.css */
/* リザルト画面全体のオーバーレイ */
/* リザルト画面全体のオーバーレイ */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    
    /* ★ 変更: 中央揃え（center）から上揃え（flex-start）にして、上側に配置できるようにします */
    justify-content: center;
    align-items: flex-start; 
    
    z-index: 9999;
    font-family: sans-serif;
    box-sizing: border-box; 
}
.overlay * {
    box-sizing: border-box;
}

.overlay.show {
    display: flex;
}

/* 枠組み */
.result-box {
    background: #1a1a2e;
    border: 3px solid #e60012;
    border-radius: 12px;
    padding: 20px;
    width: 88%;
    max-width: 350px;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(230, 0, 18, 0.5);
    
    /* ★ 変更: absoluteのまま、基準を上(top)から下(bottom)へ切り替えます */
    position: absolute;
    /* 画面の一番下から240px浮かせた位置に固定（ボタンエリアを確実に避ける高さ） */
    bottom: 240px; 
    left: 50%;
    transform: translateX(-50%);
}


.result-box h2 {
    font-size: 26px;
    margin: 0 0 15px 0;
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.6);
    letter-spacing: 2px;
}

/* スコア明細 */
.result-details {
    background: #0f0f1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: 15px;
}
.bonus-row {
    color: #ffcc00;
}
.result-divider {
    border: none;
    border-top: 1px dashed #444;
    margin: 8px 0;
}
.total-row {
    font-size: 20px;
    font-weight: bold;
    color: #00ffcc;
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.5);
}

/* 数字が動いている時の輝きエフェクト */
.counting {
    animation: pulse 0.1s infinite alternate;
    color: #fff !important;
    text-shadow: 0 0 12px #ffcc00;
}
@keyframes pulse {
    from { transform: scale(1.0); }
    to { transform: scale(1.05); }
}

/* ランキング表示用 */
.ranking-preview {
    background: #252542;
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #444;
}
.ranking-title {
    margin: 0 0 3px 0;
    font-size: 12px;
    color: #aaa;
}
.high-score-val {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

/* ★ 既存のオレンジボタン(retry-btn)がリザルト枠内に綺麗に収まるための指定 */
#retry-btn.retry-button {
    display: none; /* 初期状態はJSがONにするまで非表示 */
    background: #f0a04b; /* 元のオレンジ色（もし元々のCSSが強ければ自動で上書きされます） */
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(240, 160, 75, 0.4);
    width: 100%;
    margin-top: 5px;
}
