.lucky-wheel-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    position: relative;
    width: 100%;
    height: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lucky-wheel-input-container {
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.lucky-wheel-input-row {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.lucky-wheel-input-field {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.lucky-wheel-input-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
    text-align: left;
}

.lucky-wheel-input-field input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.lucky-wheel-input-field input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.lucky-wheel-input-group {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lucky-wheel-check-button {
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.lucky-wheel-check-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.lucky-wheel-check-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.lucky-wheel-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    display: none;
}

.lucky-wheel-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.lucky-wheel-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.lucky-wheel-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Make it square */
    border-radius: 50%;
}

.lucky-wheel-wheel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
    overflow: hidden; /* Additional overflow hidden for wheel container */
}

.lucky-wheel-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lucky-wheel-pointer-container {
    position: absolute;
    top: var(--pointer-margin-top, 5%);
    left: 50%;
    transform: translateX(-50%);
    width: var(--pointer-size, 60px);
    height: var(--pointer-size, 60px);
    z-index: 1000;
    pointer-events: none;
    /* Ensure pointer stays above the overflow hidden wrapper */
}

.lucky-wheel-pointer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.lucky-wheel-spin-button-container {
    position: absolute;
    top: calc(100% + var(--spin-button-margin-top, 10%));
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    pointer-events: none; /* Allow click to pass through container */
}

.lucky-wheel-spin-button {
    position: relative;
    width: var(--spin-button-size, 100px);
    height: auto;
    max-height: var(--spin-button-size, 100px);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Re-enable click for button */
}

.lucky-wheel-spin-image {
    width: 100% !important;
    height: auto !important;
    border-radius: 0;
    object-fit: contain;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    display: block;
}

.lucky-wheel-spin-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.lucky-wheel-spin-button:active {
    transform: scale(0.95);
}

.lucky-wheel-spin-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.lucky-wheel-spin-button:disabled:hover {
    transform: none;
}

.lucky-wheel-result {
    margin-top: 10px;
    text-align: center;
    font-size: 20px;
    color: #333;
    min-height: 30px;
    width: 100%;
}

/* Responsive */
@media (max-width: 480px) {
    .lucky-wheel-input-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .lucky-wheel-input-field {
        min-width: 100%;
    }
    
    .lucky-wheel-pointer-container {
        top: var(--pointer-margin-top, 5%);
        width: calc(var(--pointer-size, 60px) * 0.83);
        height: calc(var(--pointer-size, 60px) * 0.83);
    }
    
    .lucky-wheel-result {
        margin-top: 8px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .lucky-wheel-input-field input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .lucky-wheel-check-button {
        font-size: 14px;
        padding: 12px 20px;
    }
    
    .lucky-wheel-pointer-container {
        top: var(--pointer-margin-top, 5%);
        width: calc(var(--pointer-size, 60px) * 0.67);
        height: calc(var(--pointer-size, 60px) * 0.67);
    }
    
    .lucky-wheel-result {
        margin-top: 5px;
        font-size: 16px;
    }
}

/* Animation classes */
.lucky-wheel-spinning {
    pointer-events: none;
}

.lucky-wheel-result.show {
    animation: smoothResultAppear 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               resultPulse 3s cubic-bezier(0.4, 0, 0.6, 1) 1.8s infinite alternate;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }}

@keyframes smoothResultAppear {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.6) rotateX(45deg);
        filter: blur(5px) brightness(0.5);
        text-shadow: 0 0 0 transparent;
    }
    25% {
        opacity: 0.4;
        transform: translateY(10px) scale(0.9) rotateX(20deg);
        filter: blur(3px) brightness(0.8);
        text-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    }
    50% {
        opacity: 0.8;
        transform: translateY(-8px) scale(1.15) rotateX(-5deg);
        filter: blur(1px) brightness(1.2);
        text-shadow: 0 4px 12px rgba(76, 175, 80, 0.6);
    }
    75% {
        opacity: 0.95;
        transform: translateY(3px) scale(0.95) rotateX(2deg);
        filter: blur(0px) brightness(1.1);
        text-shadow: 0 6px 16px rgba(76, 175, 80, 0.8);
    }
    90% {
        opacity: 1;
        transform: translateY(-1px) scale(1.02) rotateX(0deg);
        filter: blur(0px) brightness(1);
        text-shadow: 0 8px 20px rgba(76, 175, 80, 1);
    }
    100% {
        opacity: 1;
        transform: translateY(0px) scale(1) rotateX(0deg);
        filter: blur(0px) brightness(1);
        text-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    }
}

@keyframes resultPulse {
    0% {
        transform: translateY(0px);
        text-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
        filter: brightness(1);
    }
    12.5% {
        transform: translateY(-1.5px);
        text-shadow: 0 4.5px 13px rgba(76, 175, 80, 0.45);
        filter: brightness(1.025);
    }
    25% {
        transform: translateY(-3px);
        text-shadow: 0 5px 15px rgba(76, 175, 80, 0.5);
        filter: brightness(1.05);
    }
    37.5% {
        transform: translateY(-1.5px);
        text-shadow: 0 5.5px 16px rgba(76, 175, 80, 0.6);
        filter: brightness(1.075);
    }
    50% {
        transform: translateY(0px);
        text-shadow: 0 6px 18px rgba(76, 175, 80, 0.7);
        filter: brightness(1.1);
    }
    62.5% {
        transform: translateY(1.5px);
        text-shadow: 0 5.5px 16px rgba(76, 175, 80, 0.6);
        filter: brightness(1.075);
    }
    75% {
        transform: translateY(3px);
        text-shadow: 0 5px 15px rgba(76, 175, 80, 0.5);
        filter: brightness(1.05);
    }
    87.5% {
        transform: translateY(1.5px);
        text-shadow: 0 4.5px 13px rgba(76, 175, 80, 0.45);
        filter: brightness(1.025);
    }
    100% {
        transform: translateY(0px);
        text-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
        filter: brightness(1);
    }
}

/* Popup image styling */
.prize-image-popup {
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
    border: 3px solid #4CAF50 !important;
    object-fit: cover !important;
    transition: transform 0.3s ease !important;
}

.prize-image-popup:hover {
    transform: scale(1.05) !important;
}

/* SweetAlert2 custom styling for prize popup */
.swal2-popup.swal2-show {
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4) !important;
}

.swal2-title {
    font-size: 28px !important;
    color: #4CAF50 !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1) !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 10px 20px !important;
}

.swal2-confirm {
    border-radius: 25px !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4) !important;
    transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.6) !important;
}

/* Player Info Modal Styles */
.player-info-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    z-index: 10000 !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    animation: fadeIn 0.3s ease !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

/* When modal is shown */
.player-info-modal[style*="display: flex"] {
    display: flex !important;
}

.player-info-modal-content {
    background: white !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    width: 90% !important;
    max-width: 500px !important;
    max-height: calc(100vh - 40px) !important;
    overflow-y: auto !important;
    animation: slideIn 0.3s ease !important;
    margin: 0 auto !important;
    position: relative !important;
}

.player-info-modal-header {
    position: relative;
    padding: 15px 15px 0px;;
    border-bottom: none;
    background: none;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
}

.modal-title-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.player-info-modal-close {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.player-info-modal-close:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #ff0000;
    transform: scale(1.1);
}

/* Override any container constraints for modal */
.player-info-modal * {
    box-sizing: border-box !important;
}

/* Ensure modal appears above everything */
body.modal-open {
    overflow: hidden !important;
}

.player-info-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    display: none; /* Hide text title since we're using image */
}

.player-info-modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 10px;
    background: #4eb3ea;
    border-radius: 25px;
    padding: 0;
    overflow: hidden;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: white;
    font-size: 16px;
    padding: 5px 30px;
    margin: 0;
    background: transparent;
    border-radius: 0;
}

.form-group .required {
    color: #ffeb3b;
    font-weight: bold;
}

.form-group input {
    width: 80%;
    padding: 5px 20px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    background: white;
    box-sizing: border-box;
    margin: 0 25px 5px;
}

.form-group input:focus {
    border: none;
    box-shadow: 0 0 10px rgba(124, 179, 66, 0.3);
    outline: none;
}

.form-group input::placeholder {
    font-size: 14px;
    color: #999;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 5px;
    padding: 5px;
}

.footer-decoration {
    max-width: 70px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.btn-submit {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s ease;
    flex: 1;
    max-width: 200px;
}

.btn-submit:hover {
    transform: scale(1.05);
}

.btn-submit img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Hide old form-buttons styles */
.form-buttons {
    display: none;
}

.btn-cancel,
.btn-confirm {
    display: none;
}

/* Spin button text */
.spin-button-text {
    font-weight: bold;
    font-size: 14px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Modal animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive design for modal */
@media (max-width: 600px) {
    .player-info-modal-content {
        width: 95%;
        margin: 0 auto;
        max-height: calc(100vh - 60px);
    }
    
    .player-info-modal-close {
        top: 3px;
        right: 3px;
        width: 25px;
        height: 25px;
        font-size: 18px;
    }
    
    .player-info-modal-header h3 {
        font-size: 18px;
    }
    
    .player-info-modal-body {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 14px;
        padding: 5px 25px;
    }
    
    .form-group input {
        padding: 12px 15px;
        font-size: 14px;
        margin: 0 20px 5px;
    }
    
    .form-group input::placeholder {
        font-size: 14px;
    }
    
    .form-footer {
        gap: 8px;
        margin-top: 5px;
        padding: 5px;
    }
    
    .footer-decoration {
        max-width: 70px;
    }
    
    /* Hide old responsive styles */
    .form-buttons {
        display: none;
    }
    
    .btn-cancel,
    .btn-confirm {
        display: none;
    }
}

/* Responsive and Display Mode Styles */
.lucky-wheel-container.floating {
    position: fixed;
    z-index: 9999;
    margin: 0;
    border-radius: 15px;
    padding: 10px;
    transition: all 0.3s ease;
}

/* Floating inside target element */
.lucky-wheel-container.floating[style*="position: absolute"] {
    position: absolute !important;
    z-index: 999;
}

/* Floating positioning handled by JavaScript based on margin settings */

/* Floating collapse/expand button - REMOVED for direct display */
/* .floating-toggle removed - no longer needed */

.lucky-wheel-container.floating .floating-toggle {
    display: none !important; /* Hide toggle button completely */
}

.lucky-wheel-container.floating.collapsed .wheel-content {
    display: block !important; /* Always show wheel content */
}

.lucky-wheel-container.floating.collapsed {
    /* Remove collapsed state - always show full wheel */
    width: auto !important;
    height: auto !important;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.floating-icon {
    display: none !important; /* Hide floating icon */
}

.lucky-wheel-container.floating.collapsed .floating-icon {
    display: none !important; /* Always hide floating icon */
}

/* Root level CSS variables with defaults */
:root {
    --wheel-scale-desktop: 70%;
    --wheel-scale-mobile: 90%;
    --wheel-margin-top-desktop: 5%;
    --wheel-margin-top-mobile: 3%;
    --wheel-margin-left-desktop: 10%;
    --wheel-margin-left-mobile: 5%;
    --pointer-margin-top: 5%;
}

/* Responsive Scaling */
.lucky-wheel-container:not(.floating) {
    /* Default sizes */
    max-width: 500px;
    width: 100%;
    margin: var(--wheel-margin-top-desktop, 5%) auto 20px var(--wheel-margin-left-desktop, 10%);
}

@media (min-width: 481px) {
    .lucky-wheel-container:not(.floating) {
        max-width: var(--wheel-scale-desktop, 70%);
        width: var(--wheel-scale-desktop, 70%);
        margin: var(--wheel-margin-top-desktop, 5%) auto 20px var(--wheel-margin-left-desktop, 10%);
    }
}

@media (max-width: 480px) {
    .lucky-wheel-container:not(.floating) {
        max-width: var(--wheel-scale-mobile, 90%);
        width: var(--wheel-scale-mobile, 90%);
        margin: var(--wheel-margin-top-mobile, 3%) auto 15px var(--wheel-margin-left-mobile, 5%);
    }
    
    .lucky-wheel-container.floating {
        /* JavaScript will handle positioning and sizing based on responsive settings */
        max-width: calc(100vw - 20px);
    }
}

/* Smooth animations */
.lucky-wheel-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lucky-wheel-container.floating {
    animation: smoothResultAppear 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
               resultPulse 5s ease-in-out 1.8s infinite alternate;
}

.lucky-wheel-container.floating.center {
    /* Ensure center transform is preserved during animations */
    animation: fadeInFloatCenter 0.5s ease-out;
}

@keyframes fadeInFloat {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInFloatCenter {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.lucky-wheel-container.floating.collapsed {
    animation: collapseFloat 0.3s ease-out;
}

@keyframes collapseFloat {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(0.2);
    }
}

/* Debug helper - can be removed in production */
.lucky-wheel-container[data-debug="true"]::before {
    content: 'Mode: ' attr(data-display-mode) ' | Desktop: ' var(--wheel-scale-desktop) ' (Top: ' var(--wheel-margin-top-desktop) ', Left: ' var(--wheel-margin-left-desktop) ') | Mobile: ' var(--wheel-scale-mobile) ' (Top: ' var(--wheel-margin-top-mobile) ', Left: ' var(--wheel-margin-left-mobile) ')';
    position: absolute;
    top: -30px;
    left: 0;
    font-size: 12px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px;
    border-radius: 3px;
    z-index: 10001;
    white-space: nowrap;
}

/* Custom styles for prize image popup */
.prize-popup-only-image .swal2-image {
    object-fit: cover;
}

.prize-popup-only-image .swal2-close {
    font-size: 24px;
    font-weight: bold;
    color: #999;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    line-height: 35px;
    top: 10px;
    right: 10px;
}

.prize-popup-only-image .swal2-close:hover {
    color: #666;
    background: rgba(255, 255, 255, 0.9);
}

/* New transparent popup styles */
.prize-popup-transparent {
    border: none !important;
    box-shadow: none !important;
}

/* Custom close button hover effect is handled inline in JavaScript */