/* Crash mini-game styles. Uses existing palette tokens from style.css where possible. */

.hidden {
    display: none !important;
}

/* ----- Modal ----- */

.crash-modal-content {
    max-width: 480px;
    padding: 2rem 2.5rem;
    text-align: center;
    background: linear-gradient(180deg, #1a0d2e 0%, #0d0820 100%);
    border: 1px solid #6a3fc7;
    border-radius: 12px;
    box-shadow: 0 0 32px rgba(122, 90, 220, 0.6);
    color: #e8e0ff;
    font-family: 'Space Grotesk', sans-serif;
}

.crash-modal-content h2 {
    margin: 0 0 1rem;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #c8b8ff;
}

.crash-modal-mechanic {
    margin: 0 0 1rem;
    font-size: 1rem;
    line-height: 1.5;
}

.crash-modal-mechanic #crashModalFGWin {
    color: #ffd966;
    font-weight: 700;
    font-size: 1.2em;
}

.crash-modal-warning {
    margin: 0 0 1rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 100, 100, 0.15);
    border: 1px solid #ff6464;
    border-radius: 6px;
    color: #ffb0b0;
    font-size: 0.9rem;
}

.crash-modal-icon {
    margin: 1.2rem 0;
    font-size: 1.6rem;
    letter-spacing: 0.4em;
}

.crash-modal-rocket,
.crash-modal-multi {
    color: #c8b8ff;
}

.crash-modal-arrow {
    margin: 0 0.3em;
    color: #a08fd0;
}

.crash-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.crash-modal-btn {
    min-width: 120px;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.crash-modal-btn:active {
    transform: scale(0.96);
}

.crash-modal-yes {
    background: linear-gradient(180deg, #5fc572 0%, #3a9648 100%);
    color: #fff;
    border: 1px solid #7ad88e;
}

.crash-modal-no {
    background: linear-gradient(180deg, #4a3a6a 0%, #2e2448 100%);
    color: #c8b8ff;
    border: 1px solid #6a4fa0;
}

.crash-modal-auto-timer {
    margin-top: 1rem;
    color: #a08fd0;
    font-size: 0.85rem;
    font-style: italic;
}

/* ----- Overlay ----- */

.crash-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 3, 16, 0.72);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    color: #e8e0ff;
}

.crash-overlay-inner {
    position: relative;
    width: min(820px, 72vw);
    height: min(820px, 76vh);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    overflow: hidden;
    border: 2px solid rgba(233, 195, 73, 0.45);
    border-radius: 12px;
    background: radial-gradient(ellipse at center, #1a0d3e 0%, #050310 80%);
    box-shadow: 0 0 24px rgba(233, 195, 73, 0.18), inset 0 0 22px rgba(0, 0, 0, 0.5);
}

.crash-curve-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    pointer-events: none;
}

.crash-linear-track {
    position: absolute;
    left: 12%;
    bottom: 14%;
    width: 76%;
    height: 3px;
    transform: rotate(-35deg);
    transform-origin: left center;
    background: linear-gradient(90deg, rgba(160, 143, 208, 0.12), rgba(255, 217, 102, 0.78));
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(255, 217, 102, 0.35);
    z-index: 1;
}

.crash-rocket {
    position: absolute;
    left: 12%;
    bottom: 14%;
    z-index: 3;
    font-size: 3.4rem;
    line-height: 1;
    filter: drop-shadow(0 0 16px rgba(255, 217, 102, 0.75));
    transform: translate(-50%, 50%) rotate(35deg);
    transition: filter 0.12s ease;
    will-change: left, bottom, transform;
}

.crash-overlay-multiplier {
    position: relative;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 6rem;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 24px rgba(180, 130, 255, 0.8);
    z-index: 2;
}

.crash-overlay-multiplier.warn,
.crash-overlay-multiplier #crashMultiplier.warn {
    color: #ffdb6a;
    text-shadow: 0 0 24px rgba(255, 200, 60, 0.7);
}

.crash-overlay-multiplier.danger,
.crash-overlay-multiplier #crashMultiplier.danger {
    color: #ff6a6a;
    text-shadow: 0 0 24px rgba(255, 80, 80, 0.8);
}

.crash-multiplier-x {
    font-size: 0.6em;
    margin-left: 0.1em;
    opacity: 0.7;
}

.crash-overlay-stake {
    position: relative;
    font-size: 1rem;
    color: #b0a0d8;
    z-index: 2;
}

.crash-overlay-stake span {
    color: #ffd966;
    font-weight: 600;
}

.crash-overlay-actions {
    position: relative;
    z-index: 2;
}

.crash-cash-out-btn {
    min-width: 220px;
    padding: 1rem 2rem;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 8px;
    border: 1px solid #7ad88e;
    background: linear-gradient(180deg, #5fc572 0%, #3a9648 100%);
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.1s ease;
    box-shadow: 0 0 18px rgba(95, 197, 114, 0.45);
}

.crash-cash-out-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(95, 197, 114, 0.65);
}

.crash-cash-out-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.crash-cash-out-btn:disabled {
    background: linear-gradient(180deg, #3a2a5a 0%, #241845 100%);
    border-color: #5a3f88;
    color: #8878b0;
    cursor: not-allowed;
    box-shadow: none;
}

.crash-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    z-index: 3;
    pointer-events: none;
    animation: crashResultPop 0.35s ease-out;
}

.crash-result.win {
    color: #6cf09a;
    text-shadow: 0 0 28px rgba(108, 240, 154, 0.9);
}

.crash-result.lose {
    color: #ff6a6a;
    text-shadow: 0 0 28px rgba(255, 80, 80, 0.9);
}

@keyframes crashResultPop {
    0% {
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@media (max-width: 700px) {
    .crash-modal-content {
        width: calc(100vw - 24px);
        padding: 1.4rem 1.1rem;
        max-height: 84vh;
    }

    .crash-modal-content h2 {
        font-size: 1.35rem;
    }

    .crash-modal-actions {
        gap: 0.7rem;
    }

    .crash-modal-btn {
        min-width: 0;
        flex: 1;
        padding: 0.8rem 0.5rem;
        font-size: 0.95rem;
    }

    .crash-overlay-inner {
        width: calc(100vw - 20px);
        height: min(78vh, 520px);
        gap: 1rem;
        border-radius: 10px;
    }

    .crash-linear-track {
        left: 10%;
        bottom: 18%;
        width: 80%;
    }

    .crash-rocket {
        font-size: 2.7rem;
    }

    .crash-overlay-multiplier {
        font-size: clamp(3.4rem, 17vw, 5rem);
    }

    .crash-overlay-stake {
        width: calc(100% - 24px);
        font-size: 0.86rem;
        text-align: center;
    }

    .crash-cash-out-btn {
        min-width: min(260px, 82vw);
        padding: 0.9rem 1rem;
        font-size: 1.05rem;
        letter-spacing: 0.04em;
    }

    .crash-result {
        width: calc(100% - 24px);
        font-size: 2rem;
    }
}
