:root {
    color-scheme: dark;
    --bg: #010401;
    --panel: rgba(2, 14, 5, 0.94);
    --green: #66ff88;
    --green-soft: #d0ffd9;
    --cyan: #36e8ff;
    --red: #ff5574;
    --yellow: #ffe36b;
    --pink: #ff62b0;
    --purple: #b48cff;
    --orange: #ff9f52;
    --muted: #75997d;
    --line: rgba(102, 255, 136, 0.25);
    --shadow: 0 0 26px rgba(102, 255, 136, 0.12);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--green-soft);
    background:
        radial-gradient(circle at 50% 0%, rgba(26, 105, 43, 0.22), transparent 45rem),
        linear-gradient(180deg, #020802, #000);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(102, 255, 136, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(102, 255, 136, 0.022) 1px, transparent 1px);
    background-size: 40px 40px;
}

button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }

.crt-noise,
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
}

.crt-noise {
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.scanlines {
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 3px,
        rgba(0, 0, 0, 0.16) 4px
    );
}

.app-shell { position: relative; z-index: 1; min-height: 100vh; }
.screen { min-height: 100vh; }
.hidden { display: none !important; }

.start-screen,
.rsvp-screen {
    display: grid;
    place-items: center;
    padding: 24px;
}

.terminal-frame {
    width: min(1120px, 100%);
    padding: clamp(22px, 5vw, 58px);
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.tiny-label {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0.16em;
}

.start-logo {
    max-width: 100%;
    overflow: hidden;
    color: var(--green);
    font-size: clamp(0.2rem, 0.72vw, 0.7rem);
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 0 14px rgba(102, 255, 136, 0.35);
}

.boot-copy {
    max-width: 780px;
    margin: 36px auto 24px;
    color: var(--green-soft);
    line-height: 1.7;
    text-align: center;
}

.start-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.pixel-button {
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 0;
    color: var(--green);
    background: rgba(0, 0, 0, 0.7);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-decoration: none;
}

.pixel-button:hover {
    border-color: var(--green);
    box-shadow: 0 0 20px rgba(102, 255, 136, 0.16);
}

.pixel-button.primary {
    color: #001505;
    background: var(--green);
}

.pixel-button.danger {
    color: #1d0007;
    background: var(--red);
}

.pixel-button:disabled {
    opacity: 0.55;
    cursor: wait;
}

.volume-warning {
    margin: 20px 0 0;
    color: var(--yellow);
    font-size: 0.76rem;
    text-align: center;
}

.movie-screen {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 55%, rgba(31, 121, 52, 0.13), transparent 35rem),
        linear-gradient(180deg, #020404, #000);
}

.movie-hud {
    position: relative;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    background: rgba(0, 0, 0, 0.78);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
}

.movie-stage {
    position: relative;
    min-height: calc(100vh - 42px);
    overflow: hidden;
}

.movie-stage::before {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 42%;
    background:
        linear-gradient(to top, rgba(255,255,255,0.04), transparent),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 70px,
            rgba(102,255,136,0.08) 71px,
            transparent 72px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 38px,
            rgba(102,255,136,0.06) 39px,
            transparent 40px
        );
    transform: perspective(420px) rotateX(58deg);
    transform-origin: bottom;
}

.light-beams {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

.beam {
    position: absolute;
    top: -20%;
    width: 18%;
    height: 80%;
    opacity: 0.12;
    filter: blur(4px);
    transform-origin: top center;
    animation: beam-swing 3.8s ease-in-out infinite alternate;
}

.beam-1 { left: 6%; background: linear-gradient(to bottom, var(--cyan), transparent); }
.beam-2 { left: 28%; background: linear-gradient(to bottom, var(--pink), transparent); animation-delay: .5s; }
.beam-3 { right: 28%; background: linear-gradient(to bottom, var(--yellow), transparent); animation-delay: .9s; }
.beam-4 { right: 6%; background: linear-gradient(to bottom, var(--purple), transparent); animation-delay: 1.3s; }

@keyframes beam-swing {
    from { transform: rotate(-18deg); }
    to { transform: rotate(18deg); }
}

.movie-status {
    position: absolute;
    top: 7%;
    left: 50%;
    z-index: 10;
    width: min(90%, 760px);
    transform: translateX(-50%);
    color: var(--cyan);
    font-size: clamp(0.8rem, 2vw, 1.05rem);
    letter-spacing: 0.12em;
    text-align: center;
    text-shadow: 0 0 10px rgba(54, 232, 255, 0.45);
}

.disco-ball {
    position: absolute;
    top: 11%;
    left: 50%;
    z-index: 6;
    transform: translateX(-50%);
    color: var(--cyan);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    text-shadow: 0 0 20px rgba(54,232,255,.65);
    animation: disco-spin 1.2s linear infinite;
}

@keyframes disco-spin {
    from { transform: translateX(-50%) rotate(0deg) scale(1); }
    to { transform: translateX(-50%) rotate(360deg) scale(1.08); }
}

.party-stage {
    position: absolute;
    inset: 18% 3% 5%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.party-stage.visible { opacity: 1; }

.dj-booth {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translateX(-50%);
    z-index: 4;
}

.dj-text {
    margin: 0;
    color: var(--pink);
    font-size: clamp(0.52rem, 0.9vw, 0.82rem);
    line-height: 1.02;
    text-shadow: 0 0 10px rgba(255,98,176,.25);
}

.ascii-sprite {
    position: absolute;
    margin: 0;
    font-size: clamp(0.62rem, 1.1vw, 1rem);
    line-height: 1.02;
    white-space: pre;
    text-shadow: 0 0 9px currentColor;
    animation: sprite-bob 0.9s ease-in-out infinite alternate;
}

@keyframes sprite-bob {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

.color-1 { color: var(--green); }
.color-2 { color: var(--cyan); }
.color-3 { color: var(--pink); }
.color-4 { color: var(--yellow); }
.color-5 { color: var(--purple); }
.color-6 { color: var(--orange); }

.color-dog { color: #ffd18f; }
.color-dog2 { color: #ffe36b; }
.color-cat { color: #ff9fe4; }

.person-1 { left: 2%; top: 35%; animation-delay: .0s; }
.person-2 { left: 9%; top: 54%; animation-delay: .1s; }
.person-3 { left: 17%; top: 30%; animation-delay: .2s; }
.person-4 { left: 24%; top: 57%; animation-delay: .3s; }
.person-5 { left: 31%; top: 28%; animation-delay: .4s; }
.person-6 { left: 39%; top: 54%; animation-delay: .5s; }
.person-7 { left: 47%; top: 31%; animation-delay: .6s; }
.person-8 { left: 55%; top: 56%; animation-delay: .7s; }
.person-9 { left: 63%; top: 28%; animation-delay: .8s; }
.person-10 { left: 71%; top: 54%; animation-delay: .9s; }
.person-11 { left: 79%; top: 33%; animation-delay: 1.0s; }
.person-12 { left: 87%; top: 56%; animation-delay: 1.1s; }
.person-13 { left: 22%; top: 74%; animation-delay: 1.2s; }
.person-14 { left: 68%; top: 75%; animation-delay: 1.3s; }

.dog {
    font-size: clamp(0.44rem, 0.82vw, 0.72rem);
    animation-duration: .7s;
}
.dog-1 { left: 8%; top: 78%; }
.dog-2 { right: 8%; top: 79%; }

.cat {
    font-size: clamp(0.46rem, 0.8vw, 0.76rem);
    animation-duration: .8s;
}
.cat-1 { left: 49%; top: 83%; }

.firework-layer,
.confetti-layer {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.firework {
    position: absolute;
    margin: 0;
    font-size: clamp(0.6rem, 1.2vw, 1rem);
    line-height: 1;
    text-shadow: 0 0 12px currentColor;
    animation: firework-pop 0.9s ease-out both;
}

@keyframes firework-pop {
    0% { opacity: 0; transform: scale(0.15); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.45); }
}

.confetti {
    position: absolute;
    top: -10%;
    font-weight: 800;
    text-shadow: 0 0 8px currentColor;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    from { transform: translateY(0) rotate(0deg); opacity: 1; }
    to { transform: translateY(110vh) rotate(480deg); opacity: 0; }
}

.movie-title {
    position: absolute;
    inset: 10% 3% auto;
    z-index: 30;
    padding: 24px;
    border: 1px solid rgba(54, 232, 255, 0.35);
    color: var(--green);
    background: rgba(0, 0, 0, 0.82);
    text-align: center;
    box-shadow: 0 0 50px rgba(54, 232, 255, 0.12);
    animation: title-crash 0.45s steps(2, end) both;
}

@keyframes title-crash {
    0% { opacity: 0; transform: scale(1.8) skewX(-12deg); filter: blur(8px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

.title-art {
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto 14px;
    color: var(--green);
    font-size: clamp(0.18rem, 0.65vw, 0.62rem);
    line-height: 1.15;
}

.movie-title h1 {
    margin: 6px 0;
    color: var(--cyan);
    font-size: clamp(2.4rem, 8vw, 7.2rem);
    line-height: 0.95;
    letter-spacing: -0.06em;
    text-shadow: 0 0 22px rgba(54, 232, 255, 0.45);
}

.movie-title p {
    margin: 20px 0 0;
    color: var(--yellow);
    font-size: clamp(1.1rem, 4vw, 2.8rem);
    letter-spacing: 0.22em;
}

.skip-button {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 40;
    padding: 8px 10px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(0, 0, 0, 0.72);
    cursor: pointer;
    font-size: 0.72rem;
}

.rsvp-terminal { padding-bottom: 28px; }

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

.rsvp-header h1 {
    margin: 0;
    color: var(--green);
    font-size: clamp(2rem, 6vw, 5.4rem);
    line-height: 0.95;
    letter-spacing: -0.055em;
}

.sound-toggle {
    flex: 0 0 auto;
    padding: 9px 11px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}

.rsvp-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 42px;
}

.choice-card {
    min-height: 210px;
    padding: 28px;
    border: 1px solid var(--line);
    color: var(--green-soft);
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    text-align: left;
}

.choice-card:hover { transform: translateY(-3px); }
.choice-card.yes:hover { border-color: var(--green); box-shadow: 0 0 28px rgba(102,255,136,0.12); }
.choice-card.no:hover { border-color: var(--red); box-shadow: 0 0 28px rgba(255,85,116,0.12); }

.choice-icon {
    display: block;
    margin-bottom: 34px;
    color: var(--cyan);
    font-size: 1.2rem;
}

.choice-card strong,
.choice-card small {
    display: block;
}

.choice-card strong {
    margin-bottom: 12px;
    font-size: clamp(1.2rem, 3vw, 2rem);
}

.choice-card small { color: var(--muted); }

.response-form {
    display: grid;
    gap: 18px;
    max-width: 820px;
    margin: 38px auto 0;
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.back-button {
    padding: 0;
    border: 0;
    color: var(--green);
    background: transparent;
    cursor: pointer;
}

.response-form > label,
.response-form legend {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

input,
select,
textarea {
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid rgba(102, 255, 136, 0.3);
    border-radius: 0;
    outline: none;
    color: var(--green-soft);
    background: rgba(0, 0, 0, 0.72);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(102, 255, 136, 0.08);
}

fieldset {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    border: 0;
}

.check-option {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 13px;
    border: 1px solid rgba(102, 255, 136, 0.16);
    color: var(--green-soft);
    cursor: pointer;
}

.check-option input {
    width: auto;
    margin: 0;
}

.submit-button { min-height: 54px; }

.decline-copy {
    margin: 0;
    color: var(--green-soft);
    line-height: 1.7;
}

.transmission-result {
    max-width: 820px;
    margin: 44px auto;
    padding: 28px;
    border: 1px solid currentColor;
    background: rgba(0, 0, 0, 0.48);
}

.transmission-result strong,
.transmission-result span {
    display: block;
}

.transmission-result strong { margin-bottom: 12px; }
.transmission-result.success { color: var(--green); }
.transmission-result.declined { color: var(--yellow); }
.transmission-result.error,
.admin-error { color: var(--red); }

.rsvp-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 44px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.72rem;
}

.admin-body { padding: 24px; }
.admin-shell { width: min(1400px, 100%); margin: 0 auto; }

.admin-terminal h1 {
    color: var(--green);
    font-size: clamp(2rem, 6vw, 5rem);
}

.admin-login {
    display: grid;
    gap: 18px;
    max-width: 620px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 30px 0;
}

.admin-stats article {
    padding: 22px;
    border: 1px solid var(--line);
}

.admin-stats span {
    color: var(--muted);
    font-size: 0.74rem;
}

.admin-stats strong {
    display: block;
    margin-top: 16px;
    color: var(--green);
    font-size: 2rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.admin-actions form { margin: 0; }

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th { color: var(--green); }

@media (max-width: 840px) {
    .start-logo,
    .title-art { display: none; }

    .movie-hud,
    .rsvp-header,
    .rsvp-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .rsvp-choice,
    .admin-stats { grid-template-columns: 1fr; }

    .movie-title { top: 18%; }

    .party-stage {
        transform: scale(0.78);
        transform-origin: center bottom;
    }
}

@media (max-width: 560px) {
    .start-screen,
    .rsvp-screen { padding: 8px; }

    .terminal-frame { padding: 22px 14px; }

    .movie-status { top: 4%; }

    .party-stage {
        inset: 14% -18% 4%;
        transform: scale(0.62);
    }

    .movie-title h1 { font-size: 2.5rem; }

    .choice-card {
        min-height: 165px;
        padding: 20px;
    }

    .form-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   SPACE-INVADER POSITION FIX
   ========================================================= */

.movie-stage {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    contain: layout paint;
}

.invader-layer {
    position: absolute !important;
    inset: 0 !important;

    width: 100% !important;
    height: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    overflow: hidden !important;
    pointer-events: none !important;

    z-index: 7 !important;
}

.invader {
    position: absolute !important;

    width: max-content !important;
    max-width: 90px !important;

    margin: 0 !important;
    padding: 0 !important;

    white-space: pre !important;
    text-align: center !important;

    transform: translateX(-50%);
    transform-origin: center center;

    animation-name: invader-rise-fixed !important;
    animation-timing-function: linear !important;
    animation-fill-mode: forwards !important;

    will-change: transform, opacity;
}

@keyframes invader-rise-fixed {
    0% {
        transform:
            translateX(-50%)
            translateY(0)
            scale(0.8);

        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    85% {
        opacity: 1;
    }

    100% {
        transform:
            translateX(-50%)
            translateY(-115vh)
            scale(1);

        opacity: 0;
    }
}

.invader-laser {
    position: absolute !important;

    width: 8px !important;

    margin: 0 !important;
    padding: 0 !important;

    text-align: center !important;

    transform: translateX(-50%);

    animation-name: invader-laser-rise-fixed !important;
    animation-timing-function: linear !important;
    animation-fill-mode: forwards !important;

    will-change: transform, opacity;
}

@keyframes invader-laser-rise-fixed {
    0% {
        transform:
            translateX(-50%)
            translateY(0);

        opacity: 1;
    }

    100% {
        transform:
            translateX(-50%)
            translateY(-115vh);

        opacity: 0;
    }
}

/* Auf kleinen Bildschirmen weniger große Invader */
@media (max-width: 700px) {
    .invader {
        max-width: 58px !important;
        font-size: 0.44rem !important;
    }

    .invader-layer {
        inset: 0 4% !important;
        width: 92% !important;
    }
}
