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

body {
    font-family: 'Monaco', 'Courier New', monospace;
    background: linear-gradient(135deg, #1e1e2e 0%, #0f0f1e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#terminalWrapper {
    min-width: 50%;
}

.terminal-container {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    width: 100%;
    max-width: 1000px;
    height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.terminal-container.maximized {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 0;
    z-index: 9999;
}

.terminal-container.minimized {
    max-width: 300px;
    height: auto;
}

.terminal-container.minimized .terminal-content {
    display: none;
}

.terminal-header {
    background: linear-gradient(to bottom, #21262d, #161b22);
    border-bottom: 1px solid #30363d;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.terminal-title {
    color: #c9d1d9;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-controls button {
    background: none;
    border: none;
    color: #8b949e;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s;
}

.terminal-controls button:hover {
    background: #30363d;
    color: #c9d1d9;
}

.btn-close:hover {
    background: #f85149;
    color: #0d1117;
}

.terminal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0d1117;
    position: relative;
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    color: #c9d1d9;
    font-size: 13px;
    line-height: 1.6;
    background: #0d1117;
    display: flex;
    flex-direction: column;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.terminal-output::-webkit-scrollbar {
    width: 8px;
}

.terminal-output::-webkit-scrollbar-track {
    background: #0d1117;
}

.terminal-output::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.terminal-output::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.terminal-line {
    margin-bottom: 0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.snake-game-line {
    line-height: 1;
    font-size: 11px;
    height: 11px;
    letter-spacing: 5px;
}

.terminal-line.input {
    color: #58a6ff;
}

.terminal-line.output {
    color: #c9d1d9;
}

.terminal-line.error {
    color: #f85149;
}

.terminal-line.success {
    color: #3fb950;
}

.terminal-line.info {
    color: #79c0ff;
}

.terminal-line.prompt {
    display: flex;
    align-items: center;
    gap: 0;
}

.welcome-message {
    color: #58a6ff;
    margin-bottom: 8px;
}

.prompt-text {
    color: #79c0ff;
    font-weight: bold;
    user-select: none;
}

.separator {
    color: #8b949e;
    margin: 0 2px;
    user-select: none;
}

.current-path {
    color: #3fb950;
    font-weight: bold;
    user-select: none;
}

.terminal-input {
    background: transparent;
    border: none;
    color: #c9d1d9;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    outline: none;
    flex: 1;
    padding: 0;
    margin: 0;
}

.terminal-input::placeholder {
    color: #6e7681;
}

@media (max-width: 768px) {
    .terminal-container {
        height: 400px;
    }
    
    .terminal-output {
        font-size: 11px;
    }
}

.reopen-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #58a6ff 0%, #79c0ff 100%);
    color: #0d1117;
    border: none;
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.4);
    transition: all 0.3s ease;
}

.reopen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.6);
}

.editor-mode {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 4px;
    margin: 8px 0;
    padding: 0;
}

.editor-header {
    background: #21262d;
    border-bottom: 1px solid #30363d;
    padding: 8px 12px;
    color: #79c0ff;
    font-size: 12px;
    font-weight: bold;
}

.editor-textarea {
    width: 100%;
    height: 250px;
    background: #0d1117;
    color: #c9d1d9;
    border: none;
    padding: 12px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    resize: none;
    outline: none;
}
