/* ─── Сброс и базовые стили ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
/*
body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}
*/
/* ─── Контент страницы ─── */
.page-content {
    text-align: center;
    padding: 2rem;
}

.page-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.page-content p {
    font-size: 1.1rem;
    color: #718096;
}

/* ─── Затемнение фона ─── */
.backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.backdrop.visible {
    display: block;
}

/* ─── Popover ─── */
[popover] {
    /* Сброс стилей браузера */
    border: none;
    padding: 0;
    background: transparent;
    overflow: visible;

    /* Позиционирование по центру */
    position: fixed;
    inset: 0;
    margin: auto;
    min-width: 370px;
    max-width: 700px;
    height: fit-content;

    z-index: 200;
}

/* Убираем стандартный backdrop popover */
[popover]::backdrop {
    display: none;
}

/* ─── Карточка попапа ─── */
.popup-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: auto;
    animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 100vh;
}

/* ─── Шапка попапа ─── */
.popup-header {
    position: relative;
    background: linear-gradient(135deg, #f8b524 0%, #e71f01 100%);
    padding: 1.5rem 3rem 1.5rem 1.5rem;
}

.popup-header h2 {
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
}

.popup-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

/* ─── Кнопка закрытия ─── */
.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.close-btn:active {
    transform: rotate(90deg) scale(0.9);
}

/* ─── Тело попапа ─── */
.popup-body {
    padding: 1.5rem;
}

/* ─── Место для контента ─── */
.popup-content {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    min-height: 100px;
}

.popup-content p {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.6;
}

.popup-content p + p {
    margin-top: 0.75rem;
}

.popup-location {
    list-style-position: inside;
    padding-left: 0
}

.stand-location {
    font-weight: 600;
}

.popup-location-image {
    max-width: 90%;
    height: auto;
    margin: 0 auto;
}

.popup-location-image img {
    width: 100%;
    height: auto;
}

/* ─── Футер попапа ─── */
.popup-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* ─── Кнопки ─── */
.btn {
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background-color: #ed7817;
    color: #ffffff;
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.mining-world-link {
    width: 100%;
}

/* ─── Анимации ─── */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

/* Классы для анимации закрытия */
.closing .popup-card {
    animation: slideDown 0.25s ease forwards;
}

.closing ~ .backdrop,
.backdrop.closing {
    animation: fadeOut 0.25s ease forwards;
}