:root {
    --totk-teal: #2dd4bf;
    --totk-teal-dark: rgba(20, 184, 166, 0.3);
    --totk-gold: #fbbf24;
    --totk-dark: rgba(0, 0, 0, 0.6);
    --totk-bg: #020617;
    --totk-text: #e2e8f0;
    --totk-glow: 0 0 12px rgba(45, 212, 191, 0.4);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); border-radius: 8px; }
::-webkit-scrollbar-thumb { background: rgba(45, 212, 191, 0.3); border-radius: 8px; border: 1px solid rgba(45, 212, 191, 0.2); }
::-webkit-scrollbar-thumb:hover { background: rgba(45, 212, 191, 0.6); box-shadow: 0 0 10px rgba(45, 212, 191, 0.5); }

body {
    margin: 0;
    padding: 0;
    font-family: 'Rajdhani', sans-serif;
    background: radial-gradient(ellipse at top, rgba(4, 47, 46, 0.4), var(--totk-bg), #000000);
    background-color: var(--totk-bg);
    color: var(--totk-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.bg-decor-1 {
    position: absolute;
    top: -20%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    border: 1px solid rgba(20, 184, 166, 0.1);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.bg-decor-2 {
    position: absolute;
    top: -15%;
    left: -5%;
    width: 40vw;
    height: 40vw;
    border: 2px solid rgba(20, 184, 166, 0.05);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

header {
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(20, 184, 166, 0.2);
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
    position: relative;
    z-index: 20;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: linear-gradient(to right, #ccfbf1, var(--totk-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

h2 {
    color: rgba(20, 184, 166, 0.8);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 4px 0 0 0;
}

.flight-protocol {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.flight-tab-content {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.flight-card-large {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem 1.25rem;
    cursor: default;
}

.flight-card-large .flight-code {
    font-size: 1.25rem;
}

.flight-card-large .flight-detail {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.flight-lore {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    padding: 0 0.25rem;
    border-left: 2px solid rgba(251, 191, 36, 0.3);
    margin-left: 0.5rem;
}

.flight-quest-link {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #5eead4;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.flight-map-btn {
    margin-top: 0.75rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-family: inherit;
    background: rgba(20, 184, 166, 0.15);
    border: 1px solid rgba(20, 184, 166, 0.4);
    color: var(--totk-teal);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    width: fit-content;
}

.flight-map-btn:hover {
    background: rgba(20, 184, 166, 0.3);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.flight-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, rgba(69, 26, 3, 0.5), rgba(0, 0, 0, 0.6));
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 0.5rem;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.08), inset 0 1px 0 rgba(251, 191, 36, 0.1);
    min-width: 220px;
}

.flight-card.departure {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.4), rgba(0, 0, 0, 0.6));
    border-color: rgba(45, 212, 191, 0.35);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.08), inset 0 1px 0 rgba(45, 212, 191, 0.1);
}

.flight-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.15);
    color: var(--totk-gold);
    flex-shrink: 0;
}

.flight-card.departure .flight-icon {
    background: rgba(45, 212, 191, 0.15);
    color: var(--totk-teal);
}

.flight-label {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(251, 191, 36, 0.8);
    margin-bottom: 2px;
}

.flight-card.departure .flight-label {
    color: rgba(45, 212, 191, 0.8);
}

.flight-code {
    font-size: 1rem;
    font-weight: 700;
    color: #fcd34d;
    letter-spacing: 0.05em;
}

.flight-card.departure .flight-code {
    color: #5eead4;
}

.flight-detail {
    font-size: 0.75rem;
    color: #94a3b8;
}

.main-container {
    max-width: 95rem;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    z-index: 10;
}

.panel {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 1rem;
    border: 1px solid rgba(20, 184, 166, 0.3);
    box-shadow: 0 0 30px rgba(20, 184, 166, 0.05);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    height: 75vh;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-top: 2px solid rgba(45, 212, 191, 0.5);
    border-left: 2px solid rgba(45, 212, 191, 0.5);
    border-top-left-radius: 1rem;
    z-index: 20;
    pointer-events: none;
}
.panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    border-top: 2px solid rgba(45, 212, 191, 0.5);
    border-right: 2px solid rgba(45, 212, 191, 0.5);
    border-top-right-radius: 1rem;
    z-index: 20;
    pointer-events: none;
}

.panel-tabs {
    display: flex;
    background: rgba(4, 47, 46, 0.6);
    border-bottom: 1px solid rgba(20, 184, 166, 0.3);
    z-index: 15;
}
.main-tab-btn {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.main-tab-btn:hover {
    color: #ccfbf1;
    background: rgba(20, 184, 166, 0.1);
}
.main-tab-btn.active {
    color: #ccfbf1;
    border-bottom: 2px solid var(--totk-teal);
    background: rgba(20, 184, 166, 0.15);
    box-shadow: inset 0 -2px 10px rgba(45, 212, 191, 0.1);
}

.view-mode-bar {
    display: flex;
    gap: 0.35rem;
    padding: 0.55rem 0.65rem;
    background: rgba(4, 47, 46, 0.75);
    border-bottom: 1px solid rgba(20, 184, 166, 0.3);
    flex-shrink: 0;
    z-index: 16;
}

.view-mode-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 40px;
    padding: 0.4rem 0.5rem;
    border-radius: 0.45rem;
    border: 1px solid rgba(20, 184, 166, 0.3);
    background: rgba(0, 0, 0, 0.35);
    color: #94a3b8;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.view-mode-btn:hover {
    color: #ccfbf1;
    border-color: rgba(45, 212, 191, 0.55);
}

.view-mode-btn.active {
    color: #042f2e;
    background: var(--totk-teal);
    border-color: var(--totk-teal);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.35);
}

.view-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.panel-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(20, 184, 166, 0.2);
    background: linear-gradient(to bottom, rgba(4, 47, 46, 0.3), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}
.panel-title {
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #ccfbf1;
    text-transform: uppercase;
    margin: 0;
}
.panel-badge {
    border: 1px solid rgba(245, 158, 11, 0.4);
    background-color: rgba(69, 26, 3, 0.4);
    color: #fcd34d;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

.map-style-select {
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #ccfbf1;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}
.map-style-select:hover, .map-style-select:focus {
    border-color: var(--totk-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}
.map-style-select option {
    background-color: #020617;
    color: #e2e8f0;
}

.map-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn-map-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    background: rgba(20, 184, 166, 0.12);
    border: 1px solid rgba(20, 184, 166, 0.4);
    color: var(--totk-teal);
    border-radius: 0.375rem;
    padding: 0.35rem 0.65rem;
    min-height: 34px;
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-map-expand:hover {
    background: rgba(20, 184, 166, 0.25);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

/* Sheet-Griff nur im Karten-Vollbild sichtbar */
.map-sheet-handle {
    display: none;
}

/* === Ansichtsmodi: split | map | list === */
body.view-map,
body.view-list {
    overflow: hidden !important;
}

body.view-map > header,
body.view-map > .bg-decor-1,
body.view-map > .bg-decor-2,
body.view-list > header,
body.view-list > .bg-decor-1,
body.view-list > .bg-decor-2 {
    display: none !important;
}

body.view-map .main-container,
body.view-list .main-container {
    display: block;
    margin: 0;
    padding: 0;
    max-width: none;
    width: 100%;
    height: 100dvh;
}

/* --- Karte Vollbild --- */
body.view-map #map-section.panel {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100%;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    border-radius: 0;
    border: none;
    margin: 0;
}

body.view-map #map-section .panel-header {
    padding-top: max(0.65rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.55), transparent);
    border-bottom: none;
}

body.view-map #map-container {
    padding: 0;
}

body.view-map #map-container .map-wrapper {
    border-radius: 0;
    border: none;
}

body.view-map #map-container .map-status {
    display: none;
}

body.view-map .btn-map-expand .icon-expand {
    display: none;
}

body.view-map .btn-map-expand .icon-collapse {
    display: block !important;
}

body.view-map #questlog.panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: 100%;
    height: auto;
    max-height: min(72dvh, 640px);
    min-height: 0;
    margin: 0;
    border-radius: 1rem 1rem 0 0;
    border: 1px solid rgba(20, 184, 166, 0.35);
    border-bottom: none;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
    background: rgba(2, 6, 23, 0.96);
    backdrop-filter: blur(18px);
    padding-bottom: env(safe-area-inset-bottom);
    transition: transform 0.28s ease, max-height 0.28s ease;
    display: flex !important;
    flex-direction: column;
}

body.view-map #questlog.panel.map-sheet-collapsed {
    max-height: none;
}

body.view-map #questlog.panel.map-sheet-collapsed .view-section {
    display: none !important;
}

body.view-map .map-sheet-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    flex-shrink: 0;
    padding: 0.55rem 1rem 0.35rem;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.map-sheet-handle-bar {
    width: 2.5rem;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
}

.map-sheet-handle-text {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

body.view-map #questlog .panel-tabs {
    flex-shrink: 0;
}

body.view-map #questlog .view-section {
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

body.view-map #questlog .quest-list-wrapper,
body.view-map #questlog .gallery-grid,
body.view-map #questlog .journal-content,
body.view-map #questlog .flight-tab-content {
    -webkit-overflow-scrolling: touch;
}

/* --- Liste Vollbild --- */
body.view-list #map-section.panel {
    display: none !important;
}

body.view-list #questlog.panel {
    position: fixed;
    inset: 0;
    z-index: 30;
    width: 100%;
    height: 100dvh;
    max-height: none;
    min-height: 0;
    margin: 0;
    border-radius: 0;
    border: none;
    display: flex !important;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

body.view-list #questlog .view-section {
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

body.view-list #questlog .quest-list-wrapper,
body.view-list #questlog .gallery-grid,
body.view-list #questlog .journal-content,
body.view-list #questlog .flight-tab-content {
    -webkit-overflow-scrolling: touch;
}

/* Desktop: Karten-Vollbild mit Seitenleiste */
@media (min-width: 901px) {
    body.view-map #questlog.panel {
        left: auto;
        right: 0;
        top: 0;
        bottom: 0;
        width: min(400px, 38vw);
        max-height: none;
        height: 100dvh;
        border-radius: 0;
        border: none;
        border-left: 1px solid rgba(20, 184, 166, 0.35);
        padding-bottom: 0;
        transform: none;
    }

    body.view-map #questlog.panel.map-sheet-collapsed {
        width: 72px;
    }

    body.view-map #questlog.panel.map-sheet-collapsed .panel-tabs {
        flex-direction: column;
    }

    body.view-map #questlog.panel.map-sheet-collapsed .map-sheet-handle-text {
        font-size: 0.55rem;
        letter-spacing: 0.04em;
        text-align: center;
        max-width: 4rem;
        line-height: 1.2;
    }

    body.view-map #map-section.panel {
        right: min(400px, 38vw);
        width: auto;
        transition: right 0.28s ease;
    }

    body.view-map.map-sheet-collapsed #map-section.panel {
        right: 72px;
    }

    body.view-list #questlog.panel {
        max-width: 52rem;
        left: 50%;
        transform: translateX(-50%);
        border-left: 1px solid rgba(20, 184, 166, 0.25);
        border-right: 1px solid rgba(20, 184, 166, 0.25);
    }
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem 0.5rem 1.25rem;
    overflow-x: auto;
    border-bottom: 1px solid rgba(20, 184, 166, 0.2);
    background: rgba(4, 47, 46, 0.2);
}
.filter-bar::-webkit-scrollbar { height: 4px; }
.filter-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #94a3b8;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.filter-btn:hover {
    background: rgba(20, 184, 166, 0.1);
    color: #ccfbf1;
    border-color: rgba(45, 212, 191, 0.6);
}
.filter-btn.active {
    background: rgba(20, 184, 166, 0.2);
    border-color: var(--totk-teal);
    color: #ccfbf1;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

.quest-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    position: relative;
}
.quest-list-wrapper::before {
    content: '';
    position: absolute;
    left: 2.5rem;
    top: 2rem;
    bottom: 2rem;
    width: 2px;
    background: linear-gradient(to bottom, rgba(20, 184, 166, 0.8), rgba(45, 212, 191, 0.3), transparent);
    z-index: 0;
    box-shadow: 0 0 8px rgba(45, 212, 191, 0.6);
}

/* Styling für das Inventar (Packliste) */
.inventory-item {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(15, 23, 42, 0.8);
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 184, 166, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}
.inventory-item.packed {
    opacity: 0.5;
    filter: grayscale(80%);
    border-color: rgba(148, 163, 184, 0.2);
}
.inventory-item.packed .item-name {
    text-decoration: line-through;
    color: #94a3b8;
}
.item-name {
    flex: 1;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 1rem;
    letter-spacing: 0.025em;
    margin: 0;
}
.inventory-input-wrapper {
    padding: 1rem 1.25rem 0 1.25rem;
    display: flex;
    gap: 0.5rem;
}
.inventory-input {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.2s;
}
.inventory-input:focus {
    border-color: var(--totk-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

/* Styling für die Fotogalerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 1.25rem;
    overflow-y: auto;
}
.gallery-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}
.gallery-card:hover {
    border-color: rgba(45, 212, 191, 0.8);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.2);
    transform: translateY(-2px);
}
.gallery-card.locked {
    opacity: 0.6;
    filter: grayscale(100%);
    border-color: rgba(148, 163, 184, 0.2);
}
.gallery-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(20, 184, 166, 0.3);
}
.gallery-info { padding: 1rem; }
.gallery-title { font-weight: 600; color: #e2e8f0; font-size: 0.95rem; margin: 0 0 0.35rem 0; line-height: 1.3; }
.gallery-date { color: #94a3b8; font-size: 0.8rem; font-family: monospace; }

.gallery-hint {
    margin: 0;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
}

.gallery-img-wrap {
    position: relative;
    width: 100%;
    height: 220px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(20, 184, 166, 0.3);
    overflow: hidden;
}

.gallery-img-wrap .gallery-img {
    height: 100%;
    border-bottom: none;
}

.gallery-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.72);
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-card:not(.locked) .gallery-upload-overlay {
    opacity: 0;
}

.gallery-card:not(.locked):hover .gallery-upload-overlay,
.gallery-card.locked .gallery-upload-overlay {
    opacity: 1;
}

.gallery-upload-overlay:hover {
    background: rgba(15, 23, 42, 0.88);
}

.gallery-upload-overlay span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d8b4fe;
}

.quest-photo-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(168, 85, 247, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quest-photo-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.btn-photo-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 0.5rem;
    border: 1px solid rgba(168, 85, 247, 0.45);
    background: rgba(88, 28, 135, 0.35);
    color: #e9d5ff;
    width: fit-content;
    transition: all 0.2s;
}

.quest-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-photo-upload:hover {
    border-color: rgba(216, 180, 254, 0.8);
    background: rgba(88, 28, 135, 0.55);
}

.btn-photo-delete,
.btn-gallery-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 0.5rem;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-photo-delete:hover,
.btn-gallery-delete:hover {
    border-color: rgba(252, 165, 165, 0.8);
    background: rgba(153, 27, 27, 0.55);
}

.btn-gallery-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    padding: 0.4rem;
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.quest-photo-hint {
    font-size: 0.7rem;
    color: #94a3b8;
    margin: 0;
}

.quest {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background-color: rgba(15, 23, 42, 0.8);
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(20, 184, 166, 0.3);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    margin-bottom: 1rem;
    cursor: grab;
    transition: all 0.2s ease;
}
.inventory-item:active,
.quest:active {
    cursor: grabbing;
}
.inventory-item.dragging,
.quest.dragging {
    opacity: 0.4;
    border: 2px dashed var(--totk-teal);
    transform: scale(0.98);
}

/* Styling für erledigte Quests */
.quest.completed {
    opacity: 0.5;
    filter: grayscale(80%);
    border-color: rgba(148, 163, 184, 0.2);
}
.quest.completed .quest-name {
    text-decoration: line-through;
    color: #94a3b8;
}

/* Custom Checkbox Styling */
.quest-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0.5rem; /* Zentriert die Checkbox mit der Nummer */
}
.quest-checkbox {
    appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--totk-teal);
    border-radius: 0.375rem;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}
.quest-checkbox:hover {
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.4);
}
.quest-checkbox:checked {
    background-color: var(--totk-teal);
}
.quest-checkbox:checked::after {
    content: '✓'; position: absolute; color: var(--totk-bg); font-size: 1rem; font-weight: 900;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
}

.quest:hover {
    border-color: rgba(45, 212, 191, 0.8);
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.2);
    transform: translateX(4px);
}

.quest-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(251, 191, 36, 0.6);
    background-color: rgba(69, 26, 3, 0.8);
    color: #fcd34d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
    flex-shrink: 0;
}

.quest-content {
    flex: 1;
    min-width: 0;
}
.quest-name {
    font-weight: 500;
    color: #e2e8f0;
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    letter-spacing: 0.025em;
}
.quest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.quest-badge {
    display: inline-flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(17, 94, 89, 1);
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    color: #5eead4;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: monospace;
}
.quest-badge.distance {
    border-color: rgba(245, 158, 11, 0.4);
    color: #fcd34d;
}
.quest-badge.type-main { border-color: rgba(251, 191, 36, 0.4); color: #fcd34d; background-color: rgba(69, 26, 3, 0.4); }
.quest-badge.type-photo { border-color: rgba(168, 85, 247, 0.4); color: #d8b4fe; background-color: rgba(88, 28, 135, 0.4); }
.quest-badge.type-collect { border-color: rgba(34, 197, 94, 0.4); color: #86efac; background-color: rgba(20, 83, 45, 0.4); }
.quest-badge.type-explore { border-color: rgba(59, 130, 246, 0.4); color: #93c5fd; background-color: rgba(30, 58, 138, 0.4); }

a.quest-badge {
    text-decoration: none;
    transition: all 0.2s;
}

a.quest-badge:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 10px currentColor;
}

.quest-desc {
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.5;
}

/* Links in der Quest-Beschreibung */
.quest-desc a {
    color: var(--totk-teal);
    text-decoration: none;
    border-bottom: 1px dotted var(--totk-teal);
    transition: all 0.2s ease;
}
.quest-desc a:hover {
    color: #ccfbf1;
    border-bottom-style: solid;
    text-shadow: var(--totk-glow);
}

#map-container {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 10;
}
.map-wrapper {
    flex: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(20, 184, 166, 0.3);
    box-shadow: inset 0 0 20px rgba(20, 184, 166, 0.2);
    background-color: rgba(4, 47, 46, 0.5);
    transition: border-color 0.2s;
}
.map-wrapper:hover {
    border-color: rgba(45, 212, 191, 0.5);
}
#map {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 0;
    background-color: #000000 !important;
}
.map-status {
    text-align: center;
    color: rgba(20, 184, 166, 0.6);
    font-size: 0.625rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

/* Leaflet Overrides */
.leaflet-container {
    background-color: #000000 !important;
    font-family: inherit;
}
.leaflet-tile-pane {
    filter: sepia(1) hue-rotate(130deg) saturate(3) contrast(1.2);
    transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
}

/* Leaflet Popup Anpassung */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background-color: rgba(0, 0, 0, 0.8);
    color: #ccfbf1;
    border: 1px solid var(--totk-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
    font-family: 'Rajdhani', sans-serif;
}
.leaflet-popup-content b {
    color: var(--totk-gold);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.marker-move-actions {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(20, 184, 166, 0.25);
}

.btn-move-marker {
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.75rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: rgba(69, 26, 3, 0.55);
    color: #fcd34d;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.btn-move-marker:hover {
    background: rgba(120, 53, 15, 0.7);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.marker-move-hint {
    margin: 0.4rem 0 0;
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.3;
}

.marker-dragging-enabled {
    cursor: grab !important;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.9));
}

/* Modal & Formular Styles */
.hidden { display: none !important; }
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(5px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.modal-content {
    width: 90%; max-width: 500px; height: auto; max-height: 90vh;
}
.modal-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }
.modal-body label { display: flex; flex-direction: column; gap: 0.5rem; color: #ccfbf1; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.modal-body input, .modal-body textarea, .modal-body select {
    background-color: rgba(0, 0, 0, 0.5); border: 1px solid rgba(20, 184, 166, 0.3); color: #e2e8f0; padding: 0.75rem; border-radius: 0.5rem; font-family: inherit; font-size: 1rem;
}
.modal-body input:focus, .modal-body textarea:focus, .modal-body select:focus { outline: none; border-color: var(--totk-teal); box-shadow: 0 0 10px rgba(45, 212, 191, 0.3); }
.modal-body select option { background-color: #020617; color: #e2e8f0; }
.coord-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 0.5rem; }
.btn { padding: 0.5rem 1.25rem; border-radius: 0.5rem; font-family: inherit; text-transform: uppercase; font-weight: 700; cursor: pointer; transition: all 0.2s; letter-spacing: 0.05em; }
.btn-cancel { background: transparent; border: 1px solid rgba(244, 63, 94, 0.5); color: #fb7185; }
.btn-cancel:hover { background: rgba(244, 63, 94, 0.1); border-color: #fb7185; box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
.btn-save { background: rgba(20, 184, 166, 0.1); border: 1px solid var(--totk-teal); color: var(--totk-teal); }
.btn-save:hover { background: rgba(20, 184, 166, 0.2); color: #ccfbf1; box-shadow: var(--totk-glow); }

.add-quest-container { margin-top: 1.5rem; position: relative; z-index: 10; }
.btn-add-quest {
    background: rgba(245, 158, 11, 0.05); border: 1px dashed rgba(245, 158, 11, 0.4); color: var(--totk-gold);
    width: 100%; padding: 1rem; border-radius: 0.75rem; font-family: inherit; text-transform: uppercase;
    font-weight: 600; letter-spacing: 0.1em; cursor: pointer; transition: all 0.2s;
}
.btn-add-quest:hover {
    background: rgba(245, 158, 11, 0.15); border-color: var(--totk-gold); box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.quest-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
}
.btn-edit {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-edit:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: #f59e0b;
    color: #f59e0b;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}
.btn-delete {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fb7185;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-delete:hover {
    background: rgba(244, 63, 94, 0.25);
    border-color: #f43f5e;
    color: #f43f5e;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

.btn-gmaps {
    background: rgba(29, 78, 216, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60a5fa;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-gmaps:hover {
    background: rgba(29, 78, 216, 0.4);
    border-color: #3b82f6;
    color: #93c5fd;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}
.btn-amaps {
    background: rgba(91, 33, 182, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.4);
    color: #a78bfa;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-amaps:hover {
    background: rgba(91, 33, 182, 0.4);
    border-color: #8b5cf6;
    color: #c4b5fd;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

.move-controls {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    justify-content: center;
}
.btn-move {
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: var(--totk-teal);
    border-radius: 0.25rem;
    padding: 0.15rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-move:hover:not(:disabled) {
    background: rgba(20, 184, 166, 0.25);
    border-color: var(--totk-teal);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}
.btn-move:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
}

/* Search Results Styling */
.search-result-item {
    padding: 0.5rem;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #ccfbf1;
    transition: all 0.2s;
}
.search-result-item:hover {
    background: rgba(20, 184, 166, 0.2);
    border-color: var(--totk-teal);
}

/* Touch / base mobile helpers */
button,
.btn,
.main-tab-btn,
.filter-btn,
.btn-photo-upload,
.btn-photo-delete,
label[for] {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Responsive Design — Tablet */
@media (max-width: 900px) {
    body {
        overflow: auto;
        overflow-x: hidden;
        min-height: 100dvh;
    }

    header {
        padding: 12px 1rem;
        padding-top: max(12px, env(safe-area-inset-top));
    }

    h1 {
        font-size: 1.2rem;
        letter-spacing: 0.06em;
    }

    h2#trip-header-info {
        font-size: 0.65rem;
        line-height: 1.4;
        padding: 0 0.5rem;
    }

    .main-container {
        grid-template-columns: 1fr;
        margin: 0.75rem auto 1.5rem;
        padding: 0 0.75rem;
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
        gap: 1rem;
    }

    #questlog.panel {
        height: auto;
        min-height: 55dvh;
        max-height: none;
    }

    #map-section.panel {
        height: 42dvh;
        min-height: 260px;
        max-height: 480px;
    }

    .panel-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .panel-title {
        font-size: 0.95rem;
    }

    .main-tab-btn {
        padding: 0.85rem 0.35rem;
        min-height: 48px;
    }

    .filter-bar {
        gap: 0.4rem;
        padding: 0.5rem 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    .filter-btn {
        padding: 0.55rem 0.85rem;
        min-height: 40px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    .quest-list-wrapper {
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem;
    }

    .move-controls {
        display: none;
    }

    .quest {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.85rem;
        cursor: pointer;
    }

    .quest:hover {
        transform: none;
    }

    .quest:active {
        border-color: rgba(45, 212, 191, 0.8);
    }

    .quest-number {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.8rem;
    }

    .quest-checkbox {
        width: 1.75rem;
        height: 1.75rem;
    }

    .quest-content {
        flex: 1 1 calc(100% - 5.5rem);
        min-width: 0;
    }

    .quest-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        justify-content: flex-end;
        gap: 0.4rem;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(20, 184, 166, 0.15);
        margin-top: 0.15rem;
    }

    .btn-edit,
    .btn-delete,
    .btn-gmaps,
    .btn-amaps {
        min-width: 44px;
        min-height: 44px;
        padding: 0.65rem;
    }

    .quest-photo-section {
        width: 100%;
    }

    .quest-photo-actions {
        width: 100%;
    }

    .btn-photo-upload,
    .btn-photo-delete {
        min-height: 44px;
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.85rem;
        padding: 1rem;
    }

    .gallery-img,
    .gallery-img-wrap {
        height: 160px;
    }

    .gallery-card:not(.locked) .gallery-upload-overlay {
        opacity: 1;
        background: rgba(15, 23, 42, 0.45);
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-content {
        width: 100%;
        max-width: none;
        max-height: 92dvh;
        border-radius: 1rem 1rem 0 0;
        margin: 0;
    }

    .modal-body {
        padding: 1.15rem;
        gap: 0.85rem;
        padding-bottom: max(1.15rem, env(safe-area-inset-bottom));
    }

    .modal-body input,
    .modal-body textarea,
    .modal-body select,
    .journal-answer-input,
    .puzzle-input,
    .inventory-input {
        font-size: 16px; /* verhindert iOS-Zoom beim Fokus */
    }

    .modal-actions {
        flex-wrap: wrap;
    }

    .modal-actions .btn {
        flex: 1;
        min-height: 48px;
        text-align: center;
    }

    .coord-inputs {
        grid-template-columns: 1fr;
    }

    .puzzle-tablet {
        max-width: none;
        width: calc(100% - 1.5rem);
        margin: 0.75rem;
        padding: 1.5rem 1.15rem 1.25rem;
        max-height: 90dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .puzzle-title {
        font-size: 1.25rem;
    }

    .puzzle-riddle {
        font-size: 0.9rem;
    }

    .puzzle-submit {
        min-height: 48px;
    }

    .journal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .journal-toolbar .btn,
    .journal-toolbar .btn-secondary {
        width: 100%;
        min-height: 44px;
        text-align: center;
    }

    .journal-fragment-slot {
        width: 2rem;
        height: 2rem;
    }

    .journal-stage-form {
        flex-direction: column;
    }

    .journal-stage-form .btn,
    .journal-check-btn {
        width: 100%;
        min-height: 44px;
    }

    .lightbox-content {
        max-width: 100%;
        max-height: 100dvh;
        padding: 0.5rem;
    }

    #lightbox-img {
        max-height: 75dvh;
        width: auto;
        max-width: 100%;
    }

    .flight-tab-content {
        padding: 0.85rem;
    }

    .map-style-select {
        max-width: 9rem;
        font-size: 0.75rem;
    }

    .btn-map-expand {
        min-height: 40px;
        min-width: 40px;
        padding: 0.45rem 0.7rem;
    }
}

/* Phones */
@media (max-width: 600px) {
    .main-container {
        margin: 0.5rem auto 1rem;
        padding: 0 0.5rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
        gap: 0.75rem;
    }

    #questlog.panel {
        min-height: 58dvh;
        border-radius: 0.75rem;
    }

    #map-section.panel {
        height: 38dvh;
        min-height: 220px;
        border-radius: 0.75rem;
    }

    .panel-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .panel-tabs::-webkit-scrollbar {
        display: none;
    }

    .main-tab-btn {
        flex: 0 0 auto;
        min-width: 3rem;
        padding: 0.75rem 0.65rem;
    }

    .panel-header {
        padding: 0.65rem 0.75rem;
    }

    .panel-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.45rem;
    }

    .quest-name {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .quest-desc {
        font-size: 0.8rem;
    }

    .quest-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .gallery-img,
    .gallery-img-wrap {
        height: 200px;
    }

    .gallery-hint {
        padding: 0.65rem 0.75rem 0;
        font-size: 0.75rem;
    }

    .journal-content {
        padding: 0.75rem;
    }

    .journal-route-line {
        font-size: 0.65rem;
        word-break: break-word;
    }

    .btn-add-quest {
        padding: 0.85rem;
        font-size: 0.8rem;
        letter-spacing: 0.06em;
    }

    #map-container {
        padding: 0.65rem;
    }

    .map-status {
        font-size: 0.55rem;
        letter-spacing: 0.12em;
    }
}

/* Landscape phones: keep map usable */
@media (max-width: 900px) and (orientation: landscape) {
    #questlog.panel {
        min-height: 70dvh;
    }

    #map-section.panel {
        height: 70dvh;
        min-height: 220px;
        max-height: none;
    }
}

/* Fog of War Styling */
.fog-of-war {
    filter: blur(6px); /* Subtilerer, technischer Rand beim Aufdecken der Daten */
    pointer-events: none;
}

/* Quest Group Header Styling */
.quest-group-header {
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(251, 191, 36, 0.3);
}
.quest-group-header h4 {
    color: var(--totk-gold);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.quest-group-header h4::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--totk-teal);
    transform: rotate(45deg);
    box-shadow: 0 0 5px var(--totk-teal);
}

/* Animation für das Aufploppen der Quest-Items */
@keyframes quest-item-popup {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; box-shadow: 0 0 0 rgba(251, 191, 36, 0); }
    50% { transform: scale(1.02) translateY(-5px); opacity: 1; box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
    100% { transform: scale(1) translateY(0); opacity: 1; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
}

.quest-item-animated {
    /* Standardmäßig unsichtbar, bis die Animation startet */
    opacity: 0; 
    /* Forwards sorgt dafür, dass das Element am Ende der Animation den Zustand von 100% behält */
    animation: quest-item-popup 0.5s ease-out forwards;
    /* Stellt sicher, dass die Animation aus der Mitte heraus skaliert */
    transform-origin: center center;
}

/* Lightbox Styles */
.lightbox-content {
    position: relative;
    max-width: 95%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: transparent;
    border: none;
    color: #ccfbf1;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s, text-shadow 0.2s;
    padding: 0;
}
.lightbox-close:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}
#lightbox-img {
    max-width: 100%;
    max-height: 85vh;
    border: 2px solid var(--totk-teal);
    border-radius: 0.5rem;
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.4);
    object-fit: contain;
    background: #000;
}
.lightbox-caption {
    color: var(--totk-gold);
    margin-top: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* --- TOTK Loading Screen --- */
body.is-loading {
    overflow: hidden;
}

.totk-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(4, 47, 46, 0.95) 0%, #020617 45%, #000 100%);
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.totk-loader.totk-loader-fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.totk-loader.totk-loader-hidden {
    display: none !important;
}

.totk-loader-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(45, 212, 191, 0.03) 2px,
        rgba(45, 212, 191, 0.03) 4px
    );
    pointer-events: none;
    animation: totk-scan 8s linear infinite;
}

.totk-loader-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
}

@keyframes totk-scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.totk-loader-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 22rem;
}

.totk-loader-rings {
    position: relative;
    width: 7rem;
    height: 7rem;
    margin: 0 auto 1.5rem;
}

.totk-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.totk-ring-outer {
    border-top-color: rgba(45, 212, 191, 0.6);
    border-right-color: rgba(45, 212, 191, 0.15);
    animation: totk-spin 3s linear infinite;
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

.totk-ring-mid {
    inset: 0.6rem;
    border-bottom-color: rgba(251, 191, 36, 0.5);
    border-left-color: rgba(251, 191, 36, 0.1);
    animation: totk-spin-reverse 2s linear infinite;
}

.totk-ring-inner {
    inset: 1.2rem;
    border-top-color: rgba(45, 212, 191, 0.8);
    animation: totk-spin 1.5s linear infinite;
}

.totk-ring-core {
    position: absolute;
    inset: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--totk-teal);
    animation: totk-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.8));
}

@keyframes totk-spin {
    to { transform: rotate(360deg); }
}

@keyframes totk-spin-reverse {
    to { transform: rotate(-360deg); }
}

@keyframes totk-pulse {
    0%, 100% { opacity: 0.7; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

.totk-loader-brand {
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(45, 212, 191, 0.7);
    margin: 0 0 0.35rem;
}

.totk-loader-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 0 0 1rem;
    background: linear-gradient(to right, #ccfbf1, var(--totk-teal), #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px rgba(45, 212, 191, 0.3));
}

.totk-loader-status {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0 0 1rem;
    min-height: 1.25rem;
    letter-spacing: 0.05em;
}

.totk-loader-bar-track {
    height: 4px;
    background: rgba(20, 184, 166, 0.15);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid rgba(20, 184, 166, 0.25);
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.5);
}

.totk-loader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0d9488, var(--totk-teal), #fbbf24);
    border-radius: 2px;
    transition: width 0.4s ease;
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.6);
}

.totk-loader-hint {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.5);
    margin: 0.75rem 0 0;
}

/* --- Puzzle Login (Shrine Gate) --- */
.totk-puzzle-gate {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    box-sizing: border-box;
}

.totk-puzzle-gate.hidden {
    display: none;
}

.totk-puzzle-gate.puzzle-success .puzzle-tablet {
    border-color: rgba(45, 212, 191, 0.8);
    box-shadow: 0 0 40px rgba(45, 212, 191, 0.35);
}

.totk-puzzle-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(4, 47, 46, 0.92) 0%, #000 70%);
}

.puzzle-tablet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26rem;
    padding: 2rem 1.75rem 1.5rem;
    background: linear-gradient(160deg, rgba(30, 25, 15, 0.95) 0%, rgba(10, 10, 10, 0.98) 50%, rgba(4, 47, 46, 0.3) 100%);
    border: 2px solid rgba(251, 191, 36, 0.35);
    border-radius: 0.25rem;
    box-shadow:
        0 0 30px rgba(251, 191, 36, 0.12),
        inset 0 0 40px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.puzzle-tablet.puzzle-shake {
    animation: puzzle-shake 0.5s ease;
    border-color: rgba(248, 113, 113, 0.6);
}

@keyframes puzzle-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

.puzzle-tablet-corner {
    position: absolute;
    width: 1.25rem;
    height: 1.25rem;
    border-color: rgba(45, 212, 191, 0.5);
    border-style: solid;
}

.puzzle-tablet-corner-tl { top: 6px; left: 6px; border-width: 2px 0 0 2px; }
.puzzle-tablet-corner-tr { top: 6px; right: 6px; border-width: 2px 2px 0 0; }
.puzzle-tablet-corner-bl { bottom: 6px; left: 6px; border-width: 0 0 2px 2px; }
.puzzle-tablet-corner-br { bottom: 6px; right: 6px; border-width: 0 2px 2px 0; }

.puzzle-runes {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: rgba(251, 191, 36, 0.5);
    font-size: 0.85rem;
    animation: totk-pulse 3s ease-in-out infinite;
}

.puzzle-shrine-label {
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(45, 212, 191, 0.7);
    margin: 0 0 0.5rem;
}

.puzzle-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 1.25rem;
    color: #fcd34d;
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.puzzle-riddle {
    margin: 0 0 1.25rem;
    padding: 1rem 1rem 1rem 1.25rem;
    border-left: 3px solid rgba(251, 191, 36, 0.4);
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.9rem;
    line-height: 1.55;
    color: #cbd5e1;
    font-style: italic;
}

.puzzle-riddle p {
    margin: 0 0 0.5rem;
}

.puzzle-riddle p:last-child {
    margin-bottom: 0;
}

.puzzle-riddle em {
    color: #fbbf24;
    font-style: normal;
}

.puzzle-error {
    color: #fca5a5;
    font-size: 0.85rem;
    text-align: center;
    margin: 0 0 1rem;
    text-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

.puzzle-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.puzzle-input-label {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #94a3b8;
}

.puzzle-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(20, 184, 166, 0.35);
    border-radius: 0.375rem;
    padding: 0 0.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.puzzle-input-wrap:focus-within {
    border-color: var(--totk-teal);
    box-shadow: 0 0 12px rgba(45, 212, 191, 0.25);
}

.puzzle-input-rune {
    color: rgba(45, 212, 191, 0.6);
    font-size: 1.1rem;
}

.puzzle-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.65rem 0;
    letter-spacing: 0.15em;
}

.puzzle-submit {
    width: 100%;
    margin-top: 0.25rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
}

.puzzle-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.puzzle-footer {
    text-align: center;
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.4);
    margin: 1rem 0 0;
}

/* --- Reisetagebuch & Schnitzeljagd --- */
.journal-toolbar {
    padding: 0 1rem 0.75rem;
    border-bottom: 1px solid rgba(20, 184, 166, 0.15);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.btn-secondary {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #fcd34d;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-family: inherit;
    text-transform: uppercase;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.btn-secondary:hover {
    background: rgba(251, 191, 36, 0.15);
}

.journal-toolbar-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0.5rem 0 0;
}

.journal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.journal-intro-card {
    padding: 1rem;
    background: rgba(120, 53, 15, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 0.5rem;
}

.journal-hunt-title {
    margin: 0 0 0.5rem;
    color: #fcd34d;
    font-size: 1rem;
}

.journal-hunt-intro {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.journal-route-line {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
}

.journal-fragment-track {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.journal-fragment-slot {
    width: 1.75rem;
    height: 1.75rem;
    border: 2px solid rgba(251, 191, 36, 0.4);
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #64748b;
    font-size: 0.9rem;
}

.journal-fragment-slot.found {
    border-color: #fbbf24;
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.1);
}

.journal-fragment-slot.final.locked {
    border-style: dashed;
    opacity: 0.5;
}

.journal-fragment-dot {
    color: rgba(148, 163, 184, 0.4);
}

.journal-fragment-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

.journal-stages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.journal-stage-card {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(20, 184, 166, 0.2);
    border-radius: 0.5rem;
    transition: border-color 0.2s;
}

.journal-stage-card.found {
    border-color: rgba(45, 212, 191, 0.4);
    background: rgba(4, 47, 46, 0.25);
}

.journal-stage-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.journal-stage-rune {
    font-size: 1.5rem;
    color: #fbbf24;
    line-height: 1;
}

.journal-stage-title {
    margin: 0;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.journal-stage-meta {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    color: #94a3b8;
}

.journal-stage-done {
    margin-left: auto;
    font-size: 0.7rem;
    color: #5eead4;
    white-space: nowrap;
}

.journal-stage-location {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 0.5rem;
}

.journal-quest-link {
    font-size: 0.75rem;
    color: #5eead4;
    margin: 0 0 0.35rem;
    padding: 0.25rem 0.5rem;
    background: rgba(45, 212, 191, 0.08);
    border-radius: 0.25rem;
    display: inline-block;
}

.journal-stage-riddle {
    margin: 0 0 0.75rem;
    padding: 0.75rem;
    border-left: 3px solid rgba(251, 191, 36, 0.4);
    font-size: 0.85rem;
    color: #cbd5e1;
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
}

.journal-stage-form {
    display: flex;
    gap: 0.5rem;
}

.journal-answer-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(20, 184, 166, 0.35);
    border-radius: 0.375rem;
    color: #e2e8f0;
    font-family: inherit;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
}

.journal-check-btn {
    white-space: nowrap;
    padding: 0.5rem 0.75rem;
}

.journal-stage-error {
    color: #fca5a5;
    font-size: 0.8rem;
    margin: 0.5rem 0 0;
}

.journal-stage-reveal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(45, 212, 191, 0.1);
    border-radius: 0.375rem;
}

.journal-stage-fragment strong {
    color: #fcd34d;
    font-size: 1.1rem;
}

.journal-stage-rune-label {
    font-size: 0.8rem;
    color: #5eead4;
}

.journal-final-card {
    padding: 1rem;
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 0.5rem;
    background: rgba(120, 53, 15, 0.25);
}

.journal-final-card h4 {
    margin: 0 0 0.75rem;
    color: #fcd34d;
}

.journal-final-solved {
    text-align: center;
    font-size: 1.1rem;
    color: #5eead4;
    margin: 1rem 0 0;
}

.journal-final-solved strong {
    color: #fcd34d;
    font-size: 1.3rem;
    letter-spacing: 0.15em;
}