/* Wheel Fortune CSS - Fixed Version for Mobile */
/* Hide scrollbars but keep scroll functionality */
html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
.portrait-container::-webkit-scrollbar {
    display: none !important;
}

.portrait-container {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

/* Fix wheel size to NOT overflow the frame */
.wrap-fortuneWheel {
    width: 100% !important;
    max-width: 414px !important;
    margin: 0 auto !important;
    padding: 15px !important;
    box-sizing: border-box !important;
    background-size: contain !important;
    overflow: hidden !important;
}

.innerWheel {
    width: 100% !important;
    max-width: 280px !important; 
    margin: 0 auto !important;
    padding: 15px !important; 
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* CRITICAL: Reduce canvas size to fit within frame */
#fortuneWheel {
    width: 220px !important; 
    height: 220px !important; 
    max-width: 220px !important;
    max-height: 220px !important;
    display: block !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Text frame adjustment */
.wrap-text-frame {
    max-width: 280px !important;
    margin: 0 auto 10px auto !important;
    padding: 8px !important;
    font-size: 0.7rem !important;
    box-sizing: border-box !important;
}

/* Arrow pointer adjustment */
.wrap-fortuneWheel .innerWheel::before {
    width: 30px !important;
    height: 30px !important;
    margin: 0 auto -20px auto !important;
}

/* Button positioning */
.btn-warning {
    max-width: 150px !important;
    margin: 15px auto !important;
    display: block !important;
}

/* Mobile specific fixes */
@media screen and (max-width: 480px) {
    .wrap-fortuneWheel {
        max-width: 350px !important;
        padding: 10px !important;
    }
    
    .innerWheel {
        max-width: 260px !important;
        padding: 10px !important;
    }
    
    #fortuneWheel {
        width: 220px !important;
        height: 220px !important;
        max-width: 220px !important;
        max-height: 220px !important;
    }
    
    .wrap-text-frame {
        max-width: 260px !important;
        margin: 0 auto 8px auto !important;
        padding: 6px !important;
        font-size: 0.6rem !important;
    }
    
    .wrap-fortuneWheel .innerWheel::before {
        width: 25px !important;
        height: 25px !important;
        margin: 0 auto -15px auto !important;
    }
}

@media screen and (max-width: 375px) {
    .wrap-fortuneWheel {
        max-width: 300px !important;
    }
    
    .innerWheel {
        max-width: 240px !important;
    }
    
    #fortuneWheel {
        width: 220px !important;
        height: 220px !important;
        max-width: 220px !important;
        max-height: 220px !important;
    }
    
    .wrap-text-frame {
        max-width: 240px !important;
        font-size: 0.55rem !important;
    }
}

@media screen and (max-width: 320px) {
    .innerWheel {
        max-width: 220px !important;
    }
    
    #fortuneWheel {
        width: 160px !important;
        height: 160px !important;
        max-width: 160px !important;
        max-height: 160px !important;
    }
}

/* Container constraints */
.wheel-container {
    max-width: 414px !important;
    margin: 0 auto !important;
    overflow-x: hidden !important;
    padding: 5px !important;
}

.container-fluid {
    max-width: 414px !important;
    margin: 0 auto !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    overflow-x: hidden !important;
}

/* Force proper sizing */
canvas {
    object-fit: contain !important;
}

/* Remove any conflicting styles */
figure {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure main content is scrollable but hide scrollbar */
main.wheel-container {
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

main.wheel-container::-webkit-scrollbar {
    display: none !important;
}

/* Main container - prevent overflow */
.wheel-container {
    padding: 10px;
    background: transparent;
    width: 100%;
    max-width: 100vw;
    overflow: hidden;
    box-sizing: border-box;
}

/* Responsive wheel center container */
.wheel-center {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* SVG Wheel Styling - fully responsive */
.wheel-svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    transform-origin: center center;
    transition: transform 4s cubic-bezier(0.23, 1, 0.32, 1);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Wheel Pointer - responsive */
.wheel-pointer {
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #FFD700;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
    z-index: 10;
}

/* Spin Button - responsive */
.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle, #FFD700 0%, #FFA500 70%, #B8860B 100%);
    border: 3px solid #8B4513;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.spin-button:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 215, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.spin-button:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.98);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666 0%, #333 100%);
}

.spin-text {
    color: #000;
    font-weight: bold;
    font-size: 9px;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
    line-height: 1.1;
    padding: 0 3px;
}

/* Bonus Banner - mobile optimized */
.bonus-banner {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 165, 0, 0.1) 100%);
    border: 2px solid #FFD700;
    border-radius: 8px;
    padding: 12px;
    margin: 10px;
    box-sizing: border-box;
}

.bonus-title {
    color: #FFD700;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    font-size: 1rem;
}

.bonus-subtitle {
    color: #FFA500;
    font-size: 0.85rem;
}

/* Wheel Wrapper - constrain width */
.wheel-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Winners Ticker - mobile friendly */
.winners-ticker {
    background: linear-gradient(90deg, #000 0%, #1a1a1a 50%, #000 100%);
    border-top: 1px solid #FFD700;
    border-bottom: 1px solid #FFD700;
    padding: 8px 0;
    overflow: hidden;
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: ticker 30s linear infinite;
}

.ticker-label {
    color: #FFD700;
    font-weight: bold;
    margin-right: 15px;
    font-size: 0.9rem;
}

.ticker-item {
    color: #FFA500;
    margin-right: 30px;
    font-size: 0.85rem;
}

.ticker-item strong {
    color: #FFD700;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Spins Counter */
.spins-counter {
    margin-top: 15px;
    text-align: center;
}

.badge.bg-gold {
    background-color: #FFD700 !important;
    color: #000 !important;
    font-size: 0.9rem;
    font-weight: bold;
    padding: 6px 12px;
    border: 2px solid #B8860B;
}

/* Win Modal */
.win-animation {
    animation: celebrate 0.5s ease-in-out;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.win-title {
    color: #FFD700;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.win-prize {
    font-size: 1.2rem;
    color: #FFA500;
    font-weight: bold;
}

/* Enhanced Mobile Responsive Design */
@media (max-width: 576px) {
    .wheel-container {
        padding: 5px;
    }
    
    .wheel-center {
        width: 100%;
        max-width: 260px;
        height: 260px;
    }
    
    .wheel-svg {
        max-width: 100%;
        max-height: 100%;
    }
    
    .spin-button {
        width: 60px;
        height: 60px;
    }
    
    .spin-text {
        font-size: 8px;
    }
    
    .wheel-pointer {
        top: -2px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 16px solid #FFD700;
    }
    
    .bonus-banner {
        margin: 5px;
        padding: 10px;
    }
    
    .bonus-title {
        font-size: 0.9rem;
    }
    
    .bonus-subtitle {
        font-size: 0.75rem;
    }
}

@media (max-width: 414px) {
    .wheel-center {
        max-width: 240px;
        height: 240px;
    }
    
    .spin-button {
        width: 55px;
        height: 55px;
    }
    
    .spin-text {
        font-size: 7px;
    }
}

@media (max-width: 375px) {
    .wheel-center {
        max-width: 220px;
        height: 220px;
    }
    
    .spin-button {
        width: 50px;
        height: 50px;
    }
    
    .spin-text {
        font-size: 6px;
    }
    
    .wheel-pointer {
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-top: 14px solid #FFD700;
    }
}

/* Extra small screens */
@media (max-width: 320px) {
    .wheel-center {
        max-width: 200px;
        height: 200px;
    }
    
    .spin-button {
        width: 45px;
        height: 45px;
    }
    
    .bonus-banner {
        margin: 3px;
        padding: 8px;
    }
}

/* Fix for SVG text positioning */
.wheel-svg text {
    pointer-events: none;
    user-select: none;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-anchor: middle;
    dominant-baseline: central;
}

/* Force proper rendering */
.wheel-svg * {
    vector-effect: non-scaling-stroke;
}

/* Button Gold Style Override */
.btn-gold {
    background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
    border: 2px solid #8B4513;
    color: #000;
    font-weight: bold;
    padding: 8px 20px;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.5);
}

/* Ensure no horizontal overflow */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

.wheel-container * {
    max-width: 100%;
}

/* Fix modal sizing on mobile */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        padding: 10px;
    }
}