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

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #1a202c;
            overflow: hidden;
        }

        .app-container {
            display: grid;
            grid-template-columns: 320px 1fr 350px;
            grid-template-rows: 80px 1fr;
            height: 100vh;
            max-width: 1800px;
            margin: 0 auto;
            gap: 15px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            box-shadow: 0 25px 50px rgba(0,0,0,0.15);
            overflow: hidden;
        }

        .header {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 20px;
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            border-radius: 15px;
            box-shadow: 0 8px 25px rgba(66, 153, 225, 0.3);
        }

        .header h1 {
            font-size: 2em;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .header .status-indicator {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #48bb78;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.7; transform: scale(1.1); }
        }

        .controls-panel {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow-y: auto;
            height: calc(100vh - 110px);
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .controls-panel::-webkit-scrollbar {
            width: 6px;
        }

        .controls-panel::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .controls-panel::-webkit-scrollbar-thumb {
            background: #4299e1;
            border-radius: 3px;
        }

        .experiment-area {
            position: relative;
            overflow-y: auto;
            border-radius: 15px;
            background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #e2e8f0 100%);
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            display: flex;
            flex-direction: column;
            height: calc(100vh - 110px);
            max-height: calc(100vh - 110px);
        }

        .info-button {
            position: absolute;
            top: 15px;
            right: 15px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            border: none;
            font-size: 18px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
            transition: all 0.3s ease;
            z-index: 100;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .info-button:hover {
            transform: scale(1.1);
            box-shadow: 0 6px 20px rgba(66, 153, 225, 0.5);
        }

        .info-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            backdrop-filter: blur(5px);
        }

        .info-modal.show {
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .info-modal-content {
            background: white;
            border-radius: 20px;
            max-width: 800px;
            max-height: 90vh;
            width: 90%;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from { transform: translateY(-50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .info-modal-header {
            background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
            color: white;
            padding: 20px 25px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .info-modal-header h2 {
            margin: 0;
            font-size: 1.5rem;
            font-weight: 600;
        }

        .close-button {
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s ease;
        }

        .close-button:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .info-modal-body {
            padding: 0;
            max-height: calc(90vh - 80px);
            overflow-y: auto;
        }

        .info-modal-body::-webkit-scrollbar {
            width: 8px;
        }

        .info-modal-body::-webkit-scrollbar-track {
            background: #f1f5f9;
        }

        .info-modal-body::-webkit-scrollbar-thumb {
            background: #4299e1;
            border-radius: 4px;
        }

        .feature-section {
            padding: 20px 25px;
            border-bottom: 1px solid #e2e8f0;
        }

        .feature-section:last-child {
            border-bottom: none;
        }

        .feature-section h3 {
            color: #2d3748;
            margin: 0 0 15px 0;
            font-size: 1.2rem;
            font-weight: 600;
        }

        .feature-section ul,
        .feature-section ol {
            margin: 0;
            padding-left: 20px;
        }

        .feature-section li {
            margin: 8px 0;
            line-height: 1.5;
            color: #4a5568;
        }

        .feature-section ul ul {
            margin-top: 5px;
            padding-left: 15px;
        }

        .feature-section ul ul li {
            margin: 4px 0;
            font-size: 0.9rem;
        }

        .feature-section strong {
            color: #2d3748;
            font-weight: 600;
        }

        .feature-section em {
            color: #3182ce;
            font-style: normal;
            font-weight: 500;
        }

        .experiment-area::-webkit-scrollbar {
            width: 10px;
        }

        .experiment-area::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 5px;
            margin: 5px 0;
        }

        .experiment-area::-webkit-scrollbar-thumb {
            background: linear-gradient(135deg, #4299e1, #3182ce);
            border-radius: 5px;
            border: 2px solid #f1f5f9;
        }

        .experiment-area::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(135deg, #3182ce, #2563eb);
        }

        .observations-panel {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            overflow-y: auto;
            height: calc(100vh - 110px);
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

        .observations-panel::-webkit-scrollbar {
            width: 6px;
        }

        .observations-panel::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .observations-panel::-webkit-scrollbar-thumb {
            background: #4299e1;
            border-radius: 3px;
        }

        .control-section {
            background: white;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.08);
        }

        .control-section h3 {
            color: #2d3748;
            margin-bottom: 15px;
            font-size: 1.1em;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .control-section h3::before {
            content: '⚙️';
            font-size: 1.2em;
        }

        .control-group {
            margin-bottom: 20px;
            padding: 15px;
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-radius: 10px;
            border: 1px solid #e2e8f0;
        }

        .control-group label {
            display: block;
            margin-bottom: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            color: #374151;
        }

        .control-group select {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e2e8f0;
            border-radius: 8px;
            background: white;
            color: #374151;
            font-size: 0.9rem;
            transition: all 0.2s ease;
        }

        .control-group select:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .speed-slider {
            width: 100%;
            height: 6px;
            border-radius: 5px;
            background: #e2e8f0;
            outline: none;
            -webkit-appearance: none;
            appearance: none;
            margin-bottom: 10px;
        }

        .speed-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
            box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
            transition: all 0.2s ease;
        }

        .speed-slider::-webkit-slider-thumb:hover {
            background: #2563eb;
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        }

        .speed-slider::-moz-range-thumb {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #3b82f6;
            cursor: pointer;
            border: none;
            box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
        }

        .speed-display {
            font-size: 0.8rem;
            color: #64748b;
            font-weight: 500;
            text-align: center;
        }

        #speedValue {
            color: #3b82f6;
            font-weight: 600;
        }

        .btn {
            width: 100%;
            padding: 12px 16px;
            border: none;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 8px;
        }

        .btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .btn-primary {
            background: linear-gradient(135deg, #3b82f6, #1e40af);
            color: white;
        }

        .btn-secondary {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
        }

        .simulation-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 25px;
            overflow: visible;
            min-height: fit-content;
        }

        .process-grid {
            display: grid;
            gap: 15px;
            margin-bottom: 25px;
            padding: 15px 0;
            min-height: fit-content;
        }

        .process-node {
            background: linear-gradient(135deg, #f8fafc, #e2e8f0);
            border-radius: 15px;
            padding: 15px;
            text-align: center;
            border: 2px solid #e2e8f0;
            transition: all 0.5s ease;
            position: relative;
        }

        .process-node.sending {
            border-color: #10b981;
            background: rgba(16, 185, 129, 0.1);
            animation: commPulseGreen 1.5s infinite;
        }

        .process-node.receiving {
            border-color: #3b82f6;
            background: rgba(59, 130, 246, 0.1);
            animation: commPulseBlue 1.5s infinite;
        }

        .process-node.computing {
            border-color: #f59e0b;
            background: rgba(245, 158, 11, 0.1);
            animation: pulseNode 2s infinite;
        }

        .process-id {
            font-size: 1rem;
            font-weight: bold;
            color: #1e40af;
            margin-bottom: 5px;
        }

        .process-status {
            font-size: 0.8rem;
            color: #64748b;
            margin-bottom: 3px;
        }

        .process-data {
            font-size: 0.7rem;
            color: #94a3b8;
        }

        .matrix-display {
            text-align: center;
            margin: 25px 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            min-height: 300px;
            padding: 20px 0;
        }

        .matrix-row {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 15px;
            margin: 20px 0;
            flex-wrap: wrap;
        }

        .matrix {
            display: inline-grid;
            gap: 2px;
            padding: 15px;
            background: white;
            border-radius: 12px;
            border: 2px solid #e2e8f0;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        }

        .matrix-cell {
            width: 35px;
            height: 35px;
            background: #f8fafc;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.9rem;
            font-weight: 600;
            color: #2d3748;
            transition: all 0.3s ease;
            cursor: pointer;
            border: 2px solid #e2e8f0;
        }

        .matrix-cell:hover {
            background: #e2e8f0;
            transform: scale(1.05);
            border-color: #3b82f6;
        }

        .matrix-cell.editable {
            background: #fff5f5;
            border-color: #3b82f6;
        }

        .matrix-cell.computing {
            animation: computingPulse 1s infinite;
            border-color: #f59e0b;
        }

        .matrix-cell.row-highlight {
            background: rgba(59, 130, 246, 0.3);
            border-color: #3b82f6;
            animation: rowPulse 1.5s infinite;
        }

        .matrix-cell.col-highlight {
            background: rgba(16, 185, 129, 0.3);
            border-color: #10b981;
            animation: colPulse 1.5s infinite;
        }

        .matrix-cell.multiplying {
            background: rgba(245, 158, 11, 0.4);    
            border-color: #f59e0b;
            animation: multiplyPulse 0.8s infinite;
            transform: scale(1.1);
        }

        .matrix-cell.process-0 { border-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
        .matrix-cell.process-1 { border-color: #10b981; background: rgba(16, 185, 129, 0.1); }
        .matrix-cell.process-2 { border-color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
        .matrix-cell.process-3 { border-color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
        .matrix-cell.process-4 { border-color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
        .matrix-cell.process-5 { border-color: #ec4899; background: rgba(236, 72, 153, 0.1); }
        .matrix-cell.process-6 { border-color: #06b6d4; background: rgba(6, 182, 212, 0.1); }
        .matrix-cell.process-7 { border-color: #84cc16; background: rgba(132, 204, 22, 0.1); }

        .matrix-operator {
            font-size: 1.5rem;
            font-weight: bold;
            color: #3b82f6;
            margin: 0 10px;
        }

        .progress-container {
            background: white;
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 15px;
            border: 1px solid #e2e8f0;
        }

        .progress-bar {
            width: 100%;
            height: 8px;
            background: #e2e8f0;
            border-radius: 4px;
            overflow: hidden;
            margin-top: 10px;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, #3b82f6, #1e40af);
            transition: width 0.3s ease;
            border-radius: 4px;
        }

        .status-section {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
            border-radius: 12px;
            padding: 15px;
            border: 1px solid #e2e8f0;
        }

        .status-section h4 {
            color: #2d3748;
            margin-bottom: 12px;
            font-size: 1em;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .status-section h4::before {
            content: '📊';
            font-size: 1.1em;
        }

        .stat-card {
            background: white;
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            border: 1px solid #e2e8f0;
            transition: all 0.3s ease;
            margin-bottom: 15px;
        }

        .stat-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        }

        .stat-value {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 5px;
        }

        .stat-label {
            font-size: 0.9rem;
            color: #64748b;
            font-weight: 500;
        }

        .stat-description {
            font-size: 0.75rem;
            color: #94a3b8;
            margin-top: 5px;
        }

        .code-download-card {
            background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
            border: 2px solid #0ea5e9;
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            transition: all 0.3s ease;
        }

        .code-download-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(14, 165, 233, 0.2);
        }

        .download-description {
            font-size: 0.9rem;
            color: #475569;
            margin-bottom: 15px;
            line-height: 1.5;
        }

        .download-btn {
            background: linear-gradient(135deg, #0ea5e9, #0284c7);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 12px 24px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin: 0 auto;
        }

        .download-btn:hover {
            background: linear-gradient(135deg, #0284c7, #0369a1);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
        }

        .download-icon {
            font-size: 1.2rem;
        }

        .logs-container {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 15px;
            max-height: 200px;
            overflow-y: auto;
            font-family: 'Consolas', 'Monaco', monospace;
        }

        .logs-container::-webkit-scrollbar {
            width: 6px;
        }

        .logs-container::-webkit-scrollbar-track {
            background: #f1f5f9;
            border-radius: 3px;
        }

        .logs-container::-webkit-scrollbar-thumb {
            background: #94a3b8;
            border-radius: 3px;
        }

        .log-entry {
            display: flex;
            margin-bottom: 8px;
            font-size: 0.8rem;
            line-height: 1.4;
        }

        .log-time {
            color: #64748b;
            font-weight: 500;
            margin-right: 10px;
            min-width: 70px;
        }

        .log-message {
            color: #374151;
            flex: 1;
        }

        .log-entry.info .log-message { color: #3b82f6; }
        .log-entry.success .log-message { color: #10b981; }
        .log-entry.warning .log-message { color: #f59e0b; }
        .log-entry.error .log-message { color: #ef4444; }

        #processCount { color: #3b82f6; }
        #matrixSize { color: #10b981; }

        @keyframes computingPulse {
            0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(245, 158, 11, 0.5); }
            50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(245, 158, 11, 0.8); }
        }

        @keyframes rowPulse {
            0%, 100% { box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
            50% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.7); }
        }

        @keyframes colPulse {
            0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
            50% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.7); }
        }

        @keyframes multiplyPulse {
            0%, 100% { 
                background: rgba(245, 158, 11, 0.4);
                box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
                transform: scale(1.1);
            }
            50% { 
                background: rgba(245, 158, 11, 0.6);
                box-shadow: 0 0 20px rgba(245, 158, 11, 0.9);
                transform: scale(1.15);
            }
        }

        @keyframes cellCalculation {
            0% { background: #f8fafc; transform: scale(1); }
            50% { background: #e2e8f0; transform: scale(1.1); }
            100% { background: #f8fafc; transform: scale(1); }
        }

        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(30px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes pulseNode {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.02); }
        }

        @keyframes commPulseGreen {
            0%, 100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.3); }
            50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.6); }
        }

        @keyframes commPulseBlue {
            0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
            50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.6); }
        }

        @media (max-width: 1200px) {
            .app-container {
                grid-template-columns: 1fr;
                grid-template-rows: 80px 1fr auto auto;
                height: 100vh;
                gap: 10px;
                padding: 10px;
            }
            
            .controls-panel {
                height: 300px;
                order: 2;
            }
            
            .experiment-area {
                order: 1;
                min-height: 400px;
            }
            
            .observations-panel {
                height: 250px;
                order: 3;
            }
        }
        
        @media (max-width: 768px) {
            .header h1 {
                font-size: 1.5em;
            }
            
            .control-group {
                padding: 12px;
            }
            
            .btn {
                padding: 8px 12px;
                font-size: 12px;
            }
        }
        
        /* Mobile Landscape Support - Desktop-like Experience */
        @media screen and (max-width: 968px) and (orientation: landscape) {
            .app-container {
                grid-template-columns: 280px 1fr 300px;
                grid-template-rows: 60px 1fr;
                gap: 10px;
                padding: 10px;
            }
            
            .header {
                padding: 0 15px;
            }
            
            .header h1 {
                font-size: 1.4em;
            }
            
            .controls-panel {
                padding: 15px;
                height: calc(100vh - 80px);
            }
            
            .observations-panel {
                padding: 15px;
                height: calc(100vh - 80px);
            }
            
            .control-section {
                padding: 15px;
                margin-bottom: 15px;
            }
            
            .control-section h3 {
                font-size: 1em;
                margin-bottom: 12px;
            }
            
            .control-group {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .control-group label {
                font-size: 0.8rem;
                margin-bottom: 6px;
            }
            
            .control-group select {
                padding: 10px 12px;
                font-size: 0.8rem;
            }
            
            .btn {
                padding: 10px 14px;
                font-size: 0.8rem;
                margin-bottom: 6px;
            }
            
            .speed-slider {
                height: 6px;
            }
            
            .speed-slider::-webkit-slider-thumb {
                width: 18px;
                height: 18px;
            }
            
            .speed-display {
                font-size: 0.75rem;
            }
            
            .experiment-area {
                padding: 0;
                height: calc(100vh - 80px);
                max-height: calc(100vh - 80px);
            }
            
            .simulation-area {
                padding: 15px;
            }
            
            .process-grid {
                gap: 10px;
                margin-bottom: 15px;
            }
            
            .process-node {
                padding: 12px;
            }
            
            .process-id {
                font-size: 0.9rem;
                margin-bottom: 4px;
            }
            
            .process-status {
                font-size: 0.75rem;
                margin-bottom: 2px;
            }
            
            .process-data {
                font-size: 0.7rem;
            }
            
            /* Matrix display optimization for mobile landscape */
            .matrix-display {
                margin: 15px 0;
                min-height: 200px;
                padding: 15px 0;
            }
            
            .matrix-display > div:first-child {
                font-size: 0.9rem !important;
                margin-bottom: 15px !important;
            }
            
            .matrix-row {
                gap: 8px;
                margin: 15px 0;
            }
            
            .matrix {
                padding: 10px;
                gap: 1px;
            }
            
            .matrix-cell {
                width: 28px;
                height: 28px;
                font-size: 0.8rem;
                border-width: 1px;
            }
            
            .matrix-operator {
                font-size: 1.2rem;
                margin: 0 5px;
            }
            
            .status-section {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .status-section h4 {
                font-size: 0.9em;
                margin-bottom: 10px;
            }
            
            .stat-card {
                padding: 12px;
                margin-bottom: 12px;
            }
            
            .stat-value {
                font-size: 1.2rem;
                margin-bottom: 4px;
            }
            
            .stat-label {
                font-size: 0.75rem;
            }
            
            .stat-description {
                font-size: 0.7rem;
                margin-top: 2px;
            }
            
            .code-download-card {
                padding: 15px;
            }
            
            .download-description {
                font-size: 0.8rem;
                margin-bottom: 12px;
            }
            
            .download-btn {
                padding: 10px 14px;
                font-size: 0.8rem;
            }
            
            .logs-container {
                height: 200px;
                font-size: 0.75rem;
                padding: 12px;
            }
            
            .log-entry {
                padding: 6px 8px;
                margin-bottom: 4px;
                font-size: 0.75rem;
            }
            
            .log-time {
                font-size: 0.7rem;
            }
            
            .log-message {
                font-size: 0.75rem;
            }
        }
        
        /* Tablet Landscape - Slightly different layout */
        @media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
            .app-container {
                grid-template-columns: 300px 1fr 320px;
                grid-template-rows: 70px 1fr;
                gap: 12px;
                padding: 12px;
            }
            
            .header h1 {
                font-size: 1.6em;
            }
            
            .controls-panel,
            .observations-panel {
                height: calc(100vh - 90px);
            }
            
            .matrix-cell {
                width: 32px;
                height: 32px;
                font-size: 0.85rem;
            }
            
            .matrix-display {
                min-height: 250px;
            }
        }
        
        /* Mobile Portrait Orientation Overlay */
        .rotate-device-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            z-index: 10000;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            color: white;
            text-align: center;
            padding: 20px;
        }

        .rotate-device-overlay .rotate-icon {
            font-size: 4rem;
            margin-bottom: 20px;
            animation: rotateAnimation 2s ease-in-out infinite;
        }

        .rotate-device-overlay h2 {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 15px;
        }

        .rotate-device-overlay p {
            font-size: 1rem;
            opacity: 0.9;
            line-height: 1.5;
            max-width: 300px;
        }

        @keyframes rotateAnimation {
            0%, 100% { transform: rotate(0deg); }
            25% { transform: rotate(-15deg); }
            75% { transform: rotate(15deg); }
        }

        @media screen and (max-width: 768px) and (orientation: portrait) {
            .rotate-device-overlay {
                display: flex !important;
            }
            
            .app-container {
                display: none !important;
            }
        }