* {
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #00ff00;
    font-family: 'Hack', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    margin: 0;
    padding: 10px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    min-height: 600px;
}

.terminal-window {
    background-color: #2e2e2e;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    overflow: hidden;
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background-color: #444;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    flex-shrink: 0;
}

.button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.red { background-color: #ff5f56; }
.yellow { background-color: #ffbd2e; }
.green { background-color: #27c93f; }

.title {
    color: #ccc;
    font-size: 0.9em;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terminal-body {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    font-size: 1em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

#terminal-output {
    height: 100%;
    overflow-y: auto;
    padding-right: 5px;
}

#terminal-output::-webkit-scrollbar {
    width: 6px;
}

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

#terminal-output::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}

#terminal-output::-webkit-scrollbar-thumb:hover {
    background: #777;
}

#terminal-input {
    background: transparent;
    border: none;
    color: #00ff00;
    outline: none;
    font-family: inherit;
    font-size: inherit;
    padding: 0;
    margin-left: 5px;
    flex: 1;
    min-width: 0;
}

.input-line {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin-top: 5px;
}

.prompt {
    color: #00ffff;
    white-space: nowrap;
    flex-shrink: 0;
}

.error {
    color: #ff5555;
}
.success {
    color: #00ff00;
}
.info {
    color: #ffff00;
}

.hints-sidebar {
    background-color: #2e2e2e;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    padding: 20px;
    flex: 1;
    color: #ccc;
    font-size: 0.9em;
    overflow-y: auto;
    min-width: 250px;
}

.hints-sidebar h2 {
    color: #00ffff;
    margin-top: 0;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    font-size: 1.2em;
}

.hints-sidebar ul {
    list-style: none;
    padding: 0;
}

.hints-sidebar li {
    margin-bottom: 10px;
    background-color: #3e3e3e;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid #00ff00;
}

.hints-sidebar li code {
    background-color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 3px;
    color: #00ff00;
    font-size: 0.9em;
}

/* Mobile and Tablet Responsive Design */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: 90vh;
        gap: 15px;
    }
    
    .terminal-window {
        flex: none;
        height: 60vh;
        min-height: 400px;
    }
    
    .hints-sidebar {
        flex: none;
        height: auto;
        min-height: 200px;
        min-width: auto;
    }
    
    .title {
        font-size: 0.8em;
    }
}

@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        gap: 10px;
        height: auto;
        min-height: 95vh;
    }
    
    .terminal-window {
        height: 55vh;
        min-height: 350px;
    }
    
    .terminal-body {
        padding: 10px;
        font-size: 0.9em;
    }
    
    .hints-sidebar {
        padding: 15px;
        font-size: 0.8em;
    }
    
    .hints-sidebar h2 {
        font-size: 1.1em;
    }
    
    .title {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 2px;
    }
    
    .container {
        gap: 8px;
        min-height: 98vh;
    }
    
    .terminal-window {
        height: 50vh;
        min-height: 300px;
    }
    
    .terminal-header {
        padding: 6px 10px;
    }
    
    .terminal-body {
        padding: 8px;
        font-size: 0.8em;
    }
    
    .hints-sidebar {
        padding: 12px;
        font-size: 0.75em;
    }
    
    .button {
        width: 10px;
        height: 10px;
        margin-right: 6px;
    }
    
    .title {
        font-size: 0.6em;
    }
    
    .prompt {
        font-size: 0.9em;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        flex-direction: row;
        height: 90vh;
    }
    
    .terminal-window {
        height: auto;
        flex: 2;
    }
    
    .hints-sidebar {
        flex: 1;
        height: auto;
        min-width: 200px;
    }
}

/* Ultra-wide screen optimization */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .terminal-body {
        font-size: 1.1em;
    }
    
    .hints-sidebar {
        font-size: 1em;
    }
}

/* High DPI screen adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .terminal-body {
        font-size: 0.95em;
        line-height: 1.4;
    }
}