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

body {
    font-family: 'Arial', 'Helvetica', system-ui, sans-serif;
    background: linear-gradient(135deg, #2d5a27 0%, #6ab04c 50%, #badc58 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Animated Background - Enhanced for mobile */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
    animation: floatingClouds 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* Disable animations on mobile for better performance */
@media (max-width: 767px) {
    body::before {
        animation: none;
        opacity: 0.5;
    }
    
    .pet-emoji {
        animation-duration: 4s;
    }
    
    .pet-emoji-display {
        animation-duration: 4s;
    }
}

@keyframes floatingClouds {
    0%, 100% { transform: translateX(0px) translateY(0px); }
    25% { transform: translateX(10px) translateY(-5px); }
    50% { transform: translateX(-5px) translateY(10px); }
    75% { transform: translateX(-10px) translateY(-5px); }
}

#app {
    position: relative;
    z-index: 1;
}

/* Header Styles */
.game-header {
    background: linear-gradient(45deg, #2d5a27 0%, #40407a 100%);
    color: white;
    padding: calc(1rem + env(safe-area-inset-top)) 2rem 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Improve touch behavior */
button, .select-pet-btn, .job-btn, .action-btn, .buy-btn, .naming-btn, .food-option, .panel-toggle, .care-btn, .pay-bill-btn, #pet-emoji {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Ensure visible focus for keyboard users */
button:focus, .select-pet-btn:focus, .job-btn:focus, .action-btn:focus, .buy-btn:focus, .naming-btn:focus, .food-option:focus, .panel-toggle:focus, .care-btn:focus, .pay-bill-btn:focus, #pet-emoji:focus {
    outline: 3px solid #2ecc71;
    outline-offset: 2px;
}

.game-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.game-header h1 {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: titleBounce 2s ease-in-out infinite;
}

@keyframes titleBounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.budget-display {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    transition: all 0.3s ease;
}

.budget-display.low-funds {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    animation: lowFundsPulse 2s ease-in-out infinite;
}

@keyframes lowFundsPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
}

.bankruptcy-warning {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff6b6b;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    animation: bounce 1s ease-in-out infinite;
}

.warning-icon {
    margin-right: 0.3rem;
}

.money-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    animation: coinSpin 2s linear infinite;
}

@keyframes coinSpin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.budget-amount {
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Screen Management */
.screen {
    display: none;
    min-height: calc(100vh - 80px);
    padding: 2rem;
}

.screen.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Pet Selection Screen */
.selection-container {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.selection-container h2 {
    font-size: 2.5rem;
    color: #4a4a4a;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.selection-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.pet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

.pet-card {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pet-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.pet-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.5s ease;
}

.pet-card:hover::before {
    left: 100%;
}

.pet-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: petBounce 2s ease-in-out infinite;
}

@keyframes petBounce {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

.pet-card h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.pet-stats {
    margin-bottom: 1.5rem;
}

.stat {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    padding: 0.3rem 0.8rem;
    margin: 0.3rem;
    border-radius: 15px;
    display: inline-block;
    font-size: 0.9rem;
}

.select-pet-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.select-pet-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

/* Main Game Screen */
.game-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    height: calc(100vh - 120px);
}

/* Pet Display Panel */
.pet-display-panel {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.pet-container {
    position: relative;
    text-align: center;
    margin-bottom: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#pet-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.pet-emoji-display {
    font-size: 8rem;
    animation: petIdle 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pet-emoji-display:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
}

@keyframes petIdle {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(1deg); }
    50% { transform: translateY(0px) rotate(0deg); }
    75% { transform: translateY(-3px) rotate(-1deg); }
}

.pet-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-top: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Status Meters */
.status-meters {
    margin-bottom: 2rem;
}

.meter-container {
    margin-bottom: 1rem;
}

.meter-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.meter {
    background: #e0e0e0;
    border-radius: 25px;
    height: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meter-fill {
    height: 100%;
    border-radius: 25px;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.happiness-meter .meter-fill {
    background: linear-gradient(45deg, #2ecc71, #58d68d);
}

.health-meter .meter-fill {
    background: linear-gradient(45deg, #27ae60, #52c41a);
}

.cleanliness-meter .meter-fill {
    background: linear-gradient(45deg, #16a085, #1abc9c);
}

.meter-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: meterShine 2s ease-in-out infinite;
}

@keyframes meterShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.meter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #333;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

/* Pet Actions */
.pet-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Care Actions */
.care-actions {
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-top: 1rem;
}

.care-actions h4 {
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.care-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.care-btn {
    background: linear-gradient(45deg, #00b894, #00cec9);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 184, 148, 0.4);
    min-width: 120px;
}

.care-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.6);
}

.care-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 184, 148, 0.2);
}

.care-btn.urgent {
    background: linear-gradient(45deg, #ff7675, #fd79a8);
    box-shadow: 0 3px 10px rgba(255, 118, 117, 0.4);
    animation: urgentPulse 2s ease-in-out infinite;
}

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

.action-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.2);
}

/* Info Panel */
.info-panel {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.info-panel h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
    border-bottom: 2px solid #27ae60;
    padding-bottom: 0.5rem;
}

/* Shop Section */
.shop-section {
    margin-bottom: 2rem;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.shop-item {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.shop-item:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.item-icon {
    font-size: 2rem;
    animation: itemFloat 2s ease-in-out infinite;
}

@keyframes itemFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-3px); }
}

.item-info {
    flex: 1;
}

.item-name {
    display: block;
    font-weight: bold;
    color: #333;
}

.item-price {
    color: #27ae60;
    font-weight: bold;
}

.buy-btn {
    background: linear-gradient(45deg, #16a085, #1abc9c);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(22, 160, 133, 0.4);
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 160, 133, 0.6);
}

.buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Inventory Section */
.inventory-section {
    margin-bottom: 2rem;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.inventory-item {
    background: linear-gradient(145deg, #e9ecef, #dee2e6);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.inventory-item:hover {
    transform: scale(1.05);
}

.inventory-item .item-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.item-count {
    background: #27ae60;
    color: white;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    position: absolute;
    top: -5px;
    right: -5px;
}

/* Activity Section */
.activity-log {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    scroll-behavior: smooth;
}

.activity-log::-webkit-scrollbar {
    width: 6px;
}

.activity-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.activity-log::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 3px;
}

.activity-log::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.activity-item {
    background: white;
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.allowance-amount {
    font-size: 3rem;
    color: #27ae60;
    font-weight: bold;
    margin: 1rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: pulse 1s ease-in-out infinite;
}

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

.modal button {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.modal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.modal.warning .modal-content {
    border: 3px solid #ff6b6b;
}

.modal.warning h3 {
    color: #ff6b6b;
}

/* Settings Panel */
.panel {
    position: fixed;
    top: 50%;
    right: -300px;
    transform: translateY(-50%);
    width: 300px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px 0 0 20px;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 100;
}

.panel.open {
    right: 0;
}

.panel-toggle {
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    background: #27ae60;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 10px 0 0 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.panel-toggle:hover {
    background: #2ecc71;
    transform: translateY(-50%) scale(1.1);
}

.panel-content {
    padding: 2rem;
}

.panel-content h3 {
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.setting-item label {
    font-weight: bold;
    color: #333;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

select {
    padding: 0.3rem;
    border-radius: 5px;
    border: 1px solid #ddd;
    background: white;
}

#reset-game {
    width: 100%;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

#reset-game:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.4);
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Enhanced Mobile-First Responsive Design */

/* Mobile devices (phones, 320px to 768px) */
@media (max-width: 767px) {
    body {
        font-size: 14px;
        line-height: 1.5;
    }

    .game-header {
        padding: 0.8rem;
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }
    
    .game-header h1 {
        font-size: 1.4rem;
        margin: 0;
    }
    
    .header-left {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .budget-display {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .budget-amount {
        font-size: 1.2rem;
    }
    
    .screen {
        padding: 1rem;
    }
    
    .game-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        height: auto;
        max-width: 100%;
    }
    
    .pet-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0;
    }
    
    .pet-card {
        padding: 1.5rem;
        margin: 0;
    }
    
    .pet-emoji {
        font-size: 3rem;
    }
    
    .pet-emoji-display {
        font-size: 5rem;
    }
    
    .pet-display-panel,
    .info-panel {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .status-meters {
        margin-bottom: 1rem;
    }
    
    .meter {
        height: 25px;
    }
    
    .pet-actions {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .action-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        width: 100%;
        min-height: 44px; /* Touch-friendly */
    }
    
    .shop-items {
        gap: 0.8rem;
    }
    
    .shop-item {
        padding: 0.8rem;
        flex-direction: row;
        text-align: left;
    }
    
    .buy-btn {
        min-height: 44px;
        padding: 0.6rem 1rem;
        white-space: nowrap;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    
    .inventory-item {
        padding: 0.8rem;
    }
    
    .job-buttons {
        gap: 0.8rem;
    }
    
    .job-btn {
        padding: 0.8rem;
        min-height: 60px;
    }
    
    .modal-content {
        width: 95%;
        max-width: 350px;
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .panel {
        width: 90%;
        max-width: 300px;
        right: -100%;
    }
    
    .panel.open {
        right: 0;
    }
    
    .panel-toggle {
        left: -45px;
        width: 45px;
        height: 45px;
    }
    
    /* Touch-friendly improvements */
    .select-pet-btn,
    .modal button {
        min-height: 48px;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .item-count {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
    }
    
    .activity-log {
        max-height: 150px;
        font-size: 0.9rem;
    }
    
    .activity-item {
        padding: 0.6rem;
    }
}

/* Small mobile devices (phones, up to 480px) */
@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.2rem;
    }
    
    .pet-emoji-display {
        font-size: 4rem;
    }
    
    .pet-actions {
        gap: 0.6rem;
    }
    
    .action-btn {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .shop-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .job-btn {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        min-height: 70px;
    }
    
    /* Food modal mobile optimizations */
    .food-option {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .food-icon {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .food-effects {
        justify-content: center;
    }
    
    .food-info h4 {
        font-size: 1rem;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .game-container {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .pet-emoji-display {
        font-size: 4rem;
    }
    
    .screen {
        padding: 0.8rem;
    }
    
    .modal-content {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* Tablet devices (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .pet-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .game-container {
        gap: 1.5rem;
    }
    
    .pet-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .action-btn {
        flex: 1;
        min-width: 140px;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Special Effects */
@keyframes celebration {
    0% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.2) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-3deg); }
    75% { transform: scale(1.15) rotate(2deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.celebrate {
    animation: celebration 0.6s ease-in-out;
}

.low-health {
    animation: healthWarning 1s ease-in-out infinite;
}

@keyframes healthWarning {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2) hue-rotate(10deg); }
}

.money-gain {
    animation: moneyGain 0.8s ease-out;
}

@keyframes moneyGain {
    0% { transform: scale(1); color: inherit; }
    50% { transform: scale(1.2); color: #10ac84; }
    100% { transform: scale(1); color: inherit; }
}

/* Money Earning Section */
.earning-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.job-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.job-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 2px solid #27ae60;
    border-radius: 15px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.2);
}

.job-btn:hover {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.job-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background: #f8f9fa;
    border-color: #dee2e6;
}

.job-emoji {
    font-size: 2rem;
    flex-shrink: 0;
}

.job-info {
    flex: 1;
    text-align: left;
}

.job-name {
    display: block;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.job-pay {
    display: block;
    color: #27ae60;
    font-weight: bold;
    font-size: 0.9rem;
}

.job-btn:hover .job-pay {
    color: white;
}

.earnings-today {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
}

.earnings-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.3rem;
}

.earnings-amount {
    font-size: 1.3rem;
    color: #ffd700;
}

/* Bills Section */
.bills-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e0e0e0;
}

.bills-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.bill-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #ff6b6b;
    transition: all 0.3s ease;
}

.bill-item.paid {
    border-left-color: #10ac84;
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
}

.bill-item.overdue {
    border-left-color: #dc3545;
    background: linear-gradient(145deg, #f8d7da, #f1aeb5);
    animation: overdueWarning 2s ease-in-out infinite;
}

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

.bill-info {
    flex: 1;
}

.bill-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.3rem;
}

.bill-amount {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 1.1rem;
}

.bill-item.paid .bill-amount {
    color: #10ac84;
}

.bill-due {
    font-size: 0.8rem;
    color: #666;
}

.bill-status {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.bill-status.pending {
    background: #fff3cd;
    color: #856404;
}

.bill-status.paid {
    background: #d4edda;
    color: #155724;
}

.bill-status.overdue {
    background: #f8d7da;
    color: #721c24;
}

/* Injury Status Section */
.injury-status {
    background: linear-gradient(145deg, #ffe8e8, #ffcccc);
    border: 2px solid #ff6b6b;
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.injury-status h4 {
    color: #dc3545;
    margin-bottom: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.injury-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.injury-item {
    background: white;
    border-radius: 10px;
    padding: 0.8rem;
    border-left: 4px solid #ff6b6b;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.2);
}

.injury-name {
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 0.3rem;
}

.injury-cost {
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.injury-time {
    font-size: 0.8rem;
    color: #666;
}

/* Enhanced Modal Styles */
.modal.success .modal-content {
    border: 3px solid #10ac84;
}

.modal.success h3 {
    color: #10ac84;
}

.modal.critical .modal-content {
    border: 3px solid #dc3545;
    background: linear-gradient(145deg, #fff, #ffe8e8);
}

.modal.critical h3 {
    color: #dc3545;
}

.financial-tips {
    background: rgba(220, 53, 69, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
    border-left: 4px solid #dc3545;
}

.financial-tips h4 {
    color: #dc3545;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.financial-tips p {
    color: #333;
    font-weight: bold;
    margin-bottom: 0.8rem;
}

.financial-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.financial-tips li {
    padding: 0.4rem 0;
    color: #333;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.6);
    margin: 0.2rem 0;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    border-left: 3px solid #27ae60;
}

/* Enhanced modal styles for financial warnings */
.modal.warning .modal-content h4 {
    color: #e74c3c;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    text-align: center;
}

.modal.critical .modal-content {
    border: 3px solid #e74c3c;
    background: linear-gradient(145deg, #fff, #ffebee);
    animation: critical-pulse 2s ease-in-out infinite;
}

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

.job-earnings {
    background: linear-gradient(45deg, #10ac84, #00d2d3);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    margin: 1rem 0;
    text-align: center;
}

.injury-details {
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.injury-cost {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cost-label {
    font-weight: bold;
    color: #333;
}

.cost-amount {
    font-size: 1.2rem;
    font-weight: bold;
    color: #dc3545;
}

.injury-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.injury-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.injury-btn.treat {
    background: linear-gradient(45deg, #10ac84, #00d2d3);
    color: white;
}

.injury-btn.treat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 172, 132, 0.4);
}

.injury-btn.delay {
    background: linear-gradient(45deg, #6c757d, #5a6268);
    color: white;
}

.injury-btn.delay:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Victory Modal Styles */
.victory-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.victory-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 30px;
    padding: 3rem;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
}

.victory-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.victory-header h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 2rem;
}

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

.stat-item {
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-text {
    font-weight: bold;
    color: #333;
}

.wisdom-section, .achievements-section, .game-summary {
    margin: 2rem 0;
    text-align: left;
}

.wisdom-section h3, .achievements-section h3, .game-summary h3 {
    text-align: center;
    color: #333;
    margin-bottom: 1rem;
}

.wisdom-messages {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.wisdom-message {
    margin: 0.5rem 0;
    color: #1565c0;
    font-weight: 500;
}

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

.achievement-item {
    background: linear-gradient(145deg, #fff3e0, #ffe0b2);
    border-radius: 10px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.achievement-emoji {
    font-size: 1.5rem;
}

.achievement-info strong {
    display: block;
    color: #e65100;
    margin-bottom: 0.3rem;
}

.achievement-info p {
    margin: 0;
    color: #bf360c;
    font-size: 0.9rem;
}

.summary-stats {
    background: linear-gradient(145deg, #f3e5f5, #e1bee7);
    border-radius: 15px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.summary-stats p {
    margin: 0.5rem 0;
    color: #4a148c;
    font-weight: 500;
}

.victory-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.victory-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.victory-btn.primary {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.victory-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.4);
}

.victory-btn.secondary {
    background: linear-gradient(45deg, #16a085, #1abc9c);
    color: white;
}

.victory-btn.secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(22, 160, 133, 0.4);
}

/* Food Selection Modal Styles */
.food-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.food-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #27ae60;
    border-radius: 15px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    cursor: pointer;
    transition: all 0.3s ease;
}

.food-option:hover {
    border-color: #2ecc71;
    background: linear-gradient(145deg, #f8fff8, #e8f5e8);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.2);
}

.food-option.insufficient-funds {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #e74c3c;
    background: linear-gradient(145deg, #fff5f5, #ffebee);
}

.food-option.insufficient-funds:hover {
    transform: none;
    box-shadow: none;
}

.food-icon {
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.food-info {
    flex: 1;
    text-align: left;
}

.food-info h4 {
    color: #27ae60;
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.food-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
}

.food-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.food-effects span {
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.effect-health {
    background: rgba(46, 204, 113, 0.2);
    color: #27ae60;
}

.effect-happiness {
    background: rgba(241, 196, 15, 0.2);
    color: #f39c12;
}

.effect-cleanliness {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.food-cost {
    font-size: 1.1rem;
    font-weight: bold;
    color: #27ae60;
    background: rgba(46, 204, 113, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    display: inline-block;
}

.food-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.food-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 120px;
}

.food-btn.cancel {
    background: linear-gradient(45deg, #95a5a6, #7f8c8d);
    color: white;
}

.food-btn.cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(149, 165, 166, 0.4);
}

/* Pet Naming Modal Styles */
.pet-preview {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    border: 2px solid #27ae60;
}

.pet-preview-emoji {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    animation: petBounce 2s ease-in-out infinite;
}

.pet-preview-type {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

.name-input-container {
    margin: 1.5rem 0;
}

#pet-name-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #27ae60;
    border-radius: 25px;
    font-size: 1.1rem;
    text-align: center;
    font-weight: bold;
    background: white;
    outline: none;
    transition: all 0.3s ease;
}

#pet-name-input:focus {
    border-color: #2ecc71;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2);
    transform: scale(1.02);
}

#pet-name-input:invalid {
    border-color: #e74c3c;
}

.name-validation {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
    text-align: center;
}

.name-validation.error {
    color: #e74c3c;
}

.name-validation.success {
    color: #27ae60;
}

.name-suggestions {
    margin: 1.5rem 0;
    text-align: center;
}

.name-suggestions h4 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.suggestion-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.suggestion-btn {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid #27ae60;
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #27ae60;
    font-weight: 500;
}

.suggestion-btn:hover {
    background: linear-gradient(145deg, #27ae60, #2ecc71);
    color: white;
    transform: translateY(-2px);
}

.naming-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.naming-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 120px;
}

.naming-btn.confirm {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.naming-btn.confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.naming-btn.confirm:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.naming-btn.random {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
}

.naming-btn.random:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

/* Achievement Notification */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: linear-gradient(145deg, #fff3e0, #ffe0b2);
    border: 2px solid #ff9800;
    border-radius: 15px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.3);
    z-index: 1500;
    transition: all 0.3s ease;
    max-width: 350px;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.achievement-content .achievement-emoji {
    font-size: 2rem;
}

.achievement-text strong {
    display: block;
    color: #e65100;
    margin-bottom: 0.3rem;
}

.achievement-text p {
    margin: 0;
    color: #bf360c;
    font-weight: bold;
}

.achievement-text small {
    color: #8d6e63;
    font-size: 0.8rem;
}

/* Modal z-index fixes */
.modal, [id*="-modal"] {
    z-index: 1000 !important;
}

.victory-modal {
    z-index: 1100 !important;
}

.injury-modal {
    z-index: 1050 !important;
}

.warning-modal {
    z-index: 1075 !important;
}

/* Injury status display */
.injury-status {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.injury-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.injury-item:hover {
    background: #f8f9fa;
    border-color: #ff6b6b;
    transform: translateY(-1px);
}

.injury-name {
    font-weight: bold;
    color: #dc3545;
}

.injury-cost {
    font-size: 0.9em;
    color: #6c757d;
}

.injury-time {
    font-size: 0.8em;
    color: #28a745;
}

/* Enhanced financial warning styles */
.budget-display.low-funds {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.2);
    animation: pulse-warning 2s infinite;
}

.budget-display.critical-funds {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    animation: pulse-critical 1.5s infinite;
}

.budget-display.danger-funds {
    border-color: #c0392b;
    background: rgba(192, 57, 43, 0.3);
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 5px rgba(243, 156, 18, 0.5); }
    50% { box-shadow: 0 0 15px rgba(243, 156, 18, 0.8); }
}

@keyframes pulse-critical {
    0%, 100% { box-shadow: 0 0 8px rgba(231, 76, 60, 0.6); }
    50% { box-shadow: 0 0 20px rgba(231, 76, 60, 0.9); }
}

@keyframes pulse-danger {
    0%, 100% { 
        box-shadow: 0 0 10px rgba(192, 57, 43, 0.8);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 25px rgba(192, 57, 43, 1);
        transform: scale(1.05);
    }
}

/* Bankruptcy warning */
#bankruptcy-warning {
    background: #dc3545;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
    margin: 0.5rem 0;
    animation: flash-warning 1s infinite;
}

@keyframes flash-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Bills status display */
.bills-status {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0;
}

.bills-status h4 {
    margin: 0 0 0.5rem 0;
    color: #1976d2;
}

.bill-item {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.25rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bill-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-1px);
}

.bill-item.due {
    border-color: #dc3545;
    background: #fff5f5;
}

.bill-info {
    flex: 1;
}

.bill-name {
    font-weight: bold;
    color: #333;
}

.bill-amount {
    color: #dc3545;
    font-weight: bold;
    font-size: 1.1em;
}

.bill-due {
    font-size: 0.8em;
    color: #6c757d;
}

.bill-description {
    font-size: 0.9em;
    color: #6c757d;
    margin: 0.25rem 0;
}

.bills-summary {
    text-align: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
}

.pay-bill-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.2s ease;
}

.pay-bill-btn:hover {
    background: #218838;
}

.pay-bill-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}
