* {
    box-sizing: border-box;
}

body {
    margin: 0;

    min-height: 100vh;

    background:
        radial-gradient(circle at center, #17172a 0%, #08080d 55%, #020204 100%);

    color: white;

    font-family: Arial, sans-serif;

    text-align: center;

    overflow: hidden;
}


/* =========================
   MAIN
========================= */

.container {
    padding-top: 35px;
}

h1 {
    letter-spacing: 6px;
}


/* =========================
   GACHA AREA
========================= */

.gacha-area {
    position: relative;

    width: 340px;
    height: 430px;

    margin: 10px auto 0;
}


/* =========================
   MAIN LIGHT
========================= */

.summon-light {
    position: absolute;

    width: 20px;
    height: 20px;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    border-radius: 50%;

    opacity: 0;

    background: white;

    box-shadow:
        0 0 20px white,
        0 0 50px white,
        0 0 100px white;

    pointer-events: none;
}


/* =========================
   ENERGY RINGS
========================= */

.energy-ring {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 40px;
    height: 40px;

    border: 2px solid white;

    border-radius: 50%;

    transform: translate(-50%, -50%) scale(0);

    opacity: 0;

    pointer-events: none;
}


/* =========================
   FLASH
========================= */

.flash {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 30px;
    height: 30px;

    transform: translate(-50%, -50%) scale(0);

    border-radius: 50%;

    background: white;

    opacity: 0;

    pointer-events: none;
}


/* =========================
   CARD
========================= */

.card {
    position: absolute;

    left: 50%;
    top: 50%;

    width: 230px;
    height: 320px;

    transform:
        translate(-50%, -50%)
        scale(0.2)
        rotateY(180deg);

    opacity: 0;

    border-radius: 20px;

    background:
        linear-gradient(
            145deg,
            #303030,
            #111111
        );

    border: 2px solid white;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    overflow: hidden;

    box-shadow:
        0 0 20px rgba(255,255,255,0.2);

    transform-style: preserve-3d;
}


/* =========================
   CARD CONTENT
========================= */

.card-rarity {
    font-size: 24px;

    font-weight: bold;

    letter-spacing: 5px;
}

.card-image {
    width: 150px;
    height: 180px;

    margin: 15px 0;

    display: flex;

    justify-content: center;
    align-items: center;

    font-size: 75px;

    border-radius: 12px;

    background: rgba(255,255,255,0.05);
}

.card-name {
    font-size: 18px;

    font-weight: bold;
}


/* =========================
   CARD SHINE
========================= */

.card-shine {
    position: absolute;

    top: -100px;
    left: -120px;

    width: 70px;
    height: 550px;

    background: rgba(255,255,255,0.35);

    transform: rotate(25deg);

    opacity: 0;

    pointer-events: none;
}


/* =====================================================
   ANIMATION START
===================================================== */

.playing .summon-light {
    animation: summonLight 2.6s ease-out forwards;
}

.playing .ring-1 {
    animation: ringExpand 2s ease-out forwards;
}

.playing .ring-2 {
    animation: ringExpand 2s 0.35s ease-out forwards;
}

.playing .ring-3 {
    animation: ringExpand 2s 0.7s ease-out forwards;
}

.playing .flash {
    animation: finalFlash 0.7s 2.7s ease-out forwards;
}

.playing .card {
    animation: cardReveal 1s 2.9s cubic-bezier(.17,.67,.3,1.4) forwards;
}

.playing .card-shine {
    animation: shine 1.2s 3.8s ease-out forwards;
}


/* =========================
   LIGHT OPENING
========================= */

@keyframes summonLight {

    0% {
        width: 10px;
        height: 10px;
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    55% {
        width: 120px;
        height: 120px;
        opacity: 0.9;
    }

    100% {
        width: 380px;
        height: 380px;
        opacity: 0;
    }
}


/* =========================
   RINGS
========================= */

@keyframes ringExpand {

    0% {
        transform:
            translate(-50%, -50%)
            scale(0);

        opacity: 0.9;
    }

    70% {
        opacity: 0.5;
    }

    100% {
        transform:
            translate(-50%, -50%)
            scale(6);

        opacity: 0;
    }
}


/* =========================
   FINAL FLASH
========================= */

@keyframes finalFlash {

    0% {
        transform:
            translate(-50%, -50%)
            scale(0);

        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform:
            translate(-50%, -50%)
            scale(12);

        opacity: 0;
    }
}


/* =========================
   CARD REVEAL
========================= */

@keyframes cardReveal {

    0% {
        opacity: 0;

        transform:
            translate(-50%, -50%)
            scale(0.2)
            rotateY(180deg);
    }

    60% {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1.08)
            rotateY(-15deg);
    }

    100% {
        opacity: 1;

        transform:
            translate(-50%, -50%)
            scale(1)
            rotateY(0deg);
    }
}


/* =========================
   SHINE
========================= */

@keyframes shine {

    0% {
        left: -120px;
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        left: 300px;
        opacity: 0;
    }
}


/* =========================
   BUTTON
========================= */

button {
    padding: 14px 42px;

    font-size: 20px;

    font-weight: bold;

    color: white;

    background: #1b1b24;

    border: 1px solid white;

    border-radius: 10px;

    cursor: pointer;

    transition: 0.2s;
}

button:hover {
    transform: scale(1.05);
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    opacity: 0.4;

    cursor: not-allowed;
}