:root {
    --bg: #071321;
    --bg-2: #0d2235;
    --panel: rgba(10, 30, 48, .78);
    --panel-strong: rgba(13, 39, 62, .92);
    --line: rgba(150, 210, 245, .24);
    --text: #f4f8ff;
    --muted: #c3d5e5;
    --muted-2: #93acc1;
    --cyan: #47d7ff;
    --cyan-readable: #7ee7ff;
    --gold: #ffc84f;
    --ok: #5ef2b6;
    --danger: #ff7890;
    --shadow: 0 22px 70px rgba(0, 0, 0, .38);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 200, 79, .14), transparent 23rem),
        radial-gradient(circle at 88% 12%, rgba(71, 215, 255, .16), transparent 28rem),
        linear-gradient(145deg, #071321, #0b1b2d 48%, #04101b);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 75%);
}

a {
    color: inherit;
}

.hero,
.content,
.footer {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.hero {
    padding: 18px 0 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 900;
    letter-spacing: -.03em;
    font-size: 1.15rem;
}

.brand-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(71, 215, 255, .22));
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-pill,
.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    border-radius: 999px;
    padding: 8px 13px;
    font-size: .88rem;
    color: var(--muted);
    text-decoration: none;
    backdrop-filter: blur(14px);
}

.pulse {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(94, 242, 182, .7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 12px rgba(94, 242, 182, 0); }
    100% { box-shadow: 0 0 0 0 rgba(94, 242, 182, 0); }
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.06fr) minmax(330px, .94fr);
    gap: 22px;
    align-items: stretch;
}

.hero-copy,
.glass,
.panel,
.admin-shell {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)),
        var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero-copy {
    border-radius: var(--radius);
    padding: clamp(22px, 3.2vw, 38px);
    position: relative;
    overflow: hidden;
}

.hero-copy::after {
    content: "";
    position: absolute;
    right: -8rem;
    bottom: -10rem;
    width: 24rem;
    height: 24rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(71, 215, 255, .18), transparent 64%);
}

.hero-logo {
    width: min(245px, 72vw);
    max-height: 138px;
    object-fit: contain;
    object-position: left center;
    display: block;
    margin: -8px 0 10px;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, .34));
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--cyan-readable);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .74rem;
    font-weight: 900;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 14px;
    font-size: clamp(2rem, 4.2vw, 3.9rem);
    line-height: 1.02;
    letter-spacing: -.055em;
}

.lead {
    max-width: 720px;
    color: var(--muted);
    font-size: clamp(1rem, 1.6vw, 1.12rem);
    line-height: 1.68;
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.hero-meta div,
.weather-cards article,
.details-grid div {
    border: 1px solid rgba(150, 210, 245, .17);
    background: rgba(255,255,255,.052);
    border-radius: 17px;
    padding: 14px 15px;
}

.hero-meta strong,
.details-grid strong {
    display: block;
    font-size: 1rem;
    line-height: 1.25;
}

.hero-meta span,
.weather-cards span,
.details-grid span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: .84rem;
}

.weather-now {
    border-radius: var(--radius);
    padding: clamp(20px, 2.8vw, 28px);
    display: flex;
    flex-direction: column;
}

.weather-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.weather-header h2 {
    margin: 0;
    font-size: clamp(3rem, 6vw, 4.8rem);
    letter-spacing: -.075em;
}

.weather-icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    border-radius: 24px;
    background: rgba(71, 215, 255, .12);
    border: 1px solid var(--line);
    font-size: 2.55rem;
}

.weather-subline {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    margin: 10px 0 20px;
}

.weather-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: auto;
}

.weather-cards strong {
    display: block;
    margin-top: 5px;
    font-size: 1.1rem;
}

.content {
    padding: 0 0 24px;
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
}

.stream-panel {
    width: 100%;
}

.panel {
    border-radius: var(--radius);
    padding: clamp(20px, 2.6vw, 28px);
}

.section-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    letter-spacing: -.04em;
}

.video-frame {
    position: relative;
    overflow: hidden;
    border-radius: 21px;
    border: 1px solid rgba(150, 210, 245, .2);
    background: #02060c;
    aspect-ratio: 16 / 9;
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    margin-top: 16px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    color: #03131f;
    background: linear-gradient(135deg, var(--cyan), var(--gold));
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.button.ghost,
.secondary {
    color: var(--text);
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line);
}

.setup-box,
.camera-placeholder {
    min-height: 260px;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 8px;
    border: 1px dashed rgba(150, 210, 245, .32);
    border-radius: 21px;
    background: rgba(255,255,255,.035);
    padding: 26px;
    color: var(--muted);
}

.setup-box h3,
.camera-placeholder h3 {
    color: var(--text);
    margin-bottom: 2px;
}

.setup-box code {
    display: block;
    max-width: 100%;
    overflow: auto;
    border-radius: 12px;
    background: rgba(0,0,0,.28);
    padding: 12px;
    color: var(--cyan-readable);
}

.camera-placeholder img {
    width: min(190px, 66%);
    justify-self: center;
    opacity: .86;
    filter: drop-shadow(0 18px 36px rgba(0,0,0,.34));
}

.data-panel {
    margin-top: 22px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.status-message {
    min-height: 1.4em;
    margin: 18px 0 0;
    color: var(--muted);
}

.status-message.error {
    color: var(--danger);
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 0 34px;
    color: var(--muted);
    font-size: .92rem;
}

.admin-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.admin-shell {
    width: min(940px, 100%);
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 40px);
}

.admin-logo {
    width: 88px;
    height: 88px;
    object-fit: contain;
    display: block;
    margin-bottom: 12px;
}

.admin-form {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,.22);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: 18px;
    min-height: 18px;
}

.admin-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.notice {
    border-radius: 16px;
    padding: 12px 14px;
}

.notice.ok {
    color: var(--ok);
    background: rgba(94, 242, 182, .09);
    border: 1px solid rgba(94, 242, 182, .22);
}

.notice.error {
    color: var(--danger);
    background: rgba(255, 120, 144, .08);
    border: 1px solid rgba(255, 120, 144, .22);
}

.hint {
    color: var(--muted);
}

@media (max-width: 980px) {
    .hero-grid,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .details-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-copy {
        min-height: auto;
    }
}

@media (max-width: 680px) {
    .hero,
    .content,
    .footer {
        width: min(100% - 22px, 1180px);
    }

    .hero {
        padding-top: 12px;
    }

    .topbar {
        margin-bottom: 12px;
    }

    .brand span {
        font-size: 1rem;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .live-pill,
    .admin-link {
        padding: 7px 10px;
        font-size: .82rem;
    }

    .hero-copy,
    .weather-now,
    .panel {
        border-radius: 20px;
    }

    .hero-copy {
        padding: 20px;
    }

    .hero-logo {
        width: min(210px, 76vw);
        max-height: 115px;
        margin: -4px 0 8px;
    }

    h1 {
        font-size: clamp(1.9rem, 12vw, 2.9rem);
        line-height: 1.04;
        letter-spacing: -.055em;
    }

    .lead {
        font-size: .98rem;
        line-height: 1.62;
    }

    .hero-meta,
    .weather-cards,
    .details-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .hero-meta {
        gap: 10px;
        margin-top: 20px;
    }

    .hero-meta div,
    .weather-cards article,
    .details-grid div {
        padding: 13px 14px;
    }

    .weather-header h2 {
        font-size: clamp(2.8rem, 17vw, 4.2rem);
    }

    .weather-icon {
        width: 64px;
        height: 64px;
        border-radius: 20px;
        font-size: 2.15rem;
    }

    .topbar,
    .footer,
    .section-title,
    .weather-subline {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-title {
        gap: 2px;
    }

    .setup-box,
    .camera-placeholder {
        min-height: 220px;
        padding: 22px;
    }
}

@media (max-width: 380px) {
    .top-actions {
        flex-wrap: wrap;
    }

    h1 {
        font-size: 2.15rem;
    }

    .weather-header {
        flex-direction: column;
    }
}


@media (min-width: 981px) {
    .stream-panel .video-frame {
        max-height: 680px;
    }
}


/* Rechtliches Dropdown */
.footer {
    align-items: center;
}

.footer-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.legal-dropdown {
    position: relative;
    z-index: 20;
}

.legal-toggle {
    margin-top: 0;
    min-height: 40px;
    gap: 8px;
    color: var(--text);
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line);
    box-shadow: none;
}

.legal-toggle:hover,
.legal-toggle:focus-visible {
    outline: none;
    border-color: rgba(126, 231, 255, .6);
    background: rgba(126, 231, 255, .12);
}

.legal-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(360px, calc(100vw - 28px));
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.045)),
        rgba(8, 25, 41, .97);
    box-shadow: 0 20px 58px rgba(0,0,0,.45);
    color: var(--muted);
    backdrop-filter: blur(18px);
}

.legal-menu h3 {
    margin: 0 0 7px;
    color: var(--text);
    font-size: .98rem;
}

.legal-menu p {
    margin: 0;
    line-height: 1.55;
}

.legal-menu hr {
    border: 0;
    border-top: 1px solid rgba(150, 210, 245, .22);
    margin: 14px 0;
}

.legal-small {
    margin-top: 10px !important;
    font-size: .86rem;
    color: var(--muted-2);
}

@media (max-width: 680px) {
    .footer {
        align-items: stretch;
    }

    .footer-info {
        flex-direction: column;
        gap: 6px;
    }

    .legal-dropdown {
        width: 100%;
    }

    .legal-toggle {
        width: 100%;
    }

    .legal-menu {
        left: 0;
        right: auto;
        bottom: calc(100% + 10px);
        width: 100%;
    }
}


/* Rechtliches Version 5 */
.legal-menu {
    width: min(430px, calc(100vw - 28px));
}

.legal-menu section + section {
    margin-top: 0;
}

.legal-menu h3 {
    letter-spacing: -.01em;
}

.legal-menu p {
    font-size: .93rem;
}

.legal-small {
    line-height: 1.55;
}


/* Version 6: sichtbares Impressum/Datenschutz als Modal */
.legal-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 0;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 0 14px;
    color: var(--text);
    background: rgba(255,255,255,.08);
    font-weight: 850;
    font-size: .88rem;
    box-shadow: none;
    cursor: pointer;
}

.legal-open:hover,
.legal-open:focus-visible {
    outline: none;
    border-color: rgba(126, 231, 255, .7);
    background: rgba(126, 231, 255, .14);
}

.footer-legal-button {
    white-space: nowrap;
}

.legal-modal[hidden] {
    display: none !important;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .66);
    backdrop-filter: blur(8px);
}

.legal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(22px, 4vw, 34px);
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)),
        rgba(8, 25, 41, .98);
    box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.legal-dialog h2 {
    margin: 0 44px 20px 0;
    font-size: clamp(1.55rem, 4vw, 2.25rem);
    letter-spacing: -.04em;
}

.legal-dialog h3 {
    margin: 0 0 8px;
    color: var(--cyan-readable);
    font-size: 1.05rem;
}

.legal-dialog p {
    color: var(--muted);
    line-height: 1.62;
    margin: 0 0 14px;
}

.legal-dialog hr {
    border: 0;
    border-top: 1px solid rgba(150, 210, 245, .24);
    margin: 20px 0;
}

.legal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255,255,255,.1);
    border: 1px solid var(--line);
    font-size: 1.6rem;
    line-height: 1;
}

body.legal-modal-open {
    overflow: hidden;
}

@media (max-width: 680px) {
    .top-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .top-legal-button {
        width: 100%;
        min-height: 38px;
        font-size: .82rem;
        padding: 0 12px;
    }

    .footer {
        align-items: stretch;
    }

    .footer-info {
        flex-direction: column;
        gap: 6px;
    }

    .footer-legal-button {
        width: 100%;
    }

    .legal-modal {
        align-items: end;
        padding: 10px;
    }

    .legal-dialog {
        width: 100%;
        max-height: 88vh;
        border-radius: 22px;
        padding: 22px;
    }
}


/* Version 7: Rechtliches ohne JavaScript per CSS :target */
.legal-open {
    text-decoration: none;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    place-items: center;
    padding: 18px;
}

.legal-modal:target {
    display: grid;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .66);
    backdrop-filter: blur(8px);
}

.legal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(82vh, 760px);
    overflow: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(22px, 4vw, 34px);
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)),
        rgba(8, 25, 41, .98);
    box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.legal-dialog h2 {
    margin: 0 44px 20px 0;
    font-size: clamp(1.55rem, 4vw, 2.25rem);
    letter-spacing: -.04em;
}

.legal-dialog h3 {
    margin: 0 0 8px;
    color: var(--cyan-readable);
    font-size: 1.05rem;
}

.legal-dialog p {
    color: var(--muted);
    line-height: 1.62;
    margin: 0 0 14px;
}

.legal-dialog hr {
    border: 0;
    border-top: 1px solid rgba(150, 210, 245, .24);
    margin: 20px 0;
}

.legal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255,255,255,.1);
    border: 1px solid var(--line);
    font-size: 1.6rem;
    line-height: 38px;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 680px) {
    .legal-modal {
        align-items: end;
        padding: 10px;
    }

    .legal-dialog {
        width: 100%;
        max-height: 88vh;
        border-radius: 22px;
        padding: 22px;
    }
}


/* Version 8: Inline-JS Modal für Impressum/Datenschutz */
.legal-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 0;
    border-radius: 999px;
    border: 1px solid var(--line);
    padding: 0 14px;
    color: var(--text);
    background: rgba(255,255,255,.08);
    font-weight: 850;
    font-size: .88rem;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.legal-open:hover,
.legal-open:focus-visible {
    outline: none;
    border-color: rgba(126, 231, 255, .7);
    background: rgba(126, 231, 255, .14);
}

.footer-legal-button {
    white-space: nowrap;
}

.legal-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    place-items: center;
    padding: 18px;
}

.legal-modal.is-open {
    display: grid;
}

.legal-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(8px);
}

.legal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: min(84vh, 760px);
    overflow: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: clamp(22px, 4vw, 34px);
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.04)),
        rgba(8, 25, 41, .98);
    box-shadow: 0 28px 90px rgba(0,0,0,.62);
}

.legal-dialog h2 {
    margin: 0 44px 20px 0;
    font-size: clamp(1.55rem, 4vw, 2.25rem);
    letter-spacing: -.04em;
}

.legal-dialog h3 {
    margin: 0 0 8px;
    color: var(--cyan-readable);
    font-size: 1.05rem;
}

.legal-dialog p {
    color: var(--muted);
    line-height: 1.62;
    margin: 0 0 14px;
}

.legal-dialog hr {
    border: 0;
    border-top: 1px solid rgba(150, 210, 245, .24);
    margin: 20px 0;
}

.legal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255,255,255,.1);
    border: 1px solid var(--line);
    font-size: 1.6rem;
    line-height: 1;
    box-shadow: none;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 680px) {
    .top-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .top-legal-button {
        width: 100%;
        min-height: 38px;
        font-size: .82rem;
        padding: 0 12px;
    }

    .footer {
        align-items: stretch;
    }

    .footer-info {
        flex-direction: column;
        gap: 6px;
    }

    .footer-legal-button {
        width: 100%;
    }

    .legal-modal {
        align-items: end;
        padding: 10px;
    }

    .legal-dialog {
        width: 100%;
        max-height: 88vh;
        border-radius: 22px;
        padding: 22px;
    }
}
