/* Dame mk – Retro CRT Design */

@font-face {
    font-family: 'VT323';
    src: url('../assets/fonts/VT323-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

/* ── 1. Reset + Body ─────────────────────────────────── */

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

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

/* ── 2. CRT Scanlines 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;
}

/* ── 3. Matrix Rain Canvas ───────────────────────────── */

#matrix-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.7;
}

/* ── 4. Wallpaper Background ─────────────────────────── */

.damk-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"] .damk-wallpaper-bg {
    opacity: 0.85;
}
body[data-bg="wallpaper"] .damk-wallpaper-bg {
    opacity: 0.85;
}

/* ── 5. Vignette Overlay ─────────────────────────────── */

.damk-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;
}

/* ── 6. Custom Cursor ────────────────────────────────── */

body.damk-custom-cursor, body.damk-custom-cursor * { cursor: none !important; }
/* Game canvas uses native hand cursors instead of custom dot */
#game-canvas { cursor: default !important; }
#game-canvas.damk-cursor-grab { cursor: grab !important; }
#game-canvas.damk-cursor-grabbing { cursor: grabbing !important; }
#game-canvas.damk-cursor-pointer { cursor: pointer !important; }
#game-canvas.damk-cursor-not-allowed { cursor: not-allowed !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: damk-cursorPulse 0.7s ease-in-out infinite;
}
#cursor-ring.is-hovering {
    width: 42px;
    height: 42px;
    opacity: 0.35;
}

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

/* ── 7. Footer ───────────────────────────────────────── */

.damk-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(--damk-font);
    letter-spacing: 0.08em;
}

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

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

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

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

/* ── 8. Screens ──────────────────────────────────────── */

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

/* ── 9. Hidden Class ─────────────────────────────────── */

.hidden {
    display: none !important;
}

/* ── 10. Start Screen ────────────────────────────────── */

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

.damk-subtitle {
    font-size: 1.2em;
    color: var(--damk-yellow);
    margin-bottom: 40px;
    text-align: center;
    animation: damk-blink 1s step-end infinite;
}

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

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

.damk-deco-piece {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px currentColor;
}
.damk-deco-green { background: var(--damk-green); color: var(--damk-green); }
.damk-deco-red { background: var(--damk-red); color: var(--damk-red); }

/* ── 11. Buttons ─────────────────────────────────────── */

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

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

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

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

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

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

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

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

/* ── 12. Difficulty Label ────────────────────────────── */

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

/* ── 13. Game Screen Container + HUD ─────────────────── */

.damk-game-container {
    position: absolute;
    inset: 0;
    bottom: 30px;
    display: flex;
    flex-direction: column;
}

.damk-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(--damk-dim);
    z-index: 10;
}

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

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

/* ── 29. Turn Indicator ──────────────────────────────── */

.damk-turn-indicator {
    text-align: center;
    padding: 4px 16px;
    font-size: 0.9em;
    background: rgba(0, 255, 65, 0.05);
    border-bottom: 1px solid var(--damk-dim);
    z-index: 10;
    letter-spacing: 2px;
}

/* ── 30. HUD Pieces Count ────────────────────────────── */

.damk-hud-pieces-green { color: var(--damk-green); }
.damk-hud-pieces-red { color: var(--damk-red); }

/* ── 14. Canvas Wrapper ──────────────────────────────── */

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

#game-canvas {
    display: block;
}

/* ── 15. Game Controls (Undo Button) ─────────────────── */

.damk-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(--damk-dim);
    z-index: 10;
}

.damk-ctrl-btn {
    font-family: var(--damk-font);
    font-size: 1em;
    background: rgba(0, 255, 65, 0.1);
    color: var(--damk-green);
    border: 1px solid var(--damk-green);
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 1px;
}
.damk-ctrl-btn:active {
    background: var(--damk-green);
    color: #000;
}

/* ── 16. Icon Buttons ────────────────────────────────── */

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

/* ── 17. Pause Overlay ───────────────────────────────── */

.damk-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;
}

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

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

/* ── 18. Star Wars Crawl Animation ───────────────────── */

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

/* ── 19. Guide Screen ────────────────────────────────── */

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

/* ── 20. Level Up / Round Complete Screen ────────────── */

.damk-level-complete {
    font-size: 2.5em;
    color: var(--damk-yellow);
    text-shadow: 0 0 20px var(--damk-yellow);
    margin-bottom: 20px;
}

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

/* ── 21. Game Over Animation ─────────────────────────── */

.damk-go-anim {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}
.damk-go-zoom {
    font-size: 3em;
    color: var(--damk-red);
    text-shadow: 0 0 20px var(--damk-red), 0 0 60px var(--damk-red);
    animation: damk-go-fly 2s ease-in forwards;
}
@keyframes damk-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(--damk-red), 0 0 80px #ff6600, 0 0 120px #ffe600; }
    100% { transform: scale(3); opacity: 0; }
}
.damk-go-zoom--quote {
    font-size: 1.4em;
    color: var(--damk-yellow);
    text-shadow: 0 0 20px var(--damk-yellow), 0 0 60px var(--damk-yellow);
    text-align: center;
    line-height: 1.4;
    animation: damk-go-fly-quote 2.2s ease-in forwards;
}
@keyframes damk-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(--damk-yellow), 0 0 60px #ff6600; }
    100% { transform: scale(2.5); opacity: 0; }
}
.damk-go-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 6;
}
.damk-go-quote {
    font-size: 1.1em;
    color: var(--damk-yellow);
    text-shadow: 0 0 10px rgba(255,230,0,0.4);
    text-align: center;
    margin-bottom: 20px;
    animation: damk-fadein 0.8s ease-out;
}
@keyframes damk-fadein {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

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

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

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

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

/* ── 22. Blink Border Animation ──────────────────────── */

.damk-blink-border {
    animation: damk-border-blink 1s step-end infinite;
}
@keyframes damk-border-blink {
    0%, 100% { border-color: var(--damk-green); }
    50% { border-color: var(--damk-yellow); box-shadow: 0 0 12px var(--damk-yellow); }
}

/* ── 23. Highscore Screen ────────────────────────────── */

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

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

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

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

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

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

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

/* ── 24. Settings Screen ─────────────────────────────── */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ── 25. Responsive ──────────────────────────────────── */

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

    /* HUD smaller */
    .damk-hud { font-size: 0.9em; padding: 4px 8px; }
    .damk-turn-indicator { font-size: 0.8em; padding: 3px 8px; }

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

/* ── 26. Easter Egg Overlay ──────────────────────────── */

.damk-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;
}
.damk-ee-text {
    font-size: 1.5em;
    color: var(--damk-red);
    text-align: center;
    line-height: 1.5;
    text-shadow: 0 0 20px var(--damk-red), 0 0 40px var(--damk-red);
    animation: damk-blink 0.8s step-end infinite;
    margin-bottom: 30px;
    z-index: 9002;
    position: relative;
}
.damk-ee-face {
    position: absolute;
    right: -300px;
    animation: damk-ee-slide 1.5s ease-out forwards;
}
.damk-ee-face-dummy {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--damk-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    color: #000;
    font-family: var(--damk-font);
    text-shadow: none;
    box-shadow: 0 0 40px var(--damk-yellow), 0 0 80px rgba(255, 230, 0, 0.3);
}
@keyframes damk-ee-slide {
    0%   { right: -300px; }
    100% { right: calc(50% - 100px); }
}

/* ── 27. Legal Pages (Impressum / Datenschutz) ───────── */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* ── 28. Footer Separator ────────────────────────────── */

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

/* ── Hide game controls on desktop ───────────────────── */

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

/* ── 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(--damk-green);
    color: #000;
    border: none;
    border-radius: 0 6px 6px 0;
    padding: 12px 10px;
    cursor: pointer;
    font-family: var(--damk-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(--damk-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(--damk-dim);
    flex-shrink: 0;
}
.feedback-panel-header h3 {
    margin: 0;
    font-family: var(--damk-font);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--damk-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(--damk-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(--damk-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(--damk-font);
    font-size: 0.9rem;
    color: var(--damk-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(--damk-dim);
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
    font-family: var(--damk-font);
    font-size: 0.85rem;
    color: #b0b8c0;
    transition: border-color 0.2s, color 0.2s;
}
.fb-type-btn:hover {
    border-color: var(--damk-green);
    color: var(--damk-green);
}
.fb-type-icon  { font-size: 1.2rem; line-height: 1; flex-shrink: 0; }
.fb-type-label { flex: 1; }
.fb-type-arrow { color: var(--damk-dim); flex-shrink: 0; font-family: var(--damk-font); }

.feedback-ratings {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.feedback-rating-btn {
    flex: 1;
    background: transparent;
    border: 2px solid var(--damk-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(--damk-green);
    transform: scale(1.08);
}
.feedback-rating-btn.selected {
    border-color: var(--damk-green);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

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

.feedback-textarea {
    width: 100%;
    border: 1px solid var(--damk-dim);
    border-radius: 4px;
    padding: 0.5rem 0.65rem;
    font-family: var(--damk-font);
    font-size: 0.85rem;
    color: var(--damk-green);
    background: #0a0a0a;
    resize: vertical;
    min-height: 68px;
    transition: border-color 0.2s;
}
.feedback-textarea:focus {
    outline: none;
    border-color: var(--damk-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(--damk-dim);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--damk-font);
    font-size: 0.8rem;
    color: #5a6570;
    transition: border-color 0.2s, color 0.2s;
}
.fb-screenshot-btn:hover {
    border-color: var(--damk-green);
    color: var(--damk-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(--damk-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(--damk-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(--damk-dim);
}
.fb-contact-question {
    font-family: var(--damk-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(--damk-font);
    font-size: 0.85rem;
    color: #b0b8c0;
    cursor: pointer;
}
.fb-radio input[type="radio"] { accent-color: var(--damk-green); cursor: pointer; }

.feedback-email {
    width: 100%;
    border: 1px solid var(--damk-dim);
    border-radius: 4px;
    padding: 0.45rem 0.65rem;
    font-family: var(--damk-font);
    font-size: 0.85rem;
    color: var(--damk-green);
    background: #0a0a0a;
    transition: border-color 0.2s;
}
.feedback-email:focus {
    outline: none;
    border-color: var(--damk-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(--damk-green);
    color: #000;
    border: none;
    border-radius: 4px;
    font-family: var(--damk-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(--damk-green); }
.fb-success p {
    margin: 0;
    font-family: var(--damk-font);
    font-weight: 700;
    color: var(--damk-green);
    font-size: 0.95rem;
}

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