/* --- Google Web Fonts für RPG & Sci-Fi Vibes --- */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Orbitron:wght@500;700;900&family=Rajdhani:wght@500;600;700&family=Inter:wght@300;400;600&display=swap');

/* ==========================================================================
   THEME FARBSCHEMATA & SCHRIFTEN
   ========================================================================== */

/* 1. DARK (Standard / Sleek Cyber) */
[data-theme="dark"] {
    --bg-base: #0a0c10;
    --bg-surface: rgba(18, 22, 30, 0.75);
    --bg-surface-hover: rgba(26, 32, 44, 0.85);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #00f0ff;
    --glow: rgba(0, 240, 255, 0.5);
    --border-subtle: rgba(0, 240, 255, 0.2);
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* 2. SHADOWRUN (High-Tech, Low-Life / Neon Magenta & Cyan) */
[data-theme="shadowrun"] {
    --bg-base: #06020c;
    --bg-surface: rgba(20, 7, 34, 0.8);
    --bg-surface-hover: rgba(36, 12, 60, 0.9);
    --text-main: #f1f5f9;
    --text-muted: #a78bfa;
    --accent: #ff007f;
    --glow: rgba(255, 0, 127, 0.65);
    --border-subtle: rgba(0, 240, 255, 0.3);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

/* 3. ALIEN (Nostromo HUD / Phosphor Deep Space Green) */
[data-theme="alien"] {
    --bg-base: #020805;
    --bg-surface: rgba(4, 20, 14, 0.85);
    --bg-surface-hover: rgba(7, 34, 24, 0.9);
    --text-main: #a7f3d0;
    --text-muted: #34d399;
    --accent: #00ff88;
    --glow: rgba(0, 255, 136, 0.7);
    --border-subtle: rgba(0, 255, 136, 0.25);
    --font-heading: 'Orbitron', monospace;
    --font-body: 'Rajdhani', sans-serif;
}

/* 4. FANTASY & SWORD & SORCERY (Pergament, Gold, Antikstein) */
[data-theme="fantasy"] {
    --bg-base: #0f0a06;
    --bg-surface: rgba(26, 18, 12, 0.85);
    --bg-surface-hover: rgba(40, 28, 19, 0.9);
    --text-main: #f5ebe0;
    --text-muted: #d4a373;
    --accent: #e0a96d;
    --glow: rgba(224, 169, 109, 0.6);
    --border-subtle: rgba(224, 169, 109, 0.3);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', serif;
}

/* 5. KULT (Eldritch / Blood & Occult Horror) */
[data-theme="kult"] {
    --bg-base: #080002;
    --bg-surface: rgba(24, 2, 8, 0.85);
    --bg-surface-hover: rgba(42, 4, 14, 0.9);
    --text-main: #fecdd3;
    --text-muted: #fda4af;
    --accent: #e11d48;
    --glow: rgba(225, 29, 72, 0.8);
    --border-subtle: rgba(225, 29, 72, 0.35);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
}

/* 7. CTHULHU (1920s Noir / Sunken R'lyeh Abyss & Eldritch Green) */
[data-theme="cthulhu"] {
    --bg-base: #030a08;
    --bg-surface: rgba(6, 22, 18, 0.85);
    --bg-surface-hover: rgba(10, 36, 30, 0.9);
    --text-main: #e8e3d3;
    --text-muted: #8fa399;
    --accent: #10b981;
    --glow: rgba(16, 185, 129, 0.7);
    --border-subtle: rgba(16, 185, 129, 0.3);
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', serif;
}

/* 6. HELL (Modernes Labor / Clean Tech) */
[data-theme="hell"] {
    --bg-base: #f8fafc;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-hover: rgba(241, 245, 249, 0.95);
    --text-main: #0f172a;
    --text-muted: #475569;
    --accent: #2563eb;
    --glow: rgba(37, 99, 235, 0.4);
    --border-subtle: rgba(37, 99, 235, 0.25);
    --font-heading: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* ==========================================================================
   BASIS-STILE & RESET OVERRIDES
   ========================================================================== */
body {
    background-color: var(--bg-base) !important;
    color: var(--text-main) !important;
    font-family: var(--font-body) !important;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(var(--border-subtle) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.35;
    pointer-events: none;
    z-index: -1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading) !important;
    color: var(--text-main) !important;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ==========================================================================
   HEADER & GLOWING TITEL
   ========================================================================== */
#custom-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem 2rem 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(8px);
    margin-bottom: 1.5rem;
}

.glowing-title {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 900;
    letter-spacing: 6px;
    margin: 0 0 1.2rem 0;
    text-align: center;
    color: #fff;
    font-family: var(--font-heading) !important;
    text-shadow:
        0 0 6px #fff,
        0 0 15px var(--accent),
        0 0 30px var(--accent),
        0 0 60px var(--glow);
    transition: all 0.3s ease;
}

.glowing-title:hover {
    transform: scale(1.02);
    text-shadow:
        0 0 8px #fff,
        0 0 20px var(--accent),
        0 0 45px var(--accent),
        0 0 80px var(--glow);
}

/* Steuerleiste: Theme & Geräte mit mehr Abstand */
.header-controls {
    display: flex;
    gap: 1.2rem;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
    justify-content: center;
}

.header-controls select, .header-controls button {
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
}

.header-controls select:hover, .header-controls button:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--glow);
    color: var(--text-main);
}

/* Navigation mit mehr Luft nach unten */
.custom-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.custom-nav a {
    position: relative;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none !important;
    color: var(--text-main) !important;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}

.custom-nav a:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--glow);
    color: #fff !important;
    transform: translateY(-2px);
}

/* Hero-Button "Zum VTT Intranet" */
.btn-vtt {
    background: linear-gradient(135deg, var(--accent) 0%, rgba(255,255,255,0.15) 100%) !important;
    color: #000 !important;
    font-weight: 900 !important;
    border: 1px solid var(--accent) !important;
    box-shadow: 0 0 15px var(--glow);
}

.btn-vtt:hover {
    box-shadow: 0 0 25px var(--glow) !important;
    transform: translateY(-2px) scale(1.03);
}

/* ==========================================================================
   VIEWPORT SIMULATION & KARTENLAYOUT (CONTENT)
   ========================================================================== */
#viewport-wrapper {
    margin: 2.8rem auto;
    transition: max-width 0.35s ease;
    width: 95%;
}
.mode-desktop { max-width: 1100px; }
.mode-tablet  { max-width: 768px; border: 2px dashed var(--border-subtle); border-radius: 12px; padding: 1rem; }
.mode-mobile  { max-width: 380px; border: 2px dashed var(--border-subtle); border-radius: 16px; padding: 0.5rem; }

#body .wrapper {
    background: transparent !important;
    padding: 1rem 0;
}

article, .card, section.content-block {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.8rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
}

article:hover, .card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px var(--glow);
    background: var(--bg-surface-hover);
}

hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 2.5rem 0;
    opacity: 0.6;
}

/* ==========================================================================
   FORMULARE & EINGABEFELDER
   ========================================================================== */
form {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

form label {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: block;
    letter-spacing: 0.5px;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
    width: 100%;
    background: rgba(0, 0, 0, 0.45) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

form input:focus, form textarea:focus, form select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 15px var(--glow) !important;
    background: rgba(0, 0, 0, 0.65) !important;
}

form textarea {
    resize: vertical;
}

form button, form input[type="submit"] {
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 900;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 15px var(--glow);
    transition: all 0.25s ease;
}

form button:hover, form input[type="submit"]:hover {
    box-shadow: 0 0 25px var(--glow);
    transform: translateY(-2px);
}

@keyframes title-pulse {
    0%, 100% {
        text-shadow:
            0 0 8px var(--glow),
            0 0 16px var(--glow);
        opacity: 0.92;
    }
    50% {
        text-shadow:
            0 0 15px var(--glow),
            0 0 32px var(--glow),
            0 0 45px var(--glow);
        opacity: 1;
    }
}

.glowing-title {
    animation: title-pulse 4s ease-in-out infinite;
    transition: text-shadow 0.4s ease, color 0.4s ease;
}

input[readonly],
input[disabled],
.form-input-readonly {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #94a3b8 !important;
    cursor: not-allowed !important;
    user-select: none;
}

select#theme-select,
.theme-selector select,
select#theme-select option,
.theme-selector select option {
    color: #4a5568 !important;
    background-color: #ffffff !important;
}

select#theme-select option:hover,
select#theme-select option:checked {
    background-color: #edf2f7 !important;
    color: #2d3748 !important;
}

/* ==========================================================================
   CUSTOM THEME SELECT DROPDOWN (MIT SLIDER & SCROLLBAR)
   ========================================================================== */
.sr-only-select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.custom-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    z-index: 1000;
}

.custom-select-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    color: inherit;
}

.custom-select-trigger:hover,
.custom-select-trigger.open {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.custom-select-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.custom-select-trigger.open .custom-select-arrow {
    transform: rotate(180deg);
}

ul.custom-select-options {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 140px;
    max-height: 175px; /* Begrenzte Höhe für Slider */
    overflow-y: auto;  /* Vertikaler Slider */
    margin: 0;
    padding: 0.25rem 0;
    list-style: none;
    background: #121318;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
    z-index: 1001 !important;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(0, 0, 0, 0.4);
}

/* Eleganter Webkit-Scrollbalken (Chrome, Safari, Edge) */
ul.custom-select-options::-webkit-scrollbar {
    width: 6px;
}
ul.custom-select-options::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
}
ul.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}
ul.custom-select-options::-webkit-scrollbar-thumb:hover {
    filter: brightness(1.2);
}

ul.custom-select-options.open {
    display: block;
}

ul.custom-select-options li {
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #e0e0e0;
    transition: background 0.15s ease, color 0.15s ease;
}

ul.custom-select-options li:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent);
}

ul.custom-select-options li.active {
    color: #ffffff;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.18);
}

/* Dynamischer Theme-Glow für das Header-Logo */
.header-logo-img {
    height: 1.3em;
    width: auto;
    vertical-align: middle;
    filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 0 16px currentColor);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.header-logo-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px currentColor) drop-shadow(0 0 24px currentColor);
}


/* Permanenter Glow für das Header-Logo, gekoppelt an den Titel */
.glowing-title .header-logo-img,
.header-logo-img {
    height: 1.35em;
    width: auto;
    vertical-align: middle;
    filter: drop-shadow(0 0 3px currentColor) drop-shadow(0 0 7px currentColor) opacity(0.95) !important;
    animation: none !important;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.glowing-title .header-logo-img:hover,
.header-logo-img:hover {
    filter: drop-shadow(0 0 5px currentColor) drop-shadow(0 0 11px currentColor) opacity(1) !important;
    transform: scale(1.04);
}

/* Sanfte Farbrotation für das Logo-Glow */
.header-logo-img {
    height: 1.35em;
    width: auto;
    vertical-align: middle;
    animation: smoothLogoColorCycle 18s linear infinite !important;
    transition: transform 0.3s ease;
}

@keyframes smoothLogoColorCycle {
    0%, 100% {
        /* Weiß / Silber */
        filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.7)) drop-shadow(0 0 7px rgba(255, 255, 255, 0.4));
    }
    11% {
        /* Rot */
        filter: drop-shadow(0 0 3px rgba(255, 50, 70, 0.7)) drop-shadow(0 0 7px rgba(255, 50, 70, 0.4));
    }
    22% {
        /* Orange */
        filter: drop-shadow(0 0 3px rgba(255, 140, 20, 0.7)) drop-shadow(0 0 7px rgba(255, 140, 20, 0.4));
    }
    33% {
        /* Gelb */
        filter: drop-shadow(0 0 3px rgba(255, 220, 40, 0.7)) drop-shadow(0 0 7px rgba(255, 220, 40, 0.4));
    }
    44% {
        /* Grün */
        filter: drop-shadow(0 0 3px rgba(40, 220, 90, 0.7)) drop-shadow(0 0 7px rgba(40, 220, 90, 0.4));
    }
    55% {
        /* Cyan / Türkis */
        filter: drop-shadow(0 0 3px rgba(20, 220, 220, 0.7)) drop-shadow(0 0 7px rgba(20, 220, 220, 0.4));
    }
    66% {
        /* Blau */
        filter: drop-shadow(0 0 3px rgba(60, 130, 255, 0.7)) drop-shadow(0 0 7px rgba(60, 130, 255, 0.4));
    }
    77% {
        /* Lila / Violett */
        filter: drop-shadow(0 0 3px rgba(180, 60, 255, 0.7)) drop-shadow(0 0 7px rgba(180, 60, 255, 0.4));
    }
    88% {
        /* Magenta / Pink */
        filter: drop-shadow(0 0 3px rgba(255, 60, 170, 0.7)) drop-shadow(0 0 7px rgba(255, 60, 170, 0.4));
    }
}

.header-logo-img:hover {
    transform: scale(1.04);
}

/* =========================================================
   RESPONSIVER HEADER & VIEWPORT-SYNCHRONISIERUNG
   ========================================================= */

/* Grundlegend flüssige Skalierung für echte Mobilgeräte */
#custom-header {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    transition: max-width 0.3s ease;
    box-sizing: border-box;
}

#custom-header h1.glowing-title,
h1.glowing-title {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    font-size: clamp(1.4rem, 4.2vw, 3.2rem) !important;
    transition: font-size 0.25s ease, letter-spacing 0.25s ease !important;
}

#custom-header .header-logo-img,
.header-logo-img {
    height: clamp(32px, 5.5vw, 68px) !important;
    width: auto !important;
    transition: height 0.25s ease !important;
}

/* --- TABLET MODUS (Button & Display) --- */
body[data-viewport="tablet"] #custom-header {
    max-width: 768px !important;
}
body[data-viewport="tablet"] #custom-header h1.glowing-title,
body[data-viewport="tablet"] h1.glowing-title {
    font-size: 2.1rem !important;
    letter-spacing: 1px !important;
}
body[data-viewport="tablet"] #custom-header .header-logo-img,
body[data-viewport="tablet"] .header-logo-img {
    height: 48px !important;
}

/* --- HANDY / MOBILE MODUS (Button & Display 380px) --- */
body[data-viewport="mobile"] #custom-header {
    max-width: 380px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
}

body[data-viewport="mobile"] #custom-header h1.glowing-title,
body[data-viewport="mobile"] h1.glowing-title {
    font-size: 1.35rem !important;
    letter-spacing: 0.5px !important;
}

body[data-viewport="mobile"] #custom-header .header-logo-img,
body[data-viewport="mobile"] .header-logo-img {
    height: 32px !important;
}

/* Navigations-Buttons im Handy-Modus ergonomisch umbrechen */
body[data-viewport="mobile"] #custom-header .custom-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
}

body[data-viewport="mobile"] #custom-header .custom-nav a {
    font-size: 0.78rem !important;
    padding: 6px 10px !important;
}

/* Echte Smartphones via Media-Query (Portrait & schmale Screens) */
@media (max-width: 480px) {
    #custom-header h1.glowing-title,
    h1.glowing-title {
        font-size: 1.3rem !important;
        letter-spacing: 0.4px !important;
    }
    #custom-header .header-logo-img,
    .header-logo-img {
        height: 30px !important;
    }
    #custom-header .custom-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    #custom-header .custom-nav a {
        font-size: 0.78rem !important;
        padding: 5px 8px !important;
    }
}
