/* ==================================================================
   결과 모달 (구버전)
   구 style.css 4729~5358줄
   ⚠️ 파일명 번호 = 로드 순서. 뒤 파일이 앞을 덮어쓰므로 순서를 바꾸면 화면이 깨진다.
   ================================================================== */
/* =========================================
   Game Result Modal (Liquidation Value)
   ========================================= */
.result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 99999;
    padding: 16px 0;
    box-sizing: border-box;
}

.result-modal-content-new {
    width: 92%;
    max-width: 600px;
    margin: 0 auto;
    background: linear-gradient(135deg, #1e1e2f, #2a2a40);
    border-radius: 2px;
    border: 2px solid #00d2ff;
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.3);
    overflow: hidden;
}

.result-header-new {
    padding: 20px 20px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.result-title {
    font-size: 1.6rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #00d2ff;
}

.result-subtitle {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.result-footer-new {
    padding: 14px 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.result-close-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 2px;
    background: linear-gradient(135deg, #555, #333);
    color: #fff;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}
.result-close-btn:hover { opacity: 0.85; }

.result-modal-content {
    background: linear-gradient(135deg, #1e1e2f, #2a2a40);
    width: 90%;
    max-width: 600px;
    border-radius: 2px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    border: 2px solid #00d2ff;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.result-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
    padding-bottom: 15px;
    flex-shrink: 0;
}

.result-header h2 {
    font-size: 2em;
    color: #fff;
    text-shadow: 0 0 10px #00d2ff;
    margin: 0;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;
    flex-grow: 1;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s;
}

.result-card.rank-1 {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
    transform: scale(1.02);
}

.result-card.rank-2 {
    background: rgba(192, 192, 192, 0.2);
    border-color: #c0c0c0;
}

.result-card.rank-3 {
    background: rgba(205, 127, 50, 0.2);
    border-color: #cd7f32;
}

.rank-badge {
    font-size: 1.5em;
    font-weight: bold;
    width: 40px;
    text-align: center;
    color: #fff;
}

.rank-1 .rank-badge {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700;
}

.rank-2 .rank-badge {
    color: #c0c0c0;
    text-shadow: 0 0 10px #c0c0c0;
}

.rank-3 .rank-badge {
    color: #cd7f32;
    text-shadow: 0 0 10px #cd7f32;
}

.player-info {
    flex-grow: 1;
    text-align: left;
    margin-left: 15px;
}

.player-name {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 4px;
}

.player-assets {
    font-size: 0.85em;
    color: #aaa;
    display: flex;
    flex-direction: column;
}

.asset-detail {
    font-size: 0.8em;
    opacity: 0.8;
}

.total-score {
    font-size: 1.2em;
    font-weight: bold;
    color: #00d2ff;
    text-align: right;
    min-width: 100px;
}

.result-footer {
    margin-top: 20px;
    flex-shrink: 0;
}

.restart-btn {
    background: #00d2ff;
    color: #000;
    border: none;
    padding: 12px 40px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
}

.restart-btn:hover {
    background: #fff;
    box-shadow: 0 0 30px #00d2ff;
    transform: scale(1.05);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* ==========================================================================
   Result Modal (Restored)
   ========================================================================== */
.result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.result-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #ffd700;
    border-radius: 2px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(255, 215, 0, 0.3);
    animation: slideUp 0.4s ease;
}

.result-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffd700;
}

.result-header h2 {
    font-size: 2rem;
    color: #ffd700;
    margin: 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 25px;
}

.result-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 2px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card:hover {
    transform: translateX(5px);
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.rank-badge {
    font-size: 1.5rem;
    font-weight: bold;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #555;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.result-card.rank-1 {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 193, 7, 0.1));
}

.result-card.rank-1 .rank-badge {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #000;
    font-size: 1.8rem;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.result-card.rank-2 {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05));
}

.result-card.rank-2 .rank-badge {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    color: #000;
    font-size: 1.6rem;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.5);
}

.result-card.rank-3 {
    border-color: #cd7f32;
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.05));
}

.result-card.rank-3 .rank-badge {
    background: linear-gradient(135deg, #cd7f32, #e9a868);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 0 15px rgba(205, 127, 50, 0.5);
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
}

.player-assets {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.asset-detail {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
}

.total-score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    text-align: right;
    flex-shrink: 0;
    min-width: 150px;
}

.result-card.rank-1 .total-score {
    font-size: 1.8rem;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.result-footer {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.restart-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    background: linear-gradient(135deg, #e0a800, #b38600);
    color: white;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .result-modal-content {
        padding: 20px;
        width: 95%;
        max-height: 90vh;
    }

    .result-header h2 {
        font-size: 1.5rem;
    }

    .result-card {
        padding: 12px 15px;
        gap: 10px;
    }

    .rank-badge {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .player-name {
        font-size: 1.1rem;
    }

    .asset-detail {
        font-size: 0.75rem;
    }

    .total-score {
        font-size: 1.2rem;
        min-width: 100px;
    }

    .result-card.rank-1 .total-score {
        font-size: 1.4rem;
    }
}


/* Toggle Table Button */
/* Toggle Table Button - Enhanced Design */
/* 시나리오 에디터 — 모드 안내 / 연도별 조작 지정 */
.ed-mode-note {
    background: rgba(0, 240, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 6px;
    padding: 7px 10px;
    margin-bottom: 10px;
    color: #7fd8e8;
    font-size: 0.68rem;
    line-height: 1.5;
}

.ed-mark-status {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 7px;
    color: #bbb;
    font-size: 0.7rem;
}

.ed-mark-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.ed-mark {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border: 1px solid #3a3a4a;
    border-radius: 999px;
    color: #999;
    font-size: 0.66rem;
    cursor: pointer;
    user-select: none;
}

.ed-mark input {
    width: 13px;
    height: 13px;
    cursor: pointer;
    margin: 0;
}

.ed-mark.bait {
    border-color: rgba(168, 85, 247, 0.45);
    color: #c084fc;
}

.ed-mark.ta {
    border-color: rgba(77, 171, 247, 0.45);
    color: #4dabf7;
}

.ed-mark.tb {
    border-color: rgba(255, 107, 107, 0.45);
    color: #ff6b6b;
}

/* 불러온 시나리오의 플레이 모드 고정 안내 (게임 옵션 영역 상단에 동적 삽입) */
.scen-mode-lock {
    display: none;
    background: rgba(255, 215, 0, 0.08);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 2px;
    padding: 10px 12px;
    margin-bottom: 12px;
    color: #ffd700;
    font-size: 0.76rem;
    line-height: 1.5;
}

.toggle-table-btn {
    width: 110px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #000;
    border: none;
    border-radius: 2px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    margin-left: auto;
    display: block;
}

.toggle-table-btn:hover {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(79, 172, 254, 0.4);
}

.toggle-table-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stock Count Styles */
.stock-count-control {
    display: flex;
    align-items: center;
    gap: 3px;
}

.stock-label {
    font-size: 0.8rem;
    color: #ccc;
    margin-right: 2px;
}

.stock-count {
    font-size: 0.85rem;
    color: #fff;
    min-width: 35px;
    text-align: center;
    font-weight: bold;
    background: #333;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #555;
    margin: 0 2px;
}

.stock-control-btn {
    background: #444;
    color: white;
    border: 1px solid #666;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.stock-control-btn:hover {
    background: #555;
    border-color: #888;
}
