/* ==========================================================================
   1. GLOBAL / BODY LAYOUT (Zwingt Spalten-Layout für echtes Scrollen)
   ========================================================================== */
html, body {
  -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    margin: 0;
    padding: 0;
    background-color: #000000;
    font-family: monospace;
    color: #00ff00;
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
}

/* ==========================================================================
   2. EBENE 1: ASCII-BEREICH (GRID-FIX FÜR PERFEKTES STAPELN)
   ========================================================================== */
#ascii-placeholder, #ascii-section {
    justify-content: center; /* <-- Zwingt den Inhalt vertikal in die Mitte */ 
    0 !important; 
    padding: 40px 20px; /* <-- Drückt alles zusätzlich noch 40px nach unten! */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: unset !important;
    width: 100vw;
    padding: 0 !important;
    height: auto !important;
    box-sizing: border-box;
    background-color: #000000;
    flex-shrink: 0;
}

/* Zwingt ASCII-Art und Text genau in das gleiche Feld */
.ascii-wrapper {
    display: grid !important;
    place-items: center;
    width: 100%;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.4s ease-in-out forwards;
    animation-delay: 0.1s;
}

/* Beides landet in Spalte 1, Zeile 1 des Grids */
.ascii-wrapper > * {
    grid-area: 1 / 1;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#ascii-section pre {
    font-size: 11px;
    line-height: 1.2;
    margin: 0;
    user-select: none;
    color: #00ff00;
    z-index: 1; /* HG-Ebene */
}

.ascii-container {
    font-family: monospace !important;
    line-height: 0.40 !important;   
    letter-spacing: 0.9px !important;
    white-space: pre !important;    
    text-align: center;
    font-size: 0.9vh !important; 
}

.ascii-art {
    font-family: "Courier New", Courier, monospace !important;
    line-height: 0.75;
    letter-spacing: -0.5px;
    white-space: pre;
    text-align: center;
    font-size: 1vw; 
}

.scroll-hint {
    margin-top: 30px;
    font-size: 12px;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ==========================================================================
   3. OVERLAY TEXT (Schwebt genau mitten auf dem ASCII)
   ========================================================================== */
.center-overlay {
    z-index: 10 !important;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 90%;
    max-width: 600px;
}

.big-text {
    font-family: 'Jacquard 12', system-ui, sans-serif !important;
    font-size: 24px !important; /* Bleibt immer gleich groß (ca. 24px) */
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    background: linear-gradient(180deg, #e0e0e0 0%, #9e9e9e 50%, #5c5c5c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.85;
    filter: drop-shadow(4px 4px 0px rgba(0, 0, 0, 0.9)) 
            drop-shadow(0px 0px 10px rgba(200, 200, 200, 0.3));
    -webkit-font-smoothing: none;
    letter-spacing: 2px;
}

.sub-text {
    font-family: 'Jacquard 12', cursive !important;
    font-size: 1.1rem !important; /* Bleibt immer gleich groß (ca. 17.6px) */
    line-height: 1.2;
    text-align: center;
    width: 100%;
    max-width: 400px;
    margin: 10px auto 0 auto;
    background: linear-gradient(180deg, #e0e0e0 0%, #9e9e9e 50%, #5c5c5c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.85;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.9));
    -webkit-font-smoothing: none;
    letter-spacing: 1px;
}

.big-text, .sub-text {
    -webkit-text-size-adjust: none !important;
    text-size-adjust: none !important;
}


/* ==========================================================================
   4. EBENE 2: CANVAS & CONTAINER
   ========================================================================== */
#canvas-container {
    clear: both;
    display: block; 
    width: 100%;
    height: 600px;
    background-color: #000000;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

#canvas-container:active {
    cursor: grabbing;
}

#infinite-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    touch-action: none;
    flex-shrink: 0;
    background-color: #000000;
}

.ascii-frame {
    width: 100%;
    height: 500px;
    border: none;
    display: block;
    overflow: hidden;
}

/* ==========================================================================
   5. FIXIERTER BUTTON (Zurück nach oben)
   ========================================================================== */
#back-to-top {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 100;
    background: rgba(20, 20, 20, 0.85);
    color: #888888;
    border: 1px solid #444444;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 4px;
    user-select: none;
    transition: all 0.15s ease;
}

#back-to-top:hover {
    background: #333333;
    color: #ffffff;
    border-color: #666666;
}

#back-to-top:active {
    background-color: #111111 !important;
    color: #555555 !important;
    border-color: #222222 !important;
    transform: scale(0.95);
}

#back-to-top:focus {
    outline: none;
}

/* ==========================================================================
   6. RESPONSIVE (Handy-Anpassungen)
   ========================================================================== */
@media (max-width: 600px) {
    .ascii-art {
        font-size: 2.2vw;
    }
}