@font-face {
    font-family: 'Amsi Pro AKS Condensed';
    src: url('../fonts/AmsiProAKSCondensed-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

* { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Amsi Pro AKS Condensed', sans-serif;

    background-image: url('../images/backgrounds/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: flex-end;

    padding-right: 1%;
    
    transition: background-image 0.5s ease-in-out;
}

.main-ui {
    position: relative;
    width: 60%;
    max-width: 1000px;
    height: 60%; 
    max-height: 650px;
    min-height: 400px;
    
    display: flex;
    justify-content: center;
    align-items: center;
}

.roulette-frame-outer {
    display: flex;
    justify-content: center;
    align-items: center;
    
    position: relative; 

    width: 100%;
    height: 100%;
    
    border: clamp(10px, 2vw, 25px) solid #fff;
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);

    pointer-events: none; 
    z-index: 10;
}

.roulette-frame-outer.win-glow {
    animation: glowing 1s infinite alternate;
}

.roulette-frame-inner {
    background: rgba(0,0,0,0.5);
    overflow: hidden;

    position: relative;

    width: 98%;
    height: 94%;

    border: clamp(8px, 1.5vw, 18px) solid #EDBEFA;
    border-radius: 15px;
    box-shadow: inset 0 0 30px #000;

    pointer-events: auto;
}

.roulette-frame-inner::after {
    content: '';

    position: absolute;
    top: 0%;
    left: 0%;

    width: 100%;
    height: 100%;
    
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0) 25%,
        rgba(0, 0, 0, 0) 75%,
        rgba(0, 0, 0, 0.7) 100%
    );
    pointer-events: none;
    z-index: 15;
}

.roulette-window {
    overflow: hidden;

    position: relative;

    width: 100%;
    height: 100%;
}

.center-marker {
    background: rgba(255, 0, 0, 0.5);
    opacity: 0;

    position: absolute;
    top: 50%; 
    left: 0%;
    transform: translateY(-50%);

    width: 100%;
    height: 2px;
    
    z-index: 50;
}

.cards-track {
    display: flex;
    flex-direction: column;

    width: 100%;

    will-change: transform;
}

.card {
    overflow: hidden; 

    display: grid;
    grid-template-rows: 15% 1fr 15%;
    grid-template-columns: 50% 50%;

    position: relative;
    margin: 0;

    flex: 0 0 60%; 
    flex-shrink: 0; 
    
    width: 100%;
    height: 60%; 
    min-height: 27.5vh;
    
    border-right: none; 
    border-bottom: 2px solid rgba(255,255,255,0.3);
}

.rare-1 { background: linear-gradient(135deg, #cfcfcf, #999); }
.rare-2 { background: #00bf33; }
.rare-3 { background: #02acdb; }
.rare-4 { background: #8602fa; }
.rare-5 { background: #ffd000; }

.card-bg-top {
    background: rgba(247, 249, 241, 0.7);

    grid-column: 1 / -1;
    grid-row: 1;

    margin: auto;

    width: 90%;
    height: 60%;
}

.card-bg-bottom {
    background: rgba(247, 249, 241, 0.9);

    grid-column: 1 / -1;
    grid-row: 3;

    margin: auto;

    width: 90%;
    height: 60%;
}

.card-text {
    display: flex;
    flex-direction: column;
    justify-content: center;

    grid-column: 1;
    grid-row: 1 / -1;
    
    padding-left: 8%;

    z-index: 5;
}

.text-group {
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: center;

    grid-column: 1;
    grid-row: 2;
    
    padding: 2% 0 2% 12%;

    height: 100%;

    z-index: 5;
}

.text-model {
    font-size: clamp(1.2rem, 2.2vw, 2.5rem);
    text-transform: uppercase;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    color: #FCFCFC;

    margin-bottom: 1vh;
}

.text-brand {
    font-size: clamp(1.5rem, 3.5vw, 4rem);
    text-transform: uppercase;
    color: #4a4a4a;
}

.card-img {
    display: block;
    grid-column: 2; 
    grid-row: 2;

    align-self: center;
    justify-self: center;

    width: auto;
    max-width: 65%;
    max-height: 85%;

    filter: drop-shadow(5px 10px 10px rgba(0,0,0,0.4));
    object-fit: contain;

    z-index: 6;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: clamp(30px, 5%, 60px);

    z-index: 20;
}

.arrow-left { left: 0%; } 
.arrow-right { right: 0%; }

.arrow img { width: 100%; height: auto; display: block; }

.controls {
    display: flex;
    justify-content: center;
    align-items: center;

    align-self: flex-end;

    margin-top: 1rem;

    min-height: 4rem;
    width: 60%;
    max-width: 1000px;
}

.btn-primary {
    font-family: 'Amsi Pro AKS Condensed', sans-serif;
    font-size: clamp(1rem, 3vw, 2.5rem);
    color: white;
    text-align: center;

    display: inline-flex;
    justify-content: center;
    align-items: center;
    
    background: #451d63;

    padding: 0.3em 1.5em 0.5em 1.5em;

    line-height: 1;
    
    border: 4px solid #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);

    transition: 0.2s;
    cursor: pointer;
}

.btn-primary:hover {
    color: #e8f000;

    background: #714494;

    transform: scale(1.05);
}

.hidden { display: none; }
.disabled { opacity: 0.7; cursor: default; pointer-events: none; }

@keyframes glowing {
    from { border-color: #fcf690; box-shadow: 0 0 20px #fcf690; }
    to { border-color: #BEFFF7; box-shadow: 0 0 50px #BEFFF7; }
}

.flash {
    background: white;
    opacity: 0;

    position: fixed;
    top: 0%; 
    left: 0%;

    width: 100%; 
    height: 100%;
    
    transition: opacity 0.3s ease-out;
    pointer-events: none;
    z-index: 9999;
}
.flash.active { opacity: 1; }