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

:root {
    --bg: #0a0e1a;
    --accent: #f5c518;
    --text: #e8eef7;
    --card: #141b2d;
    --border: #2a3550;
    --muted: rgba(232, 238, 247, 0.6);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    height: 100vh;
}

.muted {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Menu knop linksboven */
.menu-btn {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    left: 1rem;
    z-index: 150;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(20, 27, 45, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 1.5rem 1rem 4.5rem;
    background: linear-gradient(to bottom, rgba(10,14,26,0.95), transparent);
    pointer-events: none;
}

.site-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.subtitle {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-top: 0.15rem;
}

.admin-link {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    pointer-events: auto;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.admin-link:hover {
    background: var(--accent);
    color: #111;
}

#globeViz {
    width: 100vw;
    height: 100vh;
}

.loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 200;
    font-size: 1.1rem;
    transition: opacity 0.4s;
}

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

/* Side menu – gedeeltelijke overlay */
.side-menu {
    position: fixed;
    inset: 0;
    z-index: 250;
}

.side-menu.hidden {
    pointer-events: none;
}

.side-menu.hidden .side-menu-backdrop {
    opacity: 0;
}

.side-menu.hidden .side-menu-panel {
    transform: translateX(-105%);
}

.side-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 1;
    transition: opacity 0.25s;
    border: none;
    cursor: pointer;
}

.side-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(92vw, 24rem);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.45);
    transform: translateX(0);
    transition: transform 0.28s ease;
}

.side-menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.5rem 1.25rem;
}

.side-menu-top h2 {
    font-size: 1.25rem;
}

.side-menu-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.25rem 1.25rem;
}

.about-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.about-body {
    white-space: pre-wrap;
    line-height: 1.65;
    font-size: 0.92rem;
    opacity: 0.9;
}

.about-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.about-photos img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.albums-section {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.6;
}

.album-count {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

.album-count-label {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 0.75rem;
}

.menu-album-list {
    list-style: none;
}

.menu-album-list button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 0.65rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}

.menu-album-list button:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-album-list strong {
    display: block;
    font-size: 0.95rem;
}

.menu-album-list span {
    display: block;
    font-size: 0.8rem;
    opacity: 0.65;
    margin-top: 0.1rem;
}

.side-menu-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
}

.side-menu-footer a {
    color: var(--muted);
    font-size: 0.9rem;
}

.side-menu-footer a:hover {
    color: var(--accent);
}

/* Overlay album */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 1;
    transition: opacity 0.25s;
}

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

.overlay-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.close-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    z-index: 10;
    width: 40px;
    height: 40px;
}

.overlay-content > .close-btn {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
}

.close-btn:hover {
    opacity: 1;
}

.overlay-header {
    padding: 1.75rem 1.75rem 0.5rem;
}

.overlay-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    padding-right: 2rem;
}

.place {
    color: var(--accent);
    font-size: 0.95rem;
}

.overlay-body {
    padding: 0.5rem 1.75rem 1.75rem;
}

.story {
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.photos img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--border);
}

.photos img:hover {
    transform: scale(1.03);
}

.playlist-block {
    margin-top: 1.75rem;
}

.playlist-block h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.playlist-player {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    background: #0d1220;
}

.track-title {
    font-weight: 600;
}

.track-artist {
    font-size: 0.9rem;
    opacity: 0.75;
    margin-top: 0.15rem;
}

.track-meta {
    margin-top: 0.35rem;
    font-variant-numeric: tabular-nums;
}

.track-media {
    margin-top: 0.75rem;
}

.track-media audio {
    width: 100%;
}

.track-media iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 8px;
}

.track-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.track-list {
    list-style: none;
    margin-top: 0.85rem;
}

.track-list li button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0.45rem 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.track-list li.active button,
.track-list li button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
}

/* Star marker
   Geen transition op transform: CSS2DRenderer zet de positie via transform.
   Een CSS-transition daarop zorgt dat sterren "achteraan zweven" bij draaien. */
.star-marker {
    width: 28px;
    height: 28px;
    cursor: pointer;
    filter: drop-shadow(0 0 6px rgba(245, 197, 24, 0.8));
    /* alleen visuele hover, geen transform-transition */
    transition: filter 0.15s;
    will-change: auto;
}

.star-marker:hover {
    filter: drop-shadow(0 0 10px rgba(245, 197, 24, 1));
}

.star-marker svg {
    width: 100%;
    height: 100%;
    display: block;
    /* schaal de svg i.p.v. de container, zodat de positie-transform niet interfereert */
    transition: transform 0.15s;
    transform-origin: center center;
}

.star-marker:hover svg {
    transform: scale(1.3);
}

/* Admin styles */
.admin-body {
    overflow: auto;
    min-height: 100vh;
    background: var(--bg);
    padding: 2rem 1rem;
}

.admin-container {
    max-width: 960px;
    margin: 0 auto;
}

.admin-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-card h1, .admin-card h2 {
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: #0d1220;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    background: var(--accent);
    color: #111;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: filter 0.2s;
}

.btn:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: #c0392b;
    color: #fff;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.album-list {
    list-style: none;
}

.album-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
}

.album-list li:last-child {
    border-bottom: none;
}

.album-info {
    flex: 1;
}

.album-info strong {
    display: block;
}

.album-info span {
    font-size: 0.85rem;
    opacity: 0.7;
}

.album-actions {
    display: flex;
    gap: 0.5rem;
}

.photo-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.photo-item {
    position: relative;
}

.photo-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.photo-item .remove-photo {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #c0392b;
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
}

.error-msg {
    background: #3d1a1a;
    color: #f5a5a5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #5c2a2a;
}

.success-msg {
    background: #1a3d2a;
    color: #a5f5c0;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #2a5c3a;
}

.login-box {
    max-width: 380px;
    margin: 10vh auto;
}

.plus-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #111;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(245, 197, 24, 0.35);
    transition: transform 0.2s;
    text-decoration: none;
}

.plus-btn:hover {
    transform: scale(1.08);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.playlist-admin-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.65rem;
    background: #0d1220;
}

.playlist-admin-row .row-fields {
    display: grid;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .playlist-admin-row .row-fields {
        grid-template-columns: 1fr 1fr 1.4fr auto;
        align-items: end;
    }
}

@media (max-width: 600px) {
    .overlay-content {
        max-height: 95vh;
    }
    .photos {
        grid-template-columns: 1fr 1fr;
    }
}


/* Music browser (admin) */
.music-browser {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.music-browser.hidden {
    display: none;
}
.music-browser-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
}
.music-browser-panel {
    position: relative;
    width: min(560px, 96vw);
    max-height: 85vh;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.music-browser-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.5rem 1.25rem;
}
.music-browser-top h2 {
    font-size: 1.15rem;
}
.music-browser-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
}
.music-browser-toolbar input[type="search"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: #0d1220;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}
.music-browser-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
    max-height: 50vh;
}
.music-file-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
}
.music-file-row:hover {
    background: rgba(255,255,255,0.04);
}
.music-file-row.already {
    opacity: 0.45;
}
.music-file-meta {
    flex: 1;
    min-width: 0;
}
.music-file-meta strong {
    display: block;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.music-file-meta span {
    font-size: 0.75rem;
    opacity: 0.6;
}
.music-browser-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
}
.selected-music-preview {
    margin-top: 0.65rem;
}
.pending-music-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.pending-music-list li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #0d1220;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.45rem;
    font-size: 0.85rem;
}

.music-browser-upload {
    padding: 0.5rem 1.25rem 0.25rem;
}
.music-upload-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: #0d1220;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
}
.music-upload-drop:hover,
.music-upload-drop.dragover {
    border-color: var(--accent);
    background: rgba(245, 197, 24, 0.06);
}
.music-upload-drop.uploading {
    opacity: 0.7;
    pointer-events: none;
}
.music-upload-text {
    font-size: 0.9rem;
}
.music-upload-hint {
    font-size: 0.75rem;
}
.music-upload-status {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    min-height: 1.2em;
}

/* Carousel lightbox */
.carousel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}
.carousel-img {
    max-width: min(92vw, 1100px);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(20, 27, 45, 0.85);
    border: 1px solid var(--border);
    color: var(--text);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.carousel-nav:hover {
    background: var(--accent);
    color: #111;
}
.carousel-prev { left: 1rem; }
.carousel-next { right: 1rem; }
.carousel-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
}
.carousel-close:hover { opacity: 1; }
.carousel-meta {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(20, 27, 45, 0.9);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
}
.carousel-counter {
    font-variant-numeric: tabular-nums;
    font-size: 0.9rem;
    min-width: 3.5rem;
    text-align: center;
}
@media (max-width: 600px) {
    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .carousel-prev { left: 0.4rem; }
    .carousel-next { right: 0.4rem; }
}
