/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-purple: #6366f1;
    --primary-purple-dark: #4f46e5;
    --secondary-purple: #8b5cf6;
    --accent-purple: #a855f7;
    --dark-bg: #0f0f23;
    --dark-bg-secondary: #1a1a2e;
    --dark-bg-tertiary: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: #27272a;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-logo i {
    color: var(--primary-purple);
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-wallet,
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--dark-bg-secondary);
    color: var(--text-primary);
}

.btn-wallet {
    background: var(--gradient-secondary);
    color: white;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-balance {
    background: var(--dark-bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    color: var(--primary-purple);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--dark-bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.luck-score {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(99, 102, 241, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(168, 85, 247, 0.3), transparent);
    background-repeat: repeat;
    background-size: 100px 100px;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0px) translateX(0px); }
    33% { transform: translateY(-10px) translateX(10px); }
    66% { transform: translateY(5px) translateX(-5px); }
    100% { transform: translateY(0px) translateX(0px); }
}

.hero-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.btn-cta {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

/* Mystery Boxes Section */
.mystery-boxes {
    padding: 5rem 0;
    background: var(--dark-bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.search-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    max-width: 300px;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--dark-bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-dropdown select {
    padding: 0.75rem 1rem;
    background: var(--dark-bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.mystery-box {
    background: var(--dark-bg-tertiary);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.mystery-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-purple);
}

.box-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gradient-primary);
}

.box-content {
    padding: 1.5rem;
}

.box-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.box-price {
    color: var(--primary-purple);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.box-category {
    display: inline-block;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-purple);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.box-open-btn {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.box-open-btn:hover {
    background: var(--gradient-secondary);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark-bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--dark-bg-tertiary);
    color: var(--text-primary);
}

/* Spin Modal */
.spin-modal {
    width: 500px;
}

.spin-container {
    padding: 2rem;
    text-align: center;
}

.wheel-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
}

.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #ff6b35;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.spin-wheel {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
    overflow: hidden;
}

/* Fast and responsive wheel spinning animation */
@keyframes wheelSpinRealistic {
    0% { 
        transform: rotate(0deg); 
        animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    30% { 
        transform: rotate(1080deg); 
        animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
    }
    100% { 
        transform: rotate(var(--final-rotation, 2520deg)); 
        animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
    }
}

/* Single animation class for the entire spin - runs once and stops */
.wheel-spinning-realistic {
    animation: wheelSpinRealistic 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
}

.wheel-segments {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.segment-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: rotate(45deg);
    width: 80px;
    height: 80px;
}

.segment-image {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    margin-bottom: 4px;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.segment-name {
    font-size: 10px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.segment-rarity {
    font-size: 8px;
    padding: 1px 4px;
    border-radius: 8px;
    margin-top: 2px;
    font-weight: bold;
    text-transform: uppercase;
}

.segment-rarity.legendary {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #8b4513;
}

.segment-rarity.rare {
    background: linear-gradient(45deg, #8b5cf6, #a855f7);
    color: white;
}

.segment-rarity.uncommon {
    background: linear-gradient(45deg, #3b82f6, #60a5fa);
    color: white;
}

.segment-rarity.common {
    background: linear-gradient(45deg, #6b7280, #9ca3af);
    color: white;
}

/* Old wheel-spinning animation system removed to prevent conflicts with new Wheel of Fortune physics */

@keyframes buttonPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
    }
}

.wheel-center {
    width: 100px;
    height: 100px;
    background: var(--dark-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--border-color);
    position: relative;
    z-index: 20;
}

.spin-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    position: relative;
    z-index: 21;
}

.spin-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.spin-info {
    display: flex;
    justify-content: space-between;
    background: var(--dark-bg-tertiary);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.prize-result {
    padding: 2rem;
    text-align: center;
}

.prize-animation {
    position: relative;
    margin-bottom: 1.5rem;
}

.prize-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.prize-result img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 1rem;
    position: relative;
    z-index: 1;
}

.prize-result h4 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--success-color);
}

.prize-result p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Auth Modal */
.auth-modal {
    width: 400px;
}

.auth-forms {
    padding: 2rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    padding: 0.75rem;
    background: var(--dark-bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.auth-switch a {
    color: var(--primary-purple);
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Admin Panel Styles */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
}

.admin-sidebar {
    width: 280px;
    background: var(--dark-bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    overflow-y: auto;
}

.admin-logo {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.admin-logo h3 {
    color: var(--primary-purple);
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-nav {
    display: flex;
    flex-direction: column;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.admin-nav-link:hover,
.admin-nav-link.active {
    color: var(--primary-purple);
    background: rgba(139, 92, 246, 0.1);
    border-left-color: var(--primary-purple);
}

.admin-nav-link i {
    width: 20px;
    text-align: center;
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--dark-bg);
}

.admin-title h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.admin-title p {
    color: var(--text-secondary);
    margin: 0;
}

.admin-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.admin-close:hover {
    color: var(--text-primary);
    background: var(--dark-bg-secondary);
}

.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--dark-bg);
}

.admin-section {
    display: none;
}

.admin-section:first-child,
.admin-section.active {
    display: block;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.admin-section-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 0;
}

.admin-table {
    background: var(--dark-bg-secondary);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: var(--dark-bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.admin-table tbody tr:hover {
    background: var(--dark-bg-tertiary);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive Admin Panel */
@media (max-width: 1024px) {
    .admin-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .admin-panel {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        padding: 1rem 0;
    }
    
    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .admin-nav-link {
        white-space: nowrap;
        padding: 0.75rem 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .admin-nav-link:hover,
    .admin-nav-link.active {
        border-left: none;
        border-bottom-color: var(--primary-purple);
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .admin-section-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .admin-table {
        overflow-x: auto;
    }
}

/* Footer */
.footer {
    background: var(--dark-bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-purple);
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-logo i {
    color: var(--primary-purple);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .nav-actions {
        gap: 0.5rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-wallet {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .category-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .boxes-grid {
        grid-template-columns: 1fr;
    }
    
    .spin-modal,
    .auth-modal {
        width: 90vw;
        max-width: 400px;
    }
    
    .spin-wheel {
        width: 250px;
        height: 250px;
    }
    
    .admin-panel {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .admin-nav-link {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .user-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .spin-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-purple);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

/* Spin Result Modal */
.spin-result-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

/* Spinning Animation Container */
.spin-animation-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.5s ease-out;
}

.spinning-wheel {
    width: 200px;
    height: 200px;
    border: 8px solid #8b5cf6;
    border-radius: 50%;
    border-top: 8px solid #ec4899;
    border-right: 8px solid #f59e0b;
    border-bottom: 8px solid #10b981;
    border-left: 8px solid #3b82f6;
    animation: spin 2s linear infinite;
    margin-bottom: 2rem;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

.spin-text {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.spin-result-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 2px solid #8b5cf6;
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
    animation: slideUp 0.5s ease-out;
}

.spin-result-header h2 {
    color: #8b5cf6;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    animation: celebrationBounce 0.8s ease-out;
}

/* Enhanced congratulations animations */
@keyframes celebrationBounce {
    0% { 
        transform: scale(0.3) rotate(-10deg);
        opacity: 0;
    }
    50% { 
        transform: scale(1.1) rotate(5deg);
        opacity: 1;
    }
    70% { 
        transform: scale(0.95) rotate(-2deg);
    }
    100% { 
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.prize-display {
    margin: 2rem 0;
    animation: prizeReveal 1s ease-out 0.5s both;
}

@keyframes prizeReveal {
    0% {
        transform: translateY(30px) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Confetti animation */
@keyframes confettiFall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.prize-image {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    margin-bottom: 1rem;
    border: 3px solid #8b5cf6;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
}

.prize-display h3 {
    color: #ffffff;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.rarity-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.rarity-badge.common {
    background: #6b7280;
    color: #ffffff;
}

.rarity-badge.uncommon {
    background: #10b981;
    color: #ffffff;
}

.rarity-badge.rare {
    background: #3b82f6;
    color: #ffffff;
}

.rarity-badge.epic {
    background: #8b5cf6;
    color: #ffffff;
}

.rarity-badge.legendary {
    background: linear-gradient(45deg, #f59e0b, #ef4444);
    color: #ffffff;
    animation: glow 2s ease-in-out infinite alternate;
}

.prize-value {
    color: #10b981;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 0.5rem;
}

.close-result-btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.close-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
    }
    to {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 0 30px rgba(239, 68, 68, 0.6);
    }
}

/* Inventory Styles */
.inventory-section {
    padding: 6rem 0 4rem;
    background: var(--dark-bg);
}

.inventory-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--dark-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-purple);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inventory-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
}

.filter-tab {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-tab.active,
.filter-tab:hover {
    background: var(--primary-purple);
    color: white;
    border-color: var(--primary-purple);
}

.rarity-filter select {
    background: var(--dark-bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.inventory-item {
    background: var(--dark-bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.inventory-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary-purple);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.inventory-item-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--dark-bg-tertiary);
}

.inventory-item-content {
    padding: 1.5rem;
}

.inventory-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.inventory-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.inventory-item-source {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.inventory-item-rarity {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.inventory-item-rarity.common {
    background: rgba(113, 113, 122, 0.2);
    color: #a1a1aa;
}

.inventory-item-rarity.uncommon {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.inventory-item-rarity.rare {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.inventory-item-rarity.epic {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.inventory-item-rarity.legendary {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.inventory-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.inventory-item-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
}

.inventory-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.inventory-item-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.inventory-item-status.owned {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.inventory-item-status.converted {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.inventory-item-status.redeemed {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.empty-inventory {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Prize Action Modal */
.prize-action-modal {
    max-width: 500px;
    width: 90%;
}

.prize-action-content {
    padding: 1rem 0;
}

.prize-display {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.prize-display img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--dark-bg-tertiary);
}

.prize-info h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.prize-info .rarity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.prize-info .prize-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
    margin-bottom: 0.25rem;
}

.prize-info .prize-source {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--dark-bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.action-info h5 {
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.action-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.action-option button {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .inventory-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-tabs {
        justify-content: center;
    }
    
    .inventory-grid {
        grid-template-columns: 1fr;
    }
    
    .action-option {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .action-option button {
        width: 100%;
        justify-content: center;
    }
}