/* ============================================
   RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    height: 100vh;
    overflow: hidden;
    background-color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ============================================
   GAME WRAPPER
   ============================================ */
.game-wrapper {
    position: relative;
    height: 100vh;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}

/* Desktop Responsive Breakpoints */
@media (min-width: 640px) {
    .game-wrapper {
        max-width: 600px;
    }
}

@media (min-width: 768px) {
    .game-wrapper {
        max-width: 468px;
    }
}

@media (min-width: 1024px) {
    .game-wrapper {
        max-width: 900px;
    }
}

@media (min-width: 1280px) {
    .game-wrapper {
        width: 28%;
        max-width: 900px;
    }
}

@media (min-width: 1536px) {
    .game-wrapper {
        max-width: 900px;
    }
}

/* ============================================
   BACKGROUND IMAGE
   ============================================ */
.background-image {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   LOGO & TEXT ELEMENTS
   ============================================ */
.logo-text {
    position: absolute;
    z-index: 40;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
}

.promo-text {
    position: absolute;
    z-index: 40;
    top: 14%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
}

/* ============================================
   WHEEL CONTAINER & ELEMENTS
   ============================================ */
.wheel-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    top: 25%;
    width: 100%;
    padding-top: 50%;
    overflow: visible;
}

.wheel-frame {
    position: absolute;
    top: 70%;
    left: 0;
    width: 100%;
    z-index: 20;
}

.wheel {
    position: absolute;
    top: 22%;
    left: 9%;
    width: 83%;
    z-index: 10;
    transform-origin: center center;
    transform: rotate(0deg);
}

.wheel.spinning {
    transition: transform 4s cubic-bezier(0.23, 1, 0.32, 1);
}

.wheel.finished {
    transition: none !important;
}

.needle {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    z-index: 30;
}

/* ============================================
   SPIN BUTTON
   ============================================ */
.spin-button-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    width: 70%;
    max-width: 180px;
    min-width: 100px;
    top: 73%;
}

.spin-button {
    cursor: pointer;
    outline: none;
    background: none;
    border: none;
    padding: 0;
    width: 100%;
}

.spin-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.spin-button-img {
    display: block;
    width: 100%;
    height: auto;
    animation: pulse 2s infinite;
}

.spin-button:active .spin-button-img {
    transform: scale(1.05);
    transition: transform 0.2s;
}

/* Mobile Responsive Adjustments for Spin Button */
@media (max-width: 440px) {
    .spin-button-container {
        width: 32%;
        bottom: 2%;
        max-width: 160px;
    }
}

@media (max-width: 428px) {
    .spin-button-container {
        width: 34%;
        bottom: 2%;
        max-width: 150px;
    }
}

@media (max-width: 390px) {
    .spin-button-container {
        width: 36%;
        bottom: 1.5%;
        max-width: 140px;
    }
}

@media (max-width: 360px) {
    .spin-button-container {
        width: 38%;
        bottom: 1%;
        max-width: 130px;
    }
}

@media (max-height: 670px) {
    .spin-button-container {
        bottom: 1%;
        width: 28%;
    }
}

/* ============================================
   BOTTOM DECORATION
   ============================================ */
.bottom-decoration {
    position: absolute;
    bottom: -1%;
    z-index: 30;
}

.coin-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   POPUP STYLES
   ============================================ */
.pop1 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pop1.hidden {
    display: none;
}

.popup-message-image {
    width: 85%;
    max-width: 400px;
    animation: popupPop 0.3s ease-out;
}

.popup-button-container {
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    align-items: center;
    width: 100%;
}

.popup-button {
    width: 60%;
    max-width: 250px;
    cursor: pointer;
    transition: transform 0.2s;
}

.popup-button:hover {
    transform: scale(1.05);
}

/* ============================================
   HIDE ON POPUP
   ============================================ */
.hide-on-popup.hidden {
    display: none !important;
}

/* ============================================
   CURSOR POINTER
   ============================================ */
.cursor-pointer {
    cursor: pointer;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes popupPop {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes wobble {
    0% {
        transform: rotate(0deg);
    }
    15% {
        transform: rotate(5deg);
    }
    30% {
        transform: rotate(-5deg);
    }
    45% {
        transform: rotate(4deg);
    }
    60% {
        transform: rotate(-4deg);
    }
    75% {
        transform: rotate(2deg);
    }
    90% {
        transform: rotate(-1deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.wobble-animation {
    animation: wobble 1s ease-in-out;
}

/* ============================================
   CONFETTI EFFECT
   ============================================ */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 60;
    pointer-events: none;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ============================================
   GLOW EFFECT
   ============================================ */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

.spinning-glow {
    animation: glow-pulse 1s ease-in-out infinite;
    border-radius: 50%;
}

/* ============================================
   SMOOTH RELOAD ANIMATION
   ============================================ */
@keyframes smooth-reload {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(0.8) rotate(180deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.reload-animation {
    animation: smooth-reload 1s ease-in-out;
}

/* ============================================
   RESET WHEEL ANIMATION
   ============================================ */
@keyframes reset-wheel {
    0% {
        transform: rotate(var(--current-rotation));
        opacity: 0.7;
    }
    100% {
        transform: rotate(0deg);
        opacity: 1;
    }
}

.reset-animation {
    animation: reset-wheel 0.8s ease-out forwards;
}

/* ============================================
   SWEETALERT CUSTOM STYLES
   ============================================ */
.swal2-popup.sweetalert-custom-popup {
    background: transparent !important;
    width: auto !important;
    padding: 0 !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.sweetalert-custom-container {
    align-items: flex-start !important;
    padding-top: 100px !important;
}

.sweetalert-custom-popup {
    margin-top: 10px !important;
}

/* ============================================
   CLAIM POPUP CONTENT
   ============================================ */
.claim-popup-content {
    background: white;
    border-radius: 12px;
    padding: 36px 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    max-width: 450px;
    margin: 0 auto;
    text-align: center;
    overflow: hidden;
    max-height: 100%;
}

.claim-popup-content h3 {
    font-family: "Noto Sans Khmer", sans-serif;
    font-size: 18px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 12px;
}

.claim-popup-content a img {
    display: block;
    margin: 0 auto;
    max-width: 290px;
    height: auto;
}

/* ============================================
   DROP IN ANIMATION
   ============================================ */
#popupContent {
    border-radius: 10px;
    animation: dropIn 0.3s ease-out forwards;
}

#winnerContent {
    border-radius: 10px;
    animation: dropIn 0.3s ease-out forwards;
}

@keyframes dropIn {
    0% {
        transform: translateY(-100vh);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   MOBILE SPECIFIC ADJUSTMENTS
   ============================================ */
@media (max-width: 490px) {
    .scale-mobile-up {
        padding-right: 0.75rem;
        max-width: 200px !important;
    }
}
