html, body { height: 100%; margin: 0; padding: 0; overflow: hidden; }

body {
    background-color: #050505;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    font-family: 'Roboto', sans-serif;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: url("background.png") center center / cover no-repeat;
    box-shadow: inset 0 0 250px rgba(0,0,0,1);
    filter: brightness(0.5) blur(2px);
}

.container {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
}

.title {
    font-size: 28px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0;
    padding: 0 20px;
    background: linear-gradient(to bottom, #fffadb 0%, #e6b800 50%, #b8860b 51%, #fffadb 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 4px 0 #3e2600);
    opacity: 0;
    transform: translateY(-20px);
    animation: slideDownFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.wheel-wrapper {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 10px 0;
    transform: translateZ(0); 
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.9));
    opacity: 0;
    transform: scale(0.8);
    animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 0.2s;
}

.wheel-wrapper::before {
    content: "";
    position: absolute;
    top: -15px; left: -15px; right: -15px; bottom: -15px;
    border-radius: 50%;
    z-index: 0;
    background: radial-gradient(transparent 65%, #111 66%), conic-gradient(from 0deg, #333 0%, #000 100%);
    border: 3px solid #444;
    box-shadow: 0 0 20px #000;
}

.wheel-wrapper .lights-ring {
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    border-radius: 50%;
    border: 6px dotted #7a5c29;
    z-index: 1;
    box-shadow: inset 0 0 10px #000;
    animation: lights-blink 2s infinite alternate;
}

.wheel-wrapper::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
    box-sizing: border-box;
    border: 14px solid transparent;
    background: linear-gradient(135deg, #fceabb 0%, #fccd4d 50%, #f8b500 51%, #fbdf93 100%) border-box; 
    -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor; 
    mask-composite: exclude;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 5px rgba(255, 230, 100, 0.5);
}

.stopper {
    position: absolute;
    top: -30px; left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    width: 50px; height: 60px;
    background: radial-gradient(circle at 30% 30%, #ff6666, #cc0000, #550000);
    clip-path: polygon(50% 100%, 0 10%, 10% 0, 90% 0, 100% 10%);
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.8));
    border-top: 2px solid rgba(255,255,255,0.4);
}

.stopper.hit {
    animation: stopperHit 0.1s ease-out forwards;
}

.wheel {
    width: 100%; height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(#333 1px, transparent 1px) 0 0 / 10px 10px, radial-gradient(#222 1px, transparent 1px) 5px 5px / 10px 10px, #111;
    transition: transform 6s cubic-bezier(0.15, 0, 0.15, 1);
    will-change: transform;
    transform: translate3d(0,0,0); 
    contain: strict;
    box-shadow: inset 0 0 50px #000;
}

.wheel.idle {
    animation: idleSpin 60s infinite linear;
}

.wheel-shine {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 4; 
    background: linear-gradient(135deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

.sector {
    position: absolute;
    width: 50%; height: 50%;
    overflow: hidden;
    box-sizing: border-box;
    backface-visibility: hidden;
}

.sector-1, .sector-3 { background-color: #0a0a0a; }
.sector-2, .sector-4 { background-color: #1a1a1a; }

.sector .content {
    position: absolute;
    width: 110px; height: 110px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center center;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.sector.winner-flash .content {
    animation: sectorFlash 1s ease-out infinite;
    z-index: 10;
}

.sector.winner-flash::after {
    content: "";
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 215, 0, 0.4);
    mix-blend-mode: overlay;
    animation: simpleFlash 0.5s 3;
}

.sector-1 { top: 0; left: 0; border-right: 1px solid #b38728; border-bottom: 1px solid #b38728; }
.sector-1 .content { bottom: -20%; right: -20%; background-image: url('beton.png'); transform: rotate(-45deg) translate(0, -65px); }

.sector-2 { top: 0; right: 0; border-left: 1px solid #b38728; border-bottom: 1px solid #b38728; }
.sector-2 .content { bottom: -20%; left: -20%; background-image: url('ggbet.png'); transform: rotate(45deg) translate(0, -65px); }

.sector-3 { bottom: 0; right: 0; border-left: 1px solid #b38728; border-top: 1px solid #b38728; }
.sector-3 .content { top: -20%; left: -20%; background-image: url('vegas.png'); transform: rotate(135deg) translate(0, -65px); }

.sector-4 { bottom: 0; left: 0; border-right: 1px solid #b38728; border-top: 1px solid #b38728; }
.sector-4 .content { top: -20%; right: -20%; background-image: url('first.png'); transform: rotate(225deg) translate(0, -65px); }

.center-circle {
    position: absolute;
    width: 75px; height: 75px;
    background: conic-gradient(#e6b800, #fffadb, #e6b800, #b8860b, #e6b800);
    border: 4px solid #fff;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 15px rgba(0,0,0,1), inset 0 0 10px rgba(255,255,255,0.5);
    z-index: 6;
}
.center-circle::after {
    content: "";
    position: absolute;
    top: 15%; left: 15%; right: 15%; bottom: 15%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fff, #ffd700);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}

.main-btn {
    position: relative;
    overflow: visible;
    background: linear-gradient(180deg, #ff4d4d 0%, #cc0000 50%, #990000 100%);
    color: #fff;
    border: 3px solid #b8860b;
    padding: 18px 90px;
    font-size: 24px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 900;
    text-transform: uppercase;
    box-shadow: 0 6px 0 #5e0000, 0 10px 20px rgba(0,0,0,0.5);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    opacity: 0; 
    transform: translateY(30px);
    animation: slideUpFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, goldPulse 2s infinite ease-in-out 1s; 
}

.main-btn:active { top: 4px; box-shadow: 0 2px 0 #5e0000, 0 5px 10px rgba(0,0,0,0.5); }

.main-btn:disabled { 
    filter: grayscale(1); 
    cursor: not-allowed;
    animation: slideUpFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.main-btn::after {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    background: rgba(255, 215, 0, 0.6);
    border-radius: 50px;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    z-index: -1; 
}

.main-btn:active::after {
    animation: rippleWave 0.4s ease-out;
}

.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(8px);
    display: none; justify-content: center; align-items: center; z-index: 100;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-box {
    position: relative; width: 300px; padding: 40px 20px;
    background: radial-gradient(circle at center, #222, #000);
    border: 4px solid #b8860b;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
    transform: scale(0.5); 
    opacity: 0;
    overflow: hidden; 
}

.modal-overlay.active { opacity: 1; }
.modal-overlay.active .modal-box { animation: winnerPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.modal-overlay.closing { opacity: 0; pointer-events: none; }
.modal-overlay.closing .modal-box { animation: winnerClose 0.4s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards; }

.modal-box::after {
    content: "";
    position: absolute;
    top: 0; left: -150%; 
    width: 100%; height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 215, 0, 0.1) 40%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 215, 0, 0.1) 60%, transparent 100%);
    transform: skewX(-25deg);
    animation: shineSweep 2.5s infinite; 
    pointer-events: none;
}

.result-title {
    font-size: 32px; margin: 0 0 25px 0;
    background: linear-gradient(to bottom, #fff, #ffd700);
    background-clip: text; -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    text-transform: uppercase;
    filter: drop-shadow(0 0 10px rgba(255,215,0,0.5));
}

.modal-btn {
    position: relative; z-index: 2;
    background: #cc0000; color: white; border: 2px solid #ffd700;
    padding: 15px 50px; font-size: 20px; border-radius: 40px; font-weight: bold;
    box-shadow: 0 5px 0 #800000;
}

.close-btn { 
    position: absolute; top: 10px; right: 10px; width: 35px; height: 35px; 
    background: transparent; border: none; z-index: 10; cursor: pointer;
}

.particles {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}

.particle {
    position: absolute; bottom: -10px;
    width: 6px; height: 6px;
    background: #ffd700;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffd700;
    opacity: 0;
    animation: floatUp 10s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-duration: 8s; animation-delay: 0s; }
.particle:nth-child(2) { left: 30%; animation-duration: 12s; animation-delay: 2s; transform: scale(1.5); }
.particle:nth-child(3) { left: 50%; animation-duration: 10s; animation-delay: 4s; }
.particle:nth-child(4) { left: 70%; animation-duration: 7s; animation-delay: 1s; transform: scale(0.8); }
.particle:nth-child(5) { left: 90%; animation-duration: 15s; animation-delay: 3s; }

@keyframes lights-blink {
    0% { border-color: #7a5c29; box-shadow: inset 0 0 0 transparent; }
    50% { border-color: #ffd700; box-shadow: 0 0 15px #ffd700, inset 0 0 5px #ffd700; }
    100% { border-color: #7a5c29; box-shadow: inset 0 0 0 transparent; }
}

@keyframes slideDownFade { to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { to { opacity: 1; transform: scale(1); } }
@keyframes slideUpFade { to { opacity: 1; transform: translateY(0); } }

@keyframes winnerPop {
    0% { opacity: 0; transform: scale(0.5) translateY(50px); }
    60% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes winnerClose {
    0% { opacity: 1; transform: scale(1); }
    20% { transform: scale(1.1); }
    100% { opacity: 0; transform: scale(0) translateY(50px); }
}

@keyframes shineSweep {
    0% { left: -150%; }
    20% { left: 150%; }
    100% { left: 150%; }
}

@keyframes goldPulse {
    0% { box-shadow: 0 6px 0 #5e0000, 0 10px 20px rgba(0,0,0,0.5); transform: scale(1); }
    50% { box-shadow: 0 6px 0 #5e0000, 0 0 40px rgba(255, 215, 0, 0.7), inset 0 0 15px rgba(255, 215, 0, 0.3); transform: scale(1.03) translateY(-2px); }
    100% { box-shadow: 0 6px 0 #5e0000, 0 10px 20px rgba(0,0,0,0.5); transform: scale(1); }
}

@keyframes stopperHit {
    0% { transform: translateX(-50%) rotate(0deg); }
    40% { transform: translateX(-50%) rotate(-25deg); }
    100% { transform: translateX(-50%) rotate(0deg); }
}

@keyframes sectorFlash {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3)) brightness(1); }
    50% { filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1)) brightness(2) contrast(1.5); transform: scale(1.1); }
}

@keyframes simpleFlash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes floatUp {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    100% { transform: translateY(-110vh) rotate(360deg); opacity: 0; }
}

@keyframes idleSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rippleWave {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}
