:root {
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --gold-light: #ffed4a;
    --blue-dark: #0a1628;
    --blue-accent: #1e3a5f;
    --blue-glow: #00bfff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #0d1b2a 50%, #1b263b 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #fff;
}

.font-cinzel {
    font-family: 'Cinzel', serif;
}

/* Particle Background */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Fire Animation */
.fire-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 150px;
    pointer-events: none;
}

.fire {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at bottom, #ff6b35 0%, transparent 70%),
        radial-gradient(ellipse at center, #ffd700 0%, transparent 50%);
    filter: blur(20px);
    animation: fireFlicker 0.5s ease-in-out infinite alternate;
    opacity: 0.8;
}

.fire-particle {
    position: absolute;
    border-radius: 50%;
    animation: fireRise 2s ease-out infinite;
}

@keyframes fireFlicker {
    0% { transform: scaleY(1) scaleX(1); opacity: 0.8; }
    100% { transform: scaleY(1.1) scaleX(0.9); opacity: 1; }
}

@keyframes fireRise {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-200px) scale(0); opacity: 0; }
}

/* Gold Shimmer Effect */
.gold-shimmer {
    background: linear-gradient(
        90deg,
        var(--gold-dark) 0%,
        var(--gold) 25%,
        var(--gold-light) 50%,
        var(--gold) 75%,
        var(--gold-dark) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* Glowing Border */
.glow-border {
    position: relative;
    border: 2px solid var(--gold);
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.glow-border::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: linear-gradient(45deg, var(--gold), var(--blue-glow), var(--gold));
    z-index: -1;
    animation: borderRotate 3s linear infinite;
}

@keyframes borderRotate {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* Number Display */
.number-display {
    font-family: 'Cinzel', serif;
    font-size: 5rem;
    font-weight: 900;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
    letter-spacing: 0.2em;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.02); filter: brightness(1.2); }
}

/* Slot Machine Animation */
.slot-reel {
    display: inline-block;
    animation: slotSpin 0.1s linear infinite;
}

@keyframes slotSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Button Styles */
.btn-gold {
    position: relative;
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    color: #0a0a1a;
    font-weight: 700;
    padding: 1rem 3rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transform: rotate(45deg);
    animation: btnShine 2s ease-in-out infinite;
}

@keyframes btnShine {
    0% { transform: translateX(-100%) rotate(45deg); }
    50%, 100% { transform: translateX(100%) rotate(45deg); }
}

.btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.4),
        0 0 60px rgba(255, 215, 0, 0.2);
}

.btn-gold:active {
    transform: translateY(-1px);
}

/* Card Styles */
.prediction-card {
    background: linear-gradient(145deg, rgba(30, 58, 95, 0.6) 0%, rgba(10, 22, 40, 0.8) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.prediction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* Floating Diamonds */
.diamond {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--gold);
    transform: rotate(45deg);
    animation: floatDiamond 4s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes floatDiamond {
    0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.3; }
    50% { transform: rotate(45deg) translateY(-20px); opacity: 0.6; }
}

/* Stars Background */
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}

/* Result Box */
.result-box {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 40, 0.9) 100%);
    border: 2px solid var(--gold);
    border-radius: 15px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.result-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
}

/* Spinning Animation for Generation */
.generating .digit {
    animation: digitSpin 0.1s linear infinite;
}

@keyframes digitSpin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

/* Tab Navigation */
.tab-btn {
    background: transparent;
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    padding: 0.75rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tab-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--gold);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold));
    color: #0a0a1a;
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* History Item */
.history-item {
    background: rgba(255, 215, 0, 0.05);
    border-left: 3px solid var(--gold);
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: translateX(5px);
}

/* Lucky Numbers */
.lucky-number {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
    border: 2px solid var(--gold);
    border-radius: 50%;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gold);
    transition: all 0.3s ease;
}

.lucky-number:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Crown Icon Animation */
.crown-icon {
    animation: crownFloat 3s ease-in-out infinite;
}

@keyframes crownFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Glow Ring */
.glow-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--gold);
    animation: ringPulse 2s ease-out infinite;
    opacity: 0;
}

@keyframes ringPulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}

/* Input Style */
.input-gold {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.3);
    color: var(--gold);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-gold:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.input-gold::placeholder {
    color: rgba(255, 215, 0, 0.5);
}

/* Fireflies */
.firefly {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--gold-light);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--gold), 0 0 20px var(--gold-light);
    animation: fireflyFloat 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes fireflyFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% { opacity: 1; }
    50% { 
        transform: translate(100px, -200px) scale(1.5);
        opacity: 0.8;
    }
    90% { opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 22, 40, 0.5);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold-dark), var(--gold));
    border-radius: 4px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 215, 0, 0.3);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Slide In Animation for History */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .number-display {
        font-size: 3rem;
        letter-spacing: 0.1em;
    }
    
    .prediction-card {
        padding: 1.5rem;
    }
    
    .btn-gold {
        padding: 0.75rem 2rem;
        font-size: 0.9rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}