(function () {
if (window.__mobileNavLoaded) return;
window.__mobileNavLoaded = true;
const path = window.location.pathname;
const I = window.IC || function () { return ''; };
const TOPBAR_H = '4.875rem';
// ── CSS ──────────────────────────────────────────────────────────────────
const style = document.createElement('style');
style.textContent = `
.mobile-topbar {
display: none;
position: fixed;
top: 0; left: 0; right: 0;
height: ${TOPBAR_H};
background: var(--color-card);
border-bottom: 1px solid var(--color-secondary);
box-shadow: 0 2px 12px rgba(0,0,0,0.4);
z-index: 500;
align-items: center;
padding: 0 4px 0 0.25rem;
}
.mobile-topbar-logo {
position: absolute;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
pointer-events: auto;
}
.mobile-topbar-logo img {
height: 3rem;
width: auto;
}
.mobile-topbar-actions {
display: flex;
align-items: center;
margin-left: auto;
}
.mobile-tb-btn {
position: relative;
background: none;
border: none;
color: var(--color-text);
font-size: 1.3rem;
line-height: 1;
padding: 0.55rem 0.6rem;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
border-radius: 12px;
text-decoration: none;
transition: background 0.12s;
flex-shrink: 0;
}
.mobile-tb-btn:hover { background: var(--color-secondary); }
.mobile-tb-badge {
position: absolute;
top: 3px; right: 3px;
background: var(--color-primary);
color: #fff;
border-radius: 10px;
font-size: 0.87rem;
font-weight: 700;
min-width: 1.65em;
padding: 0.15em 0.375em;
display: none;
line-height: 1.4;
text-align: center;
}
.mobile-tb-avatar {
width: 2.7rem;
height: 2.7rem;
border-radius: 50%;
object-fit: cover;
}
/* ── Mobile Menu Backdrop ── */
.mob-menu-backdrop {
display: none;
position: fixed;
top: ${TOPBAR_H};
left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.55);
z-index: 998;
}
.mob-menu-backdrop.open { display: block; }
/* ── Mobile Menu Panel ── */
.mob-menu-panel {
position: fixed;
top: ${TOPBAR_H};
right: 0;
bottom: 0;
width: min(80%, 360px);
background: var(--color-card);
border-left: 1px solid var(--color-secondary);
z-index: 999;
overflow-y: auto;
transform: translateX(100%);
transition: transform 0.25s ease;
}
.mob-menu-panel.open { transform: translateX(0); }
/* ── Accordion ── */
.mnav-section { border-bottom: 1px solid var(--color-secondary); }
.mnav-section:last-child { border-bottom: none; }
.mnav-section-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0.85rem 1.1rem;
cursor: pointer;
user-select: none;
font-size: 0.88rem;
font-weight: 600;
color: var(--color-text);
transition: background 0.12s;
}
.mnav-section-header:hover { background: var(--color-secondary); }
.mnav-section-arrow {
font-size: 0.65rem;
transition: transform 0.2s;
color: var(--color-muted);
}
.mnav-section.open .mnav-section-arrow { transform: rotate(90deg); }
.mnav-section-body { display: none; }
.mnav-section.open .mnav-section-body { display: block; }
/* ── Menu Links ── */
.mnav-link {
display: flex;
align-items: center;
gap: 0.65rem;
padding: 0.6rem 1.1rem 0.6rem 1.5rem;
text-decoration: none;
color: var(--color-text);
font-size: 0.9rem;
transition: background 0.12s, color 0.12s;
}
.mnav-link:hover { background: var(--color-secondary); color: var(--color-primary); }
.mnav-link.active { color: var(--color-primary); background: rgba(var(--color-primary-rgb,233,69,96),0.08); }
.mnav-icon { width: 1.3rem; text-align: center; font-size: 1rem; flex-shrink: 0; }
.mnav-badge {
margin-left: auto;
background: var(--color-primary); color: #fff;
border-radius: 10px; font-size: 0.68rem; font-weight: 700;
min-width: 1.2em; padding: 0.1em 0.3em; display: none;
}
.mnav-link--danger { color: var(--color-primary); }
.mnav-link--danger:hover { background: rgba(var(--color-primary-rgb,233,69,96),0.1); color: var(--color-primary); }
/* ── Show only on mobile ── */
@media (max-width: 768px) {
.mobile-topbar { display: flex; }
body.app { padding-top: ${TOPBAR_H}; }
}
`;
document.head.appendChild(style);
// ── Helper ───────────────────────────────────────────────────────────────
function lnk(href, iconKey, label, id, badgeId) {
const cls = path === href ? ' active' : '';
const idAttr = id ? ` id="${id}"` : '';
const badge = badgeId ? `` : '';
const icon = iconKey ? `` : ``;
return `${icon}${label}${badge}`;
}
// ── Menu-Sektionen ────────────────────────────────────────────────────────
const SECTIONS = [
{
label: 'Allgemein',
prefixes: ['/userhome.html', '/search.html', '/community/nachrichten.html',
'/community/benachrichtigungen.html', '/games/common/einladungen.html'],
html: `
${lnk('/userhome.html', 'HOME', 'Home' )}
${lnk('/search.html', 'SEARCH', 'Suche' )}
${lnk('/community/nachrichten.html', 'MESSAGES', 'Nachrichten', null, 'mnavBadgeMsg' )}
${lnk('/community/benachrichtigungen.html', 'NOTIFICATIONS', 'Benachrichtigungen', null, 'mnavBadgeNotif' )}
${lnk('/games/common/einladungen.html', 'INVITATIONS', 'Einladungen', null, 'mnavBadgeInv' )}
`,
},
{
label: 'Community',
prefixes: ['/community/'],
html: `
${lnk('/community/feed.html', 'FEED', 'Feed' )}
${lnk('/community/freunde.html', 'FRIENDS', 'Freunde', null, 'mnavBadgeFriends' )}
${lnk('/community/gruppen.html', 'GROUPS', 'Gruppen', null, 'mnavBadgeGruppen' )}
${lnk('/community/locations.html', 'LOCATION', 'Locations' )}
${lnk('/community/events.html', 'EVENT', 'Veranstaltungen' )}
`,
},
{
label: 'Dating',
prefixes: ['/dating/'],
html: `
Dating
${lnk('/dating/besucher.html', '', 'Besucher')}
${lnk('/dating/likes.html', '', 'Likes' )}
${lnk('/dating/matches.html', '', 'Matches' )}
`,
},
{
label: 'Vanilla Game',
prefixes: ['/games/vanilla/'],
html: `
${lnk('/games/vanilla/neuvanilla.html', 'PLAY_NEW', 'Neue Session', 'mnavVanillaNeu' )}
${lnk('/games/vanilla/aufgaben.html', 'CHECK', 'Aufgaben' )}
${lnk('/games/vanilla/toys.html', 'TOYS', 'Toys' )}
${lnk('/games/vanilla/entdecken.html', 'DISCOVER', 'Entdecken' )}
`,
},
{
label: 'BDSM Game',
prefixes: ['/games/bdsm/'],
html: `
${lnk('/games/bdsm/neubdsm.html', 'PLAY_NEW', 'Neue Session', 'mnavBdsmNeu' )}
${lnk('/games/bdsm/aufgaben.html', 'CHECK', 'Aufgaben' )}
${lnk('/games/bdsm/toys.html', 'TOYS', 'Toys' )}
${lnk('/games/bdsm/entdecken.html', 'DISCOVER', 'Entdecken' )}
`,
},
{
label: 'Chastity Game',
prefixes: ['/games/chastity/'],
html: `
${lnk('/games/chastity/neulock.html', 'NEW_LOCK', 'Neues Lock', 'mnavChastityNeu' )}
${lnk('/games/chastity/communityvotes.html', 'VOTES', 'Community Votes' )}
${lnk('/games/chastity/meine-locks.html', 'LOCK', 'Meine Vorlagen' )}
${lnk('/games/chastity/entdecken-vorlagen.html', 'DISCOVER', 'Entdecken' )}
${lnk('/games/chastity/keyholder-finden.html', 'FRIENDS', 'Keyholder finden' )}
${lnk('/games/chastity/keyholder.html', 'KEY', 'Keyholder' )}
${lnk('/games/chastity/unlock-history.html', 'HISTORY', 'Code-Historie' )}
`,
},
{
label: 'Konto',
prefixes: ['/konto/', '/help/'],
html: `
${lnk('/konto/einstellungen.html', 'SETTINGS', 'Einstellungen')}
${lnk('/help/overview.html', 'HELP', 'Hilfe' )}
Abmelden
`,
},
];
// ── Mobile Topbar ─────────────────────────────────────────────────────────
const topbarEl = document.createElement('div');
topbarEl.className = 'mobile-topbar';
topbarEl.id = 'mobileTopbar';
topbarEl.innerHTML = `