*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg:           #0d0d0d;
    --header-bg:    rgba(10, 10, 10, 0.96);
    --accent:       #f5861d;
    --accent-hover: #b76315;
    --text:         #f0ede8;
    --muted:        #777;
    --popup-bg:     #161616;
    --popup-border: #262626;
    --header-h:     60px;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* ── HEADER ─────────────────────────────────────────────────────── */
header {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #1f1f1f;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    gap: 14px;
    z-index: 1000;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo {
    height: 26px;
    width: auto;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 480px) { #venue-count { display: none; } }

#venue-count {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    font-weight: 500;
}

#venue-count strong { color: var(--accent); }

.btn-about {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 7px 14px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-about:hover { background: #222; border-color: #363636; }

/* ── MAP ─────────────────────────────────────────────────────────── */
#map {
    position: fixed;
    top: var(--header-h);
    inset-inline: 0;
    bottom: 0;
    background: #0d1117;
}

/* ── MARKERS ─────────────────────────────────────────────────────── */
.vm-marker {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.vm-marker::after {
    content: '';
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid rgba(232, 197, 71, 0.25);
    box-shadow: 0 0 6px rgba(232, 197, 71, 0.4);
    flex-shrink: 0;
}

.marker-cluster div {
    background: var(--accent) !important;
    color: #111 !important;
    font-family: 'Syne', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
}

.marker-cluster { background: rgba(232, 197, 71, 0.15) !important; }

/* User location dot */
.user-dot {
    width: 18px; height: 18px;
    background: #4a9eff;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 5px rgba(74, 158, 255, 0.25);
}

/* ── GPS CONTROL ─────────────────────────────────────────────────── */
.leaflet-control-gps a {
    background: #1a1a1a !important;
    border: 1px solid #2a2a2a !important;
    border-radius: 8px !important;
    color: var(--text) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.leaflet-control-gps a:hover {
    background: #222 !important;
    border-color: #363636 !important;
}

.leaflet-control-gps a.locating {
    border-color: var(--accent) !important;
    animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--accent); }
    50%       { border-color: rgba(232, 197, 71, 0.25); }
}

/* ── POPUP ───────────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    background: var(--popup-bg) !important;
    border: 1px solid var(--popup-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-tip-container { display: none; }

.leaflet-popup-content {
    margin: 0 !important;
    width: 270px !important;
}

.leaflet-popup-close-button {
    color: var(--muted) !important;
    font-size: 18px !important;
    top: 10px !important;
    right: 12px !important;
    z-index: 10;
}

.leaflet-popup-close-button:hover { color: var(--text) !important; }

.popup-body { padding: 18px 18px 16px; }

.popup-name {
    font-family: 'Syne', sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 8px;
    padding-right: 20px;
}

.popup-summary {
    font-size: 0.79rem;
    color: #999;
    line-height: 1.6;
    margin-bottom: 10px;
}

.popup-address {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 4px;
    line-height: 1.4;
}

.popup-address svg { flex-shrink: 0; margin-top: 1px; }

.popup-footer {
    border-top: 1px solid var(--popup-border);
    padding: 12px 18px;
}

.popup-gmaps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #111 !important;
    text-decoration: none !important;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 7px;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.01em;
}

.popup-gmaps:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* ── MAP CONTROLS ────────────────────────────────────────────────── */
.leaflet-control-zoom { border: none !important; box-shadow: none !important; }

.leaflet-control-zoom a {
    background: #1a1a1a !important;
    color: var(--text) !important;
    border: 1px solid #282828 !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
    width: 32px !important; height: 32px !important;
    line-height: 30px !important;
    font-size: 16px !important;
}

.leaflet-control-zoom a:hover { background: #222 !important; }

.leaflet-control-attribution {
    background: rgba(8,8,8,0.75) !important;
    color: #444 !important;
    font-size: 9px !important;
}

.leaflet-control-attribution a { color: #555 !important; }

/* ── LOADING ─────────────────────────────────────────────────────── */
#loading {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 2000;
    transition: opacity 0.4s;
}

#loading.hidden { opacity: 0; pointer-events: none; }

.spinner {
    width: 36px; height: 36px;
    border: 3px solid #1f1f1f;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
#loading p { color: var(--muted); font-size: 0.82rem; }

/* ── INSTALL HINT ────────────────────────────────────────────────── */
#install-hint {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 16px;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: #111;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 9px 14px 9px 16px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 999;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

#hint-dismiss {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    padding: 0;
    cursor: pointer;
    color: #111;
    flex-shrink: 0;
    margin-left: 2px;
}

#hint-dismiss:hover { background: rgba(0,0,0,0.28); }

/* Pulsing ring on the GPS button */
.leaflet-control-gps a.hint-active {
    border-color: var(--accent) !important;
    animation: hint-pulse 1.4s ease-in-out infinite !important;
}

@keyframes hint-pulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(232, 197, 71, 0.7); }
    50%       { box-shadow: 0 0 0 8px rgba(232, 197, 71, 0); }
}

/* ── GPS ERROR TOAST ─────────────────────────────────────────────── */
#gps-error {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2a1414;
    border: 1px solid #5a2a2a;
    color: #e88;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    display: none;
    z-index: 999;
    white-space: nowrap;
}

/* ── ABOUT MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
    background: #141414;
    border: 1px solid #242424;
    border-radius: 18px;
    width: 100%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.7);
    transform: translateY(14px);
    transition: transform 0.25s;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 22px 0;
}

.modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.modal-title em { font-style: normal; color: var(--accent); }

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    transition: color 0.15s, background 0.15s;
}

.modal-close:hover { color: var(--text); background: #222; }

.modal-body { padding: 18px 22px 26px; }

.modal-body p {
    font-size: 0.875rem;
    color: #aaa;
    line-height: 1.7;
    margin-bottom: 14px;
}

.modal-body p:last-child { margin-bottom: 0; }
.modal-body strong { color: var(--text); font-weight: 600; }

.modal-divider { border: none; border-top: 1px solid #222; margin: 18px 0; }

.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.74rem;
    color: var(--muted);
    margin-bottom: 16px;
}

.modal-badge span {
    width: 6px; height: 6px;
    background: #4caf50;
    border-radius: 50%;
}

.modal-body a { color: var(--accent); text-decoration: none; }
.modal-body a:hover { text-decoration: underline; }

.modal-meta {
    font-size: 0.72rem !important;
    color: #444 !important;
}

/* ── INSTALL PROMPT ──────────────────────────────────────────────── */
#install-wrap { margin-bottom: 4px; }

.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 9px 16px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    width: 100%;
    justify-content: center;
}

.btn-install:hover { background: #222; border-color: #363636; }

.install-ios {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8rem !important;
    color: #aaa !important;
    line-height: 1.5;
    margin: 0 !important;
}

.install-ios svg { flex-shrink: 0; color: var(--accent); }
.install-ios strong { color: var(--text); font-weight: 600; }

/* ── IMPRINT PAGE ────────────────────────────────────────────────── */
html:has(.page-imprint),
.page-imprint {
    height: auto;
    overflow: auto;
}

.page {
    max-width: 620px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 40px;
    transition: color 0.15s;
}

.back-link:hover { color: var(--text); }

.page h1 {
    font-family: 'Syne', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.page h1 em { font-style: normal; color: var(--accent); }

.page .subtitle {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.page h2 {
    font-family: 'Syne', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
    margin-top: 32px;
}

.page p, .page address {
    font-size: 0.875rem;
    color: #aaa;
    line-height: 1.75;
    font-style: normal;
    margin-bottom: 10px;
}

.page a { color: var(--accent); text-decoration: none; }
.page a:hover { text-decoration: underline; }

.page hr {
    border: none;
    border-top: 1px solid #222;
    margin: 36px 0;
}

.page .meta {
    font-size: 0.75rem;
    color: #555;
}

.page .signature { margin-top: 16px; }
