:root {
    --bg-color: #f0fdf4;
    /* Light mint green background */
    --panel-bg: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(255, 255, 255, 0.5);

    --color-hunger: #f59e0b;
    /* Amber */
    --color-happiness: #ec4899;
    /* Pink */
    --color-energy: #3b82f6;
    /* Blue */

    --text-main: #1f2937;
    --text-muted: #4b5563;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(134, 239, 172, 0.2), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(147, 197, 253, 0.2), transparent 25%);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

header h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.main-card {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Pet Display Area */
.pet-display {
    height: 300px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 20px;
    overflow: hidden;
    /* Keep canvas contained */
}

/* ThreeJS Canvas */
.pet-display canvas {
    width: 100% !important;
    height: 100% !important;
    outline: none;
}

/* Stats */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-label {
    width: 80px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.progress-bar-container {
    flex-grow: 1;
    height: 16px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
}

.fill-hunger {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.fill-happiness {
    background: linear-gradient(90deg, #f472b6, #ec4899);
}

.fill-energy {
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
}

/* Warning colors (when low) */
.progress-bar.low {
    background: linear-gradient(90deg, #f87171, #ef4444) !important;
    animation: pulse-danger 1s infinite alternate;
}

@keyframes pulse-danger {
    from {
        opacity: 0.8;
    }

    to {
        opacity: 1;
    }
}

/* Actions */
.actions-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.action-btn {
    border: none;
    border-radius: 16px;
    padding: 14px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: var(--text-main);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.action-btn .icon {
    font-size: 1.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.action-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
}

.btn-feed:hover {
    color: var(--color-hunger);
    background: #fef3c7;
}

.btn-play:hover {
    color: var(--color-happiness);
    background: #fce7f3;
}

.btn-sleep:hover {
    color: var(--color-energy);
    background: #dbeafe;
}

/* Disabled state */
.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Customizer Panel */
.customizer-panel {
    margin-top: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.customizer-panel h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 5px;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slider-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.slider-group input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

.slider-group input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.slider-group input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.slider-group input[type=range]:focus {
    outline: none;
}