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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    padding: 1rem;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
button:focus, 
input:focus {
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#user-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.2rem;
    flex-wrap: wrap;
}

#user-info span {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

/* Game Area */
#game-area {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

#bubble-container {
    display: none;
}

.bubble {
    position: absolute;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), rgba(255,255,255,0.3));
    border-radius: 50%;
    animation: float-up 3s ease-out forwards;
    pointer-events: none;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-50px) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-200px) scale(0.5);
        opacity: 0;
    }
}

#stats {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

#stats p {
    margin: 0.5rem 0;
}

#boost-status {
    font-weight: bold;
    color: #FFD700;
}

/* Controls */
#controls {
    text-align: center;
}

.primary-btn {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-height: 44px;
    min-width: 44px;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn.active {
    background: linear-gradient(45deg, #f44336, #d32f2f);
}

/* Quest Section */
#quest-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

#quest-section h2 {
    margin-bottom: 1rem;
    text-align: center;
}

#quest-progress {
    margin-top: 0.5rem;
    font-weight: bold;
}

/* Navigation */
nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 1rem;
    min-height: 44px;
    min-width: 44px;
}

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

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 1rem;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.modal-header h2 {
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

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

/* Shop Items */
#shop-items, #diamond-shop-items {
    padding: 1.5rem;
}

.shop-item {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
}

.shop-item h3 {
    margin-bottom: 0.5rem;
    color: #FFD700;
}

.shop-item p {
    margin: 0.25rem 0;
    opacity: 0.9;
}

.shop-item button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
}

.shop-item button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.shop-item button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Leaderboard */
#leaderboard-content {
    padding: 1.5rem;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.leaderboard-entry.current-user {
    background: rgba(255,215,0,0.2);
    border: 2px solid #FFD700;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #user-info {
        gap: 1rem;
        font-size: 1rem;
    }
    
    #game-area {
        padding: 1.5rem;
    }
    
    nav {
        gap: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }
    
    .primary-btn, .nav-btn, .shop-item button {
        border: 2px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bubble {
        animation: none;
    }
    
    button {
        transition: none;
    }
    
    .primary-btn:hover, .nav-btn:hover {
        transform: none;
    }
}
.pet-card {
    border: 1px solid #ccc;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    background: #f9f9f9;
}

.pet-card.active {
    border: 2px solid #4CAF50;
    background: #e8f5e9;
}

.pet-card h3 {
    margin: 0 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pet-stats {
    margin: 10px 0;
    font-size: 0.9em;
}

.pet-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.pet-controls button {
    flex: 1;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
}

.pet-controls button:hover {
    background: #f0f0f0;
}

.pet-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.element-water { color: #1976D2; }
.element-fire { color: #D32F2F; }
.element-earth { color: #388E3C; }
.element-lightning { color: #FBC02D; }
.element-shadow { color: #7B1FA2; }
.element-light { color: #FFA000; }
.element-wind { color: #00BCD4; }

/* Auth Modal */
#auth-modal {
    z-index: 10000;
}

#auth-modal .modal-content {
    max-width: 400px;
}

#auth-content input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

#auth-content button {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

#auth-content button:hover {
    background: #45a049;
}

#auth-content p {
    text-align: center;
    margin: 16px 0;
}

#auth-content a {
    color: #2196F3;
    cursor: pointer;
    text-decoration: none;
}

#auth-content a:hover {
    text-decoration: underline;
}

#auth-error {
    padding: 12px;
    margin: 12px 0;
    background: #ffebee;
    border-radius: 8px;
    text-align: center;
}
#logout-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px 10px;
    margin-left: 10px;
    font-size: 14px;
}

#logout-btn:hover {
    text-decoration: underline;
}
