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

body {
    background: #0b1220;
    color: white;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    padding: 20px;
}

.navbar {
    max-width: 1200px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0 25px;
    gap: 20px;
}

.logo {
    font-size: 30px;
    font-weight: bold;
    letter-spacing: -1px;
}

.logo span {
    color: #38bdf8;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
}

nav a:hover,
nav a.active {
    color: #38bdf8;
}

.user-name {
    background: #17243a;
    border: 1px solid #34445d;
    padding: 10px 18px;
    border-radius: 25px;
    color: #38bdf8;
    font-size: 14px;
}

.ad-space {
    max-width: 900px;
    width: 100%;
    min-height: 90px;
    border: 1px dashed #46536b;
    border-radius: 10px;
    margin: 10px auto 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #718096;
    font-size: 13px;
    letter-spacing: 2px;
}

.container {
    max-width: 1100px;
    margin: auto;
}

.welcome {
    margin: 45px 0 35px;
}

.tagline {
    color: #38bdf8;
    letter-spacing: 3px;
    font-size: 11px;
    margin-bottom: 15px;
}

.welcome h1 {
    font-size: 36px;
    margin-bottom: 12px;
}

.welcome h1 span {
    color: #38bdf8;
}

.welcome p:last-child {
    color: #94a3b8;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 50px;
}

.stat-card {
    background: #151f32;
    border: 1px solid #293850;
    border-radius: 12px;
    padding: 25px;
}

.stat-card small {
    color: #94a3b8;
    font-size: 11px;
    letter-spacing: 1px;
}

.stat-card h2 {
    font-size: 29px;
    color: #38bdf8;
    margin: 14px 0 7px;
}

.stat-card p {
    font-size: 13px;
    color: #718096;
}

.section {
    margin-bottom: 50px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2 {
    font-size: 23px;
    margin-bottom: 8px;
}

.section-heading p {
    color: #94a3b8;
    font-size: 14px;
}

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

.level-card {
    background: #151f32;
    border: 1px solid #293850;
    border-radius: 12px;
    padding: 23px;
    transition: 0.25s ease;
}

.level-card:hover {
    transform: translateY(-4px);
    border-color: #38bdf8;
}

.level-card.selected {
    border: 1px solid #38bdf8;
    background: #172b42;
}

.level-number {
    color: #38bdf8;
    font-size: 13px;
    font-weight: bold;
}

.level-card h3 {
    margin: 15px 0 10px;
    font-size: 19px;
}

.level-card p {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
    min-height: 42px;
}

.status {
    display: block;
    margin: 17px 0;
    color: #38bdf8;
    font-size: 11px;
    letter-spacing: 1px;
}

.level-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #34445d;
    border-radius: 7px;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.level-btn:hover,
.selected .level-btn {
    background: #0284c7;
    border-color: #0284c7;
}

/* Practice and timer section */

.chapter-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 35px;
    background: #151f32;
    border: 1px solid #293850;
    border-radius: 12px;
    padding: 30px;
}

.chapter-info {
    flex: 1;
}

.chapter-label {
    color: #38bdf8;
    font-size: 11px;
    letter-spacing: 1px;
}

.chapter-card h3 {
    margin: 12px 0;
    font-size: 19px;
}

.chapter-card p {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.5;
}

.practice-options {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.practice-options label {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: bold;
}

.practice-options select,
.custom-time input {
    width: 100%;
    padding: 13px 14px;
    background: #0b1220;
    color: white;
    border: 1px solid #34445d;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
}

.practice-options select:focus,
.custom-time input:focus {
    border-color: #38bdf8;
}

.practice-options select option {
    background: #151f32;
    color: white;
}

.custom-time {
    display: none;
}

.custom-time input::placeholder {
    color: #718096;
}

.practice-options button {
    width: 100%;
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 20px;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s ease;
}

.practice-options button:hover {
    background: #0369a1;
    transform: translateY(-2px);
}

.timer-hint {
    color: #718096 !important;
    font-size: 12px !important;
}

.bottom-ad {
    margin-top: 40px;
}

footer {
    text-align: center;
    color: #718096;
    font-size: 12px;
    padding: 25px 0;
}

@media (max-width: 700px) {
    .navbar {
        flex-wrap: wrap;
    }

    nav {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 18px;
    }

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

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

    .chapter-card {
        flex-direction: column;
        align-items: stretch;
    }

    .practice-options {
        width: 100%;
    }

    .welcome h1 {
        font-size: 29px;
    }
}

/* Certificate achievements */
.certificate-progress-card { background: linear-gradient(120deg, #172b42, #151f32); border: 1px solid #30445f; border-radius: 14px; padding: 25px; margin-bottom: 20px; }
.certificate-progress-top { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.certificate-kicker { color:#38bdf8; font-size:11px; letter-spacing:1.5px; font-weight:bold; }
.certificate-progress-top h3 { font-size:34px; margin:8px 0; color:#fff; }
.certificate-progress-top h3 small { font-size:15px; color:#94a3b8; }
.certificate-progress-top p,.certificate-note { color:#94a3b8; font-size:13px; }
.progress-medal { font-size:42px; }
.progress-track { height:9px; background:#0b1220; border-radius:20px; overflow:hidden; margin-top:20px; }
.progress-track div { width:0; height:100%; background:linear-gradient(90deg,#38bdf8,#22c55e); border-radius:20px; transition:width .3s ease; }
.certificate-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:15px; }
.certificate-card { position:relative; overflow:hidden; text-align:center; background:#151f32; border:1px solid #293850; border-radius:12px; padding:22px 15px; }
.certificate-card .ribbon { display:inline-block; padding:5px 12px; border-radius:20px; font-size:10px; font-weight:bold; letter-spacing:1px; }
.certificate-card.bronze .ribbon { background:#513722; color:#e6b58a; }
.certificate-card.silver .ribbon { background:#3a4653; color:#d7e0e8; }
.certificate-card.gold .ribbon { background:#55451e; color:#f5d477; }
.certificate-card.platinum .ribbon { background:#1c4664; color:#9bdcff; }
.certificate-icon { font-size:30px; margin:12px 0 5px; }
.certificate-card h3 { font-size:16px; margin:7px 0; }
.certificate-card p { color:#94a3b8; font-size:12px; }
.certificate-status { display:block; color:#718096; font-size:10px; letter-spacing:1px; font-weight:bold; margin:15px 0 10px; }
.certificate-card:has(button:not(:disabled)) .certificate-status { color:#4ade80; }
.certificate-action { width:100%; padding:10px 8px; border:1px solid #34445d; border-radius:7px; background:#0284c7; color:#fff; cursor:pointer; font-size:12px; font-weight:bold; }
.certificate-action:disabled { background:#202b3d; color:#64748b; cursor:not-allowed; }
.certificate-note { margin-top:15px; line-height:1.6; }
@media(max-width:900px){.certificate-grid{grid-template-columns:repeat(2,1fr);}}
@media(max-width:520px){.certificate-grid{grid-template-columns:1fr;}.certificate-progress-top h3{font-size:28px;}}


#devStatus{display:block;color:#86efac;margin-top:8px}

/* Special practice cards and dashboard advertisement placement */
.special-card { position: relative; overflow: hidden; }
.special-card .level-number, .special-card .status { color: #70d9ae; }
.numbers-card { background: linear-gradient(145deg, #153d39, #151f32); border-color: #28675b; }
.coding-card { background: linear-gradient(145deg, #173b4b, #151f32); border-color: #28718b; }
.coding-card .level-number, .coding-card .status { color: #67c9f2; }
.dashboard-ad-space { min-height: 112px; margin: 8px 0 42px; border: 1px dashed #46536b; border-radius: 12px; background: #101a2a; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; color:#718096; text-align:center; }
.dashboard-ad-space span { font-size:10px; letter-spacing:2px; }
.dashboard-ad-space strong { font-size:18px; color:#94a3b8; }
.dashboard-ad-space small { font-size:11px; }
@media (max-width: 700px) { .dashboard-ad-space { min-height:90px; margin-bottom:30px; } }


/* Public dashboard ad placeholder: stable rectangular layout, never inline-collapsed. */
.dashboard-ad-space {
  box-sizing: border-box !important; width: 100% !important; min-height: 118px !important;
  margin: 28px 0 42px !important; padding: 18px 16px !important;
  display: flex !important; flex-direction: column !important;
  align-items: center !important; justify-content: center !important;
  gap: 7px !important; text-align: center !important;
  border: 1px dashed #46536b !important; border-radius: 12px !important;
  background: #101a2a !important; color: #718096 !important;
  line-height: 1.4 !important; overflow: hidden;
}
.dashboard-ad-space .ad-label { display:block !important; font-size:10px !important; letter-spacing:2px !important; font-weight:700 !important; }
.dashboard-ad-space strong { display:block !important; font-size:18px !important; color:#94a3b8 !important; }
.dashboard-ad-space small { display:block !important; font-size:11px !important; color:#718096 !important; }
@media(max-width:700px){.dashboard-ad-space{min-height:96px !important;margin:22px 0 30px !important;}}
