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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    background: #0f0f23;
}

#game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#game-container canvas {
    display: block;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Pet Info Panel */
#pet-info {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

#pet-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #00ffff, #ff00ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#pet-species {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Status Bars */
#status-bars {
    position: absolute;
    top: 100px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-label {
    font-size: 0.85rem;
    color: white;
    min-width: 90px;
}

.bar-container {
    width: 150px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease, background 0.3s ease;
    position: relative;
}

/* Bar colors based on stat type */
#hunger-bar {
    background: linear-gradient(90deg, #ff6b6b, #ffa502);
}

#fun-bar {
    background: linear-gradient(90deg, #a55eea, #ff6b81);
}

#energy-bar {
    background: linear-gradient(90deg, #2ed573, #7bed9f);
}

/* Low stat warning animation */
.bar-fill.critical {
    animation: pulse-warning 1s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-value {
    font-size: 0.8rem;
    color: white;
    min-width: 30px;
    text-align: right;
    font-weight: 600;
}

/* Action Buttons */
#action-buttons {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    pointer-events: auto;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:hover {
    transform: translateY(-5px);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
}

.action-btn:active {
    transform: translateY(-2px);
}

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

.action-btn.secondary {
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg, rgba(255, 100, 100, 0.2), rgba(255, 100, 100, 0.05));
}

.action-btn.secondary:hover {
    box-shadow: 0 10px 30px rgba(255, 100, 100, 0.3);
}

.action-btn.active {
    background: linear-gradient(145deg, rgba(0, 255, 255, 0.4), rgba(0, 255, 255, 0.1));
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    animation: button-glow 1.5s ease-in-out infinite;
}

@keyframes button-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.4); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.7); }
}

.btn-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.btn-label {
    font-size: 0.75rem;
    color: white;
    font-weight: 500;
}

/* Notification */
#notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 30px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    z-index: 100;
    backdrop-filter: blur(10px);
}

#notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

#notification.hidden {
    display: none;
}

#notification.success {
    background: linear-gradient(135deg, rgba(46, 213, 115, 0.9), rgba(123, 237, 159, 0.9));
    border: 1px solid rgba(46, 213, 115, 0.5);
}

#notification.warning {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.9), rgba(255, 107, 107, 0.9));
    border: 1px solid rgba(255, 165, 2, 0.5);
}

#notification.error {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.9), rgba(255, 107, 107, 0.9));
    border: 1px solid rgba(255, 71, 87, 0.5);
}

#notification.info {
    background: linear-gradient(135deg, rgba(0, 206, 201, 0.9), rgba(129, 236, 236, 0.9));
    border: 1px solid rgba(0, 206, 201, 0.5);
}

/* New Pet Modal */
#new-pet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#new-pet-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.95), rgba(20, 20, 40, 0.95));
    padding: 40px;
    border-radius: 25px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    max-width: 400px;
}

.modal-content h2 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.confirm {
    background: linear-gradient(135deg, #00ffff, #00d4ff);
    color: #1a1a2e;
    font-weight: 600;
}

.modal-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mood indicator */
#mood-indicator {
    position: absolute;
    top: 100px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    padding: 15px 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

#mood-emoji {
    font-size: 2rem;
    margin-bottom: 5px;
}

#mood-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

#pet-age {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    margin-top: 5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #pet-name {
        font-size: 1.5rem;
    }

    #status-bars {
        top: 80px;
        left: 10px;
    }

    .status-bar {
        padding: 6px 12px;
    }

    .status-label {
        min-width: 70px;
        font-size: 0.75rem;
    }

    .bar-container {
        width: 100px;
    }

    #action-buttons {
        bottom: 20px;
        gap: 10px;
    }

    .action-btn {
        width: 65px;
        height: 65px;
    }

    .action-btn.secondary {
        width: 55px;
        height: 55px;
    }

    .btn-icon {
        font-size: 1.4rem;
    }

    .btn-label {
        font-size: 0.65rem;
    }

    #mood-indicator {
        top: auto;
        bottom: 120px;
        right: 10px;
        padding: 10px 15px;
    }
}

/* Activity indicators */
.activity-indicator {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    animation: float 1s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); opacity: 1; }
    50% { transform: translate(-50%, -50%) translateY(-20px); opacity: 0.8; }
}

/* Loading screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f0f23;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 255, 255, 0.2);
    border-top-color: #00ffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
}

/* Stars background effect (CSS only) */
#ui-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255, 255, 255, 0.3), transparent);
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
