/* =====================================================
   DRAGON TOWER
===================================================== */

* {
    box-sizing: border-box;
}


/* =====================================================
   PAGE
===================================================== */

body {
    background:
        radial-gradient(
            circle at 50% 15%,
            rgba(113, 61, 176, 0.18),
            transparent 38%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(71, 37, 120, 0.08),
            transparent 35%
        ),
        #08090d;

    color: #ffffff;
}


.dragon-page {
    min-height: calc(100vh - 75px);

    padding:
        38px
        30px
        60px;
}


/* =====================================================
   HEADER
===================================================== */

.dragon-header {
    width: min(1180px, 100%);

    margin:
        0 auto 30px;

    display: flex;

    align-items: flex-start;

    gap: 20px;
}


.dragon-header-content {
    padding-top: 2px;
}


.dragon-label {
    color: #a874ff;

    font-size: 10px;

    font-weight: 900;

    letter-spacing: 4px;

    margin-bottom: 5px;
}


.dragon-header h1 {
    margin: 0;

    font-size: 36px;

    line-height: 1.1;

    letter-spacing: -1px;
}


.dragon-header p {
    margin:
        9px
        0
        0;

    color: #777b89;

    font-size: 14px;

    line-height: 1.5;

    max-width: 620px;
}


.back-button {
    flex-shrink: 0;

    margin-top: 3px;

    padding:
        10px
        15px;

    border:
        1px solid
        #292c37;

    border-radius: 9px;

    background:
        linear-gradient(
            180deg,
            #151820,
            #101219
        );

    color: #858a99;

    text-decoration: none;

    font-size: 13px;

    transition: 0.2s;
}


.back-button:hover {
    color: white;

    border-color: #555b6d;

    transform: translateX(-2px);
}


/* =====================================================
   MAIN LAYOUT
===================================================== */

.dragon-game {
    width: min(1180px, 100%);

    margin: auto;

    display: grid;

    grid-template-columns:
        300px
        minmax(0, 1fr);

    gap: 26px;

    align-items: start;
}


/* =====================================================
   LEFT PANEL
===================================================== */

.dragon-panel {
    background:
        linear-gradient(
            180deg,
            #12141c,
            #0d0f15
        );

    border:
        1px solid
        #252935;

    border-radius: 14px;

    padding: 21px;

    box-shadow:
        0 20px 60px
        rgba(0,0,0,0.28);
}


.panel-title {
    display: flex;

    flex-direction: column;

    gap: 5px;

    padding-bottom: 18px;

    border-bottom:
        1px solid
        #20232d;
}


.panel-title span {
    color: #737887;

    font-size: 9px;

    font-weight: 800;

    letter-spacing: 3px;
}


.panel-title strong {
    font-size: 21px;
}


/* =====================================================
   BET
===================================================== */

.dragon-panel label {
    display: block;

    margin:
        20px
        0
        8px;

    color: #858997;

    font-size: 12px;
}


.bet-input {
    height: 45px;

    display: flex;

    align-items: center;

    overflow: hidden;

    background: #171a23;

    border:
        1px solid
        #2a2e3a;

    border-radius: 8px;
}


.bet-input:focus-within {
    border-color: #8255d3;

    box-shadow:
        0 0 0 3px
        rgba(130,85,211,0.10);
}


.bet-input input {
    width: 100%;

    height: 100%;

    border: none;

    outline: none;

    background: transparent;

    color: white;

    padding:
        0
        13px;

    font-size: 14px;
}


.bet-input span {
    padding:
        0
        13px;

    color: #6e7380;

    font-size: 11px;
}


/* =====================================================
   DIFFICULTY
===================================================== */

.difficulty-buttons {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 6px;
}


.difficulty-buttons button {
    min-height: 60px;

    border:
        1px solid
        #2b2e39;

    border-radius: 8px;

    background:
        linear-gradient(
            180deg,
            #181b24,
            #13161d
        );

    color: #767b88;

    cursor: pointer;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    gap: 4px;

    transition:
        0.2s;
}


.difficulty-buttons button strong {
    font-size: 11px;

    color: inherit;
}


.difficulty-buttons button span {
    color: #5f6470;

    font-size: 9px;
}


.difficulty-buttons button:hover {
    color: white;

    border-color: #555b6c;

    transform:
        translateY(-1px);
}


.difficulty-buttons button.selected {
    color: white;

    background:
        linear-gradient(
            180deg,
            #39215e,
            #24163d
        );

    border-color: #8759d7;

    box-shadow:
        0 0 22px
        rgba(135,89,215,0.18);
}


.difficulty-buttons button.selected span {
    color: #b696e8;
}


/* =====================================================
   GAME INFO
===================================================== */

.game-info {
    margin-top: 18px;
}


.info-row {
    min-height: 42px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom:
        1px solid
        #20232d;
}


.info-row span {
    color: #707582;

    font-size: 11px;
}


.info-row strong {
    color: #e6e7eb;

    font-size: 13px;
}


.info-row small {
    color: #686d79;

    font-size: 10px;
}


.multiplier-info strong {
    color: #c38aff;

    font-size: 18px;

    text-shadow:
        0 0 15px
        rgba(190,125,255,0.35);
}


.win-info strong {
    color: #62d995;

    font-size: 15px;

    text-shadow:
        0 0 15px
        rgba(98,217,149,0.2);
}


/* =====================================================
   BUTTONS
===================================================== */

.start-button,
.cashout-button {
    width: 100%;

    height: 46px;

    margin-top: 14px;

    border-radius: 8px;

    font-size: 13px;

    font-weight: 900;

    cursor: pointer;

    transition: 0.2s;
}


.start-button {
    border: none;

    background:
        linear-gradient(
            135deg,
            #ffffff,
            #dcdce3
        );

    color: #090a0e;
}


.start-button:hover:not(:disabled) {
    transform:
        translateY(-2px);

    box-shadow:
        0 8px 25px
        rgba(255,255,255,0.09);
}


.start-button:disabled {
    opacity: 0.45;

    cursor: default;
}


.cashout-button {
    border:
        1px solid
        #343844;

    background:
        linear-gradient(
            180deg,
            #191c25,
            #14171e
        );

    color: white;
}


.cashout-button:hover:not(:disabled) {
    border-color: #626878;

    background: #20242e;
}


.cashout-button:disabled {
    opacity: 0.35;

    cursor: default;
}


/* =====================================================
   HINT
===================================================== */

.panel-hint {
    margin-top: 18px;

    padding-top: 15px;

    border-top:
        1px solid
        #20232d;

    color: #555b68;

    font-size: 10px;

    line-height: 1.8;
}


/* =====================================================
   TOWER AREA
===================================================== */

.tower-area {
    min-height: 680px;

    position: relative;

    overflow: hidden;

    padding:
        22px
        25px
        20px;

    background:
        radial-gradient(
            circle at 50% 30%,
            rgba(120,67,184,0.14),
            transparent 45%
        ),
        linear-gradient(
            180deg,
            #0d0f15,
            #090b10
        );

    border:
        1px solid
        #242733;

    border-radius: 14px;

    box-shadow:
        inset 0 0 80px
        rgba(0,0,0,0.25);
}


/* =====================================================
   DRAGON BADGE
===================================================== */

.tower-top {
    display: flex;

    justify-content: center;

    margin-bottom: 16px;
}


.dragon-badge {
    display: flex;

    align-items: center;

    gap: 11px;

    padding:
        8px
        17px;

    border:
        1px solid
        #402a56;

    border-radius: 10px;

    background:
        linear-gradient(
            180deg,
            #19121f,
            #110e16
        );

    box-shadow:
        0 0 30px
        rgba(123,70,180,0.13);
}


.dragon-emoji {
    width: 38px;

    height: 38px;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 27px;

    filter:
        drop-shadow(
            0 0 9px
            rgba(202,88,255,0.35)
        );
}


.dragon-badge span {
    display: block;

    color: #74627f;

    font-size: 8px;

    letter-spacing: 2px;
}


.dragon-badge strong {
    display: block;

    margin-top: 2px;

    color: #c38aff;

    font-size: 11px;

    letter-spacing: 1px;
}


/* =====================================================
   TOWER WRAPPER
===================================================== */

.tower-wrapper {
    width: min(720px, 100%);

    margin: auto;

    position: relative;

    padding:
        8px
        42px;
}


.tower-glow {
    position: absolute;

    z-index: 0;

    width: 70%;

    height: 90%;

    left: 15%;

    top: 5%;

    pointer-events: none;

    background:
        radial-gradient(
            ellipse,
            rgba(126,70,191,0.17),
            transparent 70%
        );

    filter: blur(8px);
}


/* =====================================================
   TOWER BODY
===================================================== */

.tower {
    position: relative;

    z-index: 2;

    display: flex;

    flex-direction: column;

    gap: 7px;

    padding:
        14px
        14px
        18px;

    border:
        1px solid
        #45344f;

    border-radius:
        11px
        11px
        7px
        7px;

    background:
        linear-gradient(
            90deg,
            #16121d 0%,
            #241a2d 8%,
            #19151f 50%,
            #241a2d 92%,
            #16121d 100%
        );

    box-shadow:
        0 25px 70px
        rgba(0,0,0,0.55),

        inset 0 0 50px
        rgba(0,0,0,0.35);
}


/* =====================================================
   ROW
===================================================== */

.tower-row {
    min-height: 61px;

    display: grid;

    /*
       ЧИСЛО | ДВЕРИ | МНОЖИТЕЛЬ
    */

    grid-template-columns:
        35px
        minmax(0, 1fr)
        92px;

    align-items: center;

    gap: 10px;

    padding:
        5px
        8px;

    border:
        1px solid
        #292d38;

    border-radius: 8px;

    background:
        linear-gradient(
            180deg,
            #181b23,
            #11141b
        );

    transition:
        0.25s;
}


/* CURRENT */

.tower-row.current {
    border-color: #7951b5;

    background:
        linear-gradient(
            180deg,
            #21182b,
            #16131d
        );

    box-shadow:
        0 0 24px
        rgba(121,81,181,0.14);
}


/* =====================================================
   FLOOR NUMBER — LEFT
===================================================== */

.tower-row-number {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 30px;

    height: 30px;

    color: #737887;

    font-size: 13px;

    font-weight: 900;

    border-radius: 7px;

    background: #101219;

    border:
        1px solid
        #292d38;
}


.tower-row.current
.tower-row-number {
    color: #b983ff;

    border-color: #65428e;

    background: #1b1425;
}


/* =====================================================
   DOORS
===================================================== */

.tower-doors {
    display: grid;

    grid-template-columns:
        repeat(
            var(--door-count),
            minmax(55px, 1fr)
        );

    gap: 7px;

    width: 100%;
}


/* =====================================================
   DOOR
===================================================== */

.tower-door {
    position: relative;

    height: 48px;

    display: flex;

    align-items: center;

    justify-content: center;

    border:
        1px solid
        #383d4a;

    border-radius: 8px;

    background:
        linear-gradient(
            180deg,
            #292d38,
            #1b1f28
        );

    color: white;

    cursor: pointer;

    transition:
        transform 0.18s,
        border-color 0.18s,
        box-shadow 0.18s,
        background 0.18s;
}


.tower-door::after {
    content: "";

    position: absolute;

    inset: 5px;

    border:
        1px solid
        rgba(255,255,255,0.035);

    border-radius: 5px;

    pointer-events: none;
}


.tower-door:hover:not(:disabled) {
    transform:
        translateY(-3px);

    border-color: #9860d7;

    background:
        linear-gradient(
            180deg,
            #3a2450,
            #251932
        );

    box-shadow:
        0 7px 20px
        rgba(137,79,190,0.22);
}


.tower-door:disabled {
    cursor: default;
}


/* =====================================================
   DOOR CONTENT
===================================================== */

.door-number {
    position: absolute;

    top: 4px;

    left: 7px;

    color: #686e7c;

    font-size: 8px;

    z-index: 2;
}


.door-symbol {
    position: relative;

    z-index: 2;

    font-size: 22px;

    line-height: 1;

    filter:
        drop-shadow(
            0 2px 3px
            rgba(0,0,0,0.5)
        );
}


.door-result {
    position: relative;

    z-index: 3;

    font-size: 23px;

    animation:
        resultPop
        0.35s
        ease;
}


@keyframes resultPop {

    0% {
        transform: scale(0.5);

        opacity: 0;
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);

        opacity: 1;
    }

}


/* =====================================================
   SAFE
===================================================== */

.tower-door.safe,
.tower-door.safe-reveal {

    background:
        radial-gradient(
            circle at center,
            rgba(50,218,147,0.16),
            transparent 70%
        ),
        #13251f;

    border-color: #3b8066;

    box-shadow:
        0 0 18px
        rgba(54,203,139,0.12);
}


.tower-door.safe .door-result,
.tower-door.safe-reveal .door-result {
    filter:
        drop-shadow(
            0 0 7px
            rgba(78,227,164,0.5)
        );
}


/* =====================================================
   DRAGON
===================================================== */

.tower-door.dragon {

    background:
        radial-gradient(
            circle,
            rgba(225,55,72,0.27),
            transparent 68%
        ),
        #2a151a;

    border-color: #a4434f;

    box-shadow:
        0 0 28px
        rgba(218,56,72,0.25);
}


.tower-door.dragon .door-result {
    filter:
        drop-shadow(
            0 0 9px
            rgba(255,70,82,0.6)
        );
}
/* =====================================================
   REVEALED SAFE DOOR
===================================================== */

.tower-door.safe-reveal {
    background:
        linear-gradient(
            180deg,
            #193028,
            #13231f
        );

    border-color: #3d7b64;

    color: #73dba8;

    animation: revealSafeDoor 0.4s ease;
}


@keyframes revealSafeDoor {

    0% {
        transform: scale(0.85);
        opacity: 0;
    }

    60% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }

}


/* =====================================================
   REVEALED DRAGON
===================================================== */

.tower-door.dragon {
    background:
        radial-gradient(
            circle at center,
            rgba(213,54,71,0.3),
            transparent 65%
        ),
        #28171b;

    border-color: #9b424d;

    color: #ff7883;

    box-shadow:
        0 0 18px rgba(220,55,70,0.18);

    animation: revealDragonDoor 0.45s ease;
}


@keyframes revealDragonDoor {

    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    45% {
        transform: scale(1.12);

        box-shadow:
            0 0 35px rgba(220,55,70,0.45);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }

}


/* =====================================================
   DOOR RESULT
===================================================== */

.door-result {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    font-size: 22px;

    filter:
        drop-shadow(
            0 2px 5px rgba(0,0,0,0.4)
        );
}

/* =====================================================
   MULTIPLIER — RIGHT SIDE
===================================================== */

.tower-row-multiplier {
    height: 100%;

    display: flex;

    align-items: center;

    justify-content: center;

    flex-direction: column;

    min-width: 80px;

    border-left:
        1px solid
        #292d38;

    padding-left: 10px;
}


.multiplier-label {
    display: none;
}


.tower-row-multiplier strong {
    color: #b985ff;

    font-size: 17px;

    font-weight: 900;

    white-space: nowrap;

    text-shadow:
        0 0 14px
        rgba(183,127,255,0.35);
}


.tower-row-multiplier.high strong {
    color: #cf91ff;

    text-shadow:
        0 0 17px
        rgba(205,126,255,0.45);
}


.tower-row-multiplier.mega strong {
    color: #ff9ad8;

    font-size: 19px;

    text-shadow:
        0 0 20px
        rgba(255,112,203,0.5);
}


/* =====================================================
   STATUS
===================================================== */

.tower-status {
    min-height: 25px;

    margin-top: 17px;

    text-align: center;
}


.tower-status span {
    color: #666b78;

    font-size: 11px;
}


.tower-status.win span {
    color: #61d894;
}


.tower-status.loss span {
    color: #ed707a;
}


/* =====================================================
   WIN EFFECT
===================================================== */

.tower.tower-win {
    animation:
        towerWin
        1s
        ease;
}


@keyframes towerWin {

    0% {
        filter: brightness(1);
    }

    50% {
        filter:
            brightness(1.45)
            drop-shadow(
                0 0 25px
                rgba(102,218,154,0.35)
            );
    }

    100% {
        filter: brightness(1);
    }

}


/* =====================================================
   NOTIFICATION
===================================================== */

.notification {
    position: fixed;

    z-index: 9999;

    left: 50%;

    bottom: 25px;

    transform:
        translate(-50%, 100px);

    opacity: 0;

    padding:
        13px
        22px;

    border:
        1px solid
        #343844;

    border-radius: 9px;

    background:
        linear-gradient(
            180deg,
            #191c25,
            #11141a
        );

    color: white;

    box-shadow:
        0 12px 40px
        rgba(0,0,0,0.45);

    transition:
        0.3s;

    pointer-events: none;
}


.notification.show {
    transform:
        translate(-50%, 0);

    opacity: 1;
}


/* =====================================================
   MOBILE
===================================================== */

@media (max-width: 950px) {

    .dragon-game {
        grid-template-columns: 1fr;
    }


    .dragon-panel {
        width: 100%;

        max-width: 600px;

        margin: auto;
    }


    .tower-area {
        min-height: 650px;
    }

}


@media (max-width: 650px) {

    .dragon-page {
        padding:
            22px
            10px
            40px;
    }


    .dragon-header {
        flex-direction: column;
    }


    .dragon-header h1 {
        font-size: 29px;
    }


    .tower-area {
        padding:
            16px
            7px;
    }


    .tower-wrapper {
        padding:
            5px
            4px;
    }


    .tower {
        padding:
            8px;
    }


    .tower-row {
        grid-template-columns:
            27px
            minmax(0, 1fr)
            65px;

        gap: 5px;

        padding:
            4px;
    }


    .tower-row-number {
        width: 25px;

        height: 28px;

        font-size: 11px;
    }


    .tower-doors {
        gap: 4px;
    }


    .tower-door {
        height: 44px;
    }


    .door-symbol {
        font-size: 19px;
    }


    .tower-row-multiplier {
        min-width: 60px;

        padding-left: 5px;
    }


    .tower-row-multiplier strong {
        font-size: 13px;
    }

}
.quick-bets {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.quick-bets button {
    flex: 1;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #111;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.quick-bets button:hover {
    background: #222;
}

.quick-bets button.active {
    border-color: #777;
    background: #292929;
}