.magic-frame-container {
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    padding: 40px 20px;
    min-height: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.matrix-display {
    display: flex;
    justify-content: center;
    width: 100%;
}

.description-with-controls {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    max-width: 800px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    margin-right: auto;
}

.description {
    flex: 1;
    text-align: center;
    min-width: 400px;
}

.controls-container {
    flex: 0 0 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.description h1 {
    margin-top: 0;
    color: #333;
    font-size: 2em;
}

.description p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.description a {
    color: #0066cc;
    text-decoration: none;
    font-weight: bold;
}

.description a:hover {
    color: #004499;
    text-decoration: underline;
}

.description .fa-github {
    margin-left: 5px;
}

.picture-frame {
    background: #000;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    margin-top: 0;
}

.canvas-container {
    background: #000;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
}

.canvas-container canvas {
    display: block;
}

/* Scale down canvas on mobile only */
@media (max-width: 768px) {
    .canvas-container canvas {
        transform: scale(0.92);
        transform-origin: center center;
    }
}

.controls {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 14px;
    width: 100%;
    margin-top: 0;
    margin-bottom: 10px;
}

.controls h3 {
    margin-top: 0;
    color: white;
}

.controls button {
    background: #4CAF50;
    border: none;
    color: white;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls button:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.controls button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.controls button.stop {
    background: #f44336;
}

.controls button.stop:hover {
    background: #d32f2f;
}

.controls button.clear {
    background: #ff9800;
}

.controls button.clear:hover {
    background: #f57c00;
}

.controls select {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 5px;
    border-radius: 3px;
    margin: 5px;
}

.controls input[type="range"] {
    width: 100%;
    margin: 5px 0;
}

.code-editor {
    position: static;
    width: 100%;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    display: none;
}

.main-content-layout {
    display: flex;
    gap: 60px;
    width: 100%;
    max-width: 1600px;
    align-items: flex-start;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.left-controls {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
}

.center-frame {
    flex: 0 1 auto;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 0;
    margin-right: auto;
}

.right-editor {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
}

.code-editor.visible {
    display: block;
}

/* Full screen mode styles */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fullscreen-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.fullscreen-controls button {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.fullscreen-controls button:hover {
    background: rgba(0, 0, 0, 0.9);
}

.fullscreen-frame {
    background: #000;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 0 2px rgba(255, 255, 255, 0.1);
}

.fullscreen-canvas-container {
    line-height: 0;
    font-size: 0;
    border-radius: 10px;
    overflow: hidden;
}

.fullscreen-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

.fullscreen-button {
    background: #9C27B0;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 0;
    width: 100%;
}

.fullscreen-button:hover {
    background: #7B1FA2;
}

.code-editor-header {
    background: #333;
    padding: 10px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-editor textarea {
    width: 100%;
    height: 280px;
    background: #1a1a1a;
    color: #00ff00;
    border: none;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.code-editor-buttons {
    padding: 10px;
    border-radius: 0 0 10px 10px;
    background: #333;
}

.editor-toggle {
    background: #333;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    margin-top: 0;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .main-content-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .left-controls {
        flex: none;
        width: 100%;
        max-width: 400px;
        margin-bottom: 20px;
    }
    
    .center-frame {
        flex: none;
        margin-bottom: 20px;
    }
    
    .right-editor {
        flex: none;
        width: 100%;
        max-width: 600px;
    }
    
    .description-with-controls {
        max-width: 800px;
    }
    
    .controls {
        font-size: 12px;
    }

    .controls button {
        padding: 6px 12px;
        margin: 3px;
    }
}