/* ===== PLATTENBAU.CSS ===== */

:root {
    --bg-main: #d2d2d2;
    --bg-panel: #bcbcbc;
    --bg-concrete: #c7c7c7;
    --border-dark: #6f6f6f;
    --border-light: #eeeeee;
    --text-main: #1a1a1a;
    --accent-red: #8b1e1e;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Courier New", Courier, monospace;
    background:
        repeating-linear-gradient(
            90deg,
            #d0d0d0 0px,
            #d0d0d0 40px,
            #c9c9c9 40px,
            #c9c9c9 80px
        );
    color: var(--text-main);
    line-height: 1.6;
}

/* ===== HEADER ===== */

header {
    background: var(--bg-panel);
    border-bottom: 5px solid var(--border-dark);
    padding: 1rem 2rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

header .meta {
    font-size: 0.8rem;
    opacity: 0.8;
}

nav {
    margin-top: 0.8rem;
}

nav a {
    margin-right: 1.5rem;
    text-decoration: none;
    color: var(--text-main);
    padding-bottom: 2px;
    border-bottom: 3px solid transparent;
}

nav a:hover {
    border-bottom: 3px solid var(--accent-red);
}

/* ===== LAYOUT ===== */

.container {
    max-width: 1200px;
    margin: 2rem auto;
    display: grid;
    gap: 1.5rem;
    padding: 0 1rem;
    grid-template-columns: minmax(0, 1fr);
}

.container.with-elevator {
    grid-template-columns: 320px minmax(0, 1fr);
    align-items: start;
}

@media (max-width: 900px) {
    .container.with-elevator {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ===== SIDEBAR (TREPPENHAUS) ===== */

aside {
    background: var(--bg-concrete);
    border: 3px solid var(--border-dark);
    padding: 1rem;
    font-size: 0.85rem;
}

aside h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    border-left: 5px solid var(--accent-red);
    padding-left: 0.4rem;
}

/* ===== AUFZUGSTAFEL ===== */

.elevator {
    background: #bdbdbd;
    border: 4px solid var(--border-dark);
    padding: 1rem;
    font-size: 0.8rem;
    box-shadow:
        inset 2px 2px 0 var(--border-light),
        inset -2px -2px 0 var(--border-dark);
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.elevator-header {
    text-align: center;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border-dark);
    padding-bottom: 0.5rem;
}

.elevator-header span {
    font-size: 0.65rem;
    font-weight: normal;
    opacity: 0.8;
}

.panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.floor {
    background: #d8d8d8;
    border: 2px solid var(--border-dark);
    font-family: "Courier New", monospace;
    font-size: 1rem;
    padding: 0.6rem 0;
    cursor: default;
    box-shadow:
        inset 1px 1px 0 var(--border-light),
        inset -1px -1px 0 var(--border-dark);
}

.floor:active {
    box-shadow:
        inset -1px -1px 0 var(--border-light),
        inset 1px 1px 0 var(--border-dark);
}

.floor.active {
    background: #8b1e1e;
    color: #fff;
    border-color: #5f1212;
}

.elevator .akten {
    margin-top: 0.8rem;
    background: #b5b5b5;
    padding: 0.4rem;
    border: 2px dashed var(--border-dark);
    text-align: center;
}

/* ===== FLACKER-EFFEKT ===== */

@keyframes flicker {
    0%   { opacity: 1; }
    5%   { opacity: 0.4; }
    10%  { opacity: 1; }
    15%  { opacity: 0.6; }
    20%  { opacity: 1; }
    100% { opacity: 1; }
}

/* leichtes unregelmäßiges Flackern */
.flicker {
    animation: flicker 2.8s infinite;
}

/* stärkeres Flackern (defekt) */
.flicker-bad {
    animation: flicker 1.4s infinite;
}

.akten {
    margin-top: 1rem;
    background: #bdbdbd;
    padding: 0.5rem;
    border: 2px dashed var(--border-dark);
}

/* ===== MAIN CONTENT ===== */

main {
    background: #e1e1e1;
    padding: 2rem;
    border: 4px solid var(--border-dark);
    box-shadow:
        inset 3px 3px 0 var(--border-light),
        inset -3px -3px 0 var(--border-dark);
    min-width: 0;
    overflow-wrap: break-word;
    width: 100%;
}

h1, h2, h3 {
    text-transform: uppercase;
    border-left: 6px solid var(--accent-red);
    padding-left: 0.6rem;
}

p {
    margin: 1rem 0;
}

main a {
    color: var(--accent-red);
    font-weight: bold;
    text-decoration: none;
}

main a:hover {
    text-decoration: underline;
}

/* ===== CODE ===== */

pre {
    background: #cfcfcf;
    padding: 1rem;
    border-left: 6px solid var(--border-dark);
    overflow-x: auto;
}

code {
    font-family: "Courier New", monospace;
}

/* ===== STAMPS ===== */

.stamp {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 2px solid var(--accent-red);
    color: var(--accent-red);
    font-weight: bold;
    transform: rotate(-3deg);
    margin-top: 1rem;
}

/* ===== FOOTER ===== */

footer {
    margin-top: 4rem;
    background: var(--bg-panel);
    border-top: 5px solid var(--border-dark);
    padding: 1rem 2rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

footer .build {
    font-family: monospace;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ===== BACK TO TOP ===== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-panel);
    border: 2px solid var(--border-dark);
    color: var(--text-main);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 
        inset 2px 2px 0 var(--border-light),
        inset -2px -2px 0 var(--border-dark);
    z-index: 100;
    transition: transform 0.1s;
    opacity: 0.8;
}

.back-to-top:hover {
    background: #d0d0d0;
    opacity: 1;
}

.back-to-top:active {
    box-shadow: 
        inset -2px -2px 0 var(--border-light),
        inset 2px 2px 0 var(--border-dark);
    transform: translateY(2px);
}
