/* =========================================
   БАЗОВЫЕ НАСТРОЙКИ
========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }

html { font-size: 16px; height: 100%; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Nunito', sans-serif; color: #2C3E2D; background-color: #C6D0BC;
    min-height: 100%; display: flex; flex-direction: column;
    user-select: none; -webkit-user-select: none;
    transition: background-color 1.5s cubic-bezier(0.25, 1, 0.5, 1); position: relative;
}

body.meeting-mode { background-color: #0B1511; }

@media (min-width: 768px) { body { height: 100vh; overflow: hidden; } }

.hidden { display: none !important; opacity: 0; pointer-events: none; }

/* =========================================
   ФОН (ТУМАН, ШУМ, СВЕТЛЯЧКИ)
========================================= */
.texture-overlay { position: fixed; inset: 0; z-index: 5; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E"); }

.zen-mist { position: absolute; border-radius: 50%; filter: blur(140px); pointer-events: none; transition: opacity 1.5s ease; z-index: 2; max-width: 100vw; }
.mist-1 { width: 70vw; height: 70vw; background: #B4C0A9; top: -20%; left: -10%; opacity: 0.7; animation: driftSlow 35s infinite ease-in-out; }
.mist-2 { width: 55vw; height: 55vw; background: #D7DEC2; bottom: -15%; right: -5%; opacity: 0.6; animation: driftFast 25s infinite ease-in-out; }
.mist-3 { width: 45vw; height: 45vw; background: #BAC5AC; top: 40%; left: 45%; opacity: 0.5; animation: driftMedium 30s infinite ease-in-out; }
body.meeting-mode .zen-mist { opacity: 0; }

@keyframes driftSlow { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(80px, 40px) scale(1.1); } }
@keyframes driftMedium { 0%, 100% { transform: translate(0, 0) scale(1.05); } 50% { transform: translate(-60px, -50px) scale(0.95); } }
@keyframes driftFast { 0%, 100% { transform: translate(0, 0) scale(0.9); } 50% { transform: translate(-40px, 60px) scale(1.15); } }

#fireflies-container { position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.5s ease; }
body.meeting-mode #fireflies-container { opacity: 1; }
.firefly { position: absolute; width: 6px; height: 6px; background: #F3C06B; border-radius: 50%; box-shadow: 0 0 10px #F3C06B, 0 0 20px #D97706, 0 0 35px rgba(217, 119, 6, 0.4); opacity: 0; }
.fly-a { animation: fly-1 8s infinite ease-in-out; } .fly-b { animation: fly-2 11s infinite ease-in-out; } .fly-c { animation: fly-3 9s infinite ease-in-out; }
@keyframes fly-1 { 0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.8); } 50% { opacity: 0.7; transform: translate(40px, -60px) scale(1.2); } }
@keyframes fly-2 { 0%, 100% { opacity: 0; transform: translate(0, 0) scale(1); } 45% { opacity: 0.9; transform: translate(-60px, -30px) scale(1.3); } }
@keyframes fly-3 { 0%, 100% { opacity: 0; transform: translate(0, 0) scale(0.7); } 60% { opacity: 0.8; transform: translate(50px, 50px) scale(1.1); } }

/* =========================================
   ИНТЕРФЕЙС (ВЕРХНЯЯ ПАНЕЛЬ И ТЕКСТ)
========================================= */
.top-panel {
    width: 100%; max-width: 1380px; margin: 0 auto; display: flex; justify-content: space-between;
    align-items: center; padding: 2rem 1.5rem 1.5rem; z-index: 40; position: relative; flex-shrink: 0; gap: 1rem;
}

.zen-score {
    font-family: 'Fredoka', sans-serif; font-weight: 700; background-color: #A7E9AF; color: #1A2421;
    padding: 0 1.5rem; height: 4rem; border-radius: 1.5rem; display: flex; align-items: center; gap: 0.75rem;
    border: 2px solid #1A2421; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); font-size: 1.125rem;
    white-space: nowrap; transition: opacity 0.5s ease;
}
.zen-score.visible { opacity: 1; pointer-events: auto; }
.zen-score .icon { width: 1.75rem; height: 1.75rem; }

.meeting-toggle-wrapper {
    display: flex; align-items: center; cursor: pointer; background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px); padding: 0 1.5rem; height: 4rem; border-radius: 1.5rem;
    box-shadow: 0 30px 60px -15px rgba(28, 38, 29, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: background-color 0.3s; border: 2px solid transparent; flex-shrink: 0;
    margin-left: auto;
}
.meeting-toggle-wrapper:hover { background: #fff; border-color: rgba(255,255,255,0.4); }
.toggle-label { margin-right: 1rem; font-weight: 800; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.025em; }
.toggle-switch { position: relative; display: flex; align-items: center; }
.toggle-switch input { position: absolute; width: 0; height: 0; opacity: 0; }
.toggle-bg { width: 3.5rem; height: 1.75rem; background: rgba(229, 231, 235, 0.8); border-radius: 999px; transition: 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.04); }
.toggle-dot { position: absolute; left: 0.25rem; top: 0.25rem; width: 1.25rem; height: 1.25rem; background: white; border-radius: 50%; transition: transform 0.3s; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
input:checked ~ .toggle-bg { background: #2C3E2D; }
input:checked ~ .toggle-dot { transform: translateX(1.75rem); }

/* Инструкция на созвоне */
.meeting-instruction {
    opacity: 0; visibility: hidden; transition: opacity 0.4s ease; pointer-events: none;
    font-size: 1.05rem; font-weight: 600; color: rgba(255,255,255,0.7); 
    text-align: center;
    flex: 1; padding: 0 2rem;
    line-height: 1.4; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.meeting-instruction p { margin-top: 0.2rem; }
.focus-title { color: #ffffff; font-weight: 800; font-size: 1.05rem; display: inline-block; margin-right: 0.5rem; }
body.meeting-mode .meeting-instruction { opacity: 1; visibility: visible; pointer-events: auto; }

@media (max-width: 900px) {
    .top-panel { flex-wrap: wrap; }
    .meeting-instruction { order: 3; width: 100%; flex: none; margin-top: 1.5rem; padding: 0; }
    .focus-title { display: block; margin-right: 0; margin-bottom: 0.25rem; }
}

/* =========================================
   ОСНОВНОЙ КОНТЕНТ (СЕТКА)
========================================= */
.main-content {
    flex: 1; width: 100%; max-width: 1380px; margin: 0 auto; padding: 0 1.5rem 2.5rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.5rem; z-index: 10; position: relative;
}
@media (min-width: 768px) { .main-content { flex-direction: row; gap: 5rem; padding-bottom: 0; } }

/* =========================================
   КАПИБАРА (ОСНОВНАЯ)
========================================= */
.capybara-section {
    position: relative; cursor: pointer; flex-shrink: 0; width: 100%; max-width: 420px;
    display: flex; justify-content: center; transition: 0.7s ease;
    touch-action: manipulation; /* Блокировка zoom-to-tap на мобильных */
}
@media (min-width: 768px) { .capybara-section { max-width: 640px; } }

.capybara-character {
    width: 100%; max-width: 600px; object-fit: contain; filter: drop-shadow(0 25px 25px rgba(44, 62, 45, 0.15));
    transition: filter 0.8s ease; transform-origin: bottom center; z-index: 10; position: relative;
    pointer-events: none; -webkit-user-drag: none; -webkit-touch-callout: none;
    touch-action: manipulation; /* Защита от случайного масштабирования при быстром клике */
}
.capybara-character.sleep-state { filter: brightness(0.7) contrast(1.1) drop-shadow(0 0 25px rgba(255, 255, 255, 0.1)) drop-shadow(0 30px 30px rgba(0, 0, 0, 0.5)); }

@keyframes breatheAlive { 0%, 100% { transform: scaleX(1) scaleY(1); } 50% { transform: scaleX(1.03) scaleY(0.96) translateY(1.5%); } }
.capy-idle { animation: breatheAlive 4s ease-in-out infinite; }
@keyframes cartoonJump { 0%, 100% { transform: scaleX(1) scaleY(1) translateY(0); } 20% { transform: scaleX(1.05) scaleY(0.9) translateY(2%); } 50% { transform: scaleX(0.9) scaleY(1.1) translateY(-15%); } 70% { transform: scaleX(1.05) scaleY(0.9) translateY(5%); } 85% { transform: scaleX(0.98) scaleY(1.02) translateY(-2%); } }
.capy-jump { animation: cartoonJump 0.9s cubic-bezier(0.25, 1, 0.5, 1) forwards; }

.purr-text { position: absolute; top: 0; left: 50%; transform: translateX(-50%); opacity: 0; font-size: 3rem; font-style: italic; color: rgba(255,255,255,0.8); transition: 0.3s; pointer-events: none; z-index: 50; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); }

.fern-container { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.fern-leaf-img { position: absolute; bottom: 10%; left: 50%; height: 112%; width: auto; object-fit: contain; transform-origin: bottom center; opacity: 0.85; transition: 1.5s ease; }
body.meeting-mode .fern-leaf-img { filter: brightness(0.2) contrast(1.1); opacity: 0.5; }
.fern-left { z-index: 1; animation: fernSwayLeftImg 6.3s ease-in-out infinite alternate; } .fern-center { z-index: 2; animation: fernSwayCenterImg 7.9s ease-in-out infinite alternate; } .fern-right { z-index: 3; animation: fernSwayRightImg 6.9s ease-in-out infinite alternate; }
@keyframes fernSwayLeftImg { 0% { transform: translateX(-50%) translateY(0) rotate(-18deg) scale(0.95); } 100% { transform: translateX(-50%) translateY(-12px) rotate(-20.5deg) scale(0.97) scaleY(1.02); } }
@keyframes fernSwayCenterImg { 0% { transform: translateX(-50%) translateY(0) rotate(-1.5deg) scale(1.05); } 100% { transform: translateX(-50%) translateY(-18px) rotate(1.5deg) scale(1.07) scaleY(1.03); } }
@keyframes fernSwayRightImg { 0% { transform: translateX(-50%) translateY(0) rotate(18deg) scale(0.95); } 100% { transform: translateX(-50%) translateY(-14px) rotate(15.5deg) scale(0.97) scaleY(1.02); } }

.zzz-particle { position: absolute; color: #5FA350; font-family: 'Fredoka', sans-serif; font-weight: bold; font-size: 2.4rem; pointer-events: none; animation: floatZzz 3s infinite ease-in-out; z-index: 60; text-shadow: 0 4px 10px rgba(0,0,0,0.6); }
.zzz-1 { top: 5%; right: 15%; animation-delay: 0s; } .zzz-2 { top: 0%; right: 5%; animation-delay: 1s; font-size: 1.6rem; } .zzz-3 { top: -10%; right: 25%; animation-delay: 2s; font-size: 2rem; }
@keyframes floatZzz { 0% { opacity: 0; transform: translate(0, 0) scale(0.5) rotate(-10deg); } 50% { opacity: 1; transform: translate(20px, -40px) scale(1.2) rotate(10deg); } 100% { opacity: 0; transform: translate(40px, -80px) scale(1.5) rotate(-20deg); } }

/* =========================================
   КАРТОЧКИ ДЕЙСТВИЙ
========================================= */
.cards-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; width: 100%; max-width: 760px; transition: 0.7s; opacity: 1; }
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }

.card { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); padding: 1.75rem; border-radius: 2.3rem; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid rgba(255, 255, 255, 0.5); position: relative; z-index: 10; box-shadow: 0 30px 60px -15px rgba(28, 38, 29, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-weight: 800; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; gap: 0.5rem; }
.card-title .icon { width: 1.5rem; height: 1.5rem; stroke-width: 2.5; }
.card-value { font-weight: 700; font-size: 1.25rem; }

.progress-track { height: 1rem; background: rgba(243, 244, 246, 0.8); border-radius: 999px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.04); margin-bottom: 1.5rem; overflow: hidden; width: 100%; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; width: 100%; }

.btn { width: 100%; padding: 0.875rem; border-radius: 1rem; font-weight: 700; font-size: 1.125rem; cursor: pointer; transition: 0.2s; border: 1px solid transparent; outline: none; font-family: inherit; }
.btn:active { transform: scale(0.95); }

.text-water { color: #1E3F66; } .bg-water { background-color: #5B9EDB; } .btn-water { background-color: rgba(240, 248, 255, 0.8); color: #1E3F66; border-color: rgba(219, 234, 254, 0.5); } .btn-water:hover { background-color: #E0EFFF; }
.text-eyes { color: #2C3E2D; } .bg-eyes { background-color: #5FA350; } .btn-eyes { background-color: #F4F9F1; color: #2C3E2D; border-color: rgba(220, 252, 231, 0.4); } .btn-eyes:hover { background-color: #E2EFE0; }
.text-stretch { color: #8A4513; } .bg-stretch { background-color: #F4A261; } .btn-stretch { background-color: #FFF7ED; color: #8A4513; border-color: rgba(255, 237, 213, 0.5); } .btn-stretch:hover { background-color: #FFEDD5; }
.text-breath { color: #5C4636; } .bg-breath { background-color: #B08E74; } .btn-breath { background-color: #FAF7F5; color: #5C4636; border-color: rgba(254, 243, 199, 0.2); } .btn-breath:hover { background-color: #EFE9E4; }

/* =========================================
   МОДАЛЬНОЕ ОКНО (ЗАРЯДКА)
========================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.1); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-box { background: rgba(255, 255, 255, 0.95); padding: 2rem 1.5rem; border-radius: 2.5rem; text-align: center; border: 1px solid #f3f4f6; position: relative; width: 95%; max-width: 440px; box-shadow: 0 30px 60px -15px rgba(28, 38, 29, 0.08); }
@media (min-width: 768px) { .modal-box { padding: 2.5rem; border-radius: 3rem; } }
.modal-close { position: absolute; top: 1.5rem; right: 1.5rem; background: none; border: none; cursor: pointer; color: #9ca3af; transition: 0.2s; outline: none; }
.modal-close:hover { color: #4b5563; } .modal-close svg { width: 1.5rem; height: 1.5rem; stroke-width: 2.5; }
.modal-video-container { margin-bottom: 1rem; display: flex; justify-content: center; }
.modal-video-container video { 
    width: 12rem; height: 12rem; object-fit: cover; pointer-events: none; outline: none; mix-blend-mode: multiply; 
    -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 95%); 
    mask-image: radial-gradient(circle, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 95%);
}
@media (min-width: 768px) { .modal-video-container video { width: 16rem; height: 16rem; margin-bottom: 1.5rem; } }
.modal-text { font-size: 1.15rem; font-weight: 800; color: #2C3E2D; margin-bottom: 1.5rem; line-height: 1.4; }
@media (min-width: 768px) { .modal-text { font-size: 1.4rem; margin-bottom: 2rem; } }
.timer-anim { animation: timerBar 10s linear forwards; }
@keyframes timerBar { from { width: 0%; } to { width: 100%; } }

/* =========================================
   СТАРТОВЫЙ ЭКРАН 
========================================= */
.welcome-screen {
    display: none; /* Скрыт по умолчанию для предотвращения мерцания при перезагрузке страницы */
    opacity: 1; pointer-events: auto; transition: opacity 0.4s ease; background-color: #C6D0BC;
    position: fixed; inset: 0; z-index: 100; flex-direction: column;
    padding: 2.5rem 1.5rem; overflow-y: auto; overflow-x: hidden; gap: 2rem; align-items: center; justify-content: flex-start;
}
.welcome-screen.active {
    display: flex; /* Показываем только через JS, если визит первый */
}
.welcome-screen.fade-out { opacity: 0; pointer-events: none; }

@media (min-width: 1024px) {
    .welcome-screen { flex-direction: row; justify-content: center; overflow: hidden; padding: 0 6%; gap: 4%; align-items: center; } 
}

/* КАРТОЧКА: z-index: 50 чтобы пузыри летали ПОД ней */
.welcome-card { position: relative; z-index: 50; background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); padding: 1.75rem; border-radius: 2.3rem; border: 1px solid rgba(255,255,255,0.6); display: flex; flex-direction: column; width: 100%; max-width: 500px; flex-shrink: 0; box-shadow: 0 30px 60px -15px rgba(28, 38, 29, 0.08); }
@media (min-width: 1024px) { .welcome-card { width: 42%; max-width: 520px; padding: 2.5rem; margin: auto 0; } }

.welcome-badge { align-self: flex-start; background: #2C3E2D; color: #DCE3D0; font-size: 0.75rem; font-weight: 900; padding: 0.5rem 1rem; border-radius: 999px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.25rem; }
.welcome-title { font-size: 2.25rem; font-weight: 900; color: #1A2E1D; margin-bottom: 1.5rem; line-height: 1.15; letter-spacing: -0.01em; }
@media (min-width: 640px) { .welcome-title { font-size: 3rem; } }

.welcome-text { font-size: 1rem; font-weight: 700; color: #1A2E1D; margin-bottom: 1.5rem; line-height: 1.6; display: flex; flex-direction: column; gap: 1rem; }
.welcome-text span { color: #b91c1c; font-weight: 900; }
@media (min-width: 640px) { .welcome-text { font-size: 1.125rem; } }

.btn-start { width: 100%; padding: 1rem; background: #2C3E2D; color: white; border-radius: 1rem; font-weight: 900; font-size: 1.25rem; border: none; cursor: pointer; transition: 0.3s; box-shadow: 0 10px 15px -3px rgba(44, 62, 45, 0.1); }
.btn-start:hover { background: #1A231B; box-shadow: 0 20px 25px -5px rgba(44, 62, 45, 0.2); } .btn-start:active { transform: scale(0.95); }
.welcome-note { font-size: 0.75rem; color: rgba(26, 46, 29, 0.5); font-weight: 700; margin-top: 1.5rem; }

.welcome-image-container { width: 100%; max-width: 500px; display: flex; justify-content: center; align-items: center; position: relative; z-index: 10; cursor: pointer; padding: 1rem 0; touch-action: manipulation; }
@media (min-width: 1024px) { .welcome-image-container { width: 55%; max-width: none; justify-content: center; } }

.glow-effect { position: absolute; width: 320px; height: 320px; background: rgba(255,255,255,0.2); border-radius: 50%; filter: blur(3rem); z-index: -1; animation: pulseGlow 2s infinite alternate; }
@media (min-width: 1024px) { .glow-effect { width: 550px; height: 550px; } }
@keyframes pulseGlow { from { opacity: 0.6; } to { opacity: 1; } }

#welcome-capy-img { width: 100%; max-width: 25rem; height: auto; object-fit: contain; z-index: 10; position: relative; pointer-events: none; -webkit-user-drag: none; -webkit-touch-callout: none; touch-action: manipulation; }
@media (min-width: 1024px) { #welcome-capy-img { max-width: 48rem; } }

/* =========================================
   МЫЛЬНЫЕ ПУЗЫРИ
========================================= */
.glass-bubble {
    border-radius: 50%; border: 2px solid rgba(255,255,255,0.7);
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.1));
    box-shadow: 0 8px 15px rgba(0,0,0,0.1); backdrop-filter: blur(4px); position: absolute;
    cursor: crosshair; 
    z-index: 99999 !important; /* Гарантировано рендерит пузыри поверх карточек и любого текста */
    animation: floatEverywhere var(--duration) ease-out forwards;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
}
.glass-bubble.popped { animation: none !important; transform: scale(1.5); opacity: 0; transition: all 0.2s ease-out; }

/* Ограничение области полета пузырей для предотвращения багов верстки на мобилках */
@media (max-width: 767px) {
    .glass-bubble {
        max-width: 100vw;
        max-height: 100vh;
        overflow: hidden;
    }
}

/* ПУЗЫРИ НА СТАРТЕ: Летают под карточкой, но поверх фонового тумана */
.welcome-bubble-style { z-index: 20 !important; }

@keyframes floatEverywhere {
    0% { transform: translate(0, 0) scale(0.5); opacity: 0; }
    10% { opacity: 1; transform: translate(calc(var(--end-x) * 0.1), calc(var(--end-y) * 0.1)) scale(1); }
    100% { transform: translate(var(--end-x), var(--end-y)) scale(1.2); opacity: 0; }
}