* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #071326;
    color: #e2e8f0;
    min-height: 100vh;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 5%;
    background: #0c1e38;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
}

.brand i {
    color: #facc15;
    font-size: 30px;
}

.brand h2 {
    font-size: 20px;
    line-height: 1.1;
}

.brand span {
    display: block;
    font-size: 10px;
    color: #94a3b8;
}

.head-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.head-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.head-links a:hover {
    color: #38bdf8;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #2563eb;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: #1d4ed8;
}

.lab-wrapper {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 5% 65px;
}

.lab-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.35);
    color: #facc15;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

h1 {
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.7;
    margin-bottom: 24px;
}

.challenge-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    background: #0c1e38;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 9px 16px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    border-color: rgba(56, 189, 248, 0.45);
    color: #ffffff;
}

.tab-btn.active {
    background: #2563eb;
    border-color: #3b82f6;
    color: #ffffff;
}

.prompt-card {
    background: #0c1e38;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 22px;
}

.prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.prompt-header h2 {
    font-size: 18px;
    color: #ffffff;
}

.hint-btn {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.hint-btn:hover {
    background: rgba(56, 189, 248, 0.2);
}

#challengeDesc {
    font-size: 14px;
    color: #cbd5e1;
    line-height: 1.65;
}

.hint-box {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(250, 204, 21, 0.08);
    border-left: 3px solid #facc15;
    color: #fde68a;
    font-size: 13px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.panel {
    background: #0c1e38;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(7, 19, 38, 0.65);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

.panel-actions {
    display: flex;
    gap: 8px;
}

.run-btn,
.secondary-btn,
.check-btn {
    border-radius: 8px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.run-btn {
    border: none;
    background: #16a34a;
    color: #ffffff;
}

.run-btn:hover {
    background: #15803d;
}

.secondary-btn {
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.CodeMirror {
    width: 100% !important;
    height: 310px !important;
    background: #050d1a !important;
    color: #ffffff !important; /* Default/base text color */
    caret-color: #facc15;
    font-family: 'Fira Code', monospace;
    font-size: 13.5px;
    line-height: 1.65;
}

.CodeMirror .CodeMirror-code {
    color: #ffffff; /* Siguradong visible kahit anong token */
}

.CodeMirror-scroll {
    min-height: 310px;
}

.CodeMirror-gutters {
    background: #071326 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.CodeMirror-linenumber {
    color: #94a3b8 !important;
}

.CodeMirror-cursor {
    border-left: 2px solid #facc15 !important;
}

.cm-js-error-highlight {
    background: rgba(239, 68, 68, 0.22);
    border-bottom: 2px solid #ef4444;
}

/* --- PALITAN MO ANG MGA COLOR CODE DITO KUNG GUSTO MONG MAG-IBA --- */
.CodeMirror .cm-keyword {
    color: #38bdf8 !important; /* const, let, if, else, function, return */
    font-weight: 600;
}

.CodeMirror .cm-string,
.CodeMirror .cm-string-2 {
    color: #4ade80 !important; /* Text sa loob ng " " o ' ' */
}

.CodeMirror .cm-number {
    color: #facc15 !important; /* Mga numero gaya ng 45, 3, 80 */
}

.CodeMirror .cm-comment {
    color: #94a3b8 !important; /* // comments */
    font-style: italic;
}

.CodeMirror .cm-variable,
.CodeMirror .cm-variable-2,
.CodeMirror .cm-variable-3,
.CodeMirror .cm-property,
.CodeMirror .cm-def {
    color: #f8fafc !important; /* Variable names, function names, console.log */
}

.CodeMirror .cm-operator,
.CodeMirror .cm-punctuation {
    color: #f472b6 !important; /* =, +, *, >=, ;, (), {} */
}

.check-btn {
    background: rgba(250, 204, 21, 0.16);
    color: #fde047;
    border: 1px solid rgba(250, 204, 21, 0.35);
}

.check-btn:hover {
    background: rgba(250, 204, 21, 0.25);
}

.checker-status {
    font-size: 11.5px;
    color: #94a3b8;
    font-weight: 500;
}

.checker-status.ok {
    color: #86efac;
}

.checker-status.warn {
    color: #fca5a5;
}

.output-box {
    min-height: 352px;
    flex: 1;
    padding: 16px;
    background: #050d1a;
    color: #86efac;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-box.error {
    color: #fca5a5;
}