/* Modern Wheel Page Styles */
.wheel-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: white;
}

.wheel-header {
    text-align: center;
    margin-bottom: 40px;
}

.wheel-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.wheel-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    animation: pulse 2s infinite;
}

.wheel-title h1 {
    color: white;
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.wheel-title .subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-top: 8px;
}

.wheel-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    align-items: start;
}

.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.wheel-canvas-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    z-index: 10;
    color: #ef4444;
    font-size: 28px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
    animation: bounce 2s infinite;
}

.wheel-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
    pointer-events: none;
    animation: glow 3s ease-in-out infinite alternate;
}

#wheel {
    border-radius: 50%;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.5),
        0 0 0 4px rgba(255,255,255,0.1),
        inset 0 0 0 4px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.1) 100%);
    cursor: pointer;
    transform-origin: center center;
}

#wheel:hover {
    transform: scale(1.02);
    box-shadow: 
        0 25px 80px rgba(0,0,0,0.6),
        0 0 0 4px rgba(255,255,255,0.15),
        inset 0 0 0 4px rgba(0,0,0,0.2);
}

/* Wheel spin animation */
#wheel.spinning {
    animation: wheelSpin 6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes wheelSpin {
    0% {
        transform: rotate(0deg);
    }
    30% {
        transform: rotate(calc(1080deg + var(--final-rotation, 0deg)));
    }
    70% {
        transform: rotate(calc(1080deg + var(--final-rotation, 0deg)));
    }
    100% {
        transform: rotate(calc(1080deg + var(--final-rotation, 0deg)));
    }
}

/* Smooth transition when wheel stops */
#wheel:not(.spinning) {
    transition: transform 0.1s ease-out;
}

.wheel-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 350px;
}

.wheel-spin-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border: none;
    padding: 18px 24px;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.wheel-spin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.wheel-spin-btn:hover::before {
    left: 100%;
}

.wheel-spin-btn:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

.wheel-spin-btn:active:not(.disabled) {
    transform: translateY(-1px);
}

.wheel-spin-btn.disabled {
    background: #64748b;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button animation during spin */
.wheel-spin-btn.spinning {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    animation: spinButtonPulse 1s infinite;
}

@keyframes spinButtonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(139, 92, 246, 0.5);
    }
}

.wheel-result {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    animation: slideInUp 0.5s ease;
    display: none; /* Hidden by default */
}

.wheel-result.success {
    display: flex !important;
    background: rgba(34, 197, 94, 0.1);
    border: 2px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.wheel-result.error {
    display: flex !important;
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.result-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.result-icon {
    font-size: 32px;
    color: inherit;
}

.result-text {
    text-align: left;
}

.result-title {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 8px;
    color: inherit;
}

.result-prize {
    font-size: 16px;
    color: inherit;
    margin-bottom: 4px;
    opacity: 0.9;
}

.result-amount {
    font-size: 20px;
    font-weight: 700;
    color: inherit;
    opacity: 0.8;
}

.wheel-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid;
}

.wheel-status.available {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.wheel-status.cooldown {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    border-color: rgba(251, 191, 36, 0.3);
}

.wheel-status.login-required {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border-color: rgba(156, 163, 175, 0.3);
}

/* Last spin info */
.last-spin-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.last-spin-info h4 {
    color: white;
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.last-prize {
    display: flex;
    align-items: center;
    gap: 16px;
}

.last-prize .prize-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.last-prize .prize-details {
    flex: 1;
}

.last-prize .prize-label {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.last-prize .prize-time {
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Sidebar */
.wheel-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.wheel-prizes-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.wheel-prizes-section h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: center;
    justify-content: center;
}

.prizes-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prize-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.prize-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transition: left 0.5s;
}

.prize-card:hover::before {
    left: 100%;
}

.prize-card:hover {
    transform: translateX(8px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    background: rgba(255, 255, 255, 0.12);
}

.prize-card.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.prize-card.inactive {
    opacity: 0.5;
    border-color: rgba(255, 255, 255, 0.05);
}

.prize-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.prize-info {
    flex: 1;
}

.prize-label {
    font-weight: 600;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.prize-amount {
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.prize-weight {
    color: #64748b;
    font-size: 0.85rem;
}

.no-prizes {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}

.no-prizes-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-prizes h4 {
    color: white;
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.no-prizes p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes glow {
    from {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    }
    to {
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

/* Wheel History Section */
.wheel-history-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.wheel-history-section h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: center;
    justify-content: center;
}

.spin-history {
    min-height: 200px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #94a3b8;
    font-size: 1rem;
    padding: 40px 20px;
}

.spin-history-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.spin-history-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.spin-history-item .prize-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.spin-history-item .prize-info {
    flex: 1;
}

.spin-history-item .prize-label {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.spin-history-item .prize-time {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Error and no history states */
.error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #ef4444;
    font-size: 1rem;
    padding: 40px 20px;
    text-align: center;
}

.no-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #94a3b8;
    font-size: 1rem;
    padding: 40px 20px;
    text-align: center;
}

.no-history i {
    font-size: 48px;
    opacity: 0.5;
}

.no-history p {
    margin: 0;
    font-size: 1rem;
}

/* ===== MOBILE RESPONSIVENESS ===== */

/* Tablet and small screens */
@media (max-width: 1024px) {
    .wheel-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .wheel-controls {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .wheel-prizes-section {
        margin-top: 20px;
    }
}

/* Mobile devices - main layout */
@media (max-width: 768px) {
    .wheel-page {
        padding: 16px;
        min-height: auto;
    }
    
    .wheel-header {
        margin-bottom: 30px;
    }
    
    .wheel-title {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .wheel-title h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .wheel-title .subtitle {
        font-size: 1rem;
        text-align: center;
    }
    
    .wheel-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    /* Scale down wheel for mobile */
    .wheel-canvas-container {
        transform: scale(0.85);
        margin: -20px 0;
    }
    
    .wheel-glow {
        width: 360px;
        height: 360px;
    }
    
    /* Optimize controls for mobile */
    .wheel-controls {
        max-width: 100%;
        gap: 16px;
    }
    
    .wheel-spin-btn {
        padding: 16px 20px;
        font-size: 1.1rem;
        border-radius: 14px;
    }
    
    /* Optimize result area for mobile */
    .wheel-result {
        min-height: 70px;
        padding: 16px;
        border-radius: 14px;
    }
    
    .result-content {
        gap: 16px;
    }
    
    .result-icon {
        font-size: 28px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .result-prize {
        font-size: 15px;
    }
    
    .result-amount {
        font-size: 18px;
    }
    
    /* Optimize status messages for mobile */
    .wheel-status {
        padding: 14px 16px;
        font-size: 13px;
        border-radius: 10px;
    }
    
    /* Optimize prize list for mobile */
    .wheel-prizes-section {
        padding: 20px;
        border-radius: 16px;
        margin-top: 20px;
    }
    
    .wheel-prizes-section h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .prizes-grid {
        gap: 12px;
    }
    
    .prize-card {
        padding: 16px;
        border-radius: 14px;
        gap: 16px;
    }
    
    .prize-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .prize-label {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .prize-amount {
        font-size: 0.9rem;
    }
}

/* Mobile devices - main layout */
@media (max-width: 768px) {
    .wheel-page {
        padding: 16px;
        min-height: auto;
    }
    
    .wheel-header {
        margin-bottom: 30px;
    }
    
    .wheel-title {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .wheel-title h1 {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .wheel-title .subtitle {
        font-size: 1rem;
        text-align: center;
    }
    
    .wheel-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    /* Scale down wheel for mobile */
    .wheel-canvas-container {
        transform: scale(0.85);
        margin: -20px 0;
    }
    
    .wheel-glow {
        width: 360px;
        height: 360px;
    }
    
    /* Optimize controls for mobile */
    .wheel-controls {
        max-width: 100%;
        gap: 16px;
    }
    
    .wheel-spin-btn {
        padding: 16px 20px;
        font-size: 1.1rem;
        border-radius: 14px;
    }
    
    /* Optimize result area for mobile */
    .wheel-result {
        min-height: 70px;
        padding: 16px;
        border-radius: 14px;
    }
    
    .result-content {
        gap: 16px;
    }
    
    .result-icon {
        font-size: 28px;
    }
    
    .result-title {
        font-size: 16px;
    }
    
    .result-prize {
        font-size: 15px;
    }
    
    .result-amount {
        font-size: 18px;
    }
    
    /* Optimize status messages for mobile */
    .wheel-status {
        padding: 14px 16px;
        font-size: 13px;
        border-radius: 10px;
    }
    
    /* Optimize prize list for mobile */
    .wheel-prizes-section {
        padding: 20px;
        border-radius: 16px;
        margin-top: 20px;
    }
    
    .wheel-prizes-section h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .prizes-grid {
        gap: 12px;
    }
    
    .prize-card {
        padding: 16px;
        border-radius: 14px;
        gap: 16px;
    }
    
    .prize-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .prize-label {
        font-size: 1rem;
        margin-bottom: 6px;
    }
    
    .prize-amount {
        font-size: 0.9rem;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .wheel-page {
        padding: 12px;
    }
    
    .wheel-header {
        margin-bottom: 25px;
    }
    
    .wheel-title h1 {
        font-size: 1.8rem;
    }
    
    .wheel-title .subtitle {
        font-size: 0.95rem;
    }
    
    .wheel-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    /* Scale down wheel even more */
    .wheel-canvas-container {
        transform: scale(0.75);
        margin: -30px 0;
    }
    
    .wheel-glow {
        width: 320px;
        height: 320px;
    }
    
    /* Further optimize controls */
    .wheel-controls {
        gap: 14px;
    }
    
    .wheel-spin-btn {
        padding: 14px 18px;
        font-size: 1rem;
        border-radius: 12px;
    }
    
    /* Further optimize result area */
    .wheel-result {
        min-height: 65px;
        padding: 14px;
        border-radius: 12px;
    }
    
    .result-content {
        gap: 14px;
    }
    
    .result-icon {
        font-size: 24px;
    }
    
    .result-title {
        font-size: 15px;
    }
    
    .result-prize {
        font-size: 14px;
    }
    
    .result-amount {
        font-size: 16px;
    }
    
    /* Further optimize status messages */
    .wheel-status {
        padding: 12px 14px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    /* Further optimize prize list */
    .wheel-prizes-section {
        padding: 16px;
        border-radius: 14px;
        margin-top: 16px;
    }
    
    .wheel-prizes-section h3 {
        font-size: 1.2rem;
        margin-bottom: 18px;
    }
    
    .prizes-grid {
        gap: 10px;
    }
    
    .prize-card {
        padding: 14px;
        border-radius: 12px;
        gap: 14px;
    }
    
    .prize-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .prize-label {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }
    
    .prize-amount {
        font-size: 0.85rem;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .wheel-page {
        padding: 10px;
    }
    
    .wheel-title h1 {
        font-size: 1.6rem;
    }
    
    .wheel-title .subtitle {
        font-size: 0.9rem;
    }
    
    .wheel-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Minimum wheel size */
    .wheel-canvas-container {
        transform: scale(0.65);
        margin: -40px 0;
    }
    
    .wheel-glow {
        width: 280px;
        height: 280px;
    }
    
    /* Minimum element sizes */
    .wheel-spin-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .wheel-result {
        padding: 12px;
    }
    
    .wheel-prizes-section {
        padding: 14px;
    }
    
    .prize-card {
        padding: 12px;
    }
}

/* Landscape mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    .wheel-page {
        padding: 12px;
        min-height: auto;
    }
    
    .wheel-header {
        margin-bottom: 20px;
    }
    
    .wheel-title h1 {
        font-size: 1.8rem;
    }
    
    .wheel-canvas-container {
        transform: scale(0.7);
        margin: -25px 0;
    }
    
    .wheel-container {
        gap: 20px;
    }
    
    .wheel-prizes-section {
        margin-top: 15px;
        padding: 20px;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .wheel-page {
        padding: 10px;
    }
    
    .wheel-title h1 {
        font-size: 1.6rem;
    }
    
    .wheel-title .subtitle {
        font-size: 0.9rem;
    }
    
    .wheel-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    /* Minimum wheel size */
    .wheel-canvas-container {
        transform: scale(0.65);
        margin: -40px 0;
    }
    
    .wheel-glow {
        width: 280px;
        height: 280px;
    }
    
    /* Minimum element sizes */
    .wheel-spin-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .wheel-result {
        padding: 12px;
    }
    
    .wheel-prizes-section {
        padding: 14px;
    }
    
    .prize-card {
        padding: 12px;
    }
}

/* Landscape mobile devices */
@media (max-height: 600px) and (orientation: landscape) {
    .wheel-page {
        padding: 12px;
        min-height: auto;
    }
    
    .wheel-header {
        margin-bottom: 20px;
    }
    
    .wheel-title h1 {
        font-size: 1.8rem;
    }
    
    .wheel-canvas-container {
        transform: scale(0.7);
        margin: -25px 0;
    }
    
    .wheel-container {
        gap: 20px;
    }
    
    .wheel-prizes-section {
        margin-top: 15px;
        padding: 20px;
    }
}
