* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', cursive, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    touch-action: none;
    user-select: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Game Container */
#game-container {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    position: relative;
}

/* Currency Display */
#currency-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    font-weight: bold;
    color: #333;
    z-index: 100;
    animation: slideInRight 0.5s ease-out;
}

.coin-icon {
    font-size: 28px;
    animation: coinSpin 2s linear infinite;
}

@keyframes coinSpin {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

#currency-amount {
    min-width: 60px;
    text-align: right;
    transition: all 0.3s ease;
}

.currency-label {
    font-size: 18px;
    color: #666;
}

/* Passive Income Display */
#passive-income-display {
    position: absolute;
    top: 80px;
    right: 20px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

/* Sound Toggle Button */
#sound-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: transform 0.2s, background 0.2s;
}

#sound-toggle:active {
    transform: scale(0.9);
}

#sound-toggle.muted {
    background: rgba(200, 200, 200, 0.95);
}

/* Shake Indicator */
#shake-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #764ba2;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 50;
}

.shake-indicator.hidden {
    display: none;
}

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

/* Game Background */
#game-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/backgrounds/001-cozy-kawaii-cafe-interior-with-warm-ligh.png');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* Capybara Sprite */
#capybara-sprite {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    width: 280px;
    height: auto;
    z-index: 15;
    pointer-events: none;
    animation: capybaraIdle 2s ease-in-out infinite;
}

@keyframes capybaraIdle {
    0%, 100% { transform: translate(-50%, -70%); }
    50% { transform: translate(-50%, -72%); }
}

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

/* Spills Container */
#spills-container {
    position: absolute;
    bottom: 120px;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    padding: 0 20px;
}

.spill {
    width: 100px;
    height: 100px;
    background-image: url('assets/ui/001-spilled-brown-boba-tea-puddle-on-ground-.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    cursor: pointer;
    animation: spillAppear 0.3s ease-out;
    transition: transform 0.1s;
}

.spill:active {
    transform: scale(0.9);
}

@keyframes spillAppear {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.spill-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Particle Effect */
.particle {
    position: absolute;
    pointer-events: none;
    font-size: 24px;
    animation: floatUp 1s ease-out forwards;
    z-index: 1000;
}

@keyframes floatUp {
    to {
        transform: translateY(-100px);
        opacity: 0;
    }
}

/* Bottom Navigation */
#bottom-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.nav-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    min-width: 140px;
}

.nav-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Screen Header */
.screen-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    min-width: 80px;
}

.back-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.screen-header h2 {
    flex: 1;
    text-align: center;
    font-size: 24px;
}

/* Tabs */
.tabs {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    color: #764ba2;
    border-bottom: 3px solid #764ba2;
    background: white;
}

/* Screen Content */
.screen-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
}

/* Upgrades List */
#upgrades-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upgrade-item {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.upgrade-icon {
    font-size: 32px;
}

.upgrade-title {
    flex: 1;
    padding: 0 10px;
}

.upgrade-title h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 4px;
}

.upgrade-level {
    font-size: 14px;
    color: #666;
}

.upgrade-buy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.upgrade-buy-btn:active {
    transform: scale(0.95);
}

.upgrade-buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.upgrade-description {
    font-size: 14px;
    color: #555;
    margin-top: 10px;
}

/* Shop Items */
#shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.shop-item {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 15px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.shop-item.owned {
    opacity: 0.6;
    border: 3px solid #4caf50;
}

.shop-item-preview {
    width: 100%;
    height: 120px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 10px;
}

.shop-item-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.shop-item-price {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.shop-buy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
}

.shop-buy-btn:active {
    transform: scale(0.95);
}

.shop-buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.owned-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4caf50;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.currency-increase {
    animation: currencyPop 0.3s ease-out;
}

@keyframes currencyPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    #currency-display {
        font-size: 20px;
        padding: 10px 15px;
    }
    
    .coin-icon {
        font-size: 24px;
    }
    
    .nav-btn {
        padding: 12px 24px;
        font-size: 16px;
        min-width: 120px;
    }
    
    #shop-items {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}
