/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000000;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* Header */
header {
    text-align: center;
    padding: 1rem 0; /* tighter */
    background: #000000; /* match body */
}

header .brand {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

header .logo {
    width: clamp(36px, 6.5vw, 56px);
    height: clamp(36px, 6.5vw, 56px);
    object-fit: contain;
    margin-top: -0.5rem;
}

header h1 {
    font-size: clamp(1.6rem, 5.2vw, 3rem);
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
}

header p {
    font-size: 1.2rem;
    color: #cccccc;
    font-style: italic;
}

/* Main content */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0; /* remove extra space */
}

.animation-container {
    text-align: center;
    max-width: none;
    width: 100%;
}

/* remove title/description */

/* ASCII Animation */
.ascii-animation {
    background: #000000;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: clamp(0.1rem, 2vw, 0.5rem); /* responsive ascii size */
    line-height: 1;
    color: #ffffff;
    min-height: 84svh; /* take most of the page, tighter on mobile */
    display: flex;
    align-items: flex-start; /* push content toward header */
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: none;
    padding-top: 2vh; /* small top breathing room */
}

.ascii-viewport {
    display: inline-block;
    will-change: transform;
}

.ascii-animation pre {
    position: relative;
    z-index: 1;
    margin: 0;
    white-space: pre;
    font-weight: normal;
}

/* Controls */
/* removed controls */

/* Footer */
footer {
    text-align: center;
    padding: 0.75rem; /* tighter */
    background: #000000; /* match body */
    color: #888888;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: clamp(1.5rem, 6.2vw, 2rem);
    }
    
    header p {
        font-size: 1rem;
    }
    
    .animation-title h2 {
        font-size: 1.5rem;
    }
    
    .ascii-animation {
        font-size: clamp(0.1rem, 2.2vw, 0.45rem);
        padding: 0;
        min-height: 82vh;
        align-items: flex-start;
        padding-top: 1.5vh;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .controls button {
        width: 200px;
    }
}

@media (max-width: 480px) {
    .ascii-animation {
        font-size: clamp(0.1rem, 2.8vw, 0.42rem);
        padding: 0;
        min-height: 80vh;
        align-items: flex-start;
        padding-top: 1.5vh;
    }
}

/* Portrait phone: rotate animation for better fill */
@media (max-width: 600px) and (orientation: portrait) {
    .ascii-animation.portrait-rotate {
        align-items: center;
        padding-top: 0;
        min-height: 86svh;
    }
}