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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(ellipse at center, #0c0c0c 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    touch-action: manipulation;
}

/* Космический фон */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 20s linear infinite;
    z-index: -1;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.cosmic-header {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#codeEditor {
    opacity: 0;
}

.stars-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 25% 25%, #fff, transparent),
        radial-gradient(1px 1px at 75% 75%, rgba(255,255,255,0.8), transparent);
    background-size: 50px 50px;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    position: relative;
    width: 60px;
    height: 60px;
}

.planet {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    position: absolute;
    top: 10px;
    left: 10px;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
    animation: rotate 10s linear infinite;
}

.orbit {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: absolute;
    top: 5px;
    left: 5px;
    animation: orbit 8s linear infinite;
}

.satellite {
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 25px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: satellite 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes orbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

@keyframes satellite {
    from { transform: rotate(0deg) translateX(25px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(25px) rotate(-360deg); }
}

.cosmic-header h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    margin: 0;
    font-weight: 300;
}

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.cosmic-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

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

.cosmic-btn:hover::before {
    left: 100%;
}

.cosmic-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cosmic-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(102, 126, 234, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.cosmic-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cosmic-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-icon {
    font-size: 16px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.btn-text {
    font-weight: 600;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

select, button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.auto-run-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-run-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
}

.auto-run-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
}

select {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    color: #495057;
}

select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#clearBtn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#clearBtn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.cosmic-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    min-height: 0;
}

.cosmic-panel {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.panel-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.editor-header, .output-header {
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h3, .output-header h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}


.editor-section, .output-section {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.editor-header {
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h3 {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.editor-container {
    height: 100%;
    position: relative;
}

.CodeMirror {
    height: 100% !important;
    font-family: 'Fira Code', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    border-radius: 15px;
}

.output-section {
    display: flex;
    flex-direction: column;
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(26, 26, 46, 0.5);
    border-radius: 15px 15px 0 0;
}

.output-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

#clearOutputBtn {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#clearOutputBtn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

#clearOutputBtn .btn-icon {
    font-size: 11px;
}

#clearOutputBtn .btn-text {
    font-size: 11px;
}

.output-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
    background: rgba(22, 22, 30, 0.9);
    color: #e2e8f0;
    border-radius: 0 0 20px 20px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #e2e8f0;
}

.welcome-message h4 {
    color: #667eea;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.welcome-message p {
    color: #a0aec0;
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.examples {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.examples h5 {
    color: #4ecdc4;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.examples ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.examples li {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.examples code {
    color: #feca57;
    font-family: 'Fira Code', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.output-area .log {
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.output-area .error {
    border-left-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    font-family: 'Fira Code', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    line-height: 1.4;
}

.output-area .error:before {
    content: '❌ ';
    margin-right: 8px;
    font-size: 14px;
}

.output-area .error.location {
    border-left-color: #ff8c00;
    background: rgba(255, 140, 0, 0.1);
    font-weight: 500;
}

.output-area .error.location:before {
    content: '📍 ';
    margin-right: 8px;
    font-size: 14px;
}

.output-area .error.header {
    border-left-color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
    font-weight: 600;
    font-size: 14px;
}

.output-area .error.header:before {
    content: '🔍 ';
    margin-right: 8px;
    font-size: 16px;
}

.output-area .warn {
    border-left-color: #ffd93d;
    background: rgba(255, 217, 61, 0.1);
}

.output-area .info {
    border-left-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.output-area .loading {
    border-left-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Подсветка активной строки */
.CodeMirror-activeline-background {
    background: rgba(102, 126, 234, 0.1) !important;
}

/* Улучшенная подсветка синтаксиса */
.cm-s-monokai .cm-variable {
    color: #f8f8f2;
}

.cm-s-monokai .cm-variable-2 {
    color: #f8f8f2;
}

.cm-s-monokai .cm-variable-3 {
    color: #f8f8f2;
}

.cm-s-monokai .cm-property {
    color: #a6e22e;
}

.cm-s-monokai .cm-operator {
    color: #f92672;
}

.cm-s-monokai .cm-keyword {
    color: #f92672;
}

.cm-s-monokai .cm-def {
    color: #fd971f;
}

.cm-s-monokai .cm-string {
    color: #e6db74;
}

.cm-s-monokai .cm-string-2 {
    color: #e6db74;
}

.cm-s-monokai .cm-number {
    color: #ae81ff;
}

.cm-s-monokai .cm-comment {
    color: #75715e;
    font-style: italic;
}

.cm-s-monokai .cm-meta {
    color: #75715e;
}

.cm-s-monokai .cm-qualifier {
    color: #fd971f;
}

.cm-s-monokai .cm-builtin {
    color: #66d9ef;
}

.cm-s-monokai .cm-bracket {
    color: #f8f8f2;
}

.cm-s-monokai .cm-tag {
    color: #f92672;
}

.cm-s-monokai .cm-attribute {
    color: #a6e22e;
}

.cm-s-monokai .cm-header {
    color: #ae81ff;
}

.cm-s-monokai .cm-quote {
    color: #e6db74;
}

.cm-s-monokai .cm-hr {
    color: #75715e;
}

.cm-s-monokai .cm-link {
    color: #66d9ef;
}

.cm-s-monokai .cm-negative {
    color: #f92672;
}

.cm-s-monokai .cm-positive {
    color: #a6e22e;
}

.cm-s-monokai .cm-strong {
    color: #f92672;
    font-weight: bold;
}

.cm-s-monokai .cm-em {
    color: #a6e22e;
    font-style: italic;
}

/* TypeScript специфичные стили */
.cm-s-monokai .cm-type {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-interface {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-enum {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-namespace {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-generic {
    color: #f92672;
}

.cm-s-monokai .cm-union {
    color: #ae81ff;
}

.cm-s-monokai .cm-intersection {
    color: #ae81ff;
}

.cm-s-monokai .cm-conditional {
    color: #f92672;
}

.cm-s-monokai .cm-optional {
    color: #fd971f;
}

.cm-s-monokai .cm-readonly {
    color: #a6e22e;
}

.cm-s-monokai .cm-export {
    color: #66d9ef;
}

.cm-s-monokai .cm-import {
    color: #66d9ef;
}

.cm-s-monokai .cm-async {
    color: #f92672;
}

.cm-s-monokai .cm-await {
    color: #f92672;
}

/* Дополнительная подсветка для TypeScript */
.cm-s-monokai .cm-type-definition {
    color: #66d9ef;
    font-weight: 600;
}

.cm-s-monokai .cm-type-annotation {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-parameter {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-constraint {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-union {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-intersection {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-conditional {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-mapped {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-template {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-infer {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-satisfies {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-assertion {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-const {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-readonly {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-optional {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-required {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-partial {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-pick {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-omit {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-record {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-return {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-parameters {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-keyof {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-typeof {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-instanceof {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-in {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-extends {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-implements {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-abstract {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-static {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-private {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-protected {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-public {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-get {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-set {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-decorator {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-namespace {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-module {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-export {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-import {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-default {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-named {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-as {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-from {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-to {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-of {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-is {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-any {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-unknown {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-never {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-void {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-null {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-undefined {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-object {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-string {
    color: #e6db74;
    font-weight: 500;
}

.cm-s-monokai .cm-type-number {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-boolean {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-symbol {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-bigint {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-function {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-array {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-tuple {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-enum {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-interface {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-class {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-type {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-const {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-let {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-var {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-return {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-throw {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-try {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-catch {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-finally {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-if {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-else {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-switch {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-case {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-default {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-for {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-while {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-do {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-break {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-continue {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-in {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-of {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-instanceof {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-new {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-delete {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-void {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-this {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-super {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-yield {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-await {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-async {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-generator {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-iterator {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-promise {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-observable {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-subject {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-behavior {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-replay {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-async {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-await {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-generator {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-iterator {
    color: #f92672;
    font-weight: 500;
}

.cm-s-monokai .cm-type-promise {
    color: #fd971f;
    font-weight: 500;
}

.cm-s-monokai .cm-type-observable {
    color: #66d9ef;
    font-weight: 500;
}

.cm-s-monokai .cm-type-subject {
    color: #a6e22e;
    font-weight: 500;
}

.cm-s-monokai .cm-type-behavior {
    color: #ae81ff;
    font-weight: 500;
}

.cm-s-monokai .cm-type-replay {
    color: #f92672;
    font-weight: 500;
}

/* Адаптивные стили для планшетов */
@media (max-width: 1024px) {
    .container {
        padding: 15px;
        gap: 15px;
    }

    .header h1 {
        font-size: 28px;
    }

    .subtitle {
        font-size: 14px;
    }

    .editor-container {
        height: 400px;
    }

    .output-area {
        height: 200px;
        font-size: 13px;
    }

    .controls {
        gap: 10px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .container {
        padding: 8px;
        gap: 8px;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .cosmic-header {
        padding: 15px;
        margin-bottom: 10px;
        border-radius: 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .title-section {
        flex-direction: column;
        gap: 10px;
    }

    .cosmic-header h1 {
        font-size: 20px;
        margin: 0;
    }

    .subtitle {
        font-size: 12px;
        margin: 0;
    }

    .controls {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .action-buttons {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .cosmic-btn {
        flex: 1;
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }

    .btn-icon {
        font-size: 14px;
    }

    .btn-text {
        font-size: 12px;
    }

    .auto-run-toggle {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .toggle-switch {
        transform: scale(0.9);
    }

    .cosmic-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-height: 0;
    }

    .editor-section, .output-section {
        flex: 1;
        min-height: 0;
    }

    .editor-container {
        height: 40vh;
        min-height: 200px;
    }

    .output-area {
        height: 25vh;
        min-height: 120px;
        font-size: 11px;
    }

    .CodeMirror {
        font-size: 12px;
        line-height: 1.3;
    }

    .CodeMirror-linenumbers {
        font-size: 10px;
    }

    .editor-header, .output-header {
        padding: 8px 12px;
        border-radius: 10px;
    }

    .editor-header h3, .output-header h3 {
        font-size: 14px;
    }

    /* Уменьшаем отступы в выводе */
    .output-area .log {
        padding: 4px 6px;
        margin-bottom: 2px;
        font-size: 11px;
        line-height: 1.2;
    }

    .output-area .error {
        font-size: 11px;
        line-height: 1.2;
    }

    .output-area .error:before,
    .output-area .error.location:before,
    .output-area .error.header:before {
        font-size: 10px;
        margin-right: 4px;
    }

    /* Компактные кнопки в заголовках */
    #clearOutputBtn {
        padding: 4px 8px;
        font-size: 10px;
        min-height: 24px;
        max-width: 100px;
    }

    #clearOutputBtn .btn-icon {
        font-size: 9px;
    }

    #clearOutputBtn .btn-text {
        font-size: 9px;
    }
}

/* Адаптивные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .container {
        padding: 5px;
        gap: 5px;
    }

    .cosmic-header {
        padding: 10px;
        border-radius: 12px;
    }

    .cosmic-header h1 {
        font-size: 18px;
    }

    .subtitle {
        font-size: 11px;
    }

    .cosmic-btn {
        padding: 8px 10px;
        font-size: 12px;
        min-height: 36px;
    }

    .btn-icon {
        font-size: 12px;
    }

    .btn-text {
        font-size: 11px;
    }

    .editor-container {
        height: 35vh;
        min-height: 180px;
    }

    .output-area {
        height: 20vh;
        min-height: 100px;
        font-size: 10px;
    }

    .CodeMirror {
        font-size: 11px;
        line-height: 1.2;
    }

    .CodeMirror-linenumbers {
        font-size: 9px;
    }

    .CodeMirror-linenumber {
        padding: 0 6px;
    }

    .editor-header h3, .output-header h3 {
        font-size: 13px;
    }

    .output-area .log {
        padding: 3px 5px;
        font-size: 10px;
    }

    .output-area .error {
        font-size: 10px;
    }

    .output-area .error:before,
    .output-area .error.location:before,
    .output-area .error.header:before {
        font-size: 9px;
        margin-right: 3px;
    }

    /* Уменьшаем иконки в кнопках */
    .btn:before {
        font-size: 10px;
        margin-right: 4px;
    }

    #clearOutputBtn {
        padding: 3px 6px;
        font-size: 8px;
        min-height: 20px;
    }

    #clearOutputBtn .btn-icon {
        font-size: 7px;
    }

    #clearOutputBtn .btn-text {
        font-size: 7px;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        padding: 5px;
        gap: 5px;
    }

    .cosmic-header {
        padding: 8px 12px;
        margin-bottom: 5px;
    }

    .header-content {
        flex-direction: row;
        gap: 15px;
        align-items: center;
    }

    .title-section {
        flex-direction: row;
        gap: 10px;
    }

    .cosmic-header h1 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 10px;
    }

    .controls {
        flex-direction: row;
        gap: 8px;
        flex-shrink: 0;
    }

    .action-buttons {
        gap: 6px;
    }

    .cosmic-btn {
        padding: 6px 10px;
        font-size: 11px;
        min-height: 32px;
    }

    .editor-container {
        height: 45vh;
        min-height: 150px;
    }

    .output-area {
        height: 30vh;
        min-height: 80px;
    }

    .cosmic-main {
        gap: 5px;
    }

    /* Компактная кнопка очистки для ландшафтной ориентации */
    #clearOutputBtn {
        padding: 3px 7px;
        font-size: 9px;
        min-height: 22px;
    }

    #clearOutputBtn .btn-icon {
        font-size: 8px;
    }

    #clearOutputBtn .btn-text {
        font-size: 8px;
    }
}

/* Улучшения для планшетов в портретной ориентации */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .container {
        padding: 15px;
        gap: 15px;
    }

    .editor-container {
        height: 45vh;
    }

    .output-area {
        height: 25vh;
    }
} 

/* Дополнительные оптимизации для очень маленьких экранов */
@media (max-width: 360px) {
    .container {
        padding: 3px;
        gap: 3px;
    }

    .cosmic-header {
        padding: 8px;
        border-radius: 10px;
    }

    .cosmic-header h1 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 10px;
    }

    .cosmic-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 32px;
    }

    .btn-icon {
        font-size: 11px;
    }

    .btn-text {
        font-size: 10px;
    }

    .editor-container {
        height: 30vh;
        min-height: 150px;
    }

    .output-area {
        height: 18vh;
        min-height: 80px;
        font-size: 9px;
    }

    .CodeMirror {
        font-size: 10px;
        line-height: 1.1;
    }

    .CodeMirror-linenumbers {
        font-size: 8px;
    }

    .CodeMirror-linenumber {
        padding: 0 4px;
    }

    .editor-header h3, .output-header h3 {
        font-size: 12px;
    }

    .output-area .log {
        padding: 2px 4px;
        font-size: 9px;
        line-height: 1.1;
    }

    .output-area .error {
        font-size: 9px;
        line-height: 1.1;
    }

    .output-area .error:before,
    .output-area .error.location:before,
    .output-area .error.header:before {
        font-size: 8px;
        margin-right: 2px;
    }

    #clearOutputBtn {
        padding: 2px 4px;
        font-size: 7px;
        min-height: 16px;
    }

    #clearOutputBtn .btn-icon {
        font-size: 6px;
    }

    #clearOutputBtn .btn-text {
        font-size: 6px;
    }
}

/* Оптимизации для высоких экранов */
@media (max-width: 768px) and (min-height: 800px) {
    .editor-container {
        height: 45vh;
        min-height: 250px;
    }

    .output-area {
        height: 30vh;
        min-height: 150px;
    }
}

/* Оптимизации для низких экранов */
@media (max-width: 768px) and (max-height: 600px) {
    .cosmic-header {
        padding: 8px 12px;
        margin-bottom: 5px;
    }

    .cosmic-header h1 {
        font-size: 16px;
    }

    .subtitle {
        font-size: 10px;
    }

    .editor-container {
        height: 35vh;
        min-height: 120px;
    }

    .output-area {
        height: 25vh;
        min-height: 80px;
    }
} 