* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #8B5CF6;
    --secondary-color: #EC4899;
    --accent-color: #F59E0B;
    --success-color: #10B981;
    --dark-bg: #0F172A;
    --card-bg: #1E293B;
    --border-color: #334155;
    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #EC4899 100%);
    --gradient-accent: linear-gradient(135deg, #F59E0B 0%, #8B5CF6 100%);
}

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

/* Main Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0F172A 0%, #1A1F2E 100%);
}

/* Header */
.header {
    padding: 1.5rem 1rem;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.1) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.streak-icon {
    font-size: 1.25rem;
    animation: pulse 1s infinite;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

/* Usage Counter */
.usage-counter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 2rem;
}

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

.counter-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Wheel Container */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
}

.wheel-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#spinWheel {
    display: block;
    filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3));
}

.spin-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: var(--gradient-primary);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.4);
    position: relative;
    top: -60px;
}

.spin-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.6);
}

.spin-button:active:not(:disabled) {
    transform: scale(0.95);
}

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

/* Result Card */
.result-section {
    animation: slideUp 0.4s ease;
}

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

.result-card {
    background: linear-gradient(135deg, var(--card-bg), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

#resultTitle {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

#resultAmount {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

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

.btn-secondary:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary-color);
}

.btn-unlock-premium {
    background: linear-gradient(135deg, #F59E0B 0%, #EC4899 100%);
    color: white;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-unlock-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

/* Premium Lock */
.premium-lock {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-end;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

.lock-card {
    background: var(--card-bg);
    border-top: 2px solid var(--primary-color);
    border-radius: 24px 24px 0 0;
    padding: 2rem;
    width: 100%;
    animation: slideUp 0.4s ease;
}

.lock-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.lock-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.lock-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.premium-benefits {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.benefit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
}

.benefit-icon {
    font-size: 1.5rem;
}

.benefit-text {
    font-size: 0.8rem;
    text-align: center;
    color: var(--text-secondary);
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.stat-icon {
    font-size: 2rem;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* History Section */
.history-section {
    padding: 2rem 1rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

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

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.history-item-amount {
    font-weight: 700;
    color: var(--success-color);
    font-size: 1rem;
}

.empty-message {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 1rem;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

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

.nav-tab.active {
    background: var(--gradient-primary);
    color: white;
    border-color: var(--primary-color);
}

.nav-tab:hover:not(.active) {
    border-color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .spin-button {
        width: 100px;
        height: 100px;
        font-size: 1rem;
        top: -50px;
    }

    #resultAmount {
        font-size: 2rem;
    }

    .premium-benefits {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .main-content {
        padding: 1rem;
    }

    .wheel-wrapper {
        width: 250px;
        height: 250px;
    }

    #spinWheel {
        width: 250px;
        height: 250px;
    }

    .spin-button {
        width: 80px;
        height: 80px;
        top: -40px;
    }
}
