:root {
    color-scheme: light;
    --blue: #3370ff;
    --blue-hover: #245bdb;
    --blue-pale: #eaf1ff;
    --ink: #1f2329;
    --muted: #646a73;
    --subtle: #8f959e;
    --danger: #d83931;
    font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, rgba(51, 112, 255, 0.16), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #f2f7ff 52%, #edf4ff 100%);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.page-stage {
    position: relative;
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    padding: 32px 16px;
}

.page-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.62), transparent 40%);
    pointer-events: none;
}

/* The gate intentionally mirrors feature/server-side-password. */

.access-gate {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: rgba(244, 248, 255, 0.96);
    transition: opacity 500ms ease, visibility 500ms ease;
}

.access-gate.is-leaving {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.access-panel {
    display: flex;
    width: min(100%, 448px);
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 32px;
    border: 1px solid rgba(31, 35, 41, 0.08);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 14px 36px rgba(46, 84, 153, 0.1);
    text-align: center;
    backdrop-filter: blur(16px);
}

.gate-heading {
    margin-bottom: 6px;
}

.gate-heading h1 {
    margin: 0;
    color: #172033;
    font-size: 36px;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.access-panel input,
.access-panel > button {
    width: 100%;
    min-height: 52px;
    border-radius: 16px;
}

.access-panel input {
    padding: 0 20px;
    border: 1px solid rgba(31, 35, 41, 0.1);
    outline: 0;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    font-size: 17px;
    text-align: center;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.access-panel input::placeholder {
    color: rgba(31, 35, 41, 0.2);
}

.access-panel input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(51, 112, 255, 0.11);
}

.access-panel > button {
    border: 0;
    background: var(--blue);
    box-shadow: 0 9px 20px rgba(51, 112, 255, 0.22);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    transition: background 160ms ease, transform 160ms ease;
}

.access-panel > button:hover {
    background: var(--blue-hover);
    transform: translateY(-1px);
}

.access-panel > button:disabled {
    cursor: wait;
    opacity: 0.6;
    transform: none;
}

.form-message {
    min-height: 20px;
    margin: -2px 0 0;
    color: var(--danger);
    font-size: 12px;
    line-height: 20px;
}

/* The unlocked view keeps the same centered composition as the reference. */

.player-shell {
    position: relative;
    z-index: 10;
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.player-heading {
    text-align: center;
}

.player-heading h1 {
    margin: 0;
    color: #172033;
    font-size: clamp(26px, 4vw, 40px);
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1.35;
}

.course-grid {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border: 1px solid rgba(31, 35, 41, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 8px 24px rgba(46, 84, 153, 0.07);
    backdrop-filter: blur(14px);
}

.course-card {
    --course-accent: var(--blue);
    display: flex;
    min-width: 104px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.course-card:hover {
    background: var(--blue-pale);
    color: var(--blue);
}

.course-card.is-active {
    background: var(--blue);
    box-shadow: 0 7px 15px rgba(51, 112, 255, 0.2);
    color: #fff;
}

.course-card-icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    background: rgba(51, 112, 255, 0.1);
    color: var(--course-accent);
    font-size: 11px;
    font-weight: 700;
}

.course-card.is-active .course-card-icon {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.course-card-copy strong {
    font-size: 13px;
    font-weight: 600;
}

.classroom {
    width: min(80vw, 1200px);
}

.lesson-heading {
    display: flex;
    margin-bottom: 12px;
    padding: 0 5px;
}

.lesson-heading h2 {
    margin: 0;
    color: #2a3039;
    font-size: 17px;
    font-weight: 600;
}

.player-frame {
    --active-accent: var(--blue);
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 24px;
    background: #101319;
    box-shadow: 0 18px 40px rgba(39, 58, 96, 0.16);
}

.player {
    width: 100%;
    height: 100%;
}

.player-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    background:
        radial-gradient(circle at center, rgba(51, 112, 255, 0.2), transparent 34%),
        linear-gradient(145deg, #171c26, #0c0f14);
    color: #fff;
}

.empty-subject {
    color: var(--active-accent);
    font-size: clamp(64px, 9vw, 110px);
    font-weight: 750;
    letter-spacing: -0.08em;
    line-height: 1;
}

.player-empty strong {
    display: block;
}

.player-empty strong {
    margin-bottom: 6px;
    font-size: clamp(18px, 2.4vw, 25px);
    font-weight: 600;
}

.course-card:focus-visible,
.access-panel input:focus-visible,
.access-panel > button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.site-ready .player-shell {
    animation: player-enter 500ms ease both;
}

@keyframes player-enter {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.985);
    }

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

@media (max-width: 768px) {
    .page-stage {
        padding: 34px 0;
    }

    .player-heading {
        padding: 0 20px;
    }

    .player-heading h1 {
        font-size: 28px;
    }

    .course-grid {
        width: calc(100% - 32px);
    }

    .course-card {
        min-width: 0;
        flex: 1;
        padding: 0 8px;
    }

    .classroom {
        width: 100%;
    }

    .lesson-heading {
        padding-right: 20px;
        padding-left: 20px;
    }

    .player-frame {
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .access-panel {
        padding: 36px 22px;
        border-radius: 28px;
    }

    .course-card-icon {
        display: none;
    }

    .player-empty {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
