/* --- ESTILOS VISUALES v21.4 (TIERRA DINÁMICA) --- */
:root {
    --bg-color: #2c1e16; 
    --glass-panel: rgba(30, 25, 20, 0.98); 
    --border-panel: rgba(255, 255, 255, 0.15);
    --text-main: #ffffff;
    --font-main: 'Fredoka', sans-serif;
    
    /* COLORES DE TIERRA */
    --huerto-bg-wet: #3e2723; /* Oscuro (Abono/Húmedo) */
    --huerto-bg-dry: #8d6e63; /* Claro (Seco/Polvo) */
    --huerto-border: #795548;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    margin: 0;
    overflow-x: hidden;
    user-select: none;
    padding-bottom: 90px;
}

/* --- PANTALLA DE BLOQUEO --- */
#block-screen {
    position: fixed; inset: 0; z-index: 9999;
    background: #1a1a1a;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 20px;
}

/* --- ASISTENTE FLOTANTE --- */
#floating-assistant {
    position: fixed; bottom: 20px; right: 15px; width: 75px; height: 75px;
    z-index: 9000; border-radius: 50%; border: 3px solid #4ade80;
    background: #2c1e16; overflow: hidden; box-shadow: 0 0 20px rgba(0,0,0,0.7);
    transition: transform 0.2s; cursor: pointer;
}
#floating-assistant:active { transform: scale(0.90); }
.float-anim { animation: floatY 4s ease-in-out infinite; }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* --- MODAL DEL ASISTENTE --- */
#assistant-modal {
    position: fixed; bottom: 100px; right: 20px; width: 300px; max-height: 70vh;
    background: rgba(20, 20, 20, 0.98); border: 1px solid #4ade80; border-radius: 20px;
    z-index: 8999; display: flex; flex-direction: column; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transform-origin: bottom right; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0; transform: scale(0.8) translateY(20px); pointer-events: none;
}
#assistant-modal.open { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }

.chat-header { background: #14532d; padding: 15px; border-top-left-radius: 18px; border-top-right-radius: 18px; display: flex; justify-content: space-between; align-items: center; }
.chat-body { padding: 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.chat-btn {
    background: #2c2c2c; color: white; border: 1px solid #444; padding: 12px; border-radius: 12px;
    text-align: left; font-size: 12px; transition: all 0.2s; cursor: pointer;
}
.chat-btn:active { background: #444; transform: scale(0.98); }
.chat-btn-back { background: #7f1d1d; text-align: center; font-weight: bold; margin-bottom: 5px; }

.chat-bubble {
    background: #1e3a8a; padding: 12px; border-radius: 12px; border-bottom-left-radius: 2px;
    font-size: 11px; line-height: 1.4; color: #e0f2fe; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- UI ELEMENTS --- */
.glass-box { background: var(--glass-panel); border: 1px solid var(--border-panel); box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.5); }

/* TARJETA HUERTO (AHORA CON TRANSICIÓN DE COLOR) */
.huerto-card { 
    background: var(--huerto-bg-wet); 
    border: 3px solid var(--huerto-border); 
    box-shadow: inset 0 0 30px rgba(0,0,0,0.6), 0 10px 20px -5px rgba(0, 0, 0, 0.6); 
    transition: background 1.5s ease; /* Transición suave al regar */
}

/* CLASE PARA CUANDO FALTA AGUA (Tierra Seca) */
.huerto-dry {
    background: var(--huerto-bg-dry) !important;
    border-color: #a1887f !important;
}

.slot-node { border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.4); overflow: hidden; }
.hidden-force { display: none !important; }
.input-field { background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 12px; border-radius: 8px; width: 100%; font-size: 0.9rem; outline: none; }

.text-shadow-hard { text-shadow: 0 1px 2px rgba(0,0,0,0.8); }

#toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { background: #1e1b18; border-left: 4px solid #6366f1; color: white; padding: 12px 16px; border-radius: 4px; display: flex; align-items: center; gap: 10px; transform: translateX(120%); transition: transform 0.4s; width: 280px; pointer-events: auto; }
.toast.show { transform: translateX(0); }
.toast.success { border-color: #22c55e; }

.fade-in { animation: fadeIn 0.5s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.pop-in { animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
@keyframes popIn { 0% { opacity: 0; transform: scale(0); } 80% { transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
.alive-plant svg { animation: breathe 3s ease-in-out infinite; transform-origin: bottom center; }
@keyframes breathe { 0% { transform: scale(1); } 50% { transform: scale(1.15) rotate(5deg); } }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* --- ANIMACIONES FX --- */
.falling-coin { position: absolute; top: -50px; font-size: 24px; animation: fallDown linear forwards; z-index: 9999; }
@keyframes fallDown { to { transform: translateY(110vh) rotate(360deg); } }

/* CLASE PARA PLANTAS SECAS (Sepia) */
.plant-dry { filter: sepia(0.8) hue-rotate(-30deg) !important; animation: none !important; opacity: 0.8; }

.falling-drop { position: absolute; top: -20px; font-size: 18px; color: #60a5fa; animation: fallDown linear forwards; z-index: 9999; }

#btn-regar { position: relative; overflow: hidden; }
#btn-regar::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(to bottom right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%); transform: rotate(45deg); animation: shine 3s infinite; }
@keyframes shine { 0% { transform: translateX(-100%) rotate(45deg); } 100% { transform: translateX(100%) rotate(45deg); } }