.scratch-workshop {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(340px, 1.15fr);
    gap: clamp(1.25rem, 3vw, 2.5rem);
    margin: clamp(2rem, 5vw, 4.5rem) 0;
    padding: clamp(1.25rem, 4vw, 3rem);
    color: #f5f8ff;
    background:
        radial-gradient(circle at 10% 10%, rgba(89, 205, 144, .18), transparent 35%),
        linear-gradient(145deg, #102a43, #09182d);
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 30px;
    box-shadow: 0 24px 70px rgba(4, 13, 28, .28);
}

.scratch-workshop h2 {
    margin: .35rem 0 .8rem;
    font-size: clamp(1.8rem, 4vw, 3rem);
    line-height: 1.04;
}

.scratch-workshop-copy > p:not(.code-kicker) {
    color: #cbd9eb;
    line-height: 1.65;
}

.scratch-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    margin: 1.4rem 0;
}

.scratch-preset {
    padding: .7rem 1rem;
    color: #fff;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.scratch-preset:hover,
.scratch-preset:focus-visible,
.scratch-preset.is-active {
    color: #102a43;
    background: #ffd166;
    border-color: #ffd166;
}

.scratch-challenge {
    display: grid;
    gap: .75rem;
    padding: 0;
    list-style: none;
}

.scratch-challenge li {
    display: grid;
    grid-template-columns: 2.25rem 1fr;
    gap: .75rem;
    align-items: start;
}

.scratch-challenge li > span {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    color: #102a43;
    background: #59cd90;
    border-radius: 50%;
    font-weight: 900;
}

.scratch-challenge p { margin: .12rem 0; color: #dce7f6; }
.scratch-challenge strong { display: block; color: #fff; }

.scratch-player-card {
    align-self: center;
    overflow: hidden;
    color: #17233a;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(0,0,0,.28);
}

.scratch-player-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: .9rem 1rem;
    background: #f4f7fb;
    border-bottom: 1px solid #dce4ef;
}

.scratch-player-head > div { display: flex; gap: .45rem; align-items: center; }
.scratch-player-head a { color: #2455c3; font-weight: 800; font-size: .86rem; }

.scratch-frame-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #e9eef6;
}

.scratch-frame-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.scratch-loader { padding: 1rem; }
.scratch-loader label { display: block; margin-bottom: .45rem; font-weight: 850; }
.scratch-loader > div { display: flex; gap: .6rem; }

.scratch-loader input {
    min-width: 0;
    flex: 1;
    padding: .75rem .85rem;
    border: 2px solid #cbd7e7;
    border-radius: 12px;
    font: inherit;
}

.scratch-loader input:focus { outline: 3px solid rgba(37, 99, 235, .22); border-color: #2563eb; }
.scratch-loader .code-button { flex: 0 0 auto; }
.scratch-loader p { min-height: 1.4em; margin: .55rem 0 0; color: #53657c; font-size: .88rem; }
.scratch-loader p.is-error { color: #b42318; font-weight: 750; }

@media (max-width: 820px) {
    .scratch-workshop { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .scratch-workshop { padding: 1rem; border-radius: 22px; }
    .scratch-player-head { align-items: flex-start; flex-direction: column; }
    .scratch-loader > div { flex-direction: column; }
    .scratch-loader .code-button { width: 100%; }
}
