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

body {
    font-family: 'Courier New', 'Monaco', monospace;
    background: #000000;
    color: #00ffff;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Scanline effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.03) 0px,
        transparent 1px,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 3px
    );
    pointer-events: none;
    z-index: 1000;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { transform: translateY(0); }
    100% { transform: translateY(10px); }
}

.machine-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
}

.title-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    min-height: 190px;
    margin-bottom: 25px;
    z-index: 1;
}

.title-container canvas {
    display: block !important;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
    height: auto;
}

.machine-interface {
    width: 100%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    position: relative;
    flex: 1;
}

.input-panel,
.output-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-panel {
    min-width: 0;
}

.output-panel {
    min-width: 0;
}

.input-section {
    position: relative;
}

.corrupted-input {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #000000;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    padding: 15px;
    resize: none;
    outline: none;
    border-radius: 12px;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.5),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    transition: all 0.3s;
    letter-spacing: 1px;
}

.corrupted-input::placeholder {
    color: #008080;
    opacity: 0.6;
}

.corrupted-input:focus {
    border-color: #ff00ff;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.8),
        0 0 40px rgba(255, 0, 255, 0.4),
        inset 0 0 20px rgba(255, 0, 255, 0.2);
    animation: glitch-border 0.3s infinite;
}

@keyframes glitch-border {
    0%, 100% { border-color: #ff00ff; }
    50% { border-color: #00ffff; }
}

.char-count {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: #00ffff;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    opacity: 0.6;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.8);
}

.char-count.warning {
    color: #ff00ff;
    opacity: 1;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.controls-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.corrupted-select {
    background: #000000;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 10px 18px;
    outline: none;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.corrupted-select:hover,
.corrupted-select:focus {
    border-color: #ff00ff;
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
    background: rgba(255, 0, 255, 0.05);
}

.corrupted-select option {
    background: #000000;
    color: #00ffff;
}

.corrupted-button {
    width: 100%;
    padding: 15px;
    background: #000000;
    border: 3px solid #ff00ff;
    color: #ff00ff;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.6),
        inset 0 0 20px rgba(255, 0, 255, 0.1);
    transition: all 0.3s;
}

.corrupted-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 0, 255, 0.4), transparent);
    transition: left 0.5s;
}

.corrupted-button:hover::before {
    left: 100%;
}

.corrupted-button:hover {
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 60px rgba(0, 255, 255, 0.4),
        inset 0 0 30px rgba(0, 255, 255, 0.2);
    transform: scale(1.02);
}

.corrupted-button:active {
    transform: scale(0.98);
    box-shadow: 
        0 0 50px rgba(255, 0, 255, 1),
        inset 0 0 50px rgba(255, 0, 255, 0.3);
}

.button-text {
    position: relative;
    z-index: 1;
    display: block;
}

.button-glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ff00ff;
    opacity: 0;
    z-index: 0;
}

.corrupted-button:active .button-glitch {
    animation: button-glitch 0.3s;
}

@keyframes button-glitch {
    0% { opacity: 0; transform: translateX(0); }
    25% { opacity: 0.8; transform: translateX(-5px); }
    50% { opacity: 0.4; transform: translateX(5px); }
    75% { opacity: 0.8; transform: translateX(-3px); }
    100% { opacity: 0; transform: translateX(0); }
}

.output-section {
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.corrupted-output {
    width: 100%;
    flex: 1;
    min-height: 400px;
    background: #000000;
    border: 2px solid #00ffff;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.5),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
    letter-spacing: 1px;
    position: relative;
    overflow-y: auto;
}

.corrupted-output::before {
    content: '> ';
    color: #00ff00;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.corrupted-output:empty::before {
    content: '> AWAITING CORRUPTION OUTPUT...';
    color: #008080;
    opacity: 0.5;
}

.copy-button {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: #000000;
    border: 2px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.copy-button:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    transform: translateY(-2px);
}

.copy-button:active {
    transform: translateY(0);
}

.error-message {
    margin-top: 8px;
    padding: 12px;
    background: rgba(255, 0, 0, 0.1);
    border: 2px solid #ff0000;
    color: #ff0000;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    animation: error-glitch 0.5s;
}

@keyframes error-glitch {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

/* Transformation animation */
@keyframes corrupt {
    0% {
        filter: hue-rotate(0deg) saturate(1);
        transform: scale(1);
    }
    25% {
        filter: hue-rotate(90deg) saturate(2);
        transform: scale(1.05) rotate(1deg);
    }
    50% {
        filter: hue-rotate(180deg) saturate(3);
        transform: scale(0.95) rotate(-1deg);
    }
    75% {
        filter: hue-rotate(270deg) saturate(2);
        transform: scale(1.02) rotate(0.5deg);
    }
    100% {
        filter: hue-rotate(360deg) saturate(1);
        transform: scale(1);
    }
}

.corrupting {
    animation: corrupt 0.8s ease-in-out;
}

@media (max-width: 1024px) {
    .machine-interface {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .corrupted-input,
    .corrupted-output {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .machine-container {
        padding: 15px;
    }
    
    .title-container {
        margin-bottom: 20px;
        min-height: 120px;
    }
    
    .corrupted-input,
    .corrupted-output {
        font-size: 0.9rem;
        padding: 12px;
        min-height: 250px;
    }
    
    .corrupted-button {
        font-size: 1rem;
        padding: 12px;
        letter-spacing: 1px;
    }
}
