/* === LAYOUT: СОВЕТ + САД === */
.dashboard-layout {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 25px;
    margin-bottom: 50px;
    align-items: stretch;
}
@media (max-width: 768px) {
    .dashboard-layout { grid-template-columns: 1fr; }
}

/* Левая часть: Блок ИИ-Совета */
.ai-advice-slot {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(201, 169, 97, 0.2);
    border-radius: 16px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    min-height: 300px;
}
.ai-advice-slot::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--gold), transparent);
}
.advice-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.advice-header i { font-size: 1.5rem; color: var(--gold); }
.advice-header h3 { font-family: 'Cinzel', serif; color: var(--gold); margin: 0; font-size: 1.2rem; }
.advice-content { color: var(--text-secondary); font-size: 1rem; line-height: 1.8; font-style: italic; flex: 1; }

/* Правая часть: Сетка Плодов */
.garden-header { margin-bottom: 20px; }
.garden-header h3 { font-family: 'Cinzel', serif; color: var(--text-primary); margin: 0; font-size: 1.5rem; }
.garden-header p { color: var(--text-secondary); margin: 5px 0 0; font-size: 0.9rem; }
.garden-header span { color: var(--gold); font-weight: bold; font-size: 1.1rem; }

.knowledge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; }

.grid-cell-empty {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(201, 169, 97, 0.1);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(201, 169, 97, 0.1); font-size: 1.5rem;
}

.grid-cell-filled {
    aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative;
    border: 1px solid rgba(201, 169, 97, 0.4); box-shadow: 0 0 15px rgba(201, 169, 97, 0.2);
    transition: all 0.3s ease; text-decoration: none; display: block;
}
.grid-cell-filled.artifact { border-color: rgba(168, 85, 247, 0.4); box-shadow: 0 0 15px rgba(168, 85, 247, 0.2); }
.grid-cell-filled:hover { transform: scale(1.05); box-shadow: 0 0 25px rgba(201, 169, 97, 0.5); z-index: 2; }
.grid-cell-filled img { width: 100%; height: 100%; object-fit: cover; opacity: 0.8; }
.cell-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 10px; background: linear-gradient(to top, rgba(11, 11, 20, 0.95) 0%, transparent 100%); color: #fff; }
.cell-title { font-size: 0.8rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-progress { height: 4px; background: rgba(0,0,0,0.5); border-radius: 100px; margin-top: 5px; overflow: hidden; }
.cell-progress-bar { height: 100%; background: var(--gold); }
.artifact .cell-progress-bar { background: #a855f7; }

/* Инструменты */
.tools-section { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; margin-top: 40px; margin-bottom: 40px; padding: 30px; background: rgba(255,255,255,0.02); border: 1px solid rgba(201, 169, 97, 0.1); border-radius: 16px; }
.tool-leaf { width: 100px; height: 100px; background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(10px); border: 1px solid rgba(201, 169, 97, 0.2); border-radius: 50%; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--gold); font-size: 0.75rem; font-weight: bold; transition: all 0.3s ease; text-decoration: none; padding: 10px; box-sizing: border-box; }
.tool-leaf i { font-size: 1.8rem; margin-bottom: 5px; }
.tool-leaf:hover { background: rgba(201, 169, 97, 0.1); border-color: var(--gold); box-shadow: 0 0 20px rgba(201, 169, 97, 0.3); transform: translateY(-5px); }

/* Модалки */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 5, 9, 0.9); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; z-index: 9999; opacity: 0; transition: opacity 0.3s ease; }
.modal-overlay.active { display: flex; opacity: 1; }
.modal-content { background: #0B0B14; border: 1px solid rgba(201, 169, 97, 0.3); padding: 40px; border-radius: 16px; max-width: 1200px; width: 90%; max-height: 85vh; overflow-y: auto; transform: scale(0.5) rotate(45deg); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 0 50px rgba(201, 169, 97, 0.2); position: relative; }
.modal-overlay.active .modal-content { transform: scale(1) rotate(0deg); }
.close-modal { position: absolute; top: 20px; right: 20px; background: transparent; border: 1px solid #ef4444; color: #ef4444; border-radius: 50%; width: 35px; height: 35px; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }

/* Ключ Мастера (18-я ячейка) */
.grid-cell-master {
    aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: radial-gradient(circle, rgba(201,169,97,0.2) 0%, transparent 70%); border: 2px solid rgba(201, 169, 97, 0.6);
    cursor: pointer; transition: all 0.3s ease; box-shadow: 0 0 20px rgba(201, 169, 97, 0.2); animation: pulse-master 3s infinite; text-align: center;
}
.grid-cell-master:hover { transform: scale(1.05); box-shadow: 0 0 35px rgba(201, 169, 97, 0.8); background: radial-gradient(circle, rgba(201,169,97,0.3) 0%, transparent 70%); }
.grid-cell-master .master-emoji { font-size: 2.5rem; margin-bottom: 5px; filter: drop-shadow(0 0 8px rgba(201, 169, 97, 0.8)); animation: float-master 4s ease-in-out infinite; }
.grid-cell-master span { font-size: 0.75rem; color: var(--gold); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
@keyframes pulse-master { 0%, 100% { box-shadow: 0 0 15px rgba(201, 169, 97, 0.2); border-color: rgba(201, 169, 97, 0.4); } 50% { box-shadow: 0 0 30px rgba(201, 169, 97, 0.6); border-color: rgba(201, 169, 97, 0.9); } }
@keyframes float-master { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* === СТИЛИ УГВЭЯ / КОСМОСА === */
#ugwe-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 9, 0.98); z-index: 99999;
    display: none; align-items: center; justify-content: center; flex-direction: column;
    opacity: 0; transition: opacity 1s ease; overflow: hidden;
}
#ugwe-overlay.active { display: flex; opacity: 1; }
#ugwe-overlay.cosmos-mode { background: #000000; }
.stars-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.star { position: absolute; background: #fff; border-radius: 50%; animation: fall-down linear infinite; }
@keyframes fall-down { 0% { transform: translateY(-100px); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(100vh); opacity: 0; } }

.ugwe-image-container { position: relative; margin-bottom: 40px; z-index: 2; }
.ugwe-glow {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 300px; height: 300px; background: radial-gradient(circle, rgba(201,169,97,0.3) 0%, transparent 70%);
    filter: blur(20px); animation: ugwe-breathe 4s ease-in-out infinite;
}
.ugwe-glow.master-glow { background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(201,169,97,0.2) 50%, transparent 70%); }
#ugwe-img {
    position: relative; height: 250px; width: auto;
    filter: drop-shadow(0 0 15px rgba(201,169,97,0.6)) brightness(1.1);
    animation: ugwe-float 6s ease-in-out infinite; display: none;
}
@keyframes ugwe-breathe { 0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); } }
@keyframes ugwe-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

.ugwe-text-container { max-width: 600px; text-align: center; padding: 0 20px; z-index: 2; }
.ugwe-text { font-family: 'Cinzel', serif; font-size: 1.4rem; color: #C9A961; line-height: 1.6; text-shadow: 0 0 10px rgba(201,169,97,0.5); min-height: 100px; }
.ugwe-close-btn { margin-top: 40px; padding: 10px 30px; background: transparent; border: 1px solid #C9A961; color: #C9A961; border-radius: 8px; cursor: pointer; font-weight: bold; opacity: 0; transition: opacity 1s ease; }
.ugwe-close-btn:hover { background: rgba(201,169,97,0.1); }

.master-path-card {
    width: 120px; height: 120px; background: rgba(201,169,97,0.1); border: 1px solid rgba(201,169,97,0.4);
    border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; color: var(--gold); font-size: 2.5rem; gap: 10px;
}
.master-path-card span { font-size: 0.8rem; font-weight: bold; text-align: center; font-family: 'Cinzel', serif; }
.master-path-card:hover { background: rgba(201,169,97,0.3); border-color: var(--gold); transform: scale(1.05); }