:root {
    --bs-primary: #0d6efd;
    --brand-grad: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --soft-bg: #f6f8fb;
    --card-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}

[data-bs-theme="dark"] {
    --soft-bg: #0b1220;
    --card-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

body {
    background: var(--soft-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand-grad);
    color: white;
    font-size: 1.1rem;
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-grad);
    color: white;
    font-weight: 600;
}

.card {
    border: none;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
}

.stat-card {
    border-left: 4px solid transparent;
    transition: transform .15s ease;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card.primary { border-left-color: #4f46e5; }
.stat-card.success { border-left-color: #10b981; }
.stat-card.warning { border-left-color: #f59e0b; }
.stat-card.info { border-left-color: #06b6d4; }
.stat-card.danger { border-left-color: #ef4444; }

.hero {
    background: var(--brand-grad);
    color: white;
    border-radius: 18px;
    padding: 2.5rem;
    box-shadow: 0 16px 40px rgba(79, 70, 229, .25);
}

.feature-icon {
    display: inline-flex;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: var(--brand-grad);
    color: white;
}

.heatmap {
    display: grid;
    gap: 3px;
    grid-template-rows: repeat(7, 14px);
    grid-auto-flow: column;
    grid-auto-columns: 14px;
}
.heatmap .cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: #ebedf0;
}
[data-bs-theme="dark"] .heatmap .cell { background: #1f2937; }
.heatmap .l1 { background: #c6e48b; }
.heatmap .l2 { background: #7bc96f; }
.heatmap .l3 { background: #239a3b; }
.heatmap .l4 { background: #196127; }

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 24px;
    background: rgba(13, 110, 253, .08);
    color: #0d6efd;
    font-size: .85rem;
    font-weight: 500;
}

.rozet-card {
    text-align: center;
    transition: transform .15s ease, box-shadow .15s;
}
.rozet-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(79,70,229,.18); }
.rozet-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 6px 16px rgba(0,0,0,.12);
}

.tech-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}
.tech-node {
    background: rgba(13, 110, 253, .06);
    border: 2px dashed rgba(13, 110, 253, .25);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: .85rem;
    transition: all .15s;
}
.tech-node.unlocked {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: white;
    border-color: transparent;
}

.code-editor {
    height: 420px;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 10px;
    overflow: hidden;
}

.terminal-output {
    background: #0b1220;
    color: #d1fae5;
    border-radius: 10px;
    padding: 14px 16px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    font-size: .9rem;
    min-height: 200px;
    white-space: pre-wrap;
    overflow-x: auto;
}
.terminal-output.error { color: #fca5a5; }

#whiteboard {
    background: white;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,.1);
    cursor: crosshair;
}
[data-bs-theme="dark"] #whiteboard { background: #f9fafb; }

.quiz-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: var(--bs-body-bg, white);
    color: var(--bs-body-color, inherit);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(0,0,0,.3);
    max-width: 600px;
    width: 90%;
    animation: popIn .3s ease;
}
@keyframes popIn { from { transform: translate(-50%, -50%) scale(.7); opacity: 0;} to {transform: translate(-50%, -50%) scale(1); opacity: 1;} }

[data-bs-theme="dark"] .quiz-popup {
    background: #1e293b;
    color: #f1f5f9;
}

.countdown {
    font-size: 4rem;
    font-weight: 700;
    color: #ef4444;
    text-align: center;
    line-height: 1;
}

.shik-button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 2px solid rgba(0,0,0,.1);
    border-radius: 10px;
    background: white;
    color: black;
    transition: all .15s;
    cursor: pointer;
}
.shik-button:hover { border-color: #0d6efd; background: rgba(13,110,253,.05); }
.shik-button.selected { border-color: #0d6efd; background: rgba(13,110,253,.1); }
.shik-button.correct { border-color: #10b981; background: rgba(16,185,129,.1); }
.shik-button.wrong { border-color: #ef4444; background: rgba(239,68,68,.1); }

[data-bs-theme="dark"] .shik-button {
    background: #0f172a;
    color: #e2e8f0;
    border-color: rgba(255,255,255,.1);
}

.theme-toggle { border-radius: 50%; width: 36px; height: 36px; padding: 0; }

.landing-bg {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%);
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    color: white;
    padding: 2rem 0;
}

.gradient-text {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.list-item-clean {
    background: transparent !important;
    border-color: rgba(0,0,0,.06) !important;
}
[data-bs-theme="dark"] .list-item-clean { border-color: rgba(255,255,255,.08) !important; }

.shadow-soft { box-shadow: var(--card-shadow); }

a { text-decoration: none; }
a:hover { text-decoration: underline; }

.table-hover-soft tbody tr:hover { background-color: rgba(13,110,253,.04); }
