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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
}

.terminal-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    max-height: 700px;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8),
                0 0 100px rgba(0, 255, 0, 0.1);
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
    animation: terminalGlow 3s ease-in-out infinite alternate;
}

@keyframes terminalGlow {
    0% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 100px rgba(0, 255, 0, 0.1); }
    100% { box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 120px rgba(0, 255, 0, 0.2); }
}

.terminal-header {
    background: #2d2d2d;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #444;
    border-radius: 12px 12px 0 0;
}

.terminal-buttons {
    display: flex;
    gap: 0.5rem;
}

.button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.button.close {
    background: #ff5f56;
}

.button.minimize {
    background: #ffbd2e;
}

.button.maximize {
    background: #27c93f;
}

.button:hover {
    transform: scale(1.2);
    filter: brightness(1.3);
}

.button:active {
    transform: scale(0.9);
}

.terminal-title {
    color: #888;
    font-size: 0.875rem;
    font-weight: 500;
}

.terminal-body {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #0a0a0a;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    border-radius: 0 0 12px 12px;
}

.output {
    margin-bottom: 1rem;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
}

.prompt {
    color: #00ff00;
    font-weight: bold;
    user-select: none;
    flex-shrink: 0;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: inherit;
    font-size: inherit;
    outline: none;
    flex: 1;
    min-width: 50px;
    caret-color: transparent;
    position: relative;
    z-index: 2;
    white-space: pre;
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background: #00ff00;
    animation: blink 1s infinite;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    pointer-events: none;
}

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

.command-output {
    margin: 0.5rem 0;
    padding: 0.25rem 0;
}

.error {
    color: #ff6b6b;
}

.success {
    color: #51cf66;
}

.info {
    color: #74c0fc;
}

.warning {
    color: #ffd43b;
}

.game-area {
    background: #111;
    border: 1px solid #333;
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 4px;
    font-family: monospace;
}

.ascii-art {
    color: #00ff00;
    font-size: 0.75rem;
    line-height: 1.2;
    white-space: pre;
    overflow-x: auto;
}

.help-section {
    margin: 1rem 0;
}

.help-category {
    color: #ffd43b;
    font-weight: bold;
    margin: 0.5rem 0 0.25rem 0;
}

.help-command {
    margin-left: 1rem;
    color: #00ff00;
}

.help-desc {
    margin-left: 2rem;
    color: #888;
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    .terminal-container {
        height: 95vh;
        max-height: none;
        border-radius: 8px;
    }
    
    .terminal-header {
        padding: 0.5rem 0.75rem;
    }
    
    .terminal-body {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .button {
        width: 10px;
        height: 10px;
    }
    
    .terminal-title {
        font-size: 0.75rem;
    }
    
    .cursor {
        width: 6px;
    }
}

@media (max-width: 480px) {
    .terminal-body {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
    
    .terminal-header {
        padding: 0.4rem 0.6rem;
    }
    
    .input-line {
        gap: 0.25rem;
    }
    
    .terminal-input {
        min-width: 30px;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}