@font-face {
    font-family: myFont;
    src: url("../fonts/albertus.ttf"), url("../fonts/albertus.eot");
}
@font-face {
    font-family: myFontri;
    src: url("../fonts/PizzaDude-Pointers.ttf"), url("../fonts/PizzaDude-Pointers.eot");
}
html {
    overflow: hidden;
	height: 100dvh;
    -ms-touch-action: none;
    -ms-content-zooming: none;
}

body {
    margin: 0;
    padding: 0;
    position: absolute;
    width: 100%;
	height: 100dvh;
    font-family: "Inter", sans-serif;
}

#sound-controls {
    position: fixed;
    bottom: 0.3em;
    left: 0.3em;
    font-size: 1em;
    z-index: 1002;
}

#toggle-sound-button {
	position: absolute;
	bottom: 0;
    background-color: rgba(51, 51, 51, 0.8);
    color: white;
    border: 1px solid white;
    border-radius: 50%;
    width: 2em;
    height: 2em;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

#toggle-sound-button:hover {
    background-color: rgba(80, 80, 80, 0.9);
}

#toggle-sound-button.muted {
    color: #888;
}

#screen {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: default;
    background-color: var(--screen-solid-background-color);
    transition: background-color var(--bg-transition-duration) var(--bg-transition-easing);
}

#background-image-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-size: cover;
    background-position: center;
    background-repeat: repeat;
    transition: opacity var(--bg-transition-duration) var(--bg-transition-easing),
                transform var(--bg-transition-duration) var(--bg-transition-easing),
                filter var(--bg-transition-duration) var(--bg-transition-easing);
}

#tree {
    /* display: none; */
}

#admin-search-options, #admin-search-options-tile {
	display: inline-block;
	font-size: 0.8em;
	color: white;
	font-weight: normal; 
	text-shadow: .8px .8px 1.8px orange;  
	line-height: 0.5em;
	border-radius: 0.5em;	
	border-left: 1.5px solid transparent; 
	border-top: 1.5px solid transparent; 
	border-right: 1.5px solid transparent; 
	border-bottom: 1.5px solid transparent;	
}	
#fast-search-toggle {
	cursor: pointer;
}

#view-toggle-container {
	position: relative; 
	float: right;
	top: 0;
	right: 0;
	z-index: 4; 
	margin: 0.2em;
}

.view-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    display: none; /* По умолчанию все контейнеры скрыты */
}

.view-container.active-view {
    display: block; /* Показываем только активный контейнер */
}

/* Контейнер для вида дерева должен по-прежнему скрывать переполнение */
#screen.view-container {
    overflow: hidden;
}

#tile-view-container {
	position: relative;
    overflow-y: auto;
	touch-action: pan-y;
	height: calc(100dvh - 180px);
	-webkit-overflow-scrolling: touch;
    background-color: rgba(125, 125, 125, 0.0); /* Фон как у дерева */
    padding-top: 1em; /* Отступ сверху для #search-controls и #breadcrumbs */
    padding-left: 1em;
    padding-right: 1em;
    padding-bottom: 7em; /* Увеличили отступ снизу для пагинации */
    box-sizing: border-box;
}

#tile-view-container::-webkit-scrollbar {
    width: 7px;
    background-color: rgba(0,0,0,0.0);
    height: 90%;
}
#tile-view-container::-webkit-scrollbar-thumb {
    background-color: orange;
}

#tile-view-container #background-image-layer {position: fixed;}
#tile-view-container input[type="checkbox"] {
 display: none;
}
#tile-view-container label {
	font-family: Verdana, Arial, serif;
    font-size: 0.9em; 
	position: relative;
}
#tile-view-container input[type="checkbox"] + label span  {
position: absolute;
    width: 19px;
    height: 19px;
    margin: -3px 3px 30px 35px;
    left: -30px;
    vertical-align: middle;
    background: url(https://lifecatalog.ru/images/check_radio_sheet.png) no-repeat;
    background-position: 4px 4px;
    cursor: pointer;
    padding: 5px 4px 3px 0px; 
}
#tile-view-container input[type="checkbox"]:checked + label span  {
   background: url(https://lifecatalog.ru/images/check_radio_sheet.png) -16px 4px no-repeat;
}
.on, .off {
    position: relative;
    top: -5px;
    left: 30px;
    font-weight: bold;
    border-bottom: 1px solid grey;
    padding: 5px 5px 5px 5px;
    background-color: rgba(255, 255, 255, 0.85);
}
.on {
    display: none;
    color: rgb(55, 155, 15);
}
.off {
    display: inline-block;
    color: rgb(150, 50, 35);
}
#tile-view-container label i {
    position: relative;
    display: inline-block;
    top: -4px;
    left: 10em;
    padding: 5px 5px;
    border-top: 1px solid grey;
    background-color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
    font-size: 0.9em;
} 
#tile-view-container input[type="checkbox"]:checked ~ label .on {
    display: inline-block;
}

#tile-view-container input[type="checkbox"]:checked ~ label .off {
    display: none;
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok {
    display: table;
    background: rgba(255,255,255, 0.8);
    margin: 25px auto;
    border-top: 1px solid white;
    border-left: 1px solid white;
    border-right: 1px solid gray;
    box-shadow: 7px 7px 8px rgb(110, 110, 110);
    -webkit-box-shadow: 7px 7px 8px rgb(110, 110, 110);
    -moz-box-shadow: 7px 7px 8px rgb(110, 110, 110);
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .pic img, 
#tile-view-container input[type="checkbox"]:checked ~ .glavblok .rpic img {
    display: none;
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big {
    display: flex;
    width: 100%;
    clear: left;
    margin: 0 auto;
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big a.shtora, 
#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big:focus {
    display: none;
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .pic, 
#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .rpic {
    display: inline-block;
    margin: auto;
    clear: both;
    width: 98%;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgb(100,100,100);
    padding: 5px 5px 0px 5px;
    background: none;
    box-shadow: 0px 0px 0px rgb(110, 110, 110);
    -webkit-box-shadow: 0px 0px 0px rgb(110, 110, 110);
    -moz-box-shadow: 0px 0px 0px rgb(110, 110, 110);
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .pic:hover {
    background-image: none;
    background: rgba(155,230,125, 0.6);
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .rpic:hover {
    background-image: none;
    background: rgba(235,120,120, 0.6);
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .pic a, 
#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .rpic a {
    display: inline-block;
    width: 50%;
    float: left;
    margin-top: -6px;
    border-right: 1px solid gray;
    padding: 5px 0px 5px 0px;
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .pic a, 
#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .rpic a {
    display: inline-block;
    width: 50%;
    float: left;
    margin-top: -6px;
    border-right: 1px solid gray;
    padding: 5px 0px 5px 0px;
}

#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .pic a:hover, 
#tile-view-container input[type="checkbox"]:checked ~ .glavblok .big .rpic a:hover {
    text-decoration: underline;
}

#tile-view-container  .pic a, 
#tile-view-container .rpic a { 
    color: black;
    text-decoration: none;
    font-family: myFont;
    letter-spacing: 0.02em;
    font-weight: normal;
    font-size: 1.16em;
    font-style: normal;
}


        
/* --- КОНЕЦ: Стили для переключения видов --- */


#node-info-controls {
    position: absolute;
    bottom: 0.5em;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 0.2em;
}

#get-node-info-button, #edit-node-button, #settings-button {
	padding: 0.7em 1.2em;
    background-color: #B46601;
    color: white;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
    border-radius: 0.7em;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 6px 6px 6px rgba(0, 0, 0, 0.6);
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: none; /* Скрыто по умолчанию */
}

#edit-node-button, #settings-button {display: block}

#get-node-info-button:hover, #edit-node-button:hover, #settings-button:hover {
    background-color: #537D22;
    transform: translateY(-4px);
}

#get-node-info-button:active {
    transform: translateY(0);
}
#modal-title-node-label {font-weight: 500;}

#html-version a {
	color: lightblue;
    text-decoration: none;
    font-weight: bold;
    background: black;
    padding: 0.3em;
    border: 1px solid orange;
    border-radius: 0.3em;
}
#html-version a:hover {
	color: lightcoral;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(51, 45, 31, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
	display: flex;
    justify-content: center;
    flex-direction: row;
    align-items: center;
    margin-bottom: 0.5em;
    margin-top: 1.5em;
    border-bottom: 1.5px solid orange;
    padding-bottom: 0.5em;
    width: 100%;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.45em;
    color: #fff;
    font-family: myFont;
}

.modal-close-button {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    font-size: 3em;
    color: orange;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-button:hover {
    color: red;
}

.modal-body {
    font-size: 16px;
    line-height: 1.6;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 20px;
    padding: 20px;
    align-items: flex-start;
    width: 100%;
}

#modal-node-image {
	min-width: 150px;
    width: 500px;
    max-width: calc(100% - 10px);
    height: auto;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.5);
    border-top: 1px solid #a9a9a9;
    border-left: 1px solid #b3b3b3;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    box-shadow: 5px 5px 10px rgba(255, 255, 255, 0.2);
}

.modal-image-and-details {
    display: flex;
    flex-direction: column; /* Изображение сверху, детали снизу, или row для ряда */
    align-items: flex-start;
    gap: 15px;
}

.image-container {/* width: 100%; max-width: 500px; min-width: 300px; height: auto;*/ margin-right: 1em; /*margin-bottom: 0.5em;*/}

.text-details-container {
    flex: 1; 
    display: flex;
    flex-direction: column;
    min-width: 250px;
}
.text-details-container p {
    margin-bottom: 0;
    line-height: 1em;
}
.modal-details-container {
    flex-grow: 1;
}
.modal-details-container p {
    margin-bottom: 0;
    line-height: 1em;
}
.modal-details-container strong {
    color: #333;
}

.node-details-top-section {width: 100%; max-width: 100%; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; align-items: flex-start; margin-bottom: 20px;}
.image-and-text-wrapper { 
	display: flex;
    flex-direction: column; 
    flex: 1;
    min-width: 280px;
	}

        /* Стили для модального окна */
#edit-modal {
	
}
.modal {
            display: none; /* Скрыто по умолчанию */
            position: fixed; /* Оставаться на месте */
            z-index: 1001; /* Поверх всего */
            left: 0;
            top: 0;
            width: 100%; /* Вся ширина */
            height: 100%; /* Вся высота */
            overflow: auto; /* Включить прокрутку, если нужно */
            background-color: rgb(0,0,0); /* Fallback color */
            background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
        }
		
.modal-content {
    background-color: rgba(40, 40, 40, 0.8);
    color: #eee;
    padding: 6px;
    border-top: 1px solid #a9a9a9;
    border-left: 1px solid #b3b3b3;
    border-right: 1px solid black;
    border-bottom: 1px solid black;
    border-radius: 20px 0px 0px 20px;
    box-shadow: 16px 10px 18px rgba(0, 0, 0, 0.8);
    width: 100%;
    min-width: 300px;
    max-width: 99%;
    max-height: 96vh;
    min-height: 30em;
    position: fixed;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
	touch-action: pan-y;
    margin: 0em 1em 0 1em;
}

.modal-content::-webkit-scrollbar {
    width: 7px;
    background-color: rgba(0,0,0,0.0);
    height: 90%;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: orange;
}			
.close {
	color: white;
    float: right;
    font-size: 2.5em;
    font-weight: bold;
    padding: 0 12px;
    border-radius: 50%;
    border-top: 1px solid #ffffff;
    border-left: 1px solid #ffffff;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 1px 1px 5px white;
}

.close:hover, .close:focus {
            color: #ff0000;
            text-decoration: none;
            cursor: pointer;
    border-top: 1px solid #000000;
    border-left: 1px solid #000000;
    border-right: 1px solid #ffffff;
    border-bottom: 1px solid #ffffff;
    box-shadow: 0px 0px 0px white;			
			
        }
#edit-modal-iframe {
                width: 100%;
				height: 100vh;
        }

        /* Styles for the message box */
.message-box {
            display: none; /* Hidden by default */
            position: fixed;
            z-index: 2000; /* Above modals */
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            background-color: #fff;
            padding: 25px;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            text-align: center;
            font-family: 'Inter', sans-serif;
            max-width: 350px;
            width: 90%;
            box-sizing: border-box;
        }
.message-box p {
            margin-bottom: 20px;
            font-size: 1.1em;
            color: #333;
        }
.message-box button {
            background-color: #895d13;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 600;
            transition: all 0.3s ease;
        }
.message-box button:hover {
            background-color: #1e5900;
            transform: translateY(-1px);
        }			

#gemini-text-content {
	flex: 1;
    padding: 0.5em;
    background-color: #f9f9f9;
    border-radius: 0.5em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    line-height: 1.2;
    color: #333;
    margin-top: 2px; 
}			

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.node-loading-gif {
    display: none;
    pointer-events: none; 
    transform-origin: center center;
}

#search-controls, #search-controls-tile {
    position: relative;
	display: flex;
	width: fit-content;
    height: fit-content;
	margin: 0.5em auto;
    z-index: 4;
    gap: 0.15em;
    background-color: rgba(51, 51, 51, 0.8);
    padding: 0.3em 0.4em;
    border-radius: 0.5em;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5);
}

#search-input, #search-input-tile {
    padding: 0.1em 0.2em;
    border: 1px solid #61651a;
    border-radius: 0.2em;
    background-color: #511d00;
    color: #eee;
    font-size: 1em;
    width: 14em;
}

#search-input::placeholder {
    color: #bbb;
}

.search-button {
    padding: 2px;
    background-color: #9d6400;
    color: white;
    border-radius: 0.5em;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
}

.search-button:hover {
    background-color: #428702;
}

.search-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}
#prev-search-button, #next-search-button { font-size: 1em; display: none; }
#search-count {color: white;}		

.highlighted-node circle {
    stroke: yellow !important;
    stroke-width: 4px !important;
    filter: url(#hover-drop-shadow-filter) !important;
}
.highlighted-node text {
    fill: yellow !important;
}
.highlighted-node .name-text {
    fill: yellow !important;
}
.highlighted-node .rank-text {
    fill: yellow !important;
}

#breadcrumbs {
	position: relative;
	width: fit-content;
    top: 0.1em;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 0.2em;
    background-color: rgba(51, 51, 51, 0.8);
    padding: 0.3em 0.5em;
    border-radius: 0.5em;
    max-width: 90%;
    justify-content: center;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5);
}

.breadcrumb-item {
    color: #eee;
    font-size: 0.9em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.breadcrumb-item:hover {
    background-color: rgba(0, 150, 0, 0.5);
    color: white;
}

.breadcrumb-item.active {
    font-weight: bold;
    color: #ffbf00;
}

.breadcrumb-separator {
    color: #bbb;
    font-size: 1em;
    margin: 0 1px;
}

#movement-controls {
	position: fixed;
    bottom: 0.5em;
    right: 0.5em;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    background-color: rgba(51, 51, 51, 0.637);
    padding: 0.4em;
    border-radius: 0.5em;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.5);
}

#exit-search-button { padding: 2px 4px; }

#directional-buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 2.2em);
    grid-template-rows: repeat(3, 2.2em);
    gap: 3px;
}

.move-button {
	width: 1.5em;
    height: 1.5em;
    background-color: #9d6400;
    color: white;
    border-radius: 0.4em;
    cursor: pointer;
    font-size: 1.5em;
    padding: 2px 0 0 0;
    display: flex;
    justify-content: center;
	align-items: center;
    transition: background-color 0.3s ease, transform 0.1s ease;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
}

.move-button:hover {
    background-color: #428702;
}

.move-button:active {
    transform: scale(0.94);
}

#move-up {
    grid-column: 2;
    grid-row: 1;
}
#move-left {
    grid-column: 1;
    grid-row: 2;
}
#move-right {
    grid-column: 3;
    grid-row: 2;
}
#move-down {
    grid-column: 2;
    grid-row: 3;
}
#move-center {
    grid-column: 2;
    grid-row: 2;
    background-color: #b36900;
}
#move-center:hover {
    background-color: #b37201;
}

#toggle-camera-follow-button {
    padding: 1em;
    position: absolute;
    background-color: rgb(130, 130, 130);
    color: white;
    border-radius: 0.5em;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
    left: 4em;
    bottom: 0.5em;
    width: auto;
    border-top: 1.5px solid white;
    border-left: 1.5px solid white;
    border-right: 1.5px solid rgb(50, 50, 50);
    border-bottom: 1.5px solid rgb(50, 50, 50);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

#toggle-camera-follow-button.active {
        background-color: #bf7000; /*#607d00*/
}

#toggle-camera-follow-button:hover {
    background-color: #587300;
}
#toggle-camera-follow-button.active:hover {
    background-color: #b75b00;
}

/* Стили для кнопок прокрутки внутри модального окна */
.modal-overlay .go-up,
.modal-overlay .go-down {
    position: absolute;
    z-index: 1001;
    right: 20px;
    background: rgb(255,165,0);
    border-top: 1px solid white;
    border-bottom: 3px solid green;
    border-radius: 50%;
    cursor: pointer;
    color: darkgreen;
    text-align: center;
    font: 100 normal 20px/20px sans-serif;
    font-family: myFontri;
    text-shadow: 2px 2px 3px rgba(255,255,255, 0.7);
    opacity: .65;
    padding: 15px 3px 3px;
    margin-bottom: 5px;
    width: 30px;
    height: 30px;
    transition: 0.4s;
}

.modal-overlay .go-up {
    bottom: 67px; 
}
.modal-overlay .go-down {
    bottom: 15px; 
}

.modal-overlay .go-down:hover,
.modal-overlay .go-up:hover {
    opacity: 1;
    box-shadow: 4pt 4pt 4pt -0.5pt rgba(0, 0, 0, 0.5);
    transition: 0.5s;
    -webkit-transition: 0.5s;
}

.glavblok {margin-top: 45px; position: relative;}
.glavblok .glavblok_p { color: #ff0000;
    text-align: center;
    width: fit-content;
    padding: 20px;
    border-top: 1px solid white;
    border-left: 1px solid white;
    border-right: 1px solid #656565;
    border-bottom: 1px solid #5d5d5d;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1.0);
    margin: 0 auto;
    border-radius: 1em;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.2);
	}
	
#toggle-view-button	{
background-color: rgb(183 125 0);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.8em;
    transition: background-color 0.3s ease;
    width: auto;
    border-top: 5px double #e2e1e1;
    border-left: 5px double white;
    border-right: 5px double rgb(59 59 59);
    border-bottom: 5px double rgb(77 76 76);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}
#tooltip-container {
	position: absolute; 
	display: none; 
	background-color: #333; 
	color: #fff; 
	padding: 3px 7px; 
	border-radius: 3px; 
	font-size: 12px; 
	pointer-events: none; 
	z-index: 1000;
}
.dtgp_tree {
    display: inline-block;
    float: left;
    text-align: center;
    color: #ffb94d;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 1.0);
    border-radius: 50px;
    padding: 4px 10px 4px 4px;
    background-color: rgba(255, 255, 255, 0.8);

}

.dtgp_tree:hover {
    color: rgb(150, 75, 0);
}
.dtgp_tree span {
	vertical-align: -webkit-baseline-middle;
    vertical-align: middle;
	display: block;
}
#tree_logo_a {
display: block;
width: auto;
height: auto; 
float: left;
position: relative;
margin: 0.15em;
z-index: 5; 
}

/*--- логотип земля ---*/

#earth_tree {
  position: relative;
  float: left;
  width: 35px;
  height: 35px;
  margin: 0 10px 0 0;
  transition: transform 200ms linear;
  -moz-transition: transform 200ms linear;
  -webkit-transition: transform 200ms linear;
  -ms-transition: transform 200ms linear;
  -o-transition: transform 200ms linear;  
  animation: rotateearth 50s linear infinite;
  -moz-animation: rotateearth 50s linear infinite;
  -webkit-animation: rotateearth 50s linear infinite;
  -ms-animation: rotateearth 50s linear infinite;
  -o-animation: rotateearth 50s linear infinite;  
  color: #000;
  border-radius: 50%;
  background: url(https://lifecatalog.ru/cont/shapka/earthbackground.jpg) 0 0 repeat;
  background-size: 80px;
  box-shadow: inset 2px 0 4px 1px rgba(0, 0, 0, .7);
  transform-style: preserve-3d;
  -moz-transform-style: preserve-3d; 
  -webkit-transform-style: preserve-3d;
  -ms-transform-style: preserve-3d;
  -o-transform-style: preserve-3d;  
}
#earth_tree:after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: '';
  border-radius: 50%;
  box-shadow: -4px 2px 4px 1px rgba(255,255,255,.5) inset;
}
#earth_tree:before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  content: '';
  opacity: .2;
  border-radius: 50%;
  background: radial-gradient(circle at 100px 100px, #fff, #000);
}

#pagination-controls {
	display: flex;
    width: 80%;
    margin-left: 2em;
    position: absolute;
    bottom: 0.3em;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(51, 51, 51, 0.9);
    padding: 2px 3px;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.5) 4px 4px 4px;
    text-shadow: rgb(0, 0, 0) 1px 1px 2px;
    z-index: 1000;
    border-width: 1.5px;
    border-style: solid;
    border-color: white rgb(50, 50, 50) rgb(50, 50, 50) white;
    font-size: 1em;
    color: white;
    font-weight: bold;
    white-space: nowrap;
    gap: 1px;
    flex-flow: wrap;
    flex-direction: row;
    justify-content: center;
}

.pagination-btn, .pagination-page {width: fit-content}

/* ============================================= */
/* == Стили для модального окна настроек == */
/* ============================================= */

/* Стили для самого модального окна (оверлей) */
.settings-modal-class {
    z-index: 1002; /* Убедимся, что окно настроек поверх других элементов */
}

/* Контентная часть модального окна */
.settings-modal-content {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    max-height: 90vh;
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid #555;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
}

/* Заголовок модального окна */
.settings-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-modal-header h2 {
    margin: 0;
    font-size: 1.2em;
    color: #ff9800; /* Оранжевый акцент */
}

/* Кнопка закрытия в модальном окне */
.settings-modal-content .close {
    font-size: 1.8em;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.settings-modal-content .close:hover {
    color: #fff;
}

/* Тело модального окна с формой */
.settings-modal-body {
    padding: 10px 20px 20px 20px;
    overflow-y: auto; /* Включаем скролл, если контента много */
}

/* Стили для скроллбара */
.settings-modal-body::-webkit-scrollbar {
    width: 8px;
}

.settings-modal-body::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 10px;
}

.settings-modal-body::-webkit-scrollbar-thumb {
    background-color: #ff9800;
    border-radius: 10px;
    border: 2px solid #2a2a2a;
}

/* Группа элементов формы (label + input) */
.settings-form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.settings-form-group label {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #ccc;
    text-transform: capitalize;
}

/* Стили для всех инпутов */
#settings-form input[type="text"],
#settings-form input[type="range"] {
    width: 100%;
    padding: 8px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 5px;
    color: #f0f0f0;
    box-sizing: border-box;
}

#settings-form input[type="range"] {
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #555;
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
}

#settings-form input[type="range"]:hover {
    opacity: 1;
}

#settings-form input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ff9800;
    cursor: pointer;
    border-radius: 50%;
}

#settings-form input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ff9800;
    cursor: pointer;
    border-radius: 50%;
}

#settings-form input[type="color"] {
	width: 4em;
	height: 3em;
    padding: 2px;
}

/* Поле для отображения значения слайдера */
.setting-value {
    font-size: 0.8em;
    color: #aaa;
    text-align: right;
    margin-top: 3px;
}

/* Стили для чекбоксов */
.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    margin-bottom: 0;
    margin-right: 10px;
}

/* Стили для групп полей (например, rankColors) */
#settings-form fieldset {
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 20px;
}

#settings-form legend {
    padding: 0 10px;
    color: #ff9800;
    font-weight: bold;
}

/* Кнопка настроек рядом с кнопкой редактирования
#settings-button {
    background-color: #3a3a3a;
    border: 1px solid #555;
    color: #eee;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

#settings-button:hover {
    background-color: #ff9800;
    color: #222;
    border-color: #ff9800;
}

/* НОВЫЕ СТИЛИ ДЛЯ ФУТЕРА И КНОПОК */
.settings-modal-footer {
    padding: 10px 20px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.settings-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.save-btn {
    background-color: #4CAF50; /* Зеленый */
    color: white;
}

.save-btn:hover {
    background-color: #45a049;
}

.reset-btn {
    background-color: #f44336; /* Красный */
    color: white;
}

.reset-btn:hover {
    background-color: #d32f2f;
}

#settings-status-message {
    margin-right: auto; /* Прижимает сообщение влево */
    font-size: 0.9em;
    color: #4CAF50;
}

@keyframes rotateearth {
  0% {background-position: 0 0;}
  100% {background-position: 630px 0;}
}

@media only screen and (max-width: 800px) {
    .modal-overlay .go-up,
    .modal-overlay .go-down {
        border-bottom: 1px solid green;
        font-size: 12px;
        right: 15px;
        font: 800 normal 10px/22px sans-serif;
        font-family: myFontri;
        padding: 1px 1px 1px;
        margin-bottom: 0px;
        width: 20px;
        height: 20px;
    }
svg {top: 2.5em;}	
#pagination-controls {bottom: 0em;}
}

@media only screen and (max-width: 768px) {
    .pagination-limit-wrapper {
        margin-right: 0;
        margin-bottom: 5px;
    }
    .pagination-btn, .pagination-page {
        width: fit-content;
    }
    #tile-view-container {
        padding: 10px;
        height: calc(100dvh - 180px);
    }

    .node-details-top-section {
        flex-direction: column;
        align-items: center; 
    }

    .image-and-text-wrapper {
        flex-direction: column; 
        width: 100%; 
    }

    .image-container {
        max-width: 100%;
        text-align: center;
    }

    .text-details-container {
        width: 100%;
        text-align: center;
    }

    #gemini-text-content {
        width: 100%; 
    }

        
#gemini-text-content hr {
    border-color: #555;
}
svg {top: 3em;}
#pagination-controls {bottom: 0em;}	
}

@media (max-width: 600px) {

    .tile-name {
        font-size: 16px;
    }
    .tile-latin-name {
        font-size: 12px;
    }
    .tile-image-container {
        height: 120px;
    }
    .pagination-btn, .pagination-page {
         width: fit-content;
    }
svg {top: 3.5em;}
#pagination-controls {bottom: 0em;}	
}

@media only screen and (max-width: 500px) {
.dtgp_tree {
	width: 15em;
    height: auto;
    padding: 2px 5px 2px 2px;
    border-radius: 0.8em;
}
#earth_tree {
	width: 2.2em;
    height: 2.2em;
    margin: 0 0 0 0;
    background-size: 5em;
}
#search-input, #search-input-tile {
	width: 6em;
	font-size: 0.85em;
}
#search-controls, #search-controls-tile {
	padding: 0.15em;
	margin: 0.1em auto;
}
#search-count { font-size: 0.85em;}
#admin-search-options { font-size: 0.75em; }
.breadcrumb-item { font-size: 0.75em; }
.breadcrumb-separator { font-size: 0.75em; }
#toggle-camera-follow-button {
	left: 2.6em;
    padding: 0.2em;
    font-size: 1.1em;
}
#sound-controls { font-size: 0.85em;}
#get-node-info-button, #edit-node-button, #settings-button {
	display: block;
    padding: 0.35em 0.85em;
    font-size: 1.1em;
}	
svg {top: 4em;}	
#pagination-controls {font-size: 0.9em; bottom: 0em;}
}
@media only screen and (max-width: 378px) {
.dtgp_tree {
	width: 12em;
    height: auto;
    padding: 2px 5px 2px 2px;
    border-radius: 0.8em;
}
#earth_tree {
	width: 2em;
    height: 2em;
    margin: 0 0 0 0;
    background-size: 4.5em;
}
#search-input, #search-input-tile {
	width: 4em;
	font-size: 0.85em;
}
#search-controls, #search-controls-tile {
	padding: 0.15em;
	margin: 0.1em auto;
}
#search-count { font-size: 0.85em;}
#admin-search-options { font-size: 0.75em; }
.breadcrumb-item { font-size: 0.75em; }
.breadcrumb-separator { font-size: 0.75em; }
#toggle-camera-follow-button {
	left: 2.6em;
    padding: 0.2em;
    font-size: 1em;
}
#sound-controls { font-size: 0.85em;}
#get-node-info-button, #edit-node-button, #settings-button {
	display: block;
    padding: 0.3em 0.8em;
    font-size: 1em;
}
#gemini-text-content {font-size: 0.95em;}
svg {top: 4.5em;}
#view_elem {display: none}
#pagination-controls {font-size: 0.8em; bottom: 0em;}
}

/* смартфоны, устройства с сенсорным экраном, с которым работают пальцами */
@media (hover: none) and (pointer: coarse) {
	#directional-buttons-grid {display: block}
	#move-up {display: none}
	#move-left {display: none}
	#move-right {display: none}
	#move-down {display: none}
}
/* устройства с сенсорным экраном, с которым работают стилусом */
@media (hover: none) and (pointer: fine) {
#directional-buttons-grid {
    grid-template-columns: repeat(3, 1.5em);
    grid-template-rows: repeat(3, 1.5em);
    gap: 2px;
}
#move-up, #move-left, #move-right, #move-down, #move-center {
	width: 1.2em;
    height: 1.2em;
    font-size: 1.3em;
}
#movement-controls {padding: 0.25em}
}