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

body {
    font-family: 'Courier New', Courier, monospace;
    background: #0a0a0a;
    min-height: 100vh;
    padding: 0;
    color: #ffffff;
    overflow-x: hidden;
    zoom: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
}

body > img {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

body > canvas:not(#editorCanvas):not(#previewCanvas) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

body > div:not(.wrapper) {
    display: none !important;
}

.wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
    gap: 20px;
    position: relative;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 0;
    border: 2px solid #333;
    padding: 30px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: scale(0.95);
    animation: containerFadeIn 0.8s ease-out forwards;
    position: relative;
    order: 1;
}

.container.compact {
    max-width: 600px;
    margin-top: 450px;
    transition: max-width 0.8s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.container.expanded {
    max-width: 1200px;
    margin-top: 0;
}

@keyframes containerFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ascii-title {
    text-align: center;
    color: #ffffff;
    margin-bottom: 10px;
    font-size: 10px;
    line-height: 1.2;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.ascii-cutter {
    display: none;
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
}

.ascii-cutter.visible {
    display: block;
    animation: asciiCutterFadeIn 0.6s ease-out forwards;
}

@keyframes asciiCutterFadeIn {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ascii-title.hidden {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
}

.subtitle {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 16px;
    letter-spacing: 3px;
    opacity: 1;
    max-height: 50px;
    transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease;
}

.subtitle.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
    overflow: hidden;
}

h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: normal;
    letter-spacing: 2px;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.load-banner-group {
    display: flex;
    gap: 0;
}

.load-banner-group .btn {
    border-radius: 0;
}

.load-banner-group .btn:first-child {
    border-right: none;
}

.btn-arrow {
    padding: 12px 16px;
    min-width: auto;
}

.btn {
    padding: 12px 24px;
    border: 2px solid #ffffff;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
    background: transparent;
    color: #ffffff;
}

.btn:hover:not(:disabled) {
    background: #ffffff;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #333;
    color: #333;
}

.btn-primary {
    border-color: #5865F2;
    color: #5865F2;
}

.btn-primary:hover:not(:disabled) {
    background: #5865F2;
    color: #0a0a0a;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

.btn-success {
    border-color: #ffffff;
    color: #ffffff;
    display: none;
    opacity: 0;
    transform: scale(0.9);
}

.btn-success.visible {
    display: inline-block;
    animation: buttonFadeIn 0.5s ease-out forwards;
}

@keyframes buttonFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.btn-success:hover:not(:disabled) {
    background: #ffffff;
    color: #0a0a0a;
}

.url-input-section {
    margin-bottom: 30px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.url-label {
    color: #ffffff;
    font-size: 14px;
    margin-bottom: 10px;
}

.url-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-input {
    flex: 1;
    padding: 12px 16px;
    background: #0f0f0f;
    border: 2px solid #333;
    border-radius: 0;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    transition: border-color 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: #5865F2;
    box-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

.url-input::placeholder {
    color: #666;
}

.url-hint {
    color: #666;
    font-size: 12px;
    margin: 5px 0 0 0;
}

.url-hint strong {
    color: #43b581;
    font-weight: bold;
}

.info {
    background: #0f0f0f;
    padding: 15px;
    border: 1px solid #333;
    margin-bottom: 0;
    border-left: 3px solid #ffffff;
}

.info p {
    margin: 5px 0;
    color: #ffffff;
    font-size: 14px;
}

.info p.controls-line {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease 0.3s, max-height 0.5s ease 0.3s;
}

.info p.controls-line.visible {
    opacity: 1;
    max-height: 30px;
}

.info p.size-info {
    opacity: 1;
    max-height: 30px;
    transition: opacity 0.5s ease, max-height 0.5s ease;
}

.info p.size-info.hidden {
    opacity: 0;
    max-height: 0;
    margin: 0;
}

.progress-container {
    background: #0f0f0f;
    padding: 15px;
    border: 1px solid #333;
    margin-bottom: 0;
    border-left: 3px solid #5865F2;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.progress-container.visible {
    opacity: 1;
    max-height: 150px;
}

.progress-text {
    margin: 0 0 10px 0;
    color: #ffffff;
    font-size: 14px;
}

.progress-bar {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
}

#progressFill {
    color: #5865F2;
}

.editor-section, .preview-section {
    margin-top: 0;
    margin-bottom: 30px;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.1s;
}

.editor-section.visible, .preview-section.visible {
    display: flex;
    max-height: 2000px;
    animation: sectionFadeIn 0.7s ease-out forwards;
}

.editor-section.visible {
    animation-delay: 0.4s;
}

.preview-section.visible {
    animation-delay: 0.6s;
}

@keyframes sectionFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.canvas-container {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
}

canvas {
    border: 2px solid #333;
    border-radius: 0;
    cursor: grab;
    background: #1E1F22;
    max-width: 100%;
    height: auto;
}

canvas:active {
    cursor: grabbing;
}

.hint {
    text-align: center;
    color: #666;
    font-size: 12px;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .ascii-title {
        font-size: 8px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

.footer {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 0;
    border: 2px solid #333;
    padding: 15px 30px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    animation: footerFadeIn 0.8s ease-out 0.3s forwards;
    order: 2;
}

@keyframes footerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.footer.move-up {
    order: 0;
    max-width: 1200px;
}

.footer p {
    margin: 0;
    color: #666;
    font-size: 12px;
    letter-spacing: 1px;
}

.footer a {
    color: #5865F2;
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.footer a:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(88, 101, 242, 0.5);
}
