:root {
    --primary: #1a237e;
    --primary-light: #303f9f;
    --gold: #FFD700;
    --gold-dark: #D4AF37;
    --dark: #121212;
    --light: #f8f9fa;
    --success: #4CAF50;
    --danger: #F44336;
    --gray: #757575;
    --gray-light: #e0e0e0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #f5f5f5;
    color: var(--dark);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
}

.spend-game {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.wealth-display {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.wealth-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2MDAiIGhlaWdodD0iNjAwIiBvcGFjaXR5PSIwLjA1Ij48Y2lyY2xlIGZpbGw9IndoaXRlIiBjeD0iNSIgY3k9IjUiIHI9IjEiLz48Y2lyY2xlIGZpbGw9IndoaXRlIiBjeD0iMjAiIGN5PSIxNSIgcj0iMSIvPjxjaXJjbGUgZmlsbD0id2hpdGUiIGN4PSIzNSIgY3k9IjgiIHI9IjEiLz48Y2lyY2xlIGZpbGw9IndoaXRlIiBjeD0iNTAiIGN5PSIyMCIgcj0iMSIvPjxjaXJjbGUgZmlsbD0id2hpdGUiIGN4PSI3MCIgY3k9IjUiIHI9IjEiLz48L3N2Zz4=');
    background-size: 120px;
    opacity: 0.15;
    z-index: -1;
    animation: particleMove 20s linear infinite;
}

@keyframes particleMove { 
    100% { background-position: 120px 60px; } 
}

#current-funds {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.progress-container {
    margin: 1.5rem 0;
}

.progress {
    height: 12px;
    border-radius: 6px;
    background-color: rgba(255,255,255,0.3);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-dark) 100%);
    transition: width 0.6s ease;
}

.comparison-text {
    font-size: 0.9rem;
    opacity: 0.9;
    margin: 0.5rem 0;
}

.ticker-wrap {
    overflow: hidden;
    background: rgba(0,0,0,0.1);
    padding: 0.5rem 0;
    margin: 1rem 0 0;
    border-radius: 4px;
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    padding-right: 100%;
    animation: tickerScroll 30s linear infinite;
}

@keyframes tickerScroll { 
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } 
}

.spending-categories {
    padding: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

.category {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.category:hover {
    transform: translateY(-5px);
}

.category-header {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.category-header i {
    font-size: 1.25rem;
}

.category-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.item-card {
    border: 1px solid var(--gray-light);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: white;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--gold);
}

.item-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--gold) 100%);
}

.item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--primary);
}

.item-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gold-dark);
    margin: 0.5rem 0;
}

.item-card small {
    color: var(--gray);
    font-size: 0.85rem;
    display: block;
    line-height: 1.4;
}

.purchases-list {
    padding: 0 1.5rem 1.5rem;
}

.purchases-list h4 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold-light);
    color: var(--primary);
}

#purchases-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

#purchases-list::-webkit-scrollbar {
    width: 8px;
    background: var(--gray-light);
}

#purchases-list::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}

#purchases-list li {
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.share-section {
    background: var(--gray-light);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn i {
    font-size: 1.1rem;
}

.btn-twitter {
    background: #1da1f2;
    color: white;
}

.btn-twitter:hover {
    background: #1991db;
    transform: translateY(-2px);
}

.btn-facebook {
    background: #1877f2;
    color: white;
}

.btn-facebook:hover {
    background: #166fe0;
    transform: translateY(-2px);
}

.btn-copy {
    background: white;
    color: var(--dark);
    border: 1px solid var(--gray);
}

.btn-copy:hover {
    background: var(--gray-light);
    transform: translateY(-2px);
}

.wealth-selector {
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.wealth-selector select {
    border-radius: 8px;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    font-size: 1rem;
    width: 100%;
    background: white;
    transition: all 0.3s ease;
}

.wealth-selector select:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.custom-wealth-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.custom-wealth-input input {
    flex: 1;
    border-radius: 8px;
    padding: 0.75rem;
    border: 2px solid var(--gray-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.custom-wealth-input input:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.custom-wealth-input button {
    background: var(--gold);
    color: var(--dark);
    border: none;
    border-radius: 8px;
    padding: 0 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-wealth-input button:hover {
    background: var(--gold-dark);
    color: white;
}

/* Animation for purchases */
@keyframes moneyFly {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2) translateY(-40px); opacity: 0; }
}

.money-animation {
    position: fixed;
    font-weight: bold;
    pointer-events: none;
    animation: moneyFly 1s forwards;
    z-index: 100;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .category-items {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    #current-funds {
        font-size: 2rem;
    }
}

/* Keyframes for confetti */
@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(360deg); }
}