
:root {
    color-scheme: dark;
    --bg: #0d1724;
    --panel: #101c2a;
    --panel-deep: #080d14;
    --blue: #78a4d4;
    --blue-bright: #b0d4f8;
    --blue-dim: #4464a0;
    --green: #749c38;
    --green-border: #314e2c;
    --green-text: #b8c060;
    --orange: #e88808;
    --red: #e84014;
    --text: #adc4c0;
    --line: #233b22;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    overflow: hidden;
    background-color: var(--bg);
    background-image:
    repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.72) 0,
                              rgba(0, 0, 0, 0.72) 2px,
                              transparent 2px,
                              transparent 4px
    );
    color: var(--blue);
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
}

/* Terminal-Kopfzeile */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px;
    padding: 12px;
    background: rgba(13, 23, 36, 0.94);
    border: 1px solid var(--green-border);
    border-radius: 3px;
    box-shadow: 0 0 12px rgba(120, 164, 212, 0.08);
}

h1,
h2,
h3 {
    color: #688cc4;
    font-family: "Arial Narrow", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

h1 {
    margin: 0;
    font-size: 19px;
}

h2 {
    margin: 0 0 18px;
    font-size: 16px;
    text-align: left;
}

h3 {
    font-size: 14px;
}

/* Bedienfeld */

.toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

button,
.file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #4464a0;
    border-radius: 2px;
    background:
    repeating-linear-gradient(
        to bottom,
        #1c5063 0,
        #1c5063 2px,
        #172d49 2px,
        #172d49 4px
    );
    color: var(--blue-bright);
    font: bold 12px "Courier New", monospace;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(120, 164, 212, 0.16);
}

button:hover,
.file-label:hover {
    border-color: var(--blue-bright);
    background:
    repeating-linear-gradient(
        to bottom,
        #688cc4 0,
        #688cc4 2px,
        #78a4d4 2px,
        #78a4d4 4px
    );
    color: #0d1724;
    box-shadow: 0 0 10px rgba(120, 164, 212, 0.3);
}

button:focus-visible,
.file-label:focus-visible {
    outline: 2px solid var(--green-text);
    outline-offset: 3px;
}

#fileInput {
display: none;
}

#zoomLabel {
min-width: 58px;
color: var(--green-text);
text-align: center;
font-weight: bold;
}

/* Hauptlayout */

main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 10px 10px;
}

#mapPanel,
aside {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--green-border);
    border-radius: 3px;
    background: rgba(8, 13, 20, 0.96);
    box-shadow:
    inset 0 0 22px rgba(35, 59, 34, 0.12),
    0 0 8px rgba(0, 0, 0, 0.45);
}

/* Karten-Viewport */

#mapPanel {
background-image:
linear-gradient(rgba(68, 100, 160, 0.07) 1px, transparent 1px),
linear-gradient(90deg, rgba(68, 100, 160, 0.07) 1px, transparent 1px),
repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.16) 2px,
                          rgba(0, 0, 0, 0.16) 4px
);
background-size: 24px 24px, 24px 24px, auto;
}

#mapViewport {
display: block;
width: 100%;
height: 100%;
touch-action: none;
cursor: grab;
user-select: none;
}

#mapViewport.dragging {
cursor: grabbing;
}

#mapViewport .map-content {
transform-box: view-box;
transform-origin: 0 0;
}

#mapViewport .clickable {
cursor: pointer;
transition: filter 120ms ease;
}

#mapViewport .clickable:hover {
filter: brightness(1.25);
}

/* Ladebildschirm */

#emptyMessage {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
color: var(--blue);
text-align: center;
line-height: 1.8;
pointer-events: none;
text-transform: uppercase;
letter-spacing: 0.05em;
}

#emptyMessage strong {
display: inline-block;
margin-bottom: 8px;
color: var(--green-text);
text-shadow: 0 0 8px rgba(184, 192, 96, 0.18);
}

/* Informationskonsole */

aside {
    overflow: auto;
    padding: 16px;
    background-image:
    repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(0, 0, 0, 0.13) 2px,
                              rgba(0, 0, 0, 0.13) 4px
    );
}

aside h2::before {
    content: "[ ";
    color: var(--green);
}

aside h2::after {
    content: " ]";
    color: var(--green);
}

#infoTitle {
margin: 0 0 12px;
padding: 10px;
border: 1px solid var(--line);
background: rgba(28, 80, 99, 0.13);
color: var(--green-text);
font-size: 14px;
overflow-wrap: anywhere;
}

#infoText {
color: var(--text);
font-size: 13px;
line-height: 1.8;
white-space: pre-wrap;
overflow-wrap: anywhere;
}

#status {
margin-top: 20px;
padding-top: 12px;
border-top: 1px solid var(--green-border);
color: var(--green);
font-size: 11px;
line-height: 1.7;
overflow-wrap: anywhere;
}

#status::before {
content: "> SYSTEM STATUS: ";
color: var(--blue-dim);
}

.hint {
    margin-top: 18px;
    padding: 10px;
    border-left: 2px solid var(--orange);
    background: rgba(232, 136, 8, 0.04);
    color: #9aa9b9;
    font-size: 11px;
    line-height: 1.7;
}

/* Scrollbars */

* {
    scrollbar-width: thin;
    scrollbar-color: var(--green-border) var(--bg);
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: var(--bg);
}

*::-webkit-scrollbar-thumb {
    background: var(--green-border);
}

/* Kleine Statusdetails */

::selection {
    color: var(--bg);
    background: var(--blue);
}

/* Reduzierte Bewegung respektieren */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile-Terminal */

@media (max-width: 720px) {
    body {
        overflow: auto;
    }

    header {
        align-items: flex-start;
        margin: 6px;
        padding: 10px;
    }

    h1 {
        font-size: 16px;
    }

    .toolbar {
        width: 100%;
    }

    .file-label {
        flex: 1 1 100%;
    }

    main {
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 0 6px 6px;
        gap: 8px;
    }

    #mapPanel {
    flex: 0 0 58dvh;
    min-height: 300px;
    }

    aside {
        flex: 0 0 auto;
        min-height: 180px;
        overflow: visible;
    }

    button,
    .file-label {
        min-height: 40px;
    }
}

#mapPanel::after {
content: "";
position: absolute;
inset: 0;
z-index: 2;
pointer-events: none;

background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.22) 2px,
                                      rgba(0, 0, 0, 0.22) 4px
);

box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.22);
}

#infoTitle {
color: #b8c060;
border-left: 2px solid #749c38;
padding: 10px;
background: rgba(116, 156, 56, 0.08);
}

#infoText {
color: #adc4c0;
white-space: pre-wrap;
line-height: 1.8;
overflow-wrap: anywhere;
}

.selected {
    filter: drop-shadow(0 0 5px #78a4d4);
}
