/* Stylizacja Pełnej Legendy i Przewodnika w motywie Kids-Night */

.halloween-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 8, 22, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.halloween-modal-backdrop.is-open {
    display: flex !important;
    opacity: 1;
    pointer-events: auto;
}

.halloween-modal-dialog {
    background: #1b1226;
    border: 2px solid #5d4277;
    border-radius: 20px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 121, 63, 0.25);
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.halloween-modal-backdrop.is-open .halloween-modal-dialog {
    transform: scale(1) translateY(0);
}

.halloween-modal-header {
    background: linear-gradient(135deg, #2f1b4a 0%, #180f26 100%);
    padding: 18px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #4a3363;
}

.modal-header-text {
    flex: 1;
}

.modal-top-badge {
    display: inline-block;
    background: rgba(255, 121, 63, 0.2);
    color: #ffb086;
    border: 1px solid rgba(255, 121, 63, 0.4);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 10px;
    border-radius: 12px;
    margin-bottom: 5px;
}

.halloween-modal-header h3 {
    color: #FFFFFF;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    margin: 0;
    line-height: 1.2;
}

.modal-subtitle {
    color: #bfaecf;
    font-size: 0.85rem;
    margin: 4px 0 0 0;
    line-height: 1.4;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
    font-size: 1.8rem;
    line-height: 1;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    background: #ff5252;
    border-color: #ff5252;
    color: #fff;
    transform: rotate(90deg) scale(1.08);
}

.halloween-modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.halloween-modal-body::-webkit-scrollbar {
    width: 7px;
}
.halloween-modal-body::-webkit-scrollbar-track {
    background: #140d1e;
}
.halloween-modal-body::-webkit-scrollbar-thumb {
    background: #48335f;
    border-radius: 4px;
}
.halloween-modal-body::-webkit-scrollbar-thumb:hover {
    background: #ff793f;
}

.legend-modal-section h4 {
    color: #ff9e43;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin: 0 0 14px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 158, 67, 0.3);
    padding-bottom: 8px;
}

.legend-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.legend-card-item {
    background: #241935;
    border: 1.5px solid #49335e;
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all 0.2s ease;
}

.legend-card-item:hover {
    border-color: #ff9e43;
    background: #2d1d42;
    transform: translateX(3px);
}

.legend-card-icon {
    width: 48px;
    min-width: 48px;
    height: 48px;
    background: rgba(18, 11, 28, 0.8);
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.legend-card-icon img {
    max-width: 36px;
    max-height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
}

.legend-card-content {
    flex: 1;
}

.card-title {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-desc {
    font-size: 0.85rem;
    color: #c9bed8;
    line-height: 1.48;
}

.legend-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.feature-box {
    background: #221733;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 13px 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: border-color 0.2s;
}

.feature-box:hover {
    border-color: #c084fc;
}

.feature-emoji {
    font-size: 1.4rem;
    line-height: 1;
}

.feature-box strong {
    display: block;
    color: #ffe600;
    font-size: 0.88rem;
    margin-bottom: 3px;
}

.feature-box p {
    font-size: 0.8rem;
    color: #b7a7cc;
    margin: 0;
    line-height: 1.4;
}

.app-download-cta {
    background: linear-gradient(135deg, rgba(255, 121, 63, 0.15) 0%, rgba(128, 0, 128, 0.15) 100%);
    border: 1.5px dashed #ff793f;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.app-download-cta span {
    font-size: 0.9rem;
    color: #f5f5f5;
}

.btn-play-store {
    background: #ff793f;
    color: #140b1e;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(255, 121, 63, 0.4);
    transition: all 0.2s ease;
}

.btn-play-store:hover {
    background: #ffa066;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 121, 63, 0.6);
}

.safety-rules-box {
    background: #14241b;
    border: 1.5px solid rgba(76, 175, 80, 0.4);
    border-radius: 14px;
    padding: 16px 20px;
}

.safety-rules-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.safety-rules-box li {
    font-size: 0.85rem;
    color: #d6e8d8;
    line-height: 1.48;
}

.safety-rules-box strong {
    color: #81c784;
}

.halloween-modal-footer {
    padding: 14px 24px;
    background: #140d1e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
}

.btn-modal-close-action {
    background: linear-gradient(135deg, #ff793f 0%, #ff5252 100%);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 121, 63, 0.4);
    transition: all 0.2s ease;
}

.btn-modal-close-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 121, 63, 0.6);
}

/* Przycisk otwierający legendę w mini-pasku */
.btn-legend-open {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ff793f 0%, #ff5252 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 121, 63, 0.4);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    margin-left: 8px;
    white-space: nowrap;
}

.btn-legend-open:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 4px 14px rgba(255, 121, 63, 0.6);
    background: linear-gradient(135deg, #ff955c 0%, #ff6b6b 100%);
}

.kids .marker-legend span[role="button"] {
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
}

.kids .marker-legend span[role="button"]:hover {
    color: #ffe0a4 !important;
    transform: scale(1.05);
}

@media (max-width: 760px) {
    .halloween-modal-dialog {
        max-height: 94vh;
        border-radius: 16px;
    }
    .halloween-modal-header {
        padding: 14px 16px;
    }
    .halloween-modal-header h3 {
        font-size: 1.3rem;
    }
    .halloween-modal-body {
        padding: 16px;
        gap: 18px;
    }
    .legend-card-item {
        padding: 10px 12px;
        gap: 12px;
    }
    .legend-card-icon {
        width: 42px;
        min-width: 42px;
        height: 42px;
    }
    .btn-legend-open {
        font-size: 10px;
        padding: 3px 9px;
        margin-left: 4px;
    }
}
