* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: #202124;
    color: white;
    font-family: Arial, sans-serif;

    display: flex;
    flex-direction: column;
    align-items: center;
}


/* Header */

header {
    width: 100%;
    background: #111;
    border-bottom: 1px solid #333;
    padding: 20px;
}

.header-content {
    max-width: 1200px;
    margin: auto;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

header h1 {
    margin: 0;
}

header p {
    margin: 6px 0 0;
    color: #aaa;
}


/* Buttons */

.toolbar {
    display: flex;
    gap: 10px;
}

button {
    border: none;
    border-radius: 7px;
    padding: 12px 22px;
    cursor: pointer;
    font-weight: bold;
}

#run {
    background: #2ea043;
    color: white;
}

#clear {
    background: #444;
    color: white;
}


/* Main */

main {
    width: 100%;
    max-width: 1200px;

    margin: 40px auto;

    padding: 0 20px;
}


/* Editors */

.editors {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.editor h2,
.preview h2,
.console-section h2 {
    margin-bottom: 10px;
}

textarea {
    width: 100%;
    height: 300px;

    padding: 15px;

    background: #0d1117;
    color: #58a6ff;

    border: 1px solid #444;
    border-radius: 8px;

    font-family: Consolas, monospace;
    font-size: 14px;

    resize: vertical;
    outline: none;
}


/* Preview */

.preview {
    margin-top: 30px;
}

.preview iframe {
    width: 100%;
    height: 350px;

    background: white;

    border: 1px solid #444;
    border-radius: 8px;
}


/* Console */

.console-section {
    margin-top: 30px;
}

#console {
    width: 100%;
    min-height: 180px;

    padding: 15px;

    background: #000;
    color: #00ff66;

    border: 1px solid #444;
    border-radius: 8px;

    font-family: Consolas, monospace;

    white-space: pre-wrap;
    overflow: auto;
}


/* Footer */

footer {
    width: 100%;

    margin-top: 20px;
    padding: 25px;

    text-align: center;

    background: #111;
    color: #888;
}


/* Mobile */

@media (max-width: 900px) {

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

    .editors {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 600px) {

    main {
        padding: 0 12px;
        margin-top: 25px;
    }

    textarea {
        height: 250px;
    }

}
