/* ==========================================
   CRASH PAGE
========================================== */

.crash-page {
    min-height: calc(100vh - 156px);
    padding: 50px 6% 80px;
    box-sizing: border-box;
    background: #090a10;
}


/* ==========================================
   HEADING
========================================== */

.crash-heading {
    margin-bottom: 25px;
}

.section-label {
    color: #7182ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.crash-heading h1 {
    margin: 7px 0;
    color: #ffffff;
    font-size: 42px;
    font-weight: 800;
}

.crash-heading p {
    margin: 0;
    color: #858da3;
    font-size: 15px;
}


/* ==========================================
   HISTORY
========================================== */

.crash-history {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-bottom: 15px;
    padding: 13px 16px;

    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;

    background: #11131d;
}

.history-title {
    color: #626a80;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}

.history-list {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.history-list span {
    padding: 6px 10px;

    border-radius: 6px;

    font-size: 11px;
    font-weight: 700;

    white-space: nowrap;
}

.history-low {
    background: rgba(255, 74, 105, 0.09);
    color: #ff6680;
}

.history-high {
    background: rgba(79, 140, 255, 0.1);
    color: #718eff;
}

.history-neutral {
    background: rgba(255, 255, 255, 0.06);
    color: #c5cad5;
}


/* ==========================================
   GAME
========================================== */

.crash-game {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr) 310px;

    overflow: hidden;

    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px;

    background: #11131d;

    box-shadow:
        0 20px 50px rgba(0,0,0,0.35);
}


/* ==========================================
   CS2 / DUST2 CRASH SCREEN
========================================== */

.crash-screen {
    position: relative;
    min-height: 540px;
    overflow: hidden;
    isolation: isolate;
    background:
        linear-gradient(90deg, rgba(5, 8, 12, 0.02) 0%, rgba(5, 8, 12, 0.16) 46%, rgba(5, 8, 12, 0.72) 100%),
        url("../images/assets/crash-dust2-a.webp") center 54% / cover no-repeat;
}

.crash-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(0deg, rgba(5, 7, 10, 0.82) 0%, transparent 38%, rgba(5, 7, 10, 0.12) 100%);
}

.crash-status {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    padding: 8px 12px;
    border: 1px solid rgba(255, 185, 65, 0.25);
    border-left: 3px solid #f0a52e;
    border-radius: 3px;
    background: rgba(12, 16, 21, 0.82);
    color: #f2c16c;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.2px;
    backdrop-filter: blur(8px);
}

.crash-status.live {
    color: #ffd36b;
    border-left-color: #ffb52e;
}

.crash-status.crashed {
    color: #ff8b58;
    border-left-color: #ff5b35;
}

.crash-status.offline {
    color: #ff7777;
    border-left-color: #ff5555;
}

.crash-brand {
    position: absolute;
    top: 20px;
    right: 22px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 13px;
    color: #f5f3ee;
    background: rgba(12, 16, 21, 0.82);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 3px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1.4px;
    backdrop-filter: blur(8px);
}

.crash-brand-cs {
    font-size: 17px;
    font-style: italic;
    letter-spacing: -1px;
}

.crash-brand-cs span {
    color: #f0a52e;
}

.crash-brand-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.35);
}

.crash-brand-title {
    color: #f2b94f;
}

.multiplier {
    position: absolute;
    left: 73%;
    top: 43%;
    transform: translate(-50%, -50%);
    z-index: 6;
    color: #fff4d8;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 950;
    letter-spacing: -3px;
    text-shadow:
        0 3px 0 rgba(0,0,0,0.35),
        0 0 22px rgba(255, 165, 45, 0.5),
        0 0 55px rgba(255, 115, 20, 0.28);
    white-space: nowrap;
}

.multiplier span {
    color: #ffb83f;
    font-size: 0.52em;
}

.crash-bomb-led {
    /* LED jest już narysowana na bombie w tle. */
    display: none;
}

@keyframes crash-led-pulse {
    0%, 100% { opacity: 0.55; transform: scale(0.82); }
    50% { opacity: 1; transform: scale(1.18); }
}

.crash-explosion {
    position: absolute;
    z-index: 5;
    left: 22%;
    top: 72%;
    width: min(680px, 66%);
    aspect-ratio: 1 / 1;
    opacity: 0;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.12);
    background:
        radial-gradient(circle,
            rgba(255,255,225,1) 0%,
            rgba(255,226,132,1) 8%,
            rgba(255,153,42,0.98) 18%,
            rgba(241,72,17,0.88) 34%,
            rgba(105,42,20,0.55) 52%,
            rgba(35,30,29,0.18) 68%,
            transparent 76%);
    filter: saturate(1.3) contrast(1.08);
    will-change: transform, opacity, filter;
}

.crash-explosion::before {
    content: "";
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    background:
        radial-gradient(ellipse at 42% 34%, rgba(65,61,58,0.92) 0 13%, transparent 34%),
        radial-gradient(ellipse at 62% 42%, rgba(94,79,65,0.82) 0 18%, transparent 42%),
        radial-gradient(ellipse at 36% 62%, rgba(48,43,41,0.8) 0 16%, transparent 43%),
        radial-gradient(ellipse at 67% 67%, rgba(80,67,57,0.75) 0 15%, transparent 40%);
    filter: blur(16px);
    opacity: 0;
}

.crash-explosion::after {
    content: "";
    position: absolute;
    inset: 5%;
    border-radius: 50%;
    background:
        repeating-conic-gradient(from 3deg,
            rgba(255,242,178,0.98) 0deg 2deg,
            rgba(255,125,24,0.96) 2deg 5deg,
            transparent 5deg 15deg);
    -webkit-mask-image: radial-gradient(circle, transparent 0 18%, #000 27% 46%, transparent 68%);
    mask-image: radial-gradient(circle, transparent 0 18%, #000 27% 46%, transparent 68%);
    filter: drop-shadow(0 0 14px rgba(255,123,22,0.95));
    opacity: 0;
}

.crash-screen.is-crashing .crash-explosion {
    animation: crash-blast 2300ms cubic-bezier(.12,.72,.2,1) both;
}

.crash-screen.is-crashing .crash-explosion::before {
    animation: crash-smoke 2300ms ease-out both;
}

.crash-screen.is-crashing .crash-explosion::after {
    animation: crash-sparks 1250ms ease-out both;
}

.crash-screen[data-state="crashed"] .multiplier {
    color: #fff0cf;
    text-shadow:
        0 0 8px rgba(255,255,220,0.9),
        0 0 28px rgba(255,112,25,0.95),
        0 0 65px rgba(255,72,20,0.75);
    animation: crash-result-pop 520ms cubic-bezier(.16,.9,.25,1.2) both;
}

.crash-screen[data-state="crashed"] .crash-bomb-led {
    animation: crash-led-dead 180ms steps(2,end) 2 forwards;
}

@keyframes crash-blast {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.12);
        filter: brightness(1);
    }
    10% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.78);
        filter: brightness(1.55);
    }
    24% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.12);
        filter: brightness(1.25);
    }
    52% {
        opacity: 0.88;
        transform: translate(-50%, -50%) scale(1.42);
        filter: brightness(0.95);
    }
    78% {
        opacity: 0.52;
        transform: translate(-50%, -50%) scale(1.68);
        filter: brightness(0.72);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.9);
        filter: brightness(0.55);
    }
}

@keyframes crash-smoke {
    0%, 12% { opacity: 0; transform: scale(0.35); }
    30% { opacity: 0.72; transform: scale(0.82); }
    68% { opacity: 0.8; transform: scale(1.22); }
    100% { opacity: 0; transform: scale(1.58); }
}

@keyframes crash-sparks {
    0% { opacity: 0; transform: scale(0.28) rotate(0deg); }
    12% { opacity: 1; transform: scale(0.9) rotate(12deg); }
    55% { opacity: 0.85; transform: scale(1.35) rotate(25deg); }
    100% { opacity: 0; transform: scale(1.62) rotate(38deg); }
}

@keyframes crash-result-pop {
    0% { transform: translate(-50%, -50%) scale(0.72); }
    70% { transform: translate(-50%, -50%) scale(1.08); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes crash-led-dead {
    to { opacity: 0; box-shadow: none; }
}

.crash-graph {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 43%;
    z-index: 3;
    overflow: visible;
    background: linear-gradient(0deg, rgba(5,7,10,0.72), transparent);
}

.graph-line {
    fill: none;
    stroke: #ffb22e;
    stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(255,171,42,0.85));
}

.graph-area {
    fill: url(#graphGradient);
}

/* ==========================================
   CONTROLS
========================================== */

.crash-controls {
    display: flex;
    flex-direction: column;

    padding: 28px;

    border-left:
        1px solid rgba(255,255,255,0.06);

    background: #11131d;
}


/* ==========================================
   BALANCE
========================================== */

.crash-account-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 30px;
}

.crash-account-balance span {
    color: #747c91;
    font-size: 12px;
}

.crash-account-balance strong {
    color: #ffffff;
    font-size: 16px;
}


/* ==========================================
   BET
========================================== */

.bet-section {
    margin-bottom: 20px;
}

.bet-section label {
    display: block;

    margin-bottom: 9px;

    color: #858da3;

    font-size: 12px;
    font-weight: 600;
}

.bet-input {
    display: flex;

    height: 48px;

    overflow: hidden;

    border: 1px solid #292d3d;
    border-radius: 9px;

    background: #0b0d14;
}

.bet-input button {
    width: 48px;

    border: none;

    background: transparent;

    color: #8b93a8;

    font-size: 20px;

    cursor: pointer;

    transition: 0.2s ease;
}

.bet-input button:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.04);
}

.bet-input input {
    flex: 1;

    min-width: 0;

    border: none;
    outline: none;

    background: transparent;

    color: #ffffff;

    text-align: center;

    font-size: 15px;
    font-weight: 700;
}


/* ==========================================
   PLAY
========================================== */

.play-crash {
    width: 100%;
    height: 50px;

    margin-top: 5px;

    border: none;
    border-radius: 10px;

    background:
        linear-gradient(
            90deg,
            #3f82ff,
            #743cff
        );

    color: #ffffff;

    font-size: 14px;
    font-weight: 800;

    cursor: pointer;

    transition: 0.25s ease;

    box-shadow:
        0 8px 25px rgba(83,74,255,0.22);
}

.play-crash:hover {
    transform: translateY(-2px);

    box-shadow:
        0 10px 30px rgba(83,74,255,0.4);
}


/* ==========================================
   CASHOUT
========================================== */

.cashout-button {
    width: 100%;
    height: 45px;

    margin-top: 10px;

    border: 1px solid #303548;
    border-radius: 10px;

    background: transparent;

    color: #7d86a0;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.25s ease;
}

.cashout-button:hover {
    border-color: #6175ff;
    color: #ffffff;
}


/* ==========================================
   WARNING
========================================== */

/* ==========================================
   LIVE BETS
========================================== */

.live-bets {
    width: 100%;
    max-width: 1200px;

    margin: 35px auto 0;
    padding: 28px;

    box-sizing: border-box;

    background: #11131d;

    border:
        1px solid rgba(255,255,255,0.06);

    border-radius: 18px;

    box-shadow:
        0 15px 40px rgba(0,0,0,0.25);
}


/* ==========================================
   LIVE BETS HEADER
========================================== */

.live-bets-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: 25px;
}

.live-bets-header h2 {
    margin: 5px 0 0;

    color: #ffffff;

    font-size: 24px;
    font-weight: 800;
}

.live-players {
    display: flex;

    align-items: center;

    gap: 8px;

    color: #aeb4c7;

    font-size: 14px;
}

.live-players i {
    color: #6d7cff;
}


/* ==========================================
   TABLE
========================================== */

.live-bets-table {
    width: 100%;
}

.live-bets-row {
    display: grid;

    grid-template-columns:
        2fr 1fr 1fr 1fr;

    align-items: center;

    gap: 15px;

    min-height: 58px;

    padding: 0 18px;

    box-sizing: border-box;

    border-bottom:
        1px solid rgba(255,255,255,0.05);

    color: #dfe3f0;
}

.live-bets-row:last-child {
    border-bottom: none;
}


/* ==========================================
   TABLE HEADER
========================================== */

.live-bets-head {
    min-height: 45px;

    color: #747b91;

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: 0.8px;
}


/* ==========================================
   PLAYER
========================================== */

.bet-player {
    display: flex;

    align-items: center;

    gap: 10px;

    font-weight: 600;
}

.bet-player i {
    color: #6d7cff;
}


/* ==========================================
   BET AMOUNT
========================================== */

.bet-amount {
    color: #ffffff;

    font-weight: 700;
}


/* ==========================================
   MULTIPLIER
========================================== */

.bet-multiplier {
    color: #8fa2ff;

    font-weight: 700;
}


/* ==========================================
   STATUS
========================================== */

.bet-status {
    justify-self: start;

    padding: 6px 12px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 800;
}


/* LIVE */

.bet-status.live {
    color: #7dffb2;

    background:
        rgba(62, 255, 139, 0.10);
}


/* CASHED */

.bet-status.cashed {
    color: #9b8cff;

    background:
        rgba(116, 70, 255, 0.12);
}


/* LOST */

.bet-status.lost {
    color: #ff6680;

    background:
        rgba(255, 74, 105, 0.10);
}


/* ==========================================
   EMPTY
========================================== */

.live-bets-empty {
    display: flex;

    align-items: center;
    justify-content: center;

    gap: 10px;

    min-height: 100px;

    color: #777e94;

    font-size: 14px;
}

.live-bets-empty i {
    color: #6d7cff;
}


/* ==========================================
   RESPONSIVE
========================================== */

@media (max-width: 900px) {

    .crash-game {
        grid-template-columns: 1fr;
    }

    .crash-controls {
        border-left: none;

        border-top:
            1px solid rgba(255,255,255,0.06);
    }

}


/* ==========================================
   TABLET / MOBILE
========================================== */

@media (max-width: 700px) {

    .live-bets {
        padding: 18px;
    }

    .live-bets-header {
        margin-bottom: 18px;
    }

    .live-bets-header h2 {
        font-size: 20px;
    }

    .live-bets-row {
        grid-template-columns:
            1.5fr 1fr 1fr;

        padding: 0 10px;

        font-size: 12px;
    }

    .live-bets-row span:last-child {
        display: none;
    }

    .live-bets-head span:last-child {
        display: none;
    }

}


/* ==========================================
   MOBILE
========================================== */

@media (max-width: 600px) {

    .crash-page {
        padding: 35px 15px 60px;
    }

    .crash-heading h1 {
        font-size: 34px;
    }

    .crash-heading p {
        font-size: 14px;
        line-height: 1.5;
    }

    .crash-history {
        align-items: flex-start;

        flex-direction: column;

        gap: 10px;
    }

    .crash-screen {
        min-height: 380px;
        background-position: 42% center;
    }

    .multiplier {
        left: 72%;
        top: 42%;
        font-size: clamp(38px, 10vw, 58px);
    }

    .crash-brand {
        top: 64px;
        right: 12px;
        font-size: 10px;
        padding: 6px 8px;
    }

    .crash-status {
        top: 14px;
        left: 12px;
    }

    .crash-bomb-led {
        left: 19%;
        top: 66%;
        width: 9px;
        height: 9px;
    }

    .crash-controls {
        padding: 22px;
    }

    .live-bets {
        margin-top: 25px;
        padding: 16px;
        border-radius: 14px;
    }

    .live-bets-header {
        align-items: flex-start;
        gap: 15px;
    }

    .live-players {
        font-size: 12px;
    }

    .live-bets-row {
        min-height: 52px;
    }

}