* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;              
}

body {
  height: var(--app-height, 100dvh); 
  background-color: #0a0a0a;
  color: #00ff41;
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  padding: clamp(10px, 2.5vw, 20px);
  display: flex;
  flex-direction: column;
  /* remove isso: min-height: 100dvh; */
  overflow: hidden;
}

.scanline {
    width: 100%; height: 2px;
    background: rgba(0, 255, 65, 0.1);
    position: fixed; top: 0; left: 0;
    z-index: 10;
    pointer-events: none;
    animation: scan 4s linear infinite;
}

@keyframes scan {
    from { top: 0; } to { top: 100%; }
}

.terminal-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 12px;
}

.line {
    margin-bottom: 5px;
    line-height: 1.3;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.artifact-header {
    color: #9dffb5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.input-area {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    border-top: 1px solid #00ff41;
    padding-top: 10px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    background: #0a0a0a;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #00ff41;
    font-family: inherit;
    font-size: clamp(16px, 3.8vw, 20px);
    outline: none;
    width: 100%;
}

.prompt { margin-right: 10px; }

.glitch-red {
    animation: red-flash 0.3s infinite;
}

@keyframes red-flash {
    0% { background-color: rgba(255, 0, 0, 0.2); }
    50% { background-color: rgba(100, 0, 0, 0.5); }
    100% { background-color: rgba(255, 0, 0, 0.2); }
}

.shake {
    animation: shake-anim 0.2s double;
}

@keyframes shake-anim {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    40% { transform: translate(3px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    80% { transform: translate(3px, -1px) rotate(1deg); }
    100% { transform: translate(1px, 1px) rotate(0deg); }
}

@media (max-width: 767px) {
    .scanline {
        height: 1px;
    }

    .prompt {
        margin-right: 8px;
    }
}
