* {
    box-sizing: border-box;
}


body {
    margin: 0;
    min-height: 100vh;
    background: #1c1c1c;
    color: white;
    font-family: Arial, sans-serif;
}


.container {
    max-width: 1100px;
    margin: auto;
    padding: 15px;
    text-align: center;
}


h1 {
    font-size: 40px;
    margin: 5px 0 10px;
}


h2 {
    margin-top: 15px;
    margin-bottom: 10px;
}


/* Det store nummer */

#number {

    width: 140px;
    height: 140px;

    margin: 10px auto;

    position: relative;

}


#drawnNumber {

    width: 140px;
    height: 140px;

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

    background: white;

    color: #111;

    font-size: 80px;
    font-weight: bold;

    border-radius: 10px;

    box-shadow: 0 5px 15px rgba(0,0,0,0.4);

}


/* Bankopose */

#bag {
    width: 190px;
    cursor: pointer;

    transition: transform 0.2s;
}


#bag:hover {
    transform: scale(1.05);
}


#bag:active {
    transform: scale(0.95);
}



/* Knap */

#reset {
    margin-top: 20px;

    padding: 12px 30px;

    font-size: 20px;

    cursor: pointer;

    border: none;
    border-radius: 6px;
}



/* Seneste numre */

#latest {
    display: flex;
    justify-content: center;
    gap: 15px;
}



/* Alle numre */

#board {
    margin-top: 20px;
}


.number-row {

    display: flex;

    justify-content: center;

    gap: 6px;

    margin-bottom: 6px;
}



/* Selve brikken */

.number-tile {

    width: 45px;
    height: 45px;

    background: #eee;

    color: #111;

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: bold;

    border-radius: 4px;

    font-size: 18px;

}



/* Seneste 3 bliver større */

#latest .number-tile {

    width: 60px;
    height: 60px;

    font-size: 28px;

}



/* Trukket */

.number-tile.drawn {

    background: #4caf50;

    color: white;

}

.hidden {

    display: none;

}


#showBoard,
#backToGame {

    margin-top: 20px;

    padding: 12px 25px;

    font-size: 18px;

    cursor: pointer;

    border-radius: 6px;

    border: none;

}

#boardView {

    position: fixed;

    inset: 0;

    background: rgba(0,0,0,0.85);

    display: flex;

    justify-content: center;

    align-items: center;

    z-index: 1000;

}



#boardView.hidden {

    display: none;

}



.modal {

    background: #222;

    padding: 30px;

    border-radius: 12px;

    width: 95%;

    max-width: 1000px;

    text-align: center;

}



.latest-drawn {

    background: #ff9800 !important;

    color: black !important;

    transform: scale(1.15);

    box-shadow: 0 0 15px rgba(255,152,0,0.8);

}



/* Posens ryst */

.shake {

    animation: shakeBag 0.4s ease-in-out;

}


@keyframes shakeBag {

    0% {
        transform: rotate(0deg);
    }


    20% {
        transform: rotate(-8deg);
    }


    40% {
        transform: rotate(8deg);
    }


    60% {
        transform: rotate(-5deg);
    }


    80% {
        transform: rotate(5deg);
    }


    100% {
        transform: rotate(0deg);
    }

}

#flyingTile {

    position: fixed;

    width: 60px;
    height: 60px;

    background: white;

    color: #111;

    display: flex;

    justify-content: center;

    align-items: center;

    font-size: 32px;

    font-weight: bold;

    border-radius: 5px;

    box-shadow: 0 5px 15px rgba(0,0,0,0.5);

    z-index: 2000;

    opacity: 0;

    pointer-events: none;

}



#flyingTile.fly {

    animation: tileFlight 0.65s ease-out forwards;

}



@keyframes tileFlight {

    0% {

        opacity: 0;

        transform:
            translate(0,0)
            scale(0.3)
            rotate(-20deg);

    }


    20% {

        opacity: 1;

    }


    70% {

        transform:
            translate(
                calc(var(--moveX) * 0.7),
                calc(var(--moveY) * 0.7 - 40px)
            )
            scale(1.1)
            rotate(10deg);

    }


    100% {

        opacity: 0;

        transform:
            translate(
                var(--moveX),
                var(--moveY)
            )
            scale(1)
            rotate(0deg);

    }

}



.land {

    animation: land 0.3s ease-out;

}



@keyframes land {

    0% {
        transform: scale(0.8);
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }

}

.big-shake {

    animation: bigShakeBag 0.8s ease-in-out;

}


@keyframes bigShakeBag {

    0% {
        transform: rotate(0deg);
    }


    10% {
        transform: rotate(-12deg) translateX(-5px);
    }


    25% {
        transform: rotate(12deg) translateX(5px);
    }


    40% {
        transform: rotate(-10deg) translateX(-4px);
    }


    55% {
        transform: rotate(10deg) translateX(4px);
    }


    70% {
        transform: rotate(-5deg);
    }


    100% {
        transform: rotate(0deg);
    }

}

/* Generel knapstil */

#reset,
#shakeButton,
#showBoard,
#backToGame {

    margin-top: 20px;

    padding: 12px 30px;

    font-size: 20px;

    font-weight: bold;

    cursor: pointer;

    border: none;

    border-radius: 8px;

    transition: transform 0.15s, background 0.15s;

}



/* Ny runde */

#reset {

    background: #555;

    color: white;

}


#reset:hover {

    background: #666;

    transform: scale(1.03);

}



/* Ryst posen */

#shakeButton {

    margin-left: 15px;

    background: #d89b28;

    color: #111;

}


#shakeButton:hover {

    background: #f0b83b;

    transform: scale(1.05);

}


#shakeButton:active {

    transform: scale(0.95);

}



/* Vis alle numre / tilbage */

#showBoard,
#backToGame {

    background: white;

    color: #111;

}


#showBoard:hover,
#backToGame:hover {

    background: #ddd;

    transform: scale(1.03);

}