:root {
    --font-sans: 'Inter', -apple-system, sans-serif;
    --bg: #0F1219;
    --surface: #1A1F2E;
    --surface-2: #232839;
    --border: rgba(99, 102, 241, .12);
    --border-hover: rgba(99, 102, 241, .3);
    --primary: #6366F1;
    --primary-glow: rgba(99, 102, 241, .2);
    --accent: #F43F5E;
    --text: #E2E8F0;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --green: #4ADE80;
    --gold: #F59E0B;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: .25s ease
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at 25% 0%, rgba(99, 102, 241, .04) 0%, transparent 50%)
}

.header {
    padding: 1.1rem 2rem;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(15, 18, 25, .85);
    position: sticky;
    top: 0;
    z-index: 50
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem
}

.logo {
    display: flex;
    align-items: center;
    gap: .7rem
}

.logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, .1);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 1.15rem
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text
}

.header-tagline {
    font-size: .8rem;
    color: var(--text-muted)
}

.main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.25rem 2rem 3rem
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    animation: fadeIn .4s ease backwards
}

.section-title {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    margin-bottom: .85rem
}

.search-input {
    width: 100%;
    padding: .55rem .85rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: .85rem;
    outline: none;
    margin-bottom: .65rem
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow)
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    max-height: 140px;
    overflow-y: auto;
    margin-bottom: .75rem
}

.tech-tag {
    padding: .25rem .55rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .7rem;
    cursor: pointer;
    transition: all .15s ease
}

.tech-tag:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, .08)
}

.tech-tag.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary)
}

.selected-row,
.templates-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
    flex-wrap: wrap
}

.sel-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    white-space: nowrap
}

.selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem
}

.chip-empty {
    font-size: .75rem;
    color: var(--text-dim)
}

.chip {
    padding: .2rem .45rem;
    background: rgba(99, 102, 241, .15);
    border-radius: 4px;
    font-size: .7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .25rem
}

.chip-x {
    cursor: pointer;
    opacity: .6
}

.chip-x:hover {
    opacity: 1
}

.template-btns {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem
}

.tmpl-btn {
    padding: .2rem .45rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: .65rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all .15s ease
}

.tmpl-btn:hover {
    border-color: var(--primary);
    color: var(--text)
}

#radar-canvas {
    display: block;
    margin: 0 auto;
    max-width: 100%
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
    margin-top: .75rem
}

.legend-item {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%
}

.matrix-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm)
}

.matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem
}

.matrix th {
    background: var(--surface-2);
    padding: .5rem .65rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    position: sticky;
    top: 0
}

.matrix td {
    padding: .4rem .65rem;
    border-top: 1px solid var(--border)
}

.matrix .val-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--primary)
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .75rem
}

.stat-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem
}

.stat-name {
    font-size: .9rem;
    font-weight: 700;
    margin-bottom: .4rem
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: var(--text-muted);
    margin-bottom: .15rem
}

.stat-val {
    color: var(--text);
    font-weight: 600
}

.learn-badge {
    display: inline-block;
    padding: .1rem .35rem;
    border-radius: 4px;
    font-size: .6rem;
    font-weight: 600
}

.learn-easy {
    background: rgba(74, 222, 128, .12);
    color: var(--green)
}

.learn-medium {
    background: rgba(245, 158, 11, .12);
    color: var(--gold)
}

.learn-hard {
    background: rgba(244, 63, 94, .12);
    color: var(--accent)
}

.hidden {
    display: none !important
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: .65rem 1rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, .4);
    opacity: 0;
    pointer-events: none;
    transition: all .4s cubic-bezier(.16, 1, .3, 1);
    z-index: 100
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0)
}

@media(max-width:768px) {
    .header {
        padding: .75rem 1rem
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: .2rem
    }

    .main {
        padding: 1rem
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}