@import url('../../../assets/css/portal-tokens.css');

* {
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    --eco-text: var(--text-primary);
    --eco-muted: var(--text-muted);
    --eco-card: rgba(255, 255, 255, 0.9);
    --eco-border: rgba(203, 213, 225, 0.85);
    --eco-shadow: var(--shadow-lg);
    --eco-surface: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
    --eco-accent: var(--primary);
    --eco-accent-dark: var(--primary-dark);
    --eco-success: var(--accent);
}

html {
    scroll-behavior: smooth;
}

body.eco-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Outfit", system-ui, "Segoe UI", sans-serif;
    color: var(--eco-text);
    background:
        radial-gradient(900px 480px at 8% 0%, rgba(96, 165, 250, 0.28), transparent 55%),
        radial-gradient(700px 420px at 95% 10%, rgba(37, 99, 235, 0.22), transparent 58%),
        radial-gradient(600px 380px at 50% 100%, rgba(29, 78, 216, 0.18), transparent 55%),
        linear-gradient(165deg, #3b82f6 0%, #2563eb 32%, #1d4ed8 62%, #1e3a8a 100%);
    background-attachment: fixed;
}

button,
input {
    font: inherit;
}

.eco-leaves {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.inv-leaf {
    position: absolute;
    width: 20px;
    height: 20px;
    left: calc(var(--i, 0) * 7% - 5%);
    top: -20px;
    opacity: 0.45;
    animation: eco-leaf-fall 14s linear infinite;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 18px;
    color: #86efac;
}

.inv-leaf::before {
    content: "\f06c";
}

.inv-leaf:nth-child(1) { --i: 1; animation-delay: 0s; }
.inv-leaf:nth-child(2) { --i: 2; animation-delay: 1.1s; }
.inv-leaf:nth-child(3) { --i: 3; animation-delay: 2.3s; }
.inv-leaf:nth-child(4) { --i: 4; animation-delay: 0.5s; }
.inv-leaf:nth-child(5) { --i: 5; animation-delay: 3.1s; }
.inv-leaf:nth-child(6) { --i: 6; animation-delay: 1.7s; }
.inv-leaf:nth-child(7) { --i: 7; animation-delay: 4.2s; }
.inv-leaf:nth-child(8) { --i: 8; animation-delay: 2s; }
.inv-leaf:nth-child(9) { --i: 9; animation-delay: 5s; }
.inv-leaf:nth-child(10) { --i: 10; animation-delay: 0.8s; }
.inv-leaf:nth-child(11) { --i: 11; animation-delay: 3.8s; }
.inv-leaf:nth-child(12) { --i: 12; animation-delay: 1.4s; }
.inv-leaf:nth-child(13) { --i: 13; animation-delay: 6s; }
.inv-leaf:nth-child(14) { --i: 14; animation-delay: 2.6s; }

@keyframes eco-leaf-fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.45; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

.eco-app {
    position: relative;
    z-index: 1;
}

.eco-studio {
    width: min(1500px, calc(100% - 16px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 10px 0 32px;
}

.studio-topbar {
    display: grid;
    grid-template-columns: minmax(220px, 300px) minmax(280px, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 68px;
    margin-bottom: 10px;
    padding: 10px 14px;
    border: 1px solid var(--eco-border);
    border-radius: var(--border-radius-lg);
    background: var(--eco-surface);
    box-shadow: var(--eco-shadow);
    backdrop-filter: blur(12px);
}

.studio-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--eco-text);
    text-decoration: none;
}

.studio-logo-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--sp-primary);
    box-shadow: 0 6px 0 rgba(2, 132, 199, 0.35);
    font-size: 1.1rem;
}

.studio-logo strong,
.studio-logo small,
.studio-challenge strong,
.studio-challenge p {
    display: block;
}

.studio-logo strong {
    font-family: "Fredoka", "Outfit", sans-serif;
    font-size: 1.08rem;
    line-height: 1.1;
}

.studio-logo small {
    margin-top: 4px;
    color: var(--eco-muted);
    font-size: 0.78rem;
}

.studio-challenge {
    padding: 10px 14px;
    border-radius: var(--border-radius-md);
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.95), rgba(219, 234, 254, 0.9));
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.studio-challenge strong {
    color: var(--primary-dark);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.studio-challenge p {
    margin: 4px 0 8px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.4;
}

.challenge-progress {
    display: flex;
    gap: 6px;
}

.challenge-star {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.35);
    position: relative;
    transition: transform 0.25s ease, background 0.25s ease;
}

.challenge-star::before {
    content: "\f005";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 11px;
    color: #fff;
}

.challenge-star.earned {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    transform: scale(1.08);
    animation: star-pop 0.45s ease;
}

@keyframes star-pop {
    0% { transform: scale(0.6); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1.08); }
}

.studio-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.eco-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--btn-surface-border);
    border-radius: 14px;
    padding: 10px 14px;
    color: var(--eco-text);
    background: var(--btn-surface);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.eco-btn-primary {
    color: #fff;
    border-color: transparent;
    background: var(--sp-primary);
    box-shadow: 0 6px 0 rgba(2, 132, 199, 0.35);
}

.eco-btn-portal {
    background: linear-gradient(180deg, #f8fafc, #e2e8f0);
}

.eco-btn:hover,
.eco-btn-portal:hover {
    transform: translateY(-2px);
}

.eco-btn:active {
    transform: translateY(1px);
}

.studio-layout {
    display: grid;
    grid-template-columns: 190px minmax(400px, 1.05fr) minmax(420px, 0.95fr);
    gap: 10px;
    align-items: stretch;
    min-height: min(78vh, 760px);
}

.studio-toolbox,
.studio-codeboard,
.studio-stage-card,
.gallery-shell,
.teacher-notes article {
    border: 1px solid var(--eco-border);
    background: var(--eco-card);
    box-shadow: var(--eco-shadow);
    backdrop-filter: blur(10px);
}

.studio-toolbox {
    padding: 12px;
    border-radius: 20px 10px 10px 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(224, 242, 254, 0.88));
}

.studio-toolbox .block-list {
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    padding-right: 4px;
}

.studio-panel-head,
.codeboard-toolbar,
.stage-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.studio-panel-head {
    display: block;
    margin-bottom: 10px;
}

.studio-panel-head h2,
.codeboard-toolbar h2,
.stage-toolbar h2,
.gallery-info h2,
.teacher-notes h2 {
    margin: 0;
    font-family: "Fredoka", "Outfit", sans-serif;
    color: var(--eco-text);
    font-size: 1.05rem;
    font-weight: 700;
}

.studio-panel-head p,
.codeboard-toolbar p,
.stage-toolbar p {
    margin: 4px 0 0;
    color: var(--eco-muted);
    font-size: 0.78rem;
}

.block-list,
.program-list {
    display: grid;
    gap: 8px;
}

.block-card,
.program-block {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: 14px;
    text-align: left;
    color: #fff;
    box-shadow: 0 5px 0 rgba(15, 23, 42, 0.18);
}

.block-card {
    min-height: 50px;
    padding: 10px;
    cursor: grab;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.block-card.is-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.block-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.24);
    font-size: 1rem;
}

.block-card strong,
.program-block strong {
    display: block;
    font-size: 0.88rem;
}

.block-card span:not(.block-icon) span,
.program-block small {
    display: block;
    opacity: 0.9;
    font-size: 0.72rem;
}

.studio-toolbox .block-card span:not(.block-icon) span {
    display: none;
}

.studio-codeboard {
    display: grid;
    grid-template-rows: auto 1fr auto;
    border-radius: 10px;
    overflow: hidden;
}

.codeboard-toolbar {
    padding: 12px 14px;
    border-bottom: 1px solid var(--eco-border);
    background: rgba(255, 255, 255, 0.94);
}

.event-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    border-radius: 12px;
    padding: 10px 13px;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 5px 0 rgba(5, 150, 105, 0.28);
    cursor: pointer;
    font-weight: 800;
}

.program-canvas {
    position: relative;
    min-height: 500px;
    padding: 20px;
    overflow: auto;
    background:
        radial-gradient(circle, rgba(37, 99, 235, 0.1) 1px, transparent 1.4px) 0 0 / 22px 22px,
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    transition: outline 0.2s ease;
}

.program-canvas.is-drag-over {
    outline: 3px dashed rgba(14, 165, 233, 0.55);
    outline-offset: -6px;
}

.program-canvas .program-list {
    width: min(100%, 440px);
    min-height: 0;
    gap: 6px;
}

.program-block {
    justify-content: space-between;
    padding: 10px 12px;
    min-height: 50px;
    border-radius: 12px 18px 18px 12px;
    cursor: grab;
    transition: transform 0.2s ease, outline 0.2s ease;
}

.program-block.is-dragging {
    opacity: 0.5;
}

.program-block.is-drop-target {
    outline: 2px dashed rgba(255, 255, 255, 0.75);
}

.program-block.is-running {
    outline: 4px solid rgba(251, 191, 36, 0.95);
    transform: translateX(8px) scale(1.02);
    z-index: 2;
}

.program-block.pop-in {
    animation: pop-in 0.45s ease;
}

.program-grip {
    opacity: 0.7;
    font-size: 0.85rem;
}

.program-actions {
    display: flex;
    gap: 5px;
}

.program-actions button {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: inherit;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
}

.program-empty {
    display: none;
    margin-top: 12px;
    padding: 28px 18px;
    border: 2px dashed rgba(14, 165, 233, 0.35);
    border-radius: 18px;
    color: var(--eco-muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.72);
}

.program-empty.visible {
    display: grid;
    gap: 6px;
    place-items: center;
    min-height: 180px;
}

.program-empty i {
    font-size: 1.6rem;
    color: var(--eco-accent);
}

.program-empty p {
    margin: 0;
    font-weight: 700;
    color: var(--eco-text);
}

.program-empty small {
    color: var(--eco-muted);
}

.studio-runbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--eco-border);
    background: rgba(255, 255, 255, 0.96);
}

.round-run,
.round-tool {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 900;
    transition: transform 0.18s ease;
}

.round-run {
    width: 56px;
    height: 56px;
    color: #fff;
    background: var(--sp-primary);
    box-shadow: 0 6px 0 rgba(2, 132, 199, 0.35);
    font-size: 1.1rem;
}

.round-tool {
    width: 42px;
    height: 42px;
    color: var(--primary-dark);
    background: #e0f2fe;
    box-shadow: 0 4px 0 rgba(14, 165, 233, 0.2);
}

.round-run:hover,
.round-tool:hover {
    transform: translateY(-2px);
}

.run-log {
    flex: 1;
    min-width: 120px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--primary-dark);
    background: rgba(224, 242, 254, 0.9);
    font-weight: 700;
    font-size: 0.9rem;
}

.studio-stage-card {
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 12px;
    border-radius: 10px 20px 20px 10px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.9));
    min-height: 0;
}

.studio-stage-card .stage.stage--photo {
    width: 100%;
    min-height: min(64vh, 700px);
    height: min(64vh, 700px);
}

.stage-toolbar {
    padding: 0 2px 10px;
}

.stage-toolbar h2,
.stage-toolbar p {
    color: #f8fafc;
}

.stage-toolbar p {
    opacity: 0.8;
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 8px 12px;
    color: #0f172a;
    background: #86efac;
    font-size: 0.78rem;
    font-weight: 800;
}

.stage {
    position: relative;
    height: 100%;
    min-height: 560px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    background: #0f172a;
    box-shadow: inset 0 -20px 60px rgba(15, 23, 42, 0.15);
}

.stage--photo {
    background: #3a5a4e;
    border-color: rgba(255, 255, 255, 0.28);
}

.stage-photo {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.stage-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 48%;
    transform: scale(1.1);
    transform-origin: center center;
}

.stage-vignette--soft {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, transparent 14%),
        linear-gradient(0deg, rgba(15, 23, 42, 0.3) 0%, transparent 30%);
}

.stage-sky {
    position: absolute;
    inset: 0 0 54%;
    z-index: 2;
    background: linear-gradient(180deg, #7dd3fc 0%, #bae6fd 100%);
    pointer-events: none;
}

.stage-sky--lite {
    inset: 0;
    background: transparent;
}

.stage-vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.cloud {
    position: absolute;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    animation: cloud-drift 18s linear infinite;
}

.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: inherit;
}

.cloud-a {
    width: 72px;
    height: 28px;
    top: 18%;
    left: -80px;
}

.cloud-a::before { width: 34px; height: 34px; top: -16px; left: 10px; }
.cloud-a::after { width: 42px; height: 42px; top: -20px; left: 32px; }

.cloud-b {
    width: 58px;
    height: 22px;
    top: 32%;
    left: -60px;
    animation-delay: -8s;
    opacity: 0.85;
}

.cloud-b::before { width: 28px; height: 28px; top: -12px; left: 8px; }
.cloud-b::after { width: 32px; height: 32px; top: -14px; left: 24px; }

@keyframes cloud-drift {
    from { transform: translateX(0); }
    to { transform: translateX(calc(100vw + 160px)); }
}

.stage-mountain {
    position: absolute;
    left: 4%;
    right: 6%;
    bottom: 38%;
    height: 180px;
    background: linear-gradient(135deg, #64748b, #334155);
    clip-path: polygon(0 100%, 24% 18%, 42% 55%, 58% 10%, 100% 100%);
    opacity: 0.9;
}

.stage-river {
    position: absolute;
    left: 32%;
    bottom: -18%;
    width: 30%;
    height: 58%;
    border-radius: 60% 60% 0 0;
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.75), rgba(2, 132, 199, 0.95));
    transform: rotate(6deg);
}

.stage-ground {
    position: absolute;
    inset: auto 0 0;
    height: 36%;
    background:
        radial-gradient(circle at 14% 58%, rgba(34, 197, 94, 0.4) 0 18px, transparent 20px),
        radial-gradient(circle at 74% 62%, rgba(74, 222, 128, 0.35) 0 24px, transparent 26px),
        linear-gradient(180deg, #86efac, #4ade80);
}

.sprite {
    position: absolute;
    z-index: 8;
    display: grid;
    place-items: center;
    border-radius: 20px;
    user-select: none;
    touch-action: none;
}

.hero-sprite {
    left: 28px;
    bottom: 52px;
    width: 76px;
    height: 88px;
    background: transparent;
    box-shadow: none;
    transition: transform 0.42s cubic-bezier(0.34, 1.2, 0.64, 1);
    transform-origin: center bottom;
}

.hero-sprite img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.25));
}

.hero-sprite.is-walking {
    animation: hero-bob 0.42s ease infinite;
}

.hero-sprite.is-turning {
    animation: hero-turn 0.48s ease;
}

.hero-sprite.is-running img {
    filter: drop-shadow(0 10px 18px rgba(14, 165, 233, 0.45));
}

@keyframes hero-bob {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -4px; }
}

@keyframes hero-turn {
    0% { scale: 1; }
    50% { scale: 1.08; }
    100% { scale: 1; }
}

.stage-item {
    cursor: grab;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.28);
    transition: transform 0.2s ease;
}

.stage-item:hover {
    transform: translateY(-3px) scale(1.04);
}

.stage-item.is-dragging {
    cursor: grabbing;
    z-index: 20;
    transform: scale(1.08);
}

.stage-item.pop-in {
    animation: pop-in 0.5s ease;
}

.stage-item.vanish {
    animation: vanish-out 0.35s ease forwards;
}

.stage-svg,
.gallery-svg {
    width: 82%;
    height: 82%;
}

.stage-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.speech {
    position: absolute;
    z-index: 10;
    left: 88px;
    bottom: 132px;
    display: none;
    max-width: 220px;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 4px;
    color: var(--eco-text);
    background: #fff;
    box-shadow: var(--shadow-md);
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform 0.35s ease;
}

.speech.visible {
    display: block;
}

.speech.pop-in {
    animation: pop-in 0.35s ease;
}

.stage-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 30;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -12px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    to {
        transform: translateY(520px) rotate(540deg);
        opacity: 0;
    }
}

@keyframes pop-in {
    0% { transform: scale(0.7); opacity: 0.4; }
    70% { transform: scale(1.06); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes vanish-out {
    to { transform: scale(0.2) rotate(20deg); opacity: 0; }
}

.gallery-shell {
    display: grid;
    grid-template-columns: minmax(240px, 320px) 1fr;
    gap: 18px;
    margin-top: 14px;
    padding: 18px;
    border-radius: var(--border-radius-xl);
}

.eco-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(224, 242, 254, 0.95);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gallery-info h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.gallery-info p {
    color: var(--eco-muted);
    line-height: 1.5;
}

.upload-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    color: #fff;
    background: var(--sp-primary);
    box-shadow: 0 6px 0 rgba(2, 132, 199, 0.35);
    cursor: pointer;
    font-weight: 800;
    position: relative;
}

.upload-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.gallery-tab {
    padding: 10px 14px;
    border: 1px solid var(--eco-border);
    border-radius: 999px;
    color: var(--eco-text);
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-weight: 700;
}

.gallery-tab.active {
    color: #fff;
    border-color: transparent;
    background: var(--sp-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.gallery-item {
    min-height: 124px;
    padding: 10px;
    border: 1px solid var(--eco-border);
    border-radius: 16px;
    color: var(--eco-text);
    background: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.gallery-item.picked {
    animation: pop-in 0.4s ease;
    outline: 3px solid rgba(14, 165, 233, 0.5);
}

.gallery-preview {
    display: grid;
    height: 72px;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(224, 242, 254, 0.9), rgba(219, 234, 254, 0.85));
    overflow: hidden;
}

.gallery-preview img {
    max-width: 86%;
    max-height: 86%;
    object-fit: contain;
}

.gallery-preview span {
    font-size: 2.2rem;
}

.gallery-item strong {
    display: block;
    font-size: 0.86rem;
}

.gallery-item small {
    color: var(--eco-muted);
    font-size: 0.76rem;
}

.gallery-empty {
    grid-column: 1 / -1;
    padding: 20px;
    color: var(--eco-muted);
    text-align: center;
}

.teacher-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.teacher-notes article {
    padding: 20px;
    border-radius: var(--border-radius-lg);
}

.teacher-notes p {
    color: var(--eco-muted);
    line-height: 1.55;
}

.tips-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.tips-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.tips-list i {
    color: var(--eco-accent);
    width: 18px;
    text-align: center;
}

kbd {
    padding: 2px 7px;
    border-radius: 6px;
    border: 1px solid var(--eco-border);
    background: #f1f5f9;
    font-size: 0.82rem;
    font-family: inherit;
}

.eco-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(120%);
    z-index: 9999;
    min-width: min(92vw, 360px);
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.92);
    color: #f8fafc;
    font-weight: 700;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

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

.eco-toast.is-success {
    background: linear-gradient(135deg, #059669, #047857);
}

.eco-toast.is-warn {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.block-motion { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.block-look { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.block-nature { background: linear-gradient(135deg, #10b981, #059669); }
.block-care { background: linear-gradient(135deg, #f97316, #ea580c); }
.block-time { background: linear-gradient(135deg, #64748b, #475569); }
.block-control { background: linear-gradient(135deg, #f59e0b, #d97706); }

.program-block.is-repeat {
    border-left: 5px solid rgba(255, 255, 255, 0.65);
}

.program-block.is-repeat + .program-block {
    margin-left: 18px;
    width: calc(100% - 18px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.16), inset 4px 0 0 rgba(251, 191, 36, 0.75);
}

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

.grade-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.grade-picker select {
    border: 1px solid rgba(14, 165, 233, 0.35);
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--eco-text);
    background: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sound-toggle {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 10px;
    color: var(--primary-dark);
    background: #fff;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.sound-toggle.is-muted {
    color: var(--eco-muted);
    background: #f1f5f9;
}

.sound-toggle:hover {
    background: #e0f2fe;
}

@media (max-width: 1160px) {
    .studio-topbar,
    .studio-layout,
    .gallery-shell,
    .teacher-notes {
        grid-template-columns: 1fr;
    }

    .studio-actions {
        justify-content: flex-start;
    }

    .studio-layout {
        min-height: 0;
    }

    .studio-toolbox,
    .studio-codeboard,
    .studio-stage-card {
        border-radius: 16px;
    }

    .studio-stage-card .stage.stage--photo {
        min-height: min(52vh, 520px);
        height: min(52vh, 520px);
    }

    .studio-stage-card .stage {
        min-height: 400px;
    }
}

@media (max-width: 640px) {
    .eco-studio {
        width: min(100% - 10px, 720px);
    }

    .studio-topbar {
        padding: 10px;
    }

    .studio-actions .eco-btn {
        flex: 1 1 calc(50% - 8px);
        justify-content: center;
    }

    .stage {
        min-height: 320px;
    }
}
