.open-tree-btn-round {
    position: fixed; bottom: 115px; right: 18px; width: 48px; height: 48px;
    border-radius: 50%; background-color: #0c2656; color: #f5e6b8;
    border: 2px solid #d4c3a3; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 9999;
}
.open-tree-btn-round:hover { transform: scale(1.1); background-color: #153c82; }

#tree-fullscreen-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000; z-index: 999999; overflow: hidden;
    font-family: 'Merriweather', 'PT Serif', Georgia, serif;
}

.tree-close-fullscreen {
    position: absolute; top: 20px; right: 20px; background: rgba(255, 253, 248, 0.85);
    border: 1px solid #a39581; color: #2e2620; border-radius: 50%; width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    z-index: 1000; backdrop-filter: blur(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}
.tree-close-fullscreen:hover { background: #d4c3a3; color: #ffffff; transform: scale(1.1); }

.tree-side-action-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 45px; height: 45px; border-radius: 50%; background: rgba(255, 253, 248, 0.85);
    border: 1px solid #a39581; color: #2e2620; font-family: 'Merriweather', serif;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 1000; backdrop-filter: blur(4px); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}
.tree-side-action-btn:hover { background: #d4c3a3; color: #ffffff; transform: translateY(-50%) scale(1.1); }
.tree-side-action-btn.left-side { left: 20px; font-size: 22px; font-style: italic; }
.tree-side-action-btn.right-side { right: 20px; }

#tree-scroll-area {
    width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden;
    -webkit-overflow-scrolling: touch; 
}
#tree-scroll-area::-webkit-scrollbar { display: none; }
#tree-scroll-area { -ms-overflow-style: none; scrollbar-width: none; }

#tree-wrapper {
    position: relative; height: 100%; 
    background: url('/wp-content/uploads/2026/09/gratitude_tree.webp') no-repeat center bottom; 
    background-size: cover; width: max(100vw, 1200px); 
    transform-origin: center center;
    transition: transform 0.1s ease-out; 
}

#tree-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
#leaves-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

#clouds-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 350px; 
    pointer-events: none; z-index: 1; overflow: hidden;
}
.cloud {
    position: absolute; background: rgba(255, 255, 255, 0.4); border-radius: 200px;
    filter: blur(15px); animation: floatClouds linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: rgba(255, 255, 255, 0.4); border-radius: 50%; }
.cloud-1 { width: 180px; height: 60px; top: 50px; left: -250px; animation-duration: 90s; }
.cloud-1::before { width: 90px; height: 90px; top: -40px; left: 30px; }
.cloud-1::after { width: 110px; height: 110px; top: -50px; right: 30px; }
.cloud-2 { width: 250px; height: 80px; top: 120px; left: -350px; animation-duration: 130s; animation-delay: 25s; }
.cloud-2::before { width: 120px; height: 120px; top: -60px; left: 40px; }
.cloud-2::after { width: 100px; height: 100px; top: -50px; right: 50px; }
.cloud-3 { width: 200px; height: 70px; top: 30px; left: -300px; animation-duration: 105s; animation-delay: 50s; }
.cloud-3::before { width: 100px; height: 100px; top: -45px; left: 30px; }
@keyframes floatClouds { 0% { transform: translateX(0); } 100% { transform: translateX(calc(100vw + 400px)); } }

.dom-leaf {
    position: absolute; width: 22px; height: 22px; border-radius: 2px 18px 2px 18px;
    background: linear-gradient(135deg, #748c51 0%, #3e5229 100%);
    box-shadow: 1px 2px 6px rgba(0,0,0,0.3); cursor: pointer; z-index: 5; opacity: 0;
    transform-origin: center center; transition: filter 0.3s ease, opacity 1s ease;
}
.dom-leaf:hover { filter: brightness(1.2) drop-shadow(0 0 8px rgba(163, 177, 138, 0.8)); z-index: 10; }

#tree-tooltip {
    position: absolute; background: rgba(253, 251, 247, 0.95); border: 1px solid #a39581; padding: 10px 16px;
    border-radius: 6px; pointer-events: none; opacity: 0; transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 15; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    font-size: 13px; color: #2e2620; font-style: italic; max-width: 220px; text-align: center;
}

.tree-ui-bottom {
    position: absolute; bottom: 50px; left: 0; width: 100%;
    display: flex; flex-direction: column; align-items: center; z-index: 50;
    pointer-events: none; 
}
.tree-controls-row {
    display: flex; align-items: center; justify-content: center; gap: 20px;
    pointer-events: auto; 
}

.tree-circle-btn {
    width: 50px; height: 50px; border-radius: 50%;
    background: rgba(255, 253, 248, 0.85); border: 1px solid #a39581; color: #2e2620;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    backdrop-filter: blur(4px); text-decoration: none;
}
.tree-circle-btn:hover { background: #d4c3a3; color: #ffffff; border-color: #d4c3a3; }

.tree-main-btn-round {
    background: rgba(255, 253, 248, 0.9); border: 1px solid #748c51; color: #3e5229; 
    width: 75px; height: 75px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); backdrop-filter: blur(4px);
}
.tree-main-btn-round:hover { background: #748c51; color: #ffffff; box-shadow: 0 6px 20px rgba(62, 82, 41, 0.5); transform: scale(1.05); }

.tree-modal {
    display: none; position: absolute; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(20, 25, 20, 0.7); z-index: 10000; backdrop-filter: blur(5px);
    justify-content: center; align-items: center; opacity: 0; transition: opacity 0.4s ease;
}
.tree-modal.active { display: flex; opacity: 1; }

.tree-modal-content {
    background-color: #fdfbf7; padding: 45px 35px; border: 1px solid #d4c3a3; border-radius: 8px;
    max-width: 480px; width: 90%; text-align: center; position: relative;
    box-shadow: 0 15px 50px rgba(0,0,0,0.4); transform: translateY(20px); transition: transform 0.4s ease;
}
.tree-modal.active .tree-modal-content { transform: translateY(0); }

.tree-modal-content::-webkit-scrollbar { width: 6px; }
.tree-modal-content::-webkit-scrollbar-track { background: #fdfbf7; }
.tree-modal-content::-webkit-scrollbar-thumb { background: #d4c3a3; border-radius: 4px; }

.tree-close-modal-btn {
    position: absolute; top: 10px; right: 20px; font-size: 36px; color: #a89f91; cursor: pointer;
    transition: color 0.2s ease; line-height: 1;
}
.tree-close-modal-btn:hover { color: #5a4a3e; }

.tree-serif-title { color: #2e2620; font-size: 24px; margin-top: 0; margin-bottom: 25px; font-weight: normal; line-height: 1.2; }
.tree-serif-text { color: #1a1a1a; font-size: 18px; line-height: 1.7; margin-bottom: 25px; font-style: italic; }
.tree-author-text { color: #748c51; font-size: 14px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: bold; }

.tree-textarea {
    width: 100%; box-sizing: border-box; border: 1px solid #d4c3a3; background-color: #ffffff;
    padding: 16px; margin-bottom: 20px; font-family: inherit; font-size: 15px; color: #2e2620;
    resize: none; border-radius: 6px; min-height: 120px;
}
.tree-input {
    width: 100%; box-sizing: border-box; border: 1px solid #d4c3a3; background-color: #ffffff;
    padding: 16px; margin-bottom: 20px; font-family: inherit; font-size: 15px; color: #2e2620;
    resize: none; border-radius: 6px;
}
.tree-textarea:focus, .tree-input:focus { outline: none; border-color: #748c51; box-shadow: 0 0 5px rgba(116, 140, 81, 0.3); }
.tree-submit-btn {
    background-color: #fdfbf7; border: 1px solid #d4c3a3; color: #5a4a3e; padding: 14px 28px;
    font-size: 16px; font-family: inherit; cursor: pointer; transition: all 0.3s ease;
    border-radius: 30px; width: 100%; font-weight: bold;
}
.tree-submit-btn:hover { background-color: #d4c3a3; color: #ffffff; }
.tree-textarea, .tree-input {
    width: 100%; box-sizing: border-box; border: 1px solid #d4c3a3; background-color: #ffffff;
    padding: 16px; margin-bottom: 20px; font-family: inherit; font-size: 15px; 
    color: #2e2620 !important; /* Явный темно-коричневый цвет вводимого текста */
    resize: none; border-radius: 6px; min-height: 120px;
}

/* Делаем цвет текста подсказки (плейсхолдера) читаемым */
.tree-textarea::placeholder, .tree-input::placeholder {
    color: #8c8173;
    opacity: 1;
}
@media (max-width: 768px) {
    .open-tree-btn-round { bottom: 68px; right: 16px; width: 35px; height: 35px; }
    .tree-ui-bottom { bottom: 30px; }
    .tree-main-btn-round { width: 65px; height: 65px; }
    .tree-main-btn-round svg { width: 30px; height: 30px; }
    .tree-circle-btn { width: 45px; height: 45px; }
    .tree-controls-row { gap: 15px; }
    .tree-side-action-btn.left-side { left: 10px; width: 40px; height: 40px; font-size: 20px; }
    .tree-side-action-btn.right-side { right: 10px; width: 40px; height: 40px; }
    .tree-close-fullscreen { top: 10px; right: 10px; width: 40px; height: 40px; }
}