/* PixelDefender MK – Retro CRT Design */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --pdef-green: #00ff41;
    --pdef-red: #ff2244;
    --pdef-yellow: #ffe600;
    --pdef-bg: #000000;
    --pdef-dim: #00ff4133;
    --pdef-font: 'VT323', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--pdef-bg);
    color: var(--pdef-green);
    font-family: var(--pdef-font);
    font-size: 20px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

/* CRT effect */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Matrix Rain Canvas */
#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.7;
}

/* Wallpaper Background */
.pdef-wallpaper-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
}
body[data-bg="space"] .pdef-wallpaper-bg {
    opacity: 0.85;
}

/* Vignette Overlay */
.pdef-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: radial-gradient(ellipse at center,
        transparent 30%,
        rgba(0, 0, 0, 0.75) 70%,
        rgba(0, 0, 0, 0.97) 100%);
    pointer-events: none;
}

/* Custom Cursor */
body.pdef-custom-cursor, body.pdef-custom-cursor * { cursor: none !important; }
#cursor-dot, #cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
}
#cursor-dot {
    width: 8px;
    height: 8px;
    background: #9d0b0e;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s;
}
#cursor-ring {
    width: 30px;
    height: 30px;
    border: 2px solid #9d0b0e;
    border-radius: 50%;
    opacity: 0;
    transition: width 0.2s, height 0.2s, opacity 0.3s;
}
#cursor-dot.is-hovering {
    animation: pdef-cursorPulse 0.7s ease-in-out infinite;
}
#cursor-ring.is-hovering {
    width: 42px;
    height: 42px;
    opacity: 0.35;
}

@keyframes pdef-cursorPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.9); opacity: 0.5; }
}

/* Footer */
.pdef-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    text-align: center;
    padding: 6px 10px;
    font-size: 0.65em;
    height: 30px;
    color: #5a6570;
    font-family: var(--pdef-font);
    letter-spacing: 0.08em;
}

.pdef-footer a {
    color: #5a6570;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.pdef-footer a:hover {
    color: #fff;
}

.pdef-footer-credit {
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 1px 5px;
}

.pdef-footer-credit:hover {
    color: #ff6b6b !important;
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.08);
}

/* Screens */
.pdef-screen {
    position: absolute;
    inset: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 2;
}

.hidden {
    display: none !important;
}

/* Start Screen */
.pdef-title {
    font-size: 2.8em;
    color: var(--pdef-green);
    text-shadow: 0 0 20px var(--pdef-green), 0 0 40px var(--pdef-green);
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 4px;
}
.pdef-title sup {
    font-size: 0.45em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 10px var(--pdef-yellow);
    vertical-align: super;
    margin-left: -8px;
}

.pdef-subtitle {
    font-size: 1.2em;
    color: var(--pdef-yellow);
    margin-bottom: 40px;
    text-align: center;
    animation: pdef-blink 1s step-end infinite;
}
@keyframes pdef-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Buttons */
.pdef-btn {
    font-family: var(--pdef-font);
    font-size: 1.3em;
    background: transparent;
    color: var(--pdef-green);
    border: 2px solid var(--pdef-green);
    padding: 12px 32px;
    margin: 8px;
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 2px;
    min-width: 200px;
}

.pdef-btn:hover, .pdef-btn:active, .pdef-btn.pdef-btn--focused {
    background: var(--pdef-green);
    color: var(--pdef-bg);
    box-shadow: 0 0 15px var(--pdef-green);
}

.pdef-btn--red {
    color: var(--pdef-red);
    border-color: var(--pdef-red);
}

.pdef-btn--red:hover, .pdef-btn--red:active, .pdef-btn--red.pdef-btn--focused {
    background: var(--pdef-red);
    color: var(--pdef-bg);
    box-shadow: 0 0 15px var(--pdef-red);
}

.pdef-btn--yellow {
    color: var(--pdef-yellow);
    border-color: var(--pdef-yellow);
}

.pdef-btn--yellow:hover, .pdef-btn--yellow:active, .pdef-btn--yellow.pdef-btn--focused {
    background: var(--pdef-yellow);
    color: var(--pdef-bg);
    box-shadow: 0 0 15px var(--pdef-yellow);
}

.pdef-btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
}

.pdef-difficulty-label {
    font-size: 1.1em;
    margin-bottom: 8px;
    color: var(--pdef-yellow);
}

/* Game Screen */
.pdef-game-container {
    position: absolute;
    inset: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
}

.pdef-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    font-size: 1.2em;
    background: rgba(0, 255, 65, 0.05);
    border-bottom: 1px solid var(--pdef-dim);
    z-index: 10;
}

.pdef-hud-btn {
    width: 32px;
    height: 32px;
    font-size: 1em;
    flex-shrink: 0;
}

.pdef-hud-score { color: var(--pdef-green); }
.pdef-hud-timer { color: #aaa; font-size: 0.9em; font-variant-numeric: tabular-nums; }
.pdef-hud-lives { color: var(--pdef-red); font-size: 1.4em; }
.pdef-hud-shield {
    color: #00c8ff;
    text-shadow: 0 0 8px #00c8ff;
    font-size: 1em;
}
.pdef-weapon-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
    padding: 4px 16px;
    background: rgba(0, 255, 65, 0.03);
    border-bottom: 1px solid var(--pdef-dim);
    z-index: 10;
}
.pdef-weapon {
    font-size: 0.85em;
    padding: 4px 10px;
    border: 1px solid var(--pdef-dim);
    border-radius: 3px;
    color: var(--pdef-dim);
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.1s;
}
.pdef-weapon.active {
    border-color: var(--pdef-green);
    color: var(--pdef-green);
    text-shadow: 0 0 6px var(--pdef-green);
}
.pdef-weapon.active[data-color="cyan"] {
    border-color: #00ffff;
    color: #00ffff;
    text-shadow: 0 0 6px #00ffff;
}
.pdef-weapon.active[data-color="red"] {
    border-color: var(--pdef-red);
    color: var(--pdef-red);
    text-shadow: 0 0 6px var(--pdef-red);
}
.pdef-weapon.active[data-color="magenta"] {
    border-color: #ff33cc;
    color: #ff33cc;
    text-shadow: 0 0 6px #ff33cc;
}
.pdef-hud-level { color: var(--pdef-yellow); }

body[data-bg="wallpaper"] .pdef-hud,
body[data-bg="wallpaper"] .pdef-weapon-bar,
body[data-bg="wallpaper"] .pdef-game-controls,
body[data-bg="space"] .pdef-hud,
body[data-bg="space"] .pdef-weapon-bar,
body[data-bg="space"] .pdef-game-controls {
    background: rgba(0, 0, 0, 0.7);
}

.pdef-canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.pdef-game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    gap: 16px;
    background: rgba(0, 255, 65, 0.05);
    border-top: 1px solid var(--pdef-dim);
    z-index: 10;
}

.pdef-icon-btn {
    font-family: var(--pdef-font);
    font-size: 1.5em;
    background: transparent;
    color: var(--pdef-green);
    border: 1px solid var(--pdef-dim);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}

.pdef-move-btn {
    font-family: var(--pdef-font);
    font-size: 1.8em;
    background: rgba(0, 255, 65, 0.1);
    color: var(--pdef-green);
    border: 1px solid var(--pdef-green);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
}
.pdef-move-btn:active {
    background: var(--pdef-green);
    color: #000;
    box-shadow: 0 0 12px var(--pdef-green);
}

.pdef-fire-btn {
    font-family: var(--pdef-font);
    font-size: 1.3em;
    background: var(--pdef-red);
    color: #fff;
    border: none;
    padding: 12px 36px;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 10px var(--pdef-red);
}

/* Pause overlay */
.pdef-pause-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 20;
    padding: 20px 0;
}

.pdef-pause-text {
    font-size: 3em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 20px var(--pdef-yellow);
    animation: pdef-blink 1s infinite;
}

.pdef-pause-quit {
    font-size: 1em;
    min-width: auto;
    z-index: 2;
    margin-bottom: 8px;
}
.pdef-pause-quit:first-of-type {
    margin-top: auto;
    margin-bottom: 8px;
}
@media (min-height: 600px) {
    .pdef-pause-quit:first-of-type {
        margin-top: auto;
        margin-bottom: 8px;
        position: relative;
        bottom: 10vh;
    }
    .pdef-pause-quit:last-of-type {
        position: relative;
        bottom: 10vh;
    }
}

/* Star Wars crawl – bottom to center vanishing point */
.pdef-crawl-container {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: hidden;
    perspective: 400px;
    perspective-origin: 50% 40%;
}
.pdef-crawl {
    position: absolute;
    left: 10%;
    right: 10%;
    text-align: center;
    transform-origin: 50% 0%;
    transform: rotateX(35deg);
    animation: pdef-crawl-scroll 20s linear infinite;
}
.pdef-crawl-label {
    font-size: 1em;
    color: #6a8a9a;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0 0 6px 0;
}
.pdef-crawl-value {
    font-size: 1.5em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 10px rgba(255, 230, 0, 0.4);
    margin: 0 0 28px 0;
}
.pdef-crawl-link {
    color: var(--pdef-yellow);
    text-decoration: none;
    transition: color 0.2s;
}
.pdef-crawl-link:hover {
    color: var(--pdef-green);
    text-shadow: 0 0 10px var(--pdef-green);
}
@keyframes pdef-crawl-scroll {
    0%   { top: 100%; }
    100% { top: -80%; }
}

@keyframes pdef-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Guide Screen */
.pdef-guide-title {
    font-size: 2.2em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 15px var(--pdef-yellow);
    margin-bottom: 10px;
    flex-shrink: 0;
}
.pdef-guide-scroll {
    flex: 1;
    overflow-y: auto;
    width: 90%;
    max-width: 500px;
    padding: 0 10px 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--pdef-dim) transparent;
}
.pdef-guide-section {
    margin-bottom: 20px;
}
.pdef-guide-section h3 {
    font-size: 1.2em;
    color: var(--pdef-green);
    text-shadow: 0 0 8px var(--pdef-green);
    border-bottom: 1px solid var(--pdef-dim);
    padding-bottom: 4px;
    margin-bottom: 8px;
}
.pdef-guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}
.pdef-guide-table td {
    padding: 3px 8px;
}
.pdef-guide-key {
    color: var(--pdef-yellow);
    white-space: nowrap;
    width: 110px;
}
.pdef-guide-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    font-size: 0.9em;
}
.pdef-guide-icon {
    font-size: 1.4em;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}
.pdef-gi-red { color: var(--pdef-red); text-shadow: 0 0 6px var(--pdef-red); }
.pdef-gi-yellow { color: var(--pdef-yellow); text-shadow: 0 0 6px var(--pdef-yellow); }
.pdef-gi-green { color: var(--pdef-green); text-shadow: 0 0 6px var(--pdef-green); }
.pdef-gi-cyan { color: #00ffff; text-shadow: 0 0 6px #00ffff; }
.pdef-gi-magenta { color: #ff33cc; text-shadow: 0 0 6px #ff33cc; }
.pdef-guide-tag {
    font-size: 0.85em;
    padding: 2px 10px;
    border: 1px solid currentColor;
    border-radius: 3px;
    min-width: 60px;
    text-align: center;
}
.pdef-guide-formula {
    color: var(--pdef-yellow);
    text-align: center;
    font-size: 1em;
    margin: 8px 0;
    text-shadow: 0 0 6px rgba(255, 230, 0, 0.3);
}
.pdef-guide-hint {
    font-size: 0.8em;
    color: rgba(0, 255, 65, 0.75);
    margin: 4px 0 8px;
}

/* Level Up Screen */
.pdef-level-complete {
    font-size: 2.5em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 20px var(--pdef-yellow);
    margin-bottom: 20px;
}

.pdef-level-info {
    font-size: 1.4em;
    margin-bottom: 10px;
}
.pdef-level-info:last-of-type {
    margin-bottom: 30px;
}
.pdef-bonus-info {
    color: var(--pdef-yellow);
    text-shadow: 0 0 10px var(--pdef-yellow);
}

/* Game Over Screen */
/* Game Over animation */
.pdef-go-anim {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}
.pdef-go-zoom {
    font-size: 3em;
    color: var(--pdef-red);
    text-shadow: 0 0 20px var(--pdef-red), 0 0 60px var(--pdef-red);
    animation: pdef-go-fly 2s ease-in forwards;
}
@keyframes pdef-go-fly {
    0%   { transform: scale(0.05); opacity: 0; }
    20%  { opacity: 1; }
    80%  { transform: scale(1); opacity: 1; }
    90%  { transform: scale(1.3); opacity: 1; text-shadow: 0 0 40px var(--pdef-red), 0 0 80px #ff6600, 0 0 120px #ffe600; }
    100% { transform: scale(3); opacity: 0; }
}
.pdef-go-zoom--quote {
    font-size: 1.4em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 20px var(--pdef-yellow), 0 0 60px var(--pdef-yellow);
    text-align: center;
    line-height: 1.4;
    animation: pdef-go-fly-quote 2.2s ease-in forwards;
}
@keyframes pdef-go-fly-quote {
    0%   { transform: scale(0.05); opacity: 0; }
    20%  { opacity: 1; }
    75%  { transform: scale(1); opacity: 1; }
    85%  { transform: scale(1.1); opacity: 1; text-shadow: 0 0 30px var(--pdef-yellow), 0 0 60px #ff6600; }
    100% { transform: scale(2.5); opacity: 0; }
}
.pdef-go-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 6;
}
.pdef-go-quote {
    font-size: 1.1em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 10px rgba(255,230,0,0.4);
    text-align: center;
    margin-bottom: 20px;
    animation: pdef-fadein 0.8s ease-out;
}
@keyframes pdef-fadein {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}
.pdef-blink-border {
    animation: pdef-border-blink 1s step-end infinite;
}
@keyframes pdef-border-blink {
    0%, 100% { border-color: var(--pdef-green); }
    50% { border-color: var(--pdef-yellow); box-shadow: 0 0 12px var(--pdef-yellow); }
}

.pdef-final-score {
    font-size: 1.8em;
    color: var(--pdef-yellow);
    margin-bottom: 30px;
}

.pdef-name-input {
    font-family: var(--pdef-font);
    font-size: 1.4em;
    background: transparent;
    color: var(--pdef-green);
    border: 2px solid var(--pdef-green);
    padding: 10px 16px;
    text-align: center;
    width: 200px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
    outline: none;
}

.pdef-name-input:focus {
    box-shadow: 0 0 10px var(--pdef-green);
}

.pdef-name-input::placeholder {
    color: var(--pdef-dim);
}

/* Highscore Screen */
.pdef-hs-title {
    font-size: 2.2em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 15px var(--pdef-yellow);
    margin-bottom: 20px;
}

.pdef-hs-list {
    width: 100%;
    max-width: 360px;
    margin-bottom: 30px;
}

.pdef-hs-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--pdef-dim);
    font-size: 1.2em;
}

.pdef-hs-rank {
    width: 30px;
    color: var(--pdef-yellow);
}

.pdef-hs-name {
    flex: 1;
    text-align: left;
    padding-left: 10px;
}

.pdef-hs-score {
    color: var(--pdef-yellow);
    min-width: 80px;
    text-align: right;
}

.pdef-no-scores {
    color: var(--pdef-dim);
    font-size: 1.1em;
    text-align: center;
}

/* Decorative invader sprites on start screen */
.pdef-invader-row {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
    opacity: 0.6;
    font-size: 2em;
}

/* Wallpaper settings */
.pdef-file-input {
    display: none;
}

.pdef-file-btn {
    font-family: var(--pdef-font);
    font-size: 0.85em;
    background: rgba(0, 255, 65, 0.1);
    color: var(--pdef-green);
    border: 1px solid var(--pdef-green);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.pdef-file-btn:hover {
    background: var(--pdef-green);
    color: var(--pdef-bg);
}

.pdef-wallpaper-name {
    font-size: 0.8em;
    color: var(--pdef-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.pdef-wallpaper-preview {
    width: 100%;
    height: 80px;
    border: 1px solid var(--pdef-dim);
    border-radius: 4px;
    margin-bottom: 8px;
    background-size: cover;
    background-position: center;
}

/* Settings Screen */
.pdef-settings-title {
    font-size: 2.2em;
    color: var(--pdef-yellow);
    text-shadow: 0 0 15px var(--pdef-yellow);
    margin-bottom: 20px;
}

.pdef-settings-panel {
    width: 100%;
    max-width: 400px;
    max-height: 60vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.pdef-setting-group {
    border: 1px solid var(--pdef-dim);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.pdef-setting-header {
    font-size: 1em;
    color: var(--pdef-yellow);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.pdef-setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.pdef-setting-row label {
    min-width: 80px;
    color: var(--pdef-green);
}

.pdef-select {
    font-family: var(--pdef-font);
    font-size: 1em;
    background: #111;
    color: var(--pdef-green);
    border: 1px solid var(--pdef-dim);
    padding: 6px 10px;
    border-radius: 4px;
    flex: 1;
    outline: none;
}

.pdef-select:focus {
    border-color: var(--pdef-green);
}

.pdef-slider {
    flex: 1;
    accent-color: var(--pdef-green);
    height: 4px;
}

.pdef-slider-val {
    min-width: 40px;
    text-align: right;
    color: var(--pdef-green);
    font-size: 0.85em;
}

.pdef-toggle {
    font-family: var(--pdef-font);
    font-size: 0.9em;
    background: rgba(0, 255, 65, 0.1);
    color: var(--pdef-green);
    border: 1px solid var(--pdef-green);
    padding: 4px 16px;
    border-radius: 4px;
    cursor: pointer;
    min-width: 50px;
    letter-spacing: 1px;
}

.pdef-toggle.off {
    background: rgba(255, 34, 68, 0.1);
    color: var(--pdef-red);
    border-color: var(--pdef-red);
}

.pdef-btn--small {
    font-size: 0.85em;
    padding: 6px 16px;
    min-width: auto;
    margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
    .pdef-title { font-size: 1.6em; letter-spacing: 2px; }
    .pdef-subtitle { font-size: 1em; margin-bottom: 24px; }
    .pdef-btn { font-size: 0.95em; padding: 8px 18px; min-width: 140px; }
    .pdef-difficulty-label { font-size: 0.95em; }
    .pdef-btn-group { margin-bottom: 12px; }
    .pdef-go-zoom { font-size: 2.2em; }

    /* HUD kleiner */
    .pdef-hud { font-size: 0.9em; padding: 4px 8px; }
    .pdef-hud-lives { font-size: 1.2em; }
    .pdef-hud-shield { font-size: 0.85em; }
    .pdef-weapon-bar { padding: 3px 8px; gap: 6px; }
    .pdef-weapon { font-size: 0.75em; padding: 3px 8px; }

    /* Highscore kleiner */
    .pdef-hs-title { font-size: 1.6em; }
    .pdef-hs-row { font-size: 1em; padding: 4px 0; }
    .pdef-hs-list { max-width: 300px; }
}

/* Easter Egg */
.pdef-easter-egg {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.pdef-ee-text {
    font-size: 1.5em;
    color: var(--pdef-red);
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 0 20px var(--pdef-red), 0 0 40px var(--pdef-red);
    animation: pdef-blink 0.8s step-end infinite;
    margin-bottom: 30px;
    z-index: 9002;
    position: relative;
}
.pdef-ee-face {
    position: relative;
    width: 220px;
    height: 220px;
    animation: pdef-ee-slide 1.5s cubic-bezier(.2,.8,.2,1.05) forwards,
               pdef-ee-wobble 2.5s ease-in-out 1.5s infinite;
}
.pdef-ee-face-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: saturate(1.35) contrast(1.25) brightness(1.05) hue-rotate(-4deg);
}
/* Gemeinsamer Retro-Rahmen: grüner Neon-Pixel-Look + innerer Glow */
.pdef-retro-frame {
    border: 3px solid var(--pdef-green);
    border-radius: 2px;
    box-shadow:
        0 0 18px var(--pdef-green),
        0 0 36px rgba(0, 255, 65, 0.35),
        inset 0 0 14px rgba(0, 255, 65, 0.45);
    overflow: hidden;
    background: #000;
}
/* Scanlines-Overlay (CRT-Look) */
.pdef-retro-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.22) 0px,
        rgba(0, 0, 0, 0.22) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    mix-blend-mode: multiply;
}
/* Intro: slide von rechts mit Scale + kleiner Overshoot */
@keyframes pdef-ee-slide {
    0%   { transform: translateX(500px) rotate(-14deg) scale(0.35); opacity: 0; }
    55%  { transform: translateX(0) rotate(5deg) scale(1.12); opacity: 1; }
    75%  { transform: translateX(0) rotate(-3deg) scale(0.96); }
    100% { transform: translateX(0) rotate(0deg) scale(1); opacity: 1; }
}
/* Anschließendes leichtes Wobble */
@keyframes pdef-ee-wobble {
    0%, 100% { transform: translateY(0) rotate(0); }
    50%      { transform: translateY(-6px) rotate(1.5deg); }
}

/* Corner-Badge (persistent nach Unlock) */
.pdef-ee-corner {
    position: fixed;
    bottom: 14px;
    width: 72px;
    height: 72px;
    z-index: 100;
    pointer-events: none;
    animation: pdef-ee-corner-float 3.2s ease-in-out infinite;
}
.pdef-ee-corner.left  { left: 14px; }
.pdef-ee-corner.right { right: 14px; }
.pdef-ee-corner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: saturate(1.35) contrast(1.25) brightness(1.05) hue-rotate(-4deg);
}
@keyframes pdef-ee-corner-float {
    0%, 100% { transform: translateY(0) rotate(0); }
    50%      { transform: translateY(-4px) rotate(1deg); }
}

@media (min-width: 768px) {
    .pdef-game-controls { display: none; }
}

/* ── Legal pages (Impressum / Datenschutz) ────────────── */

.pdef-legal-logo {
    margin-bottom: 12px;
}

.pdef-prologixx-logo {
    max-width: 160px;
    height: auto;
    border-radius: 6px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.pdef-prologixx-logo:hover {
    opacity: 1;
}

.pdef-legal-title {
    font-size: 1.8em;
    color: var(--pdef-green);
    text-shadow: 0 0 10px var(--pdef-green);
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.pdef-legal-subtitle {
    color: #5a6570;
    font-size: 0.8em;
    margin-bottom: 12px;
}

.pdef-legal-scroll {
    width: 100%;
    max-width: 520px;
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 16px;
    text-align: left;
}

.pdef-legal-scroll::-webkit-scrollbar {
    width: 4px;
}
.pdef-legal-scroll::-webkit-scrollbar-thumb {
    background: var(--pdef-dim);
    border-radius: 2px;
}

.pdef-legal-section {
    border: 1px solid var(--pdef-dim);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.pdef-legal-section h3 {
    font-size: 0.95em;
    color: var(--pdef-yellow);
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.pdef-legal-section p {
    font-size: 0.8em;
    color: #b0b8c0;
    line-height: 1.5;
    margin-bottom: 6px;
}

.pdef-legal-section strong {
    color: var(--pdef-green);
}

.pdef-legal-section ul {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}

.pdef-legal-section ul li {
    font-size: 0.8em;
    color: #b0b8c0;
    padding: 2px 0 2px 16px;
    position: relative;
}

.pdef-legal-section ul li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--pdef-green);
}

.pdef-legal-section a {
    color: var(--pdef-green);
    text-decoration: none;
}

.pdef-legal-section a:hover {
    text-decoration: underline;
}

.pdef-legal-date {
    color: #5a6570 !important;
    margin-top: 8px !important;
    font-style: italic;
}

/* ── Footer links ─────────────────────────────────────── */

.pdef-footer-sep {
    margin: 0 4px;
}

/* ── Feedback Widget (Desktop only) ──────────────────── */

.feedback-trigger,
.feedback-panel { display: none; }

@media (min-width: 768px) {

.feedback-trigger {
    display: flex;
    position: fixed;
    bottom: 80px;
    left: 0;
    z-index: 1050;
    align-items: center;
    gap: 6px;
    background: var(--pdef-green);
    color: #000;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 12px 10px;
    cursor: pointer;
    font-family: var(--pdef-font);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    box-shadow: 3px 0 12px rgba(0, 255, 65, 0.3);
    transition: background 0.2s, box-shadow 0.2s;
    line-height: 1;
}
.feedback-trigger:hover,
.feedback-trigger:focus-visible {
    background: #fff;
    box-shadow: 3px 0 18px rgba(0, 255, 65, 0.5);
    outline: none;
}
.feedback-trigger svg { width: 16px; height: 16px; flex-shrink: 0; }

.feedback-panel {
    display: flex;
    position: fixed;
    bottom: 50px;
    left: 24px;
    z-index: 1055;
    width: 340px;
    max-height: calc(100vh - 80px);
    flex-direction: column;
    background: #111;
    border: 1px solid var(--pdef-green);
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.15), 0 8px 32px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: translateY(16px);
    opacity: 0;
    pointer-events: none;
    transition: transform 240ms ease, opacity 240ms ease;
}
.feedback-panel.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.feedback-panel-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--pdef-dim);
    flex-shrink: 0;
}
.feedback-panel-header h3 {
    margin: 0;
    font-family: var(--pdef-font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pdef-green);
    flex: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.feedback-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: #5a6570;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.2s;
}
.feedback-close:hover { color: var(--pdef-red); }

.fb-back {
    background: none;
    border: none;
    cursor: pointer;
    color: #5a6570;
    padding: 2px 4px 2px 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}
.fb-back:hover { color: var(--pdef-green); }
.fb-back svg { width: 18px; height: 18px; }

.feedback-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1 1 auto;
}
.feedback-body[hidden] { display: none !important; }

.feedback-question {
    font-family: var(--pdef-font);
    font-size: 0.9rem;
    color: var(--pdef-green);
    margin-bottom: 0.75rem;
}

.fb-types {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.fb-type-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: 1px solid var(--pdef-dim);
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-family: var(--pdef-font);
    font-size: 0.85rem;
    color: #b0b8c0;
    transition: border-color 0.2s, color 0.2s;
}
.fb-type-btn:hover {
    border-color: var(--pdef-green);
    color: var(--pdef-green);
}
.fb-type-icon  { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.fb-type-label { flex: 1; }
.fb-type-arrow { color: var(--pdef-dim); flex-shrink: 0; font-family: var(--pdef-font); }

.feedback-ratings {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.feedback-rating-btn {
    flex: 1;
    background: transparent;
    border: 2px solid var(--pdef-dim);
    border-radius: 4px;
    padding: 0.5rem 0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    line-height: 1.3;
}
.feedback-rating-btn:hover {
    border-color: var(--pdef-green);
    transform: scale(1.08);
}
.feedback-rating-btn.selected {
    border-color: var(--pdef-green);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.fb-label {
    display: block;
    font-family: var(--pdef-font);
    font-size: 0.85rem;
    color: var(--pdef-green);
    margin-bottom: 0.4rem;
}

.feedback-textarea {
    width: 100%;
    border: 1px solid var(--pdef-dim);
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    font-family: var(--pdef-font);
    font-size: 0.85rem;
    color: var(--pdef-green);
    background: #0a0a0a;
    resize: vertical;
    min-height: 68px;
    transition: border-color 0.2s;
}
.feedback-textarea:focus {
    outline: none;
    border-color: var(--pdef-green);
    box-shadow: 0 0 6px rgba(0, 255, 65, 0.15);
}
.feedback-textarea::placeholder { color: #5a6570; }

.fb-screenshot-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    margin-top: 0.5rem;
    background: transparent;
    border: 1px dashed var(--pdef-dim);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--pdef-font);
    font-size: 0.8rem;
    color: #5a6570;
    transition: border-color 0.2s, color 0.2s;
}
.fb-screenshot-btn:hover {
    border-color: var(--pdef-green);
    color: var(--pdef-green);
}
.fb-screenshot-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fb-screenshot-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.fb-screenshot-preview {
    position: relative;
    margin-top: 0.5rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--pdef-dim);
}
.fb-screenshot-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 110px;
    object-fit: cover;
}
.fb-screenshot-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0,0,0,0.7);
    color: var(--pdef-red);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fb-screenshot-remove:hover { background: rgba(0,0,0,0.9); }

.fb-contact {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--pdef-dim);
}
.fb-contact-question {
    font-family: var(--pdef-font);
    font-size: 0.8rem;
    color: #5a6570;
    margin-bottom: 0.35rem;
}
.fb-radio-group {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.4rem;
}
.fb-radio {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--pdef-font);
    font-size: 0.85rem;
    color: #b0b8c0;
    cursor: pointer;
}
.fb-radio input[type="radio"] { accent-color: var(--pdef-green); cursor: pointer; }

.feedback-email {
    width: 100%;
    border: 1px solid var(--pdef-dim);
    border-radius: 4px;
    padding: 0.45rem 0.65rem;
    font-family: var(--pdef-font);
    font-size: 0.85rem;
    color: var(--pdef-green);
    background: #0a0a0a;
    transition: border-color 0.2s;
}
.feedback-email:focus {
    outline: none;
    border-color: var(--pdef-green);
    box-shadow: 0 0 6px rgba(0, 255, 65, 0.15);
}
.feedback-email::placeholder { color: #5a6570; }

.feedback-submit {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.55rem 1rem;
    background: var(--pdef-green);
    color: #000;
    border: none;
    border-radius: 4px;
    font-family: var(--pdef-font);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
}
.feedback-submit:hover:not(:disabled) { background: #fff; }
.feedback-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.fb-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
}
.fb-success svg { width: 48px; height: 48px; color: var(--pdef-green); }
.fb-success p {
    margin: 0;
    font-family: var(--pdef-font);
    font-weight: 700;
    color: var(--pdef-green);
    font-size: 0.95rem;
}

} /* end @media (min-width: 768px) */
