:root {
    color-scheme: dark;
    --bg: #0d0d14;
    --panel: rgba(255, 255, 255, 0.035);
    --panel-strong: rgba(255, 255, 255, 0.06);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #ffffff;
    --muted: #a8a8ba;
    --blue: #4285f4;
    --purple: #9013fe;
    --cyan: #00ffff;
    --green: #1ed760;
    --gold: #ffd700;
    --danger: #ff6b6b;
}

@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/outfit-v15-latin-regular.woff2") format("woff2");
}

@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/fonts/outfit-v15-latin-700.woff2") format("woff2");
}

@font-face {
    font-family: "Outfit";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("/fonts/outfit-v15-latin-900.woff2") format("woff2");
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 15% 45%, rgba(66, 133, 244, 0.15), transparent 28%),
        radial-gradient(circle at 85% 22%, rgba(144, 19, 254, 0.16), transparent 26%),
        var(--bg);
    color: var(--text);
    font-family: "Outfit", "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 84px;
    padding: 20px 40px;
    background: rgba(20, 20, 30, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0;
}

.brand img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.4);
}

.nav {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-left: auto;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: #fff;
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-user {
    color: #d8d8ea;
    font-size: 13px;
    font-weight: 700;
}

.layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 64px;
}

.intro-band {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    margin-bottom: 34px;
    padding: 58px 38px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.18), rgba(144, 19, 254, 0.14));
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.intro-band::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(13, 13, 20, 0.82));
    pointer-events: none;
}

.intro-band > * {
    position: relative;
    z-index: 1;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 14px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 0.96;
    font-weight: 900;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 26px;
    font-weight: 900;
}

h3 {
    margin-bottom: 8px;
    font-size: 20px;
}

.intro-copy {
    max-width: 650px;
    margin-bottom: 0;
    color: #d1d1e0;
    font-size: 17px;
    line-height: 1.6;
}

.status-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.status-strip span,
.lesson-meta {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    color: #d8d8ea;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.challenge-band {
    margin-bottom: 24px;
}

.training-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: 30px;
    overflow: hidden;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.summary-block {
    display: grid;
    gap: 5px;
    min-height: 82px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.035);
}

.summary-block span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.summary-block strong {
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-head span {
    color: #777789;
    font-size: 13px;
    font-weight: 700;
}

.challenge-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.challenge-item,
.coach-panel,
.lessons-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.challenge-item {
    padding: 24px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.challenge-item:hover {
    transform: translateY(-3px);
    border-color: rgba(66, 133, 244, 0.42);
}

.challenge-item > span {
    color: var(--gold);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.challenge-item p,
.coach-panel p {
    color: var(--muted);
    line-height: 1.5;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    gap: 20px;
}

.lessons-panel,
.coach-panel {
    padding: 24px;
}

.lessons-list {
    display: grid;
    gap: 10px;
}

.module-title {
    margin: 20px 0 7px;
    color: #777789;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lesson-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 72px;
    padding: 15px;
    color: var(--text);
    text-align: left;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lesson-row:hover {
    transform: translateY(-2px);
    background: rgba(66, 133, 244, 0.08);
    border-color: rgba(66, 133, 244, 0.5);
}

.lesson-row.locked {
    color: var(--muted);
    cursor: not-allowed;
}

.lesson-row.completed {
    background: rgba(30, 215, 96, 0.07);
    border-color: rgba(30, 215, 96, 0.22);
}

.lesson-row.locked:hover {
    transform: none;
    background: var(--panel-strong);
    border-color: var(--line);
}

.lesson-main {
    display: grid;
    gap: 4px;
}

.lesson-main small {
    color: var(--muted);
}

.lesson-meta.locked {
    color: var(--gold);
    border-color: rgba(255, 215, 0, 0.28);
}

.lesson-meta.completed {
    color: #b8ffd1;
    border-color: rgba(30, 215, 96, 0.35);
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.icon-btn {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.primary-btn {
    padding: 0 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue), #7b61ff);
}

.secondary-btn {
    padding: 0 18px;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--line-strong);
}

.ghost-btn {
    padding: 0 18px;
    color: #fff;
    background: rgba(253, 0, 253, 0.1);
    border-color: rgba(253, 0, 253, 0.5);
}

.icon-btn {
    width: 42px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--line-strong);
    font-size: 16px;
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.song-form {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.song-form label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.search-row input {
    min-width: 0;
    min-height: 44px;
    padding: 0 13px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    outline: none;
}

.search-row input:focus {
    border-color: var(--blue);
}

.song-results,
.playlist-result,
.saved-playlists-list {
    display: grid;
    gap: 8px;
}

.song-choice,
.playlist-item {
    padding: 13px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.playlist-item.locked {
    color: var(--muted);
}

.playlist-item span {
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
}

.song-choice {
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.playlist-note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.usage-note {
    margin-bottom: 2px;
    color: #dbe7ff;
    font-size: 13px;
    font-weight: 800;
}

.playlist-start-btn {
    width: fit-content;
    margin-top: 4px;
}

.saved-playlists {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.mini-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mini-section-head h3 {
    margin-bottom: 0;
    font-size: 16px;
}

.text-btn {
    padding: 0;
    color: var(--cyan);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.saved-playlist-choice {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 12px 13px;
    color: var(--text);
    text-align: left;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.saved-playlist-choice span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.store-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 36px;
    padding: 0 13px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    border-radius: 10px;
    font-size: 13px;
    font-weight: 900;
}

.lesson-dialog {
    width: min(1040px, calc(100vw - 32px));
    padding: 0;
    color: var(--text);
    background: #1a1a24;
    border: 1px solid #333;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.65);
}

.lesson-dialog::backdrop {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.dialog-close-form {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.lesson-stage {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    min-height: 520px;
}

.lesson-info {
    padding: 30px;
    border-right: 1px solid var(--line);
}

.score-line {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 22px 0;
}

.score-line span {
    padding: 12px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--cyan);
    font-weight: 900;
}

.stage-actions {
    display: flex;
    gap: 10px;
}

.engine-controls {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 13px;
}

.engine-control {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.engine-control-split {
    justify-content: space-between;
}

.engine-control select {
    padding: 4px 8px;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: none;
}

#lesson-canvas {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 520px;
    background: #07080b;
}

.locked-note {
    color: var(--gold);
}

.error-note {
    color: var(--danger);
}

@media (max-width: 820px) {
    .topbar,
    .intro-band,
    .training-summary,
    .content-grid,
    .challenge-grid,
    .lesson-stage {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-left: 0;
    }

    .status-strip {
        justify-content: flex-start;
    }

    .intro-band {
        padding: 36px 22px;
    }

    .lesson-info {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }
}
