:root {
    --color-bg-primary: #ffffff;
    --color-bg-additional: #f4f4f4;
    --color-bg-separator: #ebebeb;
    --color-text-primary: #000000;
    --color-text-secondary: #878787;
    --color-border: #eeeeee;
    --color-ui-blue: #196dff;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
body {
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #1e2f3a;
}
.map-header {
    background: #ffffff;
    color: #111;
    border-bottom: 3px solid #c12b2b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 12px 20px;
    text-align: center;
    font-family: 'Russo One', 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
}
.map-header h1 {
    font-size: 1.6rem;
    font-weight: 500;
    margin-bottom: 4px;
}
.map-header p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0;
}
.leaflet-popup-content {
    font-size: 13px;
    line-height: 1.45;
    max-width: 280px;
}
.leaflet-popup-content strong {
    color: #1e3c4a;
}
.footer-note {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: #eee;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    z-index: 1000;
}
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    backdrop-filter: blur(4px);
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.error-message {
    background: #c0392b;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
}


/* Стили для галереи изображений в попапе */
.photo-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}
.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: transform 0.2s, border-color 0.2s;
}
.gallery-thumb:hover {
    transform: scale(1.05);
    border-color: #c12b2b;
}
/* Модальное окно */
#lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
}
.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    font-weight: bold;
}
.lightbox-close:hover {
    color: #ccc;
}
/* SVG-иконки */
.custom-svg-marker {
    background: transparent;
    border: none;
}
.custom-svg-marker svg {
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.leaflet-control-attribution .leaflet-attribution-flag {
    display: none !important;
}
.desc-container a {
    color: #1e2f3a;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
    font-style: italic;
}
.desc-container a:hover {
    text-decoration: underline;
}
.lightbox-attribution {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.6);
    border-radius: 8px;
    font-size: 12px;
    color: #eee;
    text-align: center;
    width: auto;
    max-width: 90%;
}
.attribution-text {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}
.attribution-text span {
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    border-radius: 20px;
}
.attribution-text a {
    color: #2ecc71;
    text-decoration: none;
}
.attribution-text a:hover {
    text-decoration: underline;
}
.lightbox-prev, .lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 36px;
    cursor: pointer;
    padding: 16px 12px;
    border-radius: 4px;
    user-select: none;
    z-index: 10001;
    transition: background 0.2s;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(0,0,0,0.8);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }


/* Боковая панель списка (без изменений, оставляем как было) */
.list-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    height: 100%;
    background: var(--color-bg-primary);
    box-shadow: -2px 0 12px rgba(0,0,0,0.2);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    transform: translateX(100%);
    font-family: inherit;
}
.list-sidebar.hidden {
    transform: translateX(100%);
}
.list-sidebar:not(.hidden) {
    transform: translateX(0);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-bg-separator);
    background: var(--color-bg-primary);
}
.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
}
.close-sidebar-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-secondary);
    line-height: 1;
}
.close-sidebar-btn:hover {
    color: var(--color-text-primary);
}
.sidebar-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-bg-separator);
}
.sidebar-search input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-additional);
    color: var(--color-text-primary);
    font-size: 14px;
}
.sidebar-search input:focus {
    outline: none;
    border-color: var(--color-ui-blue);
}
.list-container {
    overflow-y: auto;
    padding: 12px 16px;
}
.list-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    background: #fff;
    border-radius: 14px;
    border: 1px solid #ececec;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    flex: 0 0 auto;
}
.list-card.active {
    border-color: #c12b2b;
    box-shadow: 0 0 0 3px rgba(193,43,43,0.12);
}
.list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.list-card-photo {
    width: 110px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #ddd;
}
.list-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.placeholder-photo {
    width: 100%;
    height: 100%;
    background: #c8e0e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #666;
}
.list-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.list-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
}
.list-card-address {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.list-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #777;
}
.list-card-status {
    display: inline-flex;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.list-card-status.exists {
    background: #ffe5e5;
    color: #b40000;
}
.list-card-status.lost {
    background: #ececec;
    color: #555;
}
.list-card-status.unknown {
    background: #fff4d6;
    color: #b37a00;
}
.list-card-extra-photos {
    margin-top: 8px;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
#map {
    flex: 1;              /* карта занимает всё оставшееся пространство */
    width: 100%;
    background: #c8e0e6;
}
.map-header,
.filter-bar,
.extra-filters {
    flex-shrink: 0;      /* чтобы эти блоки не сжимались */
}

/* ========== НОВЫЕ СТИЛИ ДЛЯ ПАНЕЛЕЙ И КНОПОК (спокойный плакатный стиль) ========== */
.filter-bar, .extra-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;      /* было 8px 16px */
    background: #fafaf8;
    border-bottom: 2px solid #c12b2b;
    flex-wrap: wrap;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.filter-bar {
    justify-content: flex-start;
}
.extra-filters {
    justify-content: flex-start;
    border-top: none;
}
.filter-btn, .extra-filters select {
    background: #ffffff;
    border: 1px solid #c0c0c0;
    color: #222;
    padding: 4px 14px;      /* было 6px 18px */
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.7rem;      /* было 0.85rem */
    font-weight: 500;
    transition: all 0.2s ease;
    height: 28px;           /* было 36px */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}
.filter-btn:hover, .extra-filters select:hover {
    background: #f0f0f0;
    border-color: #c12b2b;
}
.filter-btn.active {
    background: #c12b2b;
    border-color: #c12b2b;
    color: #ffffff;
}
.filter-btn.reset-btn {
    background: #ffffff;
    border-color: #c0c0c0;
    color: #555;
}
.filter-btn.reset-btn:hover {
    background: #c12b2b;
    border-color: #c12b2b;
    color: #ffffff;
}
.extra-filters select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='%23c12b2b'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
}
#toggle-list-btn {
    margin-left: auto;
    background: #ffffff;
    border-color: #c12b2b;
    color: #c12b2b;
}
#toggle-list-btn:hover {
    background: #c12b2b;
    color: #ffffff;
}
@media (max-width: 600px) {
    .filter-btn, .extra-filters select, #toggle-list-btn {
        padding: 3px 10px;
        font-size: 0.65rem;
        height: 26px;
    }
    .extra-filters select {
        padding-right: 24px;
        background-position: right 6px center;
    }
    .list-sidebar {
        width: 100%;
    }
    .list-card-photo {
        height: 120px;
    }
	.lightbox-prev, .lightbox-next {
        font-size: 24px;
        padding: 8px 10px;
    }
	.map-header h1 {
        font-size: 1.2rem;
    }
}


/* Сворачивание панелей */
body.collapsed .map-header,
body.collapsed .extra-filters {
    display: none;
}
body.collapsed .filter-bar .filter-btn:not(#toggle-list-btn) {
    display: none;
}
body.collapsed .filter-bar {
    justify-content: flex-start;
}
/* Плавающая кнопка сворачивания в левом верхнем углу */
.collapse-float {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    background: #ffffff;
    border: 1px solid #c12b2b;
    color: #c12b2b;
    padding: 4px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    height: 28px;
    transition: all 0.2s ease;
	display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
	opacity: 0.7; 
}
.collapse-float:hover {
    background: #c12b2b;
    color: #ffffff;
	opacity: 1;  
}
/* При свернутом состоянии кнопка остаётся красной с белым текстом */
body.collapsed .collapse-float {
    background: #c12b2b;
    color: #ffffff;
    border-color: #c12b2b;
    opacity: 1;
}
body.collapsed .collapse-float:hover {
    background: #a12323;
}

/* ... все существующие стили остаются без изменений ... */

/* ========== СТИЛИ ДЛЯ ТЕСТА ========== */
/* ========== СТИЛИ ДЛЯ ТЕСТА ========== */
.quiz-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    overflow: hidden; /* убираем прокрутку у модального окна */
}

.quiz-modal-content {
    background: var(--color-bg-primary);
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    border-radius: 28px;
    overflow-y: auto; /* внутренняя прокрутка при необходимости */
    padding: 20px 24px;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
    position: relative;
    border: 1px solid rgba(193, 43, 43, 0.2);
}

/* Адаптация под мобильные – убираем лишние отступы */
@media (max-width: 600px) {
    .quiz-modal-content {
        padding: 16px;
        width: 95%;
        max-height: 85vh;
    }
}

.quiz-close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 30px;
    font-weight: 300;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: color 0.2s;
    line-height: 1;
}

.quiz-close-btn:hover {
    color: #c12b2b;
}

.quiz-modal-content h2 {
    font-size: 1.4rem;
    margin: 0 0 12px 0;
    color: #c12b2b;
    font-weight: 500;
    letter-spacing: -0.3px;
    padding-right: 30px;
}

/* Шкала прогресса – маленькие квадраты */
.quiz-progress {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 4px 0 4px;
    flex-wrap: wrap;
}

.quiz-progress-segment {
    width: 16px;
    height: 16px;
    background: #e8e8e8;
    border: 1px solid #ccc;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 0;
    line-height: 0;
}

.quiz-progress-segment.correct {
    background: #c12b2b;
    border-color: #a12323;
}

.quiz-progress-segment.wrong {
    background: #b0b0b0;
    border-color: #8a8a8a;
}

.quiz-progress-segment.active {
    border: 2px solid #c12b2b;
    box-shadow: 0 0 0 2px rgba(193, 43, 43, 0.3);
    transform: scale(1.1);
}

/* Фото памятника */
.quiz-photo-wrapper {
    position: relative;  /* важно для абсолютного позиционирования фидбека */
    text-align: center;
    margin-bottom: 20px;
    background: #f8f8f8;
    border-radius: 20px;
    padding: 8px;
    overflow: hidden; /* чтобы фидбек не вылезал за скругления */
}

.quiz-photo {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

@media (max-width: 600px) {
    .quiz-photo {
        max-height: 200px;
    }
}

/* Кнопки вариантов ответов – сетка 2x2 */
.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.quiz-option-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    padding: 12px 8px;
    font-size: 0.9rem;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    color: #222;
    word-break: break-word;
    outline: none; /* убираем стандартный outline */
}

.quiz-option-btn:hover {
    border-color: #c12b2b;
    background: #fff6f6;
}

.quiz-option-btn:focus {
    outline: none; /* дополнительно для безопасности */
}

.quiz-option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.6;
	pointer-events: none; /* полностью отключаем взаимодействие, чтобы hover не срабатывал */
}

.quiz-option-btn.disabled:hover {
    transform: none;
    border-color: #e0e0e0;
}

@media (max-width: 550px) {
    .quiz-options {
        gap: 8px;
    }
    .quiz-option-btn {
        padding: 10px 6px;
        font-size: 0.8rem;
    }
}

/* Экран результатов */
.quiz-result-screen {
    text-align: center;
    padding: 10px 0;
}

.quiz-result-score {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #c12b2b;
}

.quiz-result-phrase {
    font-size: 1.1rem;
    line-height: 1.4;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 24px;
    color: #2c3e44;
    margin-bottom: 10px;
}

.quiz-result-phrase q {
    font-style: italic;
    color: #c12b2b;
    font-weight: 500;
}

@media (max-width: 600px) {
    .quiz-result-score {
        font-size: 1.4rem;
    }
    .quiz-result-phrase {
        font-size: 0.95rem;
    }
}

/* ========== СТИЛИ ДЛЯ ТЕСТА (дополнения) ========== */

/* Блок фидбека */
/* Блок фидбека – абсолютно поверх фото */
.quiz-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 700;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding: 20px;
    text-align: center;
    pointer-events: none; /* чтобы не мешать кликам по кнопкам (хотя они заблокированы) */
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.quiz-feedback.correct {
    background: rgba(40, 167, 69, 0.85); /* зелёный полупрозрачный */
    color: #fff;
}

.quiz-feedback.wrong {
    background: rgba(220, 53, 69, 0.85); /* красный полупрозрачный */
    color: #fff;
}

/* Кнопки вариантов – состояния выбора */
.quiz-option-btn.selected {
    border-color: #ffc107;
    background: #fff3cd;
}

.quiz-option-btn.correct {
    border-color: #28a745;
    background: #d4edda;
}

.quiz-option-btn.wrong {
    border-color: #dc3545;
    background: #f8d7da;
}

/* Адаптация под мобильные */
@media (max-width: 600px) {
    .quiz-feedback {
        font-size: 1.6rem;
        padding: 12px;
    }
    .quiz-photo {
        max-height: 200px;
    }