.roblox-studio-page {
    --roblox-cyan: #35d4ff;
    --roblox-blue: #2f7dff;
    --roblox-purple: #8f72ff;
    --roblox-panel: rgba(10, 14, 22, 0.84);
    overflow-x: hidden;
}

.roblox-lesson-hero {
    min-height: 84vh;
}

.roblox-intro-bg {
    background:
        linear-gradient(90deg, rgba(5, 7, 12, 0.88), rgba(5, 7, 12, 0.34) 52%, rgba(5, 7, 12, 0.74)),
        linear-gradient(0deg, rgba(8, 9, 12, 0.92), transparent 54%),
        url("../../pics/roblox/studio-intro/lesson-01-01.png") center / cover no-repeat;
    filter: saturate(1.05) contrast(1.03);
}

.roblox-lesson-bg {
    /* The renderer supplies the lesson-specific image and gradients inline. */
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: saturate(1.05) contrast(1.03);
}

.roblox-studio-page .mario-hero h1 {
    max-width: 20ch;
    font-size: clamp(2.75rem, 4.4vw, 4.9rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    text-wrap: balance;
}

.roblox-studio-page .mario-hero .hero-copy code {
    color: #d9fbff;
    background: rgba(53, 212, 255, 0.14);
}

.roblox-studio-page .mario-strip span {
    border-color: rgba(53, 212, 255, 0.32);
    background: rgba(5, 14, 24, 0.68);
}

.roblox-shell {
    display: grid;
    grid-template-columns: minmax(12rem, 16rem) minmax(0, 1fr);
    gap: 1.3rem;
    width: min(var(--max), calc(100% - 2.5rem));
    max-width: none;
    margin: 0 auto;
    padding: 4rem 0 5rem;
}

.roblox-toc {
    position: sticky;
    top: 6.2rem;
    align-self: start;
    display: grid;
    gap: 0.34rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
    box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.18);
}

.roblox-toc strong {
    margin-bottom: 0.45rem;
    color: var(--mario-gold);
    letter-spacing: 0.02em;
}

.roblox-toc a {
    padding: 0.46rem 0.55rem;
    color: rgba(247, 244, 236, 0.76);
    border: 1px solid transparent;
    border-radius: 6px;
}

.roblox-toc a:hover,
.roblox-toc a:focus-visible {
    color: var(--paper);
    border-color: rgba(53, 212, 255, 0.26);
    background: rgba(53, 212, 255, 0.08);
}

.roblox-article {
    display: grid;
    gap: 1.2rem;
    min-width: 0;
}

.roblox-section {
    overflow: hidden;
    min-width: 0;
    padding: clamp(1.2rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 12px;
    background:
        radial-gradient(circle at 8% 0%, rgba(53, 212, 255, 0.12), transparent 18rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
    box-shadow: 0 1.2rem 3rem rgba(0, 0, 0, 0.18);
}

.roblox-section h2 {
    max-width: 62rem;
    margin-top: 0.15rem;
}

.roblox-section > p {
    color: rgba(247, 244, 236, 0.76);
}

.roblox-lead {
    max-width: 58rem;
    color: rgba(247, 244, 236, 0.82) !important;
    font-size: 1.08rem;
}

.roblox-full-image,
.roblox-shot {
    align-self: start;
    width: 100%;
    height: auto;
    min-width: 0;
}

.roblox-full-image img,
.roblox-shot img {
    display: block;
    width: 100%;
    height: auto !important;
    max-height: none;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    background: #eef4f7;
}

.roblox-studio-page .mario-overview-grid,
.roblox-studio-page .mario-learning-layout,
.roblox-studio-page .mario-video-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start;
}

.roblox-studio-page .mario-overview-grid {
    gap: 1.4rem;
}

.roblox-studio-page .mario-overview-grid > figure {
    width: 100%;
    max-width: none;
    height: auto;
}

.roblox-studio-page .mario-overview-grid > div {
    max-width: 62rem;
}

.roblox-studio-page .mario-stat-grid,
.roblox-studio-page .mario-step-grid,
.roblox-studio-page .mario-fix-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.roblox-shot-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 1rem;
    margin-top: 1.1rem;
}

.roblox-section > .roblox-shot,
.roblox-shot-grid .roblox-shot {
    width: 100%;
}

.roblox-lesson-page .roblox-code-shell {
    margin-top: 1.15rem;
}

.roblox-image-link { display: block; width: min(100%, var(--roblox-shot-width, 1920px)); margin: 0 auto; }
.roblox-image-link:focus-visible { outline: 3px solid var(--roblox-cyan); outline-offset: 4px; }
.roblox-image-credit { display: block; margin-top: .5rem; font-size: .78rem; line-height: 1.6; }
.roblox-image-credit a, #references a { color: #91deff; text-decoration: underline; text-underline-offset: .2em; }
.roblox-action-list { padding-left: 1.6rem; line-height: 1.85; }
.roblox-table caption { text-align: left; padding: .8rem 1rem; color: #dff7ff; }
.roblox-action-list li + li { margin-top: .65rem; }
.roblox-copy-code { margin-left: auto; padding: .35rem .65rem; color: #dff7ff; background: #153347; border: 1px solid #3b6980; border-radius: 5px; cursor: pointer; font: inherit; white-space: nowrap; }
.roblox-copy-code:focus-visible { outline: 2px solid var(--roblox-cyan); outline-offset: 3px; }
.roblox-lesson-page .mario-code-toolbar { flex-wrap: wrap; gap: .5rem; }
.roblox-lesson-page .mario-code-toolbar > span:first-child { flex: 1 1 18rem; overflow-wrap: anywhere; }
.roblox-lesson-page .mario-code-shell pre { max-width: 100%; overflow-x: auto; tab-size: 4; }
.roblox-lesson-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: 12px; }
.roblox-lesson-pagination a { color: #a9e9ff; padding: .4rem; }
.roblox-lesson-page .roblox-toc { max-height: calc(100vh - 7rem); overflow-y: auto; }
@media (max-width: 800px) { .roblox-lesson-page .roblox-toc { max-height: none; } }

.roblox-lesson-page .mario-code-toolbar span:last-child {
    color: var(--roblox-cyan);
    font-family: Consolas, "SFMono-Regular", "Liberation Mono", monospace;
    font-size: 0.86rem;
    font-weight: 800;
}

.roblox-lesson-page .mario-list {
    color: rgba(247, 244, 236, 0.78);
}

.roblox-table-wrap {
    overflow-x: auto;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(2, 6, 12, 0.42);
}

.roblox-table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
}

.roblox-table th,
.roblox-table td {
    padding: 0.88rem 0.95rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roblox-table th {
    color: #d9fbff;
    background: rgba(53, 212, 255, 0.09);
}

.roblox-table td {
    color: rgba(247, 244, 236, 0.76);
}

.roblox-table tr:last-child td {
    border-bottom: 0;
}

.roblox-callout {
    margin-top: 1.1rem;
    padding: 0.9rem 1rem;
    color: rgba(247, 244, 236, 0.84);
    border: 1px solid rgba(53, 212, 255, 0.34);
    border-left: 4px solid var(--roblox-cyan);
    border-radius: 8px;
    background: rgba(53, 212, 255, 0.08);
}

.roblox-callout strong {
    color: #d9fbff;
}

.roblox-callout.is-warning {
    border-color: rgba(255, 211, 79, 0.4);
    border-left-color: var(--mario-gold);
    background: rgba(255, 211, 79, 0.09);
}

.roblox-callout.is-success {
    border-color: rgba(90, 255, 150, 0.36);
    border-left-color: #5aff96;
    background: rgba(90, 255, 150, 0.08);
}

.roblox-check-grid,
.roblox-homework {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.roblox-check-grid article,
.roblox-homework div {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
}

.roblox-check-grid i {
    width: 1.3rem;
    height: 1.3rem;
    color: var(--roblox-cyan);
}

.roblox-check-grid strong,
.roblox-homework strong {
    display: block;
    margin: 0.5rem 0 0.35rem;
    color: var(--paper);
}

.roblox-check-grid span,
.roblox-homework p {
    color: rgba(247, 244, 236, 0.7);
}

.roblox-homework span {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    color: #051019;
    border-radius: 50%;
    background: var(--mario-gold);
    font-weight: 900;
}

.roblox-question-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.roblox-question-list details {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.roblox-question-list summary {
    cursor: pointer;
    padding: 0.85rem 1rem;
    color: var(--paper);
    font-weight: 800;
}

.roblox-question-list p {
    margin: 0;
    padding: 0 1rem 1rem;
    color: rgba(247, 244, 236, 0.74);
}

.roblox-finish {
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 211, 79, 0.18), transparent 18rem),
        radial-gradient(circle at 90% 18%, rgba(53, 212, 255, 0.16), transparent 18rem),
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

@media (max-width: 980px) {
    .roblox-studio-page .roblox-lesson-hero {
        min-height: auto;
        align-content: end;
        padding-bottom: 2rem;
    }

    .roblox-studio-page .roblox-lesson-hero .mario-strip {
        position: relative;
        inset: auto;
        margin-top: 2rem;
    }

    .roblox-studio-page .mario-overview-grid,
    .roblox-studio-page .mario-learning-layout,
    .roblox-studio-page .mario-video-layout,
    .roblox-shell,
    .roblox-shot-grid,
    .roblox-check-grid,
    .roblox-homework {
        grid-template-columns: 1fr;
    }

    .roblox-toc {
        position: static;
    }
}

@media (max-width: 620px) {
    .roblox-studio-page .mario-code-toolbar {
        flex-direction: row;
        align-items: center;
    }

    .roblox-lesson-hero {
        min-height: 92vh;
    }

    .roblox-studio-page .mario-hero h1 {
        max-width: 14ch;
        font-size: clamp(2.35rem, 10vw, 3.45rem);
        line-height: 1.06;
    }

    .roblox-shell {
        padding-top: 2.4rem;
    }

    .roblox-table {
        min-width: 36rem;
    }
}
