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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f8f8;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#scene-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

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

.ui-element {
    position: absolute;
    pointer-events: auto;
}

#loading {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: opacity 0.5s ease;
}

.pulse {
    width: 40px;
    height: 40px;
    background: #6bcf7f;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 0.4; }
}

#loading p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

/* Health Dashboard */
#health-dashboard {
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 250px;
}

.health-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.health-meter:last-child {
    margin-bottom: 0;
}

.meter-label {
    font-size: 14px;
    font-weight: 600;
    min-width: 80px;
    color: #333;
}

.meter-bar {
    flex: 1;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.meter-fill {
    height: 100%;
    background: #6bcf7f;
    border-radius: 10px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 50%;
}

.meter-value {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    min-width: 40px;
    text-align: right;
}

/* Action Buttons */
#action-buttons {
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.action-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    min-width: 100px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.action-btn.cooling-down {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-btn.cooling-down:hover {
    transform: none;
}

.btn-icon {
    font-size: 24px;
}

.btn-text {
    font-weight: 600;
    text-align: center;
}

.cooldown {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* Recovery Score */
#recovery-score {
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.score-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.score-bar {
    height: 24px;
    background: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin-bottom: 8px;
}

.score-fill {
    height: 100%;
    background: #6bcf7f;
    border-radius: 12px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 50%;
}

.score-value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

/* Daily Goals */
#daily-goals {
    top: 200px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.goals-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.goal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.goal-item:last-child {
    margin-bottom: 0;
}

.goal-item.completed {
    background: rgba(107, 207, 127, 0.2);
}

.goal-icon {
    font-size: 16px;
}

.goal-text {
    flex: 1;
    font-size: 12px;
    color: #666;
}

.goal-progress {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Action Feedback */
.action-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

/* Other UI Elements */
#reset-btn {
    top: 20px;
    right: 250px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

#reset-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#reset-btn svg {
    stroke: #666;
}

#instructions {
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    text-align: center;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(10px);
}

.berrry-footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    text-align: center;
    pointer-events: auto;
}

.berrry-footer p {
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    color: #666;
    margin: 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.berrry-footer a {
    color: #ff6b6b;
    text-decoration: none;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #health-dashboard {
        top: 10px;
        left: 10px;
        padding: 15px;
        min-width: 200px;
    }
    
    #recovery-score {
        top: 10px;
        right: 10px;
        padding: 12px 15px;
        min-width: 150px;
    }
    
    #daily-goals {
        top: 150px;
        left: 10px;
        padding: 12px;
        min-width: 180px;
    }
    
    #reset-btn {
        top: 10px;
        right: 180px;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    #action-buttons {
        bottom: 80px;
        gap: 10px;
    }
    
    .action-btn {
        padding: 12px 15px;
        min-width: 80px;
        font-size: 12px;
    }
    
    .btn-icon {
        font-size: 20px;
    }
    
    #instructions {
        bottom: 30px;
        font-size: 12px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    #health-dashboard,
    #recovery-score,
    #daily-goals {
        position: relative;
        margin: 5px;
        display: inline-block;
        min-width: auto;
        width: calc(50% - 10px);
    }
    
    #ui-overlay {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 5px;
    }
    
    #action-buttons {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin: 10px 0;
    }
    
    #reset-btn {
        position: relative;
        top: auto;
        right: auto;
        margin: 5px auto;
    }
    
    #instructions {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin: 5px;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    #health-dashboard {
        top: 5px;
        left: 5px;
        padding: 10px;
    }
    
    #daily-goals {
        display: none;
    }
    
    #action-buttons {
        bottom: 40px;
    }
    
    .berrry-footer {
        bottom: 5px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .ui-element {
        background: white !important;
        border: 2px solid #333 !important;
    }
    
    .action-btn {
        background: white !important;
        border: 2px solid #333 !important;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}