/* Final Victory Cinematic — "The Origin" defeat sequence */

#final-victory-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #0a0820 0%, #000 70%);
    z-index: 99999;
    display: none;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

#final-victory-overlay.active {
    display: flex;
    animation: fv-fade-in 1.2s ease-out forwards;
}

#final-victory-overlay.fv-fading {
    animation: fv-fade-out 0.8s ease-in forwards;
}

@keyframes fv-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fv-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* Starfield */
.fv-stars {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.fv-star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px #fff8;
    animation: fv-twinkle 3s ease-in-out infinite;
}
@keyframes fv-twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.fv-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, #000 85%);
    pointer-events: none;
    z-index: 2;
}

/* Title cards */
.fv-title-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    text-align: center;
    z-index: 5;
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
    padding: 0 20px;
    width: 100%;
    max-width: 900px;
}
.fv-title-card.fv-show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.fv-title-card.fv-hide {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.15);
}

.fv-title-main {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: 0.5em;
    background: linear-gradient(to bottom, #fff 0%, #ffd1dc 60%, #c44569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255, 100, 150, 0.6);
}
.fv-title-sub {
    margin-top: 18px;
    font-size: clamp(0.9rem, 1.6vw, 1.2rem);
    letter-spacing: 0.3em;
    color: #aaa;
    font-style: italic;
}

/* Stats + credits panel */
.fv-panel {
    position: relative;
    z-index: 5;
    max-width: 640px;
    width: 92%;
    background: rgba(10, 8, 20, 0.85);
    border: 1px solid rgba(255, 200, 220, 0.2);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 0 80px rgba(196, 69, 105, 0.25), inset 0 0 30px rgba(196, 69, 105, 0.08);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    backdrop-filter: blur(4px);
}
.fv-panel.fv-show {
    opacity: 1;
    transform: translateY(0);
}
.fv-panel-large {
    max-height: 90vh;
    overflow-y: auto;
}

.fv-stats-title {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.3em;
    text-align: center;
    color: #ffd1dc;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(255, 200, 220, 0.5);
}
.fv-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.fv-stat-row:last-child { border-bottom: none; }
.fv-stat-k { color: #888; }
.fv-stat-v { color: #fff; font-weight: 700; }

/* Credits scroll */
.fv-credits {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}
.fv-credits-inner > div { margin: 4px 0; }
.fv-credits-h1 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.4em;
    color: #fff;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.3);
}
.fv-credits-h2 {
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: #aaa;
    margin-bottom: 6px !important;
}
.fv-credits-h3 {
    font-size: 0.85rem;
    color: #c44569;
    font-style: italic;
    letter-spacing: 0.15em;
}
.fv-credits-role { font-size: 0.75rem; color: #777; text-transform: uppercase; letter-spacing: 0.2em; }
.fv-credits-name { font-size: 1.1rem; color: #fff; font-weight: 700; }
.fv-credits-spacer { height: 14px; }

/* Button row */
.fv-button-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}
.fv-btn {
    border: none;
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 0.2em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}
.fv-btn:hover { transform: scale(1.05); }
.fv-btn:active { transform: scale(0.97); }
.fv-btn-primary {
    background: linear-gradient(135deg, #c44569, #ff6b9d);
    color: #fff;
    box-shadow: 0 0 25px rgba(196, 69, 105, 0.5);
}
.fv-btn-primary:hover { box-shadow: 0 0 40px rgba(255, 107, 157, 0.8); }
.fv-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Brief variant (repeat kills) */
.fv-brief-title {
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    font-weight: 900;
    letter-spacing: 0.35em;
    text-align: center;
    background: linear-gradient(to bottom, #fff, #c44569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}
.fv-brief-sub {
    text-align: center;
    color: #ffd1dc;
    letter-spacing: 0.3em;
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* --- Origin Boss Phase visuals (combat.js applies these classes) --- */
.battle-avatar.origin-phase-1 {
    filter: drop-shadow(0 0 12px #ff6b9d);
}
.battle-avatar.origin-phase-2 {
    filter: drop-shadow(0 0 18px #c44569) hue-rotate(-15deg) saturate(1.3);
    animation: origin-pulse 2.4s ease-in-out infinite;
}
.battle-avatar.origin-phase-3 {
    filter: drop-shadow(0 0 24px #ff3838) hue-rotate(-30deg) saturate(1.6) brightness(1.15);
    animation: origin-pulse 1.2s ease-in-out infinite;
}
@keyframes origin-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}
#combat-overlay.origin-phase-2,
#combat-container.origin-phase-2,
#mobile-combat-overlay.origin-phase-2 {
    box-shadow: inset 0 0 80px rgba(196, 69, 105, 0.35);
}
#combat-overlay.origin-phase-3,
#combat-container.origin-phase-3,
#mobile-combat-overlay.origin-phase-3 {
    box-shadow: inset 0 0 120px rgba(255, 56, 56, 0.5);
    animation: origin-screen-pulse 1.6s ease-in-out infinite;
}
@keyframes origin-screen-pulse {
    0%, 100% { box-shadow: inset 0 0 120px rgba(255, 56, 56, 0.5); }
    50% { box-shadow: inset 0 0 180px rgba(255, 56, 56, 0.7); }
}

/* NG+ confirmation panel */
.fv-ngplus-confirm {
    max-width: 720px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 26px 28px;
}
.fv-ngplus-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
    letter-spacing: 0.3em;
    text-align: center;
    background: linear-gradient(to bottom, #fff, #ff6b9d);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.5);
    margin-bottom: 4px;
}
.fv-ngplus-sub {
    text-align: center;
    color: #ccc;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    margin-bottom: 18px;
}
.fv-ngplus-sub b { color: #ffd1dc; }

.fv-ngplus-bonus {
    background: linear-gradient(135deg, rgba(196, 69, 105, 0.18), rgba(255, 107, 157, 0.08));
    border: 1px solid rgba(255, 107, 157, 0.4);
    border-radius: 12px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 18px;
    box-shadow: inset 0 0 20px rgba(196, 69, 105, 0.15);
}
.fv-ngplus-bonus-label {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: #ffd1dc;
    margin-bottom: 4px;
}
.fv-ngplus-bonus-val {
    font-size: 2.4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.7);
    line-height: 1.1;
}
.fv-ngplus-bonus-note {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 4px;
    font-style: italic;
}

/* "Cost" variant of the bonus card — for the boss escalation (armor + damage) */
.fv-ngplus-cost-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.fv-ngplus-cost-row .fv-ngplus-bonus { margin-bottom: 0; }
.fv-ngplus-cost {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.16), rgba(241, 116, 76, 0.06));
    border-color: rgba(231, 76, 60, 0.45);
    box-shadow: inset 0 0 20px rgba(231, 76, 60, 0.12);
}
.fv-ngplus-cost .fv-ngplus-bonus-label { color: #ffb3a8; }
.fv-ngplus-cost .fv-ngplus-bonus-val {
    color: #fff;
    text-shadow: 0 0 20px rgba(231, 76, 60, 0.7);
    font-size: 2rem;
}
@media (max-width: 600px) {
    .fv-ngplus-cost-row { grid-template-columns: 1fr; }
}

.fv-ngplus-warn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}
.fv-ngplus-warn-icon {
    font-size: 1.4rem;
    line-height: 1.2;
    flex-shrink: 0;
}
.fv-ngplus-warn-text {
    font-size: 0.82rem;
    color: #ffb3a8;
    line-height: 1.5;
}
.fv-ngplus-warn-text b { color: #fff; }

.fv-ngplus-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.fv-ngplus-col {
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.82rem;
    line-height: 1.5;
}
.fv-ngplus-col ul {
    margin: 0;
    padding-left: 18px;
    color: #ddd;
}
.fv-ngplus-col li { margin-bottom: 3px; }
.fv-ngplus-col-h {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid;
}
.fv-ngplus-keep {
    background: rgba(46, 204, 113, 0.06);
    border: 1px solid rgba(46, 204, 113, 0.25);
}
.fv-ngplus-keep .fv-ngplus-col-h {
    color: #2ecc71;
    border-bottom-color: rgba(46, 204, 113, 0.3);
}
.fv-ngplus-reset {
    background: rgba(231, 76, 60, 0.06);
    border: 1px solid rgba(231, 76, 60, 0.25);
}
.fv-ngplus-reset .fv-ngplus-col-h {
    color: #e74c3c;
    border-bottom-color: rgba(231, 76, 60, 0.3);
}

.fv-ngplus-flow {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 8px;
}
.fv-ngplus-flow-h {
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.25em;
    color: #ffd1dc;
    margin-bottom: 8px;
}
.fv-ngplus-flow ol {
    margin: 0;
    padding-left: 22px;
    font-size: 0.82rem;
    color: #ccc;
    line-height: 1.6;
}
.fv-ngplus-flow li { margin-bottom: 3px; }
.fv-ngplus-flow b { color: #fff; }

@media (max-width: 600px) {
    .fv-ngplus-cols { grid-template-columns: 1fr; }
    .fv-ngplus-confirm { padding: 18px 14px; }
}

/* Hero panel — Omega Miner title */
.omega-miner-title {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 0.62em;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #fff;
    background: linear-gradient(135deg, #c44569, #ff6b9d);
    border-radius: 10px;
    vertical-align: middle;
    text-shadow: 0 0 8px rgba(255, 100, 150, 0.6);
    box-shadow: 0 0 12px rgba(196, 69, 105, 0.4);
}
.omega-miner-ng {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    font-size: 0.6em;
    font-weight: 900;
    color: #ffd1dc;
    background: rgba(196, 69, 105, 0.25);
    border: 1px solid rgba(255, 107, 157, 0.5);
    border-radius: 8px;
    vertical-align: middle;
}
