/* Insula Ta (/insula-ta/): the block-coding game for beginners (templates/insula.php + assets/insula.js). */
.ins { --ins-bg: #07121f; --ins-panel: #0e1b2c; --ins-panel2: #12233a; --ins-line: rgba(148, 163, 184, .16); --ins-teal: #2dd4bf; --ins-gold: #fbbf24; --ins-text: #e2e8f0; --ins-mute: #94a3b8;
    --c-move: #38bdf8; --c-act: #4ade80; --c-loop: #fb923c; --c-cond: #c084fc; --c-var: #f472b6; --c-fn: #fbbf24; --c-ev: #f87171;
    position: relative; color: var(--ins-text); background: radial-gradient(1200px 600px at 80% -10%, rgba(45, 212, 191, .1), transparent 60%), linear-gradient(180deg, #081627, var(--ins-bg)); min-height: calc(100vh - 64px); overflow: hidden; font-family: inherit; }
.ins *, .ins *::before, .ins *::after { box-sizing: border-box; }
.ins-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ins [hidden] { display: none !important; }
.ins-kick { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ins-teal); }
.ins-h { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ins-mute); margin-bottom: 8px; }
.ins-h small { font-weight: 600; letter-spacing: 0; text-transform: none; opacity: .8; }
.ins-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .35); color: #fde68a; font-weight: 800; }

/* buttons */
.ins-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border-radius: 14px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; border: 0; text-decoration: none !important; transition: transform .15s, box-shadow .15s, filter .15s; }
.ins-btn:active { transform: translateY(2px); }
.ins-btn--go { color: #052e2b !important; background: linear-gradient(180deg, #5eead4, #14b8a6); box-shadow: 0 5px 0 #0f766e, 0 14px 30px -10px rgba(45, 212, 191, .7); }
.ins-btn--go:hover { filter: brightness(1.07); }
.ins-btn--go:active { box-shadow: 0 2px 0 #0f766e; }
.ins-btn--ghost { color: var(--ins-text) !important; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .16); }
.ins-btn--ghost:hover { background: rgba(255, 255, 255, .1); }
.ins-btn--sm { padding: 9px 16px; font-size: 14px; border-radius: 11px; }
.ins-btn--go.ins-btn--sm { box-shadow: 0 3px 0 #0f766e; }
.ins-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ins-text); background: rgba(255, 255, 255, .06); border: 1px solid var(--ins-line); cursor: pointer; }
.ins-chip:hover { background: rgba(255, 255, 255, .1); }
.ins-chip--hint { color: #fde68a; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .1); animation: ins-glowp 1.6s ease-in-out infinite; }
.ins-link { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--ins-mute); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-transform: none; letter-spacing: 0; }
.ins-link:hover { color: var(--ins-text); }
.ins-progw .ins-h .ins-link { margin-left: auto; }

/* sea animation shared by every scene */
.ins-sea-a { animation: ins-sea 14s linear infinite; }
@keyframes ins-sea { to { transform: translateX(140px); } }
.ins-float { animation: ins-float 3.4s ease-in-out infinite; }
.ins-float--b { animation-duration: 4.2s; animation-delay: -1s; }
@keyframes ins-float { 50% { transform: translateY(-7px) rotate(-4deg); } }
.bot-wave { animation: ins-bob 2.2s ease-in-out infinite; }
@keyframes ins-bob { 50% { transform: translateY(-4px); } }

/* ---------- intro ---------- */
.ins-intro { position: relative; min-height: calc(100vh - 64px); display: flex; align-items: center; }
.ins-intro__sky i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; box-shadow: 120px 80px #fff, 340px 40px rgba(255,255,255,.6), 620px 120px #fff, 900px 60px rgba(255,255,255,.7), 1100px 140px #fff, 1300px 30px rgba(255,255,255,.5), 200px 200px rgba(255,255,255,.4), 760px 220px rgba(255,255,255,.5); opacity: .5; animation: ins-tw 3s ease-in-out infinite; }
.ins-intro__sky i:nth-child(2) { left: 60px; top: 40px; animation-delay: -1s; }
.ins-intro__sky i:nth-child(3) { left: 30px; top: 110px; animation-delay: -2s; }
@keyframes ins-tw { 50% { opacity: .15; } }
.ins-intro__in { position: relative; width: min(1200px, 100%); margin: 0 auto; padding: 48px 24px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.ins-intro__txt h1 { margin: 10px 0 14px; font-size: clamp(48px, 7vw, 92px); line-height: .95; font-weight: 900; letter-spacing: -.03em; color: #fff; background: linear-gradient(180deg, #fff 30%, #99f6e4); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ins-intro__lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: #cbd5e1; margin: 0 0 18px; }
.ins-intro__lead b { color: #fff; }
.ins-intro__steps { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.ins-intro__steps li { position: relative; padding: 10px 14px 10px 50px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--ins-line); color: #cbd5e1; counter-increment: s; }
.ins-intro__steps li::before { content: counter(s); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; color: #052e2b; background: var(--ins-teal); }
.ins-intro__steps b { color: #fff; }
.ins-intro__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.ins-intro__cta .ins-btn--go { font-size: 18px; padding: 16px 30px; }
.ins-intro__fine { margin: 14px 0 0; color: var(--ins-mute); font-size: 14px; }
.ins-intro__art { position: relative; }
.ins-intro__art::before { content: ""; position: absolute; inset: 8% 4% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(45, 212, 191, .22), transparent); filter: blur(10px); }
.ins-intro__svg { position: relative; width: 100%; height: auto; display: block; -webkit-mask-image: radial-gradient(ellipse 72% 72% at 50% 55%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 72% 72% at 50% 55%, #000 62%, transparent 100%); }
.ins-intro__svg .lh-l .lh-rot { animation: ins-sweep 6s ease-in-out infinite; }
.ins-bottle-note { display: flex; gap: 12px; align-items: center; margin: 0 0 18px; padding: 12px 16px; border-radius: 16px; background: linear-gradient(170deg, #f6e7bf, #dcc28a); color: #3b2410; box-shadow: inset 0 0 18px rgba(120, 72, 20, .3); }
.ins-bottle-note p { margin: 0; font-size: 15px; line-height: 1.45; }

/* ---------- map ---------- */
.ins-map { width: min(1200px, 100%); margin: 0 auto; padding: 32px 24px 40px; animation: ins-in .4s ease both; }
.ins-map__head { text-align: center; max-width: 760px; margin: 0 auto 14px; }
.ins-map__head h2 { margin: 6px 0 8px; font-size: clamp(26px, 3.2vw, 38px); line-height: 1.15; font-weight: 900; color: #fff; }
.ins-map__head p { margin: 0 0 16px; color: var(--ins-mute); }
.ins-map__bar { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; }
.ins-map__sea { margin-top: 18px; border-radius: 28px; overflow: hidden; border: 1px solid rgba(94, 234, 212, .2); background: linear-gradient(180deg, #0f4c73, #0a2d4a); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 0 80px rgba(0, 0, 0, .25); }
.ins-map__svg { display: block; width: 100%; height: auto; }
.ins-route { fill: none; stroke: rgba(254, 243, 199, .55); stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; }
.ins-isl { cursor: pointer; outline: none; }
.ins-isl > * { transition: transform .2s; }
.ins-isl:hover .ins-isl__art, .ins-isl:focus-visible .ins-isl__art { transform: translateY(-6px) scale(1.08); }
.ins-isl__foam { fill: rgba(236, 253, 245, .28); }
.ins-isl__sand { fill: url(#insSand); }
.ins-isl__lbl rect { fill: rgba(7, 18, 31, .82); stroke: rgba(94, 234, 212, .35); }
.ins-isl__lbl text { fill: #fff; font: 800 14px Inter, system-ui, sans-serif; text-anchor: middle; }
.ins-isl__st path { fill: rgba(255, 255, 255, .18); }
.ins-isl__st path.on { fill: #fbbf24; }
.ins-isl.is-lock { cursor: not-allowed; }
.ins-isl.is-lock .ins-isl__art, .ins-isl.is-lock .ins-isl__sand { filter: grayscale(1) brightness(.6); }
.ins-isl.is-lock .ins-isl__lbl text { fill: #94a3b8; }
.ins-isl.is-next .ins-isl__foam { animation: ins-ring 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.ins-isl.is-next .ins-isl__lbl rect { fill: #14b8a6; stroke: #99f6e4; }
.ins-isl.is-next .ins-isl__lbl text { fill: #052e2b; }
.ins-isl.is-done .ins-isl__lbl rect { stroke: rgba(251, 191, 36, .6); }
.ins-isl.is-flash .ins-isl__art { animation: ins-hop .6s ease 2; }
@keyframes ins-ring { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes ins-hop { 50% { transform: translate(0, -18px) scale(1.1); } }
.ins-map__bit { pointer-events: none; }

/* ---------- play ---------- */
.ins-play { width: min(1440px, 100%); margin: 0 auto; padding: 14px 20px 28px; animation: ins-in .35s ease both; }
@keyframes ins-in { from { opacity: 0; transform: translateY(10px); } }
.ins-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.ins-top__t { display: grid; line-height: 1.15; }
.ins-top__n { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ins-teal); }
.ins-top__name { font-size: 22px; font-weight: 900; color: #fff; }
.ins-top__goal { flex: 1; margin: 0; padding: 9px 14px; border-radius: 12px; background: rgba(251, 191, 36, .08); border: 1px dashed rgba(251, 191, 36, .35); color: #fde68a; font-weight: 700; font-size: 14px; }
.ins-top__goal::before { content: "Misiune: "; color: var(--ins-gold); font-weight: 900; }
.ins-snd[aria-pressed="false"] { opacity: .6; }
.ins-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); gap: 16px; align-items: start; }
.ins-left { position: sticky; top: 76px; display: grid; gap: 12px; min-width: 0; }
.ins-stage { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); border-radius: 24px; overflow: hidden; border: 1px solid rgba(94, 234, 212, .22); background: #0a2d4a; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .7); }
.ins-view { position: relative; min-width: 0; }
/* The Python code lives inside the stage, next to (wide screens) or right under the island, so it runs in sight. */
.ins-stage > .ins-code { margin: 0; border-radius: 0; border: 0; border-top: 1px solid rgba(94, 234, 212, .2); background: #07111e; padding: 10px 12px; }
.ins-stage > .ins-code pre { max-height: 170px; scroll-behavior: smooth; }
.ins-live { display: none; padding: 2px 8px; border-radius: 99px; background: rgba(34, 197, 94, .18); color: #86efac; letter-spacing: 0; text-transform: none; }
.is-running .ins-live { display: inline-block; animation: ins-glowp 1s ease-in-out infinite; }
.is-running .ins-stage > .ins-code { box-shadow: inset 0 0 0 1px rgba(34, 197, 94, .35); }
@media (min-width: 1300px) {
    .ins-stage:has(> .ins-code:not([hidden])) { grid-template-columns: minmax(0, 1fr) 250px; }
    .ins-stage > .ins-code .ins-h { flex-wrap: wrap; row-gap: 4px; }
    .ins-stage > .ins-code { grid-row: 1; grid-column: 2; border-top: 0; border-left: 1px solid rgba(94, 234, 212, .2); display: flex; flex-direction: column; }
    .ins-stage > .ins-code pre { flex: 1 1 0; max-height: none; min-height: 0; }
    .ins-stage > .ins-say { grid-column: 1 / -1; }
}
.ins-scene { display: grid; place-items: center; min-height: 300px; }
.ins-svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 250px); }
@media (max-width: 1299px) { .ins-stage:has(> .ins-code:not([hidden])) .ins-svg { max-height: calc(100vh - 440px); min-height: 220px; } }
.ins-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ins-hud { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; pointer-events: none; }
.ins-var { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(7, 18, 31, .85); border: 1.5px solid var(--c-var); color: #fff; font-weight: 800; box-shadow: 0 8px 20px -8px rgba(244, 114, 182, .6); }
.ins-var code { font: 700 15px ui-monospace, SFMono-Regular, Menlo, monospace; color: #f9a8d4; }
.ins-var b { min-width: 22px; text-align: center; font-size: 20px; color: #fde68a; }
.ins-var.is-bump b { animation: ins-bump .45s ease; }
.ins-var--map { border-color: var(--c-cond); box-shadow: none; }
@keyframes ins-bump { 40% { transform: scale(1.7); color: #fff; } }
.ins-say { position: relative; display: flex; gap: 12px; align-items: flex-start; min-height: 74px; padding: 12px 16px; background: #0b1a2c; border-top: 1px solid rgba(94, 234, 212, .25); }
.ins-say.is-fail { background: #2a1015; border-top-color: rgba(248, 113, 113, .6); }
.ins-say.is-fail .ins-say__ava { animation: ins-shake .4s ease; }
.ins-say__ava { flex: 0 0 auto; width: 46px; height: 50px; display: grid; place-items: center; border-radius: 14px; background: rgba(45, 212, 191, .12); }
.ins-say__ava svg { width: 40px; height: 44px; }
.ins-say__in { flex: 1; min-width: 0; }
.ins-say p { margin: 2px 0 0; font-size: 15px; line-height: 1.5; color: #f1f5f9; min-height: 1.5em; }
.ins-say__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-say__btns:not(:empty) { margin-top: 10px; }

/* scene sprites */
.ins-cell { fill: rgba(120, 80, 30, .06); stroke: rgba(146, 98, 40, .28); stroke-width: 1.5; stroke-dasharray: 4 5; }
.ins-rw { animation: ins-rw 2.5s linear infinite; }
@keyframes ins-rw { to { transform: translateY(24px); } }
.bot { transition: transform calc(.36s / var(--ins-sp, 1)) cubic-bezier(.4, 0, .2, 1); }
.bot-dir { transition: transform .28s ease; }
.bot-eyes { transition: transform .25s ease; }
.bot-b { animation: ins-bob 1.6s ease-in-out infinite; }
.bot-ant { animation: ins-blink 2s ease-in-out infinite; }
@keyframes ins-blink { 50% { fill: #fde68a; } 55% { fill: #f97316; } }
.bot.is-sink .bot-b { animation: ins-sink .7s ease-in forwards; }
.bot.is-sink .bot-sh, .bot.is-sink .bot-dir { opacity: 0; transition: opacity .3s; }
@keyframes ins-sink { 30% { transform: translateY(6px) rotate(-12deg); } 100% { transform: translateY(26px) scale(.4) rotate(20deg); opacity: 0; } }
.bot.is-dizzy .bot-b { animation: ins-shake .45s ease; }
.bot.is-happy .bot-b { animation: ins-jump .5s ease 3; }
@keyframes ins-jump { 50% { transform: translateY(-16px); } }
@keyframes ins-shake { 20% { transform: translateX(-5px) rotate(-6deg); } 40% { transform: translateX(5px) rotate(6deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.sp-coin__s { animation: ins-coin 1.8s ease-in-out infinite; }
@keyframes ins-coin { 50% { transform: scaleX(.25); } }
.o-coin.is-taken > * { animation: ins-take .5s ease forwards; }
@keyframes ins-take { to { transform: translateY(-50px) scale(.5); opacity: 0; } }
.sp-chest__glow, .sp-chest__gold { opacity: 0; transition: opacity .4s; }
.sp-chest__lid { transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 0 -4px; }
.o-chest.is-open .sp-chest__lid { transform: translate(0, -10px) rotate(-14deg); }
.o-chest.is-open .sp-chest__glow, .o-chest.is-open .sp-chest__gold { opacity: 1; }
.o-chest.is-open .sp-chest__gold { animation: ins-hop .6s ease 2; }
.ins-grow { animation: ins-grow .55s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes ins-grow { from { transform: scale(0); } }
.o-rock.is-crumble .o-rock__in { animation: ins-crumble .45s ease forwards; }
@keyframes ins-crumble { 30% { transform: scale(1.15); } 100% { transform: scale(.2) translateY(30px); opacity: 0; } }
.ins-plank { animation: ins-plank .3s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes ins-plank { from { transform: translateY(-30px) scale(.6); opacity: 0; } }
.lh > g { opacity: 0; transition: opacity .35s, transform .45s cubic-bezier(.3, 1.6, .5, 1); transform: translateY(-14px); }
.lh[data-st="1"] .lh-b, .lh[data-st="2"] .lh-b, .lh[data-st="2"] .lh-t, .lh[data-st="3"] > g { opacity: 1; transform: none; }
.lh[data-st="3"] .lh-spot { opacity: 0; }
.lh .lh-beamw, .lh .lh-glow { display: none; }
.lh[data-st="3"] .lh-glow { display: inline; }
.lh-spot { animation: ins-glowp 1.6s ease-in-out infinite; }
.lh-rot { animation: ins-sweep 6s ease-in-out infinite; }
@keyframes ins-sweep { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1); } 100% { transform: scaleX(1); } }
.lh[data-st="3"] .lh-glow, .ins-lhg .lh-glow, .ins-intro__svg .lh-glow { animation: ins-flash 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ins-flash { 0%, 100% { opacity: .45; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.25); } }
@keyframes ins-spin { to { transform: rotate(360deg); } }
@keyframes ins-glowp { 50% { opacity: .55; } }
.ins-lhg { opacity: 0; transition: opacity .8s; }
.ins-lhg.is-lit { opacity: 1; }
.ins-night { fill: #050a1f; opacity: 0; transition: opacity 1.5s ease; pointer-events: none; }
.is-night .ins-night { opacity: .66; }
.ins-sky { opacity: 0; transition: opacity 1s; }
.is-starry .ins-sky { opacity: 1; }
.ins-star { fill: #fff; animation: ins-tw 2.4s ease-in-out infinite; }
.o-boat { cursor: pointer; outline: none; }
.o-boat__bob { animation: ins-float 3s ease-in-out infinite; }
.o-boat__go { transition: transform 2.6s cubic-bezier(.5, 0, .7, 1), opacity 2.6s; }
.o-boat.is-sail .o-boat__go { transform: translate(260px, -40px) scale(.6); opacity: 0; }
.o-boat.is-call .o-boat__bob { animation: ins-call .9s ease-in-out infinite; }
@keyframes ins-call { 50% { transform: scale(1.12) translateY(-6px); } }
.sp-boat__lamp { filter: drop-shadow(0 0 6px #fde68a); }
.ins-pop text { font: 900 18px Inter, system-ui, sans-serif; fill: #fff; text-anchor: middle; paint-order: stroke; stroke: rgba(7, 18, 31, .8); stroke-width: 5px; }
.ins-pop { animation: ins-popup 1.2s ease forwards; }
.ins-pop.is-gold text { fill: #fde68a; font-size: 24px; }
.ins-pop.is-ev text { fill: #fca5a5; font-size: 20px; }
@keyframes ins-popup { from { opacity: 0; transform: translateY(10px); } 20% { opacity: 1; } 75% { opacity: 1; } to { opacity: 0; transform: translateY(-26px); } }
.ins-puff { animation: ins-puff .65s ease-out forwards; }
@keyframes ins-puff { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.ins-pop, .ins-puff, .o-coin > *, .o-rock__in, .ins-grow, .ins-plank, .lh > g, .o-boat__go, .o-boat__bob, .bot-b, .sp-coin__s { transform-box: view-box; }

/* ---------- workspace ---------- */
.ins-work { display: grid; gap: 12px; }
.ins-pal, .ins-progw, .ins-code { padding: 14px; border-radius: 20px; background: var(--ins-panel); border: 1px solid var(--ins-line); }
.ins-pal { transition: background .2s, border-color .2s; }
.ins-pal.is-trash { border-color: rgba(248, 113, 113, .6); background: rgba(127, 29, 29, .25); }
.ins-pal.is-trash .ins-h::after { content: "Lasă blocul aici ca să-l ștergi"; margin-left: auto; color: #fca5a5; letter-spacing: 0; text-transform: none; }
.ins-pal__list { display: flex; flex-wrap: wrap; gap: 8px; }
.ins-progw { min-height: 220px; transition: border-color .2s, box-shadow .2s; }
.ins-progw.is-over { border-color: rgba(94, 234, 212, .6); box-shadow: 0 0 0 4px rgba(45, 212, 191, .12); }
.ins-count { margin-left: 4px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: #cbd5e1; letter-spacing: 0; text-transform: none; }
.ins-count:empty { display: none; }
.ins-prog { max-height: 46vh; overflow: auto; padding: 2px; scrollbar-width: thin; }
.ins-slot { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 44px; padding: 6px; border-radius: 12px; }
.ins-slot--root { min-height: 160px; padding: 10px; border: 2px dashed rgba(148, 163, 184, .22); background: repeating-linear-gradient(0deg, transparent 0 23px, rgba(148, 163, 184, .05) 23px 24px); }
.ins-slot:empty::before { content: attr(data-ph); display: grid; place-items: center; align-self: stretch; min-height: 32px; color: #64748b; font-size: 13px; font-weight: 700; }
.ins-slot--root:empty::before { min-height: 136px; font-size: 15px; }
.ins-slot.is-active { outline: 2px solid var(--ins-gold); outline-offset: -2px; background: rgba(251, 191, 36, .08); }
.ins-mark { align-self: stretch; height: 6px; border-radius: 6px; background: var(--ins-teal); box-shadow: 0 0 14px rgba(45, 212, 191, .9); margin: -1px 0; }

.ins-b { --c: var(--c-move); position: relative; display: inline-grid; max-width: 100%; border-radius: 12px; color: #04131f; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .22), 0 6px 14px -8px rgba(0, 0, 0, .7); cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation; transition: transform .12s, box-shadow .12s, filter .12s; }
.ins-b:hover { filter: brightness(1.06); }
.ins-b.c-act { --c: var(--c-act); }
.ins-b.c-loop { --c: var(--c-loop); }
.ins-b.c-cond { --c: var(--c-cond); }
.ins-b.c-var { --c: var(--c-var); }
.ins-b.c-fn { --c: var(--c-fn); }
.ins-b.c-ev { --c: var(--c-ev); }
.ins-b__row { display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.ins-b__ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: rgba(255, 255, 255, .35); }
.ins-b__ic svg { width: 16px; height: 16px; }
.ins-b__py { display: none; padding: 0 12px 8px 43px; margin-top: -6px; font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; color: rgba(4, 19, 31, .72); white-space: nowrap; }
.show-py .ins-prog .ins-b__py { display: block; }
.ins-b.is-wrap { display: grid; min-width: 220px; padding-bottom: 0; }
.ins-b.is-wrap > .ins-slot { margin: 0 0 0 16px; min-width: 180px; background: rgba(7, 18, 31, .82); border-radius: 10px 0 0 10px; }
.ins-b.is-wrap > .ins-b__else { padding-top: 6px; padding-bottom: 6px; }
.ins-b.is-wrap > .ins-b__else .ins-b__py { display: none; }
.show-py .ins-b.is-wrap > .ins-b__else .ins-b__py { display: inline; margin: 0 0 0 6px; padding: 0; }
.ins-b__foot { height: 12px; }
.ins-b.is-hat { border-top-left-radius: 22px; border-top-right-radius: 22px; }
.ins-b.is-hat > .ins-b__row { padding-top: 12px; }
.ins-pal .ins-b.is-wrap { min-width: 0; padding-bottom: 12px; }
.ins-pal .ins-b.is-wrap::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 6px; height: 8px; border-radius: 6px 0 0 6px; background: rgba(7, 18, 31, .7); }
.ins-pal .ins-b.is-wrap .ins-b__row { padding-bottom: 8px; }
.ins-b.is-pulse { animation: ins-pulse 1.4s ease-in-out infinite; }
@keyframes ins-pulse { 50% { box-shadow: 0 0 0 7px rgba(56, 189, 248, .35), inset 0 -3px 0 rgba(0, 0, 0, .22); transform: translateY(-2px); } }
.ins-b.is-tap { animation: ins-tap .3s ease; }
@keyframes ins-tap { 40% { transform: scale(.92); } }
.ins-b.is-new { animation: ins-new .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ins-new { from { transform: scale(.6); opacity: 0; } }
.ins-prog .ins-b.is-run { box-shadow: 0 0 0 3px #fff, 0 0 22px 4px var(--c); filter: brightness(1.12); }
.ins-num { min-width: 24px; padding: 1px 7px; border-radius: 8px; background: rgba(255, 255, 255, .45); text-align: center; }
.ins-step { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(255, 255, 255, .45); }
.ins-step b { min-width: 20px; text-align: center; }
.ins-step button, .ins-x { width: 24px; height: 24px; border: 0; border-radius: 7px; font: 900 16px/1 inherit; color: #04131f; background: rgba(255, 255, 255, .55); cursor: pointer; }
.ins-step button:hover { background: #fff; }
.ins-x { margin-left: 4px; width: 22px; height: 22px; background: rgba(4, 19, 31, .14); opacity: .55; }
.ins-x:hover { opacity: 1; background: rgba(4, 19, 31, .25); }
.ins-chipvar { padding: 2px 8px; border-radius: 99px; background: #fff; color: #9d174d; font: 800 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.ins-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: .92; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .55)); }
.ins-ghost .ins-b { cursor: grabbing; }
.is-dragging, .is-dragging * { cursor: grabbing !important; }
.is-running .ins-pal, .is-running .ins-prog { pointer-events: none; }
.is-running .ins-pal { opacity: .55; }
.is-running .ins-x, .is-running .ins-step button { visibility: hidden; }
.is-shake { animation: ins-shake .4s ease; }

.ins-ctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ins-btn--run { flex: 1 1 220px; font-size: 18px; padding: 15px 22px; color: #052e2b !important; background: linear-gradient(180deg, #86efac, #22c55e); box-shadow: 0 5px 0 #15803d, 0 16px 30px -12px rgba(34, 197, 94, .8); }
.ins-btn--run:active { box-shadow: 0 2px 0 #15803d; }
.ins-btn--run.is-stop { color: #fff !important; background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: 0 5px 0 #991b1b; }

.ins-code pre, .ins-win__code pre, .ins-final__code pre { margin: 0; padding: 12px 0; border-radius: 12px; background: #050d18; border: 1px solid rgba(148, 163, 184, .12); font: 500 14px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; color: #e2e8f0; overflow: auto; white-space: pre; max-height: 260px; }
.ins-code .ln, .ins-win__code .ln { display: block; padding: 0 14px 0 0; transition: background .15s; }
.ins-code .ln em, .ins-win__code .ln em { display: inline-block; width: 34px; padding-right: 10px; text-align: right; font-style: normal; color: #475569; user-select: none; }
.ins-code .ln.is-run { background: rgba(45, 212, 191, .18); box-shadow: inset 3px 0 0 var(--ins-teal); }
.ins-final__code .ln { display: block; padding: 0 14px; }
.ins i.k { font-style: normal; color: #c084fc; font-weight: 700; }
.ins i.f { font-style: normal; color: #67e8f9; }
.ins i.n { font-style: normal; color: #fdba74; }
.ins i.s { font-style: normal; color: #86efac; }
.ins i.c { font-style: normal; color: #64748b; }
.ins-lines { margin-left: auto; color: #5eead4; letter-spacing: 0; text-transform: none; }

/* ---------- guidance: help line, adding-into banner, tips, route preview, hand ---------- */
.ins-pal__help { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; color: var(--ins-mute); background: rgba(255, 255, 255, .03); min-height: 2.9em; }
.ins-pal__help.is-on { color: #e2e8f0; background: rgba(56, 189, 248, .1); }
.ins-pal__help b { color: #fff; }
.ins-into { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; color: #fde68a; background: rgba(251, 191, 36, .1); border: 1px solid rgba(251, 191, 36, .35); }
.ins-into .ins-link { color: #fde68a; }
.ins-tipline { margin: 10px 0 0; padding: 10px 12px 10px 38px; border-radius: 12px; position: relative; font-size: 14px; line-height: 1.45; color: #cbd5e1; background: rgba(45, 212, 191, .07); border: 1px solid rgba(45, 212, 191, .2); }
.ins-tipline::before { content: "💡"; position: absolute; left: 12px; top: 9px; }
.ins-tipline.is-go { color: #bbf7d0; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .45); }
.ins-tipline:empty { display: none; }
.ins-grip { touch-action: none; width: 8px; height: 18px; margin-right: -2px; opacity: .45; background: radial-gradient(circle, #04131f 1.3px, transparent 1.6px) 0 0 / 4px 6px; }
.ins-badge { margin-left: 4px; padding: 2px 8px; border-radius: 99px; background: #04131f; color: #fff; font-size: 12px; font-weight: 800; animation: ins-new .25s ease; }
.ins-prog .ins-b.is-err { box-shadow: 0 0 0 3px #f87171, 0 0 24px 4px rgba(248, 113, 113, .7); animation: ins-shake .45s ease; }
.ins-prog .ins-b.is-err > .ins-b__row::after { content: "aici s-a oprit"; margin-left: 6px; padding: 2px 8px; border-radius: 99px; background: #7f1d1d; color: #fecaca; font-size: 11.5px; }
.ins-prog .ins-b.is-yes > .ins-slot:first-of-type, .ins-prog .ins-b.is-no > .ins-slot:last-of-type { box-shadow: inset 0 0 0 2px #86efac; }
.ins-prog .ins-b.is-call { box-shadow: 0 0 0 3px #fde68a, 0 0 22px 4px rgba(251, 191, 36, .6); }
.is-dragging .ins-progw { border-color: rgba(94, 234, 212, .55); box-shadow: 0 0 0 4px rgba(45, 212, 191, .12); }
.is-dragging .ins-slot--root { border-color: rgba(94, 234, 212, .6); background-color: rgba(45, 212, 191, .05); }
.is-dragging .ins-b.is-wrap > .ins-slot { outline: 2px dashed rgba(255, 255, 255, .35); outline-offset: -3px; min-height: 48px; }
.ins-b.is-wrap > .ins-slot:empty::before { color: #94a3b8; border: 2px dashed rgba(148, 163, 184, .35); border-radius: 8px; padding: 6px 10px; }
.ins-path__line { fill: none; stroke: #fef08a; stroke-width: 5; stroke-dasharray: 2 11; stroke-linecap: round; opacity: .9; }
.ins-path__ar { fill: none; stroke: #fef08a; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.ins-path__end circle { fill: rgba(45, 212, 191, .18); stroke: #5eead4; stroke-width: 2.5; stroke-dasharray: 5 4; }
.ins-path__end path { fill: #fbbf24; opacity: .8; }
.ins-path__bad circle { fill: rgba(239, 68, 68, .85); stroke: #fff; stroke-width: 2.5; }
.ins-path__bad path { stroke: #fff; stroke-width: 3.5; stroke-linecap: round; }
.ins-path__bad { animation: ins-call .9s ease-in-out infinite; transform-box: view-box; transform-origin: 0 0; }
.is-running .ins-path { display: none; }
.ins-goal { fill: rgba(251, 191, 36, .15); stroke: #fbbf24; stroke-width: 2.5; stroke-dasharray: 6 5; animation: ins-glowp 1.4s ease-in-out infinite; }
.o-chest.is-open .ins-goal, .o-hole:has(.ins-grow) .ins-goal { display: none; }
.ins-pop.is-cap text { font-size: 17px; fill: #fff; stroke: #0f766e; stroke-width: 6px; }
.ins-pop.is-cap.is-yes text { stroke: #9a3412; }
.ins-pop.is-cap.is-no text, .ins-pop.is-cap.is-ok text { stroke: #166534; }
.ins-hand { position: absolute; left: 0; top: 0; z-index: 30; pointer-events: none; display: flex; align-items: flex-start; animation: ins-hand 2.8s cubic-bezier(.5, 0, .3, 1) infinite; }
.ins-hand svg { margin: 14px 0 0 -14px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.ins-hand__blk { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--c-move); color: #04131f; font-weight: 800; font-size: 14px; transform: translate(-50%, -50%); box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .7); }
@keyframes ins-hand { 0% { transform: translate(var(--x1), var(--y1)); opacity: 0; } 12% { opacity: 1; transform: translate(var(--x1), var(--y1)); } 65% { transform: translate(var(--x2), var(--y2)); opacity: 1; } 85%, 100% { transform: translate(var(--x2), var(--y2)); opacity: 0; } }

/* ---------- modal ---------- */
.ins-modal { position: fixed; inset: 0; z-index: 9990; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 16, .6); backdrop-filter: blur(4px); opacity: 0; transition: opacity .25s; }
.ins-modal.is-on { opacity: 1; }
.ins-modal__box { width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 26px; background: linear-gradient(180deg, #11233a, #0b1828); border: 1px solid rgba(94, 234, 212, .3); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9); transform: translateY(16px) scale(.97); transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.ins-modal.is-on .ins-modal__box { transform: none; }
.ins-win { padding: 26px; text-align: center; }
.ins-win__stars { display: flex; justify-content: center; gap: 10px; font-size: 56px; line-height: 1; }
.ins-win__stars span { color: rgba(255, 255, 255, .14); animation: ins-star .5s cubic-bezier(.3, 1.8, .5, 1) both; }
.ins-win__stars span.on { color: #fbbf24; text-shadow: 0 0 22px rgba(251, 191, 36, .7); }
.ins-win__stars span:nth-child(2) { font-size: 70px; transform: translateY(-8px); }
@keyframes ins-star { from { transform: scale(0) rotate(-40deg); opacity: 0; } }
.ins-win h2 { margin: 10px 0 4px; font-size: 30px; font-weight: 900; color: #fff; }
.ins-win__sub { margin: 0 0 16px; color: var(--ins-mute); }
.ins-concept { text-align: left; padding: 14px 16px; border-radius: 16px; background: rgba(45, 212, 191, .08); border: 1px solid rgba(45, 212, 191, .3); }
.ins-concept p { margin: 6px 0 0; line-height: 1.55; color: #e2e8f0; }
.ins-win__code { margin-top: 14px; text-align: left; }
.ins-win__aha { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: #cbd5e1; }
.ins-savecard { margin-top: 14px; padding: 14px 16px; border-radius: 16px; text-align: left; background: linear-gradient(170deg, #f6e7bf, #dcc28a); color: #3b2410; }
.ins-savecard p { margin: 4px 0 10px; font-size: 14px; line-height: 1.5; }
.ins-savecard .ins-btn--ghost { color: #3b2410 !important; border-color: rgba(59, 36, 16, .4); background: rgba(255, 255, 255, .35); }
.ins-win__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }

/* ---------- finale ---------- */
.ins-final { position: relative; animation: ins-in .5s ease both; }
.ins-final__sky { position: absolute; inset: 0; background: radial-gradient(900px 400px at 50% 0, rgba(251, 191, 36, .14), transparent 70%); pointer-events: none; }
.ins-final__in { position: relative; width: min(1180px, 100%); margin: 0 auto; }
.ins-final__hero { text-align: center; max-width: 820px; margin: 0 auto 26px; }
.ins-final__hero h2 { margin: 8px 0 10px; font-size: clamp(32px, 4.6vw, 56px); line-height: 1.05; font-weight: 900; color: #fff; }
.ins-final__hero p { margin: 0 0 16px; font-size: 18px; line-height: 1.55; color: #cbd5e1; }
.ins-final__hero p b { color: #fde68a; }
.ins-final__ideas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ins-final__ideas li { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 99px; background: rgba(255, 255, 255, .05); border: 1px solid var(--ins-line); font-weight: 700; }
.ins-final__ideas b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ins-teal); color: #052e2b; font-size: 12px; }
.ins-final__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ins-final__card { padding: 18px; border-radius: 22px; background: var(--ins-panel); border: 1px solid var(--ins-line); min-width: 0; }
.ins-final__code pre { max-height: 430px; }
.ins-field { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 700; font-size: 14px; color: #cbd5e1; }
.ins-field input { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .3); background: #050d18; color: #fff; font: inherit; font-size: 16px; }
.ins-field input:focus { outline: 2px solid var(--ins-teal); border-color: transparent; }
.ins-card { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--ins-line); }
.ins-final__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ins-final__note { margin: 10px 0 0; font-size: 14px; color: #5eead4; word-break: break-all; }
.ins-next { margin-top: 26px; text-align: center; }
.ins-next h3 { margin: 6px 0 16px; font-size: clamp(24px, 3vw, 32px); font-weight: 900; color: #fff; }
.ins-next__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; text-align: left; }
.ins-next__grid a { display: grid; align-content: start; gap: 8px; padding: 20px; border-radius: 22px; text-decoration: none !important; color: #cbd5e1 !important; background: var(--ins-panel); border: 1px solid var(--ins-line); transition: transform .2s, border-color .2s; }
.ins-next__grid a:hover { transform: translateY(-3px); border-color: rgba(94, 234, 212, .5); }
.ins-next__grid b { font-size: 19px; line-height: 1.25; color: #fff; }
.ins-next__grid em { font-style: normal; font-weight: 800; color: var(--ins-teal); }
.ins-next__grid em::after { content: " →"; }
.ins-next__main { background: linear-gradient(150deg, rgba(45, 212, 191, .22), rgba(14, 27, 44, .9)) !important; border-color: rgba(94, 234, 212, .5) !important; }
.ins-next__main b { font-size: 24px; }
.ins-next__main em { justify-self: start; margin-top: 6px; padding: 12px 20px; border-radius: 12px; color: #052e2b; background: linear-gradient(180deg, #5eead4, #14b8a6); box-shadow: 0 4px 0 #0f766e; }
.ins-next__tag { justify-self: start; padding: 4px 10px; border-radius: 99px; background: rgba(251, 191, 36, .15); color: #fde68a; font-weight: 800; font-size: 12px; }
.ins-final__again { margin: 24px 0 0; text-align: center; color: var(--ins-mute); }
.ins-final__again .ins-link { font-size: 14px; }
.ins-confetti { position: fixed; inset: 0; z-index: 10000; pointer-events: none; }
.ins-noscript { padding: 40px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
    .ins-grid { grid-template-columns: 1fr; }
    .ins-left { position: relative; top: 0; }
    .ins-svg { max-height: 52vh; }
    .ins-prog { max-height: none; }
    .ins-next__grid { grid-template-columns: 1fr 1fr; }
    .ins-next__main { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
    .ins-intro__in { grid-template-columns: 1fr; padding: 24px 16px 40px; gap: 10px; }
    .ins-intro__art { order: -1; max-width: 420px; margin: 0 auto; }
    .ins-final__grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .ins-play { padding: 10px 10px 24px; }
    .ins-top { flex-wrap: wrap; gap: 8px; }
    .ins-top__goal { order: 3; flex-basis: 100%; font-size: 13px; }
    .ins-top__t { flex: 1; }
    .ins-top__name { font-size: 19px; }
    .ins-stage { border-radius: 18px; }
    .ins-scene { min-height: 0; }
    .ins-say p { font-size: 14px; }
    .ins-hud { top: 8px; left: 8px; }
    .ins-pal, .ins-progw, .ins-code { padding: 12px; border-radius: 16px; }
    .ins-b__row { padding: 8px 10px; font-size: 14px; }
    .ins-b.is-wrap { min-width: 0; }
    .ins-b.is-wrap > .ins-slot { min-width: 150px; }
    .ins-map { padding: 20px 10px 30px; }
    .ins-map__sea { border-radius: 18px; overflow-x: auto; }
    .ins-map__svg { min-width: 640px; }
    .ins-win { padding: 20px 16px; }
    .ins-win__stars { font-size: 44px; }
    .ins-win__stars span:nth-child(2) { font-size: 56px; }
    .ins-next__grid { grid-template-columns: 1fr; }
    .ins-x { opacity: .8; }
}
@media (prefers-reduced-motion: reduce) {
    .ins-sea-a, .ins-float, .bot-b, .bot-wave, .sp-coin__s, .lh-rot, .ins-star, .ins-rw, .o-boat__bob { animation: none !important; }
}

/* ---------- logic steps, lighthouse places, finale next steps ---------- */
.ins-logic { padding: 12px 14px; border-radius: 18px; background: linear-gradient(170deg, rgba(251, 191, 36, .1), rgba(14, 27, 44, .9)); border: 1px solid rgba(251, 191, 36, .3); }
.ins-logic summary { cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fde68a; list-style: none; display: flex; align-items: center; gap: 8px; }
.ins-logic summary::-webkit-details-marker { display: none; }
.ins-logic summary::after { content: "ascunde"; margin-left: auto; font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--ins-mute); text-decoration: underline; }
.ins-logic:not([open]) summary::after { content: "arată"; }
.ins-logic ol { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: lg; display: grid; gap: 7px; }
.ins-logic li { position: relative; padding-left: 30px; font-size: 14.5px; line-height: 1.5; color: #e2e8f0; counter-increment: lg; }
.ins-logic li::before { content: counter(lg); position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #3b2410; background: #fbbf24; }
.lh .lh-ghost text { fill: #3b2410; font: 900 11px Inter, system-ui, sans-serif; letter-spacing: .04em; }
.lh[data-st="0"] .lh-ghost { opacity: 1; transform: none; animation: ins-glowp 1.6s ease-in-out infinite; }

.ins-cell--far { fill: rgba(251, 191, 36, .45); stroke: #d97706; stroke-width: 3; stroke-dasharray: none; animation: ins-farpulse 1.6s ease-in-out infinite; }
@keyframes ins-farpulse { 50% { fill: rgba(251, 191, 36, .22); } }
.ins-cell__n { fill: #fff; font: 900 13px Inter, system-ui, sans-serif; text-anchor: middle; }


/* ---------- finale: one screen, island theme ---------- */
.ins-final:not([hidden]) { display: flex; flex-direction: column; }
.ins-fh { position: relative; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; padding-top: clamp(12px, 2.4vh, 28px); background: linear-gradient(180deg, #070d24, #132a52 70%, #0e3556); overflow: hidden; }
.ins-fh__sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.ins-fh__strip { position: relative; display: block; width: 100%; height: clamp(84px, 13vh, 150px); margin-top: -6px; }
.ins-fh::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 18px; background: linear-gradient(transparent, var(--ins-bg)); pointer-events: none; }
.ins-fh__isl { animation: ins-isl .8s cubic-bezier(.3, 1.5, .5, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes ins-isl { from { transform: translateY(30px) scale(.4); opacity: 0; } }
.ins-fh__boat { animation: ins-sail 28s linear infinite; }
@keyframes ins-sail { from { transform: translateX(-80px); } to { transform: translateX(1280px); } }
.ins-fh__txt { position: relative; z-index: 1; text-align: center; padding: 0 16px; }
.ins-fh__txt h2 { margin: 4px 0 6px; font-size: clamp(26px, 4.2vh, 46px); line-height: 1.05; font-weight: 900; color: #fff; animation: ins-in .6s .2s ease both; }
.ins-fh__txt p { margin: 0; font-size: clamp(14px, 1.9vh, 17px); line-height: 1.45; color: #dbe5f1; animation: ins-in .6s .35s ease both; }
.ins-fh__txt p b { color: #fde68a; }
.ins-final .ins-final__in { flex: 1; min-height: 0; width: min(1240px, 100%); display: flex; flex-direction: column; gap: clamp(8px, 1.8vh, 20px); padding: clamp(6px, 1.2vh, 14px) 20px clamp(8px, 1.4vh, 16px); justify-content: space-evenly; }
.ins-final .ins-kick { font-size: 11px; }
.ins-final h3 { margin: 2px 0 0; font-size: clamp(17px, 2.4vh, 24px); font-weight: 900; color: #fff; }
.ins-next { margin: 0; text-align: left; }
.ins-next > h3, .ins-fhd > h3 { display: inline; margin-left: 10px; }
.ins-nxs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 14px; margin-top: clamp(8px, 1.2vh, 12px); }
.ins-nxs:not(:has(> :nth-child(3))) { grid-template-columns: 1.3fr 1fr; }
.ins-nxs:has(> .ins-vid) .ins-nx { grid-template-columns: clamp(84px, 10.5vh, 118px) 1fr; column-gap: 10px; }
.ins-nx__tag { margin-right: 30px; }
.ins-nx em { white-space: nowrap; }
.ins-nx.is-main em { padding: 9px 14px; }
.ins-nx { position: relative; display: grid; grid-template-columns: clamp(120px, 19vh, 200px) 1fr; grid-template-rows: auto auto auto 1fr auto; column-gap: 14px; row-gap: 4px; align-items: start; padding: 14px 16px; border-radius: 20px; text-decoration: none !important; color: #cbd5e1 !important; text-align: left;
    background: linear-gradient(170deg, rgba(14, 116, 144, .28), rgba(14, 27, 44, .95)); border: 1px solid rgba(94, 234, 212, .22); overflow: hidden; transition: transform .25s, border-color .25s, box-shadow .25s; }
.ins-nx:hover { transform: translateY(-4px); border-color: rgba(94, 234, 212, .6); box-shadow: 0 18px 40px -22px rgba(45, 212, 191, .7); }
.ins-nx__art { grid-row: 1 / -1; align-self: center; }
.ins-nx__art svg { display: block; width: 100%; height: auto; overflow: visible; }
.ins-nx__n { position: absolute; top: 10px; right: 12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: #3b2410; background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .2); }
.ins-nx__tag { justify-self: start; padding: 2px 9px; border-radius: 99px; background: rgba(251, 191, 36, .14); color: #fde68a; font-weight: 800; font-size: 11.5px; }
.ins-nx b { font-size: clamp(16px, 2.1vh, 20px); line-height: 1.2; color: #fff; padding-right: 26px; }
.ins-nx__what, .ins-nx__why { font-size: clamp(12.5px, 1.6vh, 14px); line-height: 1.4; }
.ins-nx strong { color: #fff; }
.ins-nx em { justify-self: start; margin-top: 4px; font-style: normal; font-weight: 800; color: var(--ins-teal); }
.ins-nx em::after { content: "→"; display: inline-block; margin-left: 7px; transition: transform .2s; }
.ins-nx:hover em::after { transform: translateX(4px); }
.ins-nx.is-main { background: linear-gradient(160deg, rgba(45, 212, 191, .3), rgba(14, 27, 44, .95)); border-color: rgba(94, 234, 212, .6); box-shadow: 0 0 0 0 rgba(45, 212, 191, .5); animation: ins-mainglow 2.6s ease-in-out 1.4s infinite; }
@keyframes ins-mainglow { 50% { box-shadow: 0 0 0 6px rgba(45, 212, 191, .14), 0 20px 50px -24px rgba(45, 212, 191, .8); } }
.ins-nx.is-main em { padding: 9px 16px; border-radius: 11px; color: #052e2b; background: linear-gradient(180deg, #5eead4, #14b8a6); box-shadow: 0 4px 0 #0f766e; }
.ins-fs__bubble { animation: ins-float 3s ease-in-out infinite; transform-box: fill-box; }
.ins-fs__bubble text { font: 700 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; }
.ins-fs__arm { animation: ins-arm 3s ease-in-out infinite; transform-box: fill-box; transform-origin: 0 50%; }
.ins-fs__arm text { fill: #3b2410; font: 900 11px Inter, system-ui, sans-serif; }
@keyframes ins-arm { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
.ins-fs__needle { animation: ins-needle 3.2s ease-in-out infinite; transform-box: view-box; transform-origin: 0 0; }
@keyframes ins-needle { 0%, 100% { transform: rotate(-30deg); } 30% { transform: rotate(50deg); } 55% { transform: rotate(10deg); } 75% { transform: rotate(22deg); } }
.ins-fs__card { fill: #a16207; font: 900 13px Inter, system-ui, sans-serif; }
.ins-fs__chest { animation: ins-bob 2.4s ease-in-out infinite; }
.ins-nx:hover .bot-wave, .ins-nx:hover .ins-fs__chest { animation-duration: .8s; }
.ins-learn { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ins-learn__grid { flex: 0 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: clamp(8px, 1.2vh, 12px); }
.ins-learn__c { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 0; padding: 8px 10px 10px; border-radius: 18px; text-align: center; background: linear-gradient(180deg, rgba(56, 189, 248, .1), rgba(14, 27, 44, .85)); border: 1px solid var(--ins-line); transition: transform .25s, border-color .25s; }
.ins-learn__c:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, .5); }
.ins-learn__c svg { flex: 0 1 clamp(70px, 13vh, 140px); min-height: 58px; margin-bottom: 4px; width: 100%; overflow: visible; }
.ins-learn__c:hover .ins-learn__isl { animation: ins-bob 1.2s ease-in-out infinite; }
.ins-learn__n { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ins-teal); }
.ins-learn__c b { font-size: clamp(14px, 1.9vh, 17px); color: #fff; }
.ins-learn__c code { margin: 4px 0; padding: 3px 8px; max-width: 100%; border-radius: 7px; font: 700 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: #3b2410; background: linear-gradient(170deg, #f6e7bf, #dcc28a); box-shadow: 0 2px 0 #a16207; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ins-learn__c p { margin: 0; font-size: clamp(11.5px, 1.45vh, 13px); line-height: 1.35; color: #cbd5e1; }
.ins-rev { opacity: 0; transform: translateY(26px) scale(.96); transition: opacity .6s ease var(--d, 0s), transform .7s cubic-bezier(.3, 1.4, .5, 1) var(--d, 0s); }
.ins-rev.is-in { opacity: 1; transform: none; }
.ins-nx.ins-rev:nth-child(2) { --d: .12s; } .ins-nx.ins-rev:nth-child(3) { --d: .24s; }
.ins-learn__c.ins-rev { transition-delay: calc(.4s + var(--d, 0s)); }
.ins-final .ins-final__again { margin: 0; font-size: 13px; }
.ins-fcode__h { margin: 0 0 10px; color: #fff; font-size: 20px; }
.ins-modal .ins-final__code pre { max-height: 60vh; }
@media (max-height: 820px) {
    .ins-fh { padding-top: 8px; }
    .ins-fh__strip { height: 78px; }
    .ins-fh__txt h2 { font-size: 28px; margin: 2px 0 4px; }
    .ins-fh__txt p { font-size: 14px; }
    .ins-nx { padding: 10px 14px; row-gap: 3px; grid-template-columns: 120px 1fr; }
    .ins-final .ins-final__in { gap: 8px; }
    .ins-learn__c { padding: 6px 8px 8px; }
    .ins-learn__c p { font-size: 11.5px; }
}
@media (max-height: 700px) { .ins-learn__c p { display: none; } .ins-nx__why { display: none; } }
@media (max-width: 1080px) {
    .ins-final:not([hidden]) { height: auto; min-height: 0; overflow: visible; }
    .ins-fh { flex-basis: 240px; }
    .ins-nxs, .ins-nxs:not(:has(> :nth-child(3))) { grid-template-columns: 1fr; }
    .ins-learn__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ins-learn__c svg { max-height: 90px; }
}
@media (max-width: 560px) { .ins-learn__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ins-next > h3, .ins-fhd > h3 { display: block; margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .ins-fh__boat, .ins-fh__isl, .ins-nx::before, .ins-nx.is-main, .ins-fs__needle, .ins-fs__bubble, .ins-fs__chest { animation: none !important; } .ins-rev { opacity: 1; transform: none; } }

/* ---------- laptops/desktops: every screen fits under the header, no page scroll ---------- */
@media (min-width: 1081px) and (min-height: 600px) {
    html.ins-lock, html.ins-lock body { overflow: hidden !important; }
    html.ins-lock .ins { height: calc(100vh - var(--ins-top, 64px)); height: calc(100svh - var(--ins-top, 64px)); min-height: 0; }
    html.ins-lock .ins > [data-screen]:not([hidden]) { height: 100%; min-height: 0; }
    html.ins-lock .ins-intro { min-height: 0; }
    html.ins-lock .ins-map:not([hidden]) { display: flex; flex-direction: column; padding: clamp(10px, 2vh, 28px) 24px clamp(10px, 2vh, 24px); }
    html.ins-lock .ins-map__sea { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; }
    html.ins-lock .ins-map__svg { width: 100%; height: 100%; }
    html.ins-lock .ins-play:not([hidden]) { display: flex; flex-direction: column; padding: 10px 20px 12px; }
    html.ins-lock .ins-top { margin-bottom: 10px; }
    html.ins-lock .ins-grid { flex: 1 1 auto; min-height: 0; align-items: stretch; }
    html.ins-lock .ins-left { position: relative; top: 0; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
    html.ins-lock .ins-stage { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
    html.ins-lock .ins-view { min-height: 0; background: #0d4467; }
    html.ins-lock .ins-scene { height: 100%; min-height: 0; }
    html.ins-lock .ins-svg, html.ins-lock .ins-stage:has(> .ins-code:not([hidden])) .ins-svg { width: 100%; height: 100%; max-height: none; min-height: 0; }
    html.ins-lock .ins-stage > .ins-code pre { max-height: 110px; }
    html.ins-lock .ins-logic { flex: 0 1 auto; min-height: 44px; overflow: auto; scrollbar-width: thin; }
    html.ins-lock .ins-logic li { font-size: 13.5px; line-height: 1.4; }
    html.ins-lock .ins-work { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
    html.ins-lock .ins-pal { flex: 0 0 auto; }
    html.ins-lock .ins-progw { flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; }
    html.ins-lock .ins-prog { flex: 1 1 auto; min-height: 0; max-height: none; }
    html.ins-lock .ins-slot--root { min-height: 100%; }
    html.ins-lock .ins-ctl { flex: 0 0 auto; }
    html.ins-lock .ins-final:not([hidden]) { overflow: hidden; }
}
@media (min-width: 1081px) and (min-width: 1300px) and (min-height: 600px) { html.ins-lock .ins-stage > .ins-code pre { max-height: none; } }
@media (min-width: 1081px) and (min-height: 600px) and (max-height: 820px) {
    html.ins-lock .ins-pal__help { display: none; }
    html.ins-lock .ins-say { min-height: 0; padding: 8px 14px; }
    html.ins-lock .ins-btn--run { padding: 11px 18px; font-size: 16px; }
}

/* finale: the "Cum înveți cu noi" video card (opens in the modal) */
/* Video card: our own title on the left; the right side is the home poster's browser (its title masked out), so the
   browser fades into the text. The pulse sits on the poster's own play button (78.5% / 46.9% of the 16:10 poster). */
.ins-vid { position: relative; width: 100%; min-height: 170px; padding: 0; border: 1px solid rgba(94, 234, 212, .35); border-radius: 20px; overflow: hidden; cursor: pointer; font: inherit; color: #fff; text-align: left; background: radial-gradient(120% 90% at 0% 100%, rgba(139, 92, 246, .22), transparent 60%), radial-gradient(90% 80% at 20% 0%, rgba(45, 212, 191, .16), transparent 60%), #0a0f18; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .9); transition: transform .25s, border-color .25s, box-shadow .25s; }
.ins-vid:hover { transform: translateY(-4px); border-color: rgba(94, 234, 212, .75); box-shadow: 0 22px 46px -22px rgba(45, 212, 191, .6); }
.ins-vid__shot { position: absolute; top: 0; left: 44%; height: 100%; aspect-ratio: 16 / 10; translate: -48% 0; background: var(--poster) center / cover no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent 50%, #000 61%), linear-gradient(180deg, #000 72%, transparent 90%); -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 50%, #000 61%), linear-gradient(180deg, #000 72%, transparent 90%); mask-composite: intersect; transition: scale .4s ease; transform-origin: 78% 47%; }
.ins-vid:hover .ins-vid__shot { scale: 1.05; }
.ins-vid__play { position: absolute; left: 78.5%; top: 46.9%; width: 11.7%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%); animation: ins-vidp 2.2s infinite; }
@keyframes ins-vidp { 0% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .6); } 70% { box-shadow: 0 0 0 16px rgba(45, 212, 191, 0); } 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); } }
.ins-vid__txt { position: absolute; left: 16px; top: 0; bottom: 0; width: calc(46% - 16px); display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.ins-vid__pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #5eead4; background: rgba(45, 212, 191, .1); border: 1px solid rgba(45, 212, 191, .45); }
.ins-vid__pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f43f5e; animation: ins-glowp 1.4s ease-in-out infinite; }
.ins-vid__txt b { white-space: nowrap; font-size: clamp(18px, 2.3vh, 22px); line-height: 1.08; font-weight: 900; letter-spacing: -.01em; }
.ins-vid__txt b i { font-style: normal; background: linear-gradient(90deg, #5eead4, #a78bfa 55%, #f472b6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ins-vid__txt small { font-size: 12.5px; line-height: 1.35; color: #cbd5e1; }
.ins-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ins-modal.is-video .ins-modal__box { width: min(1100px, 100%); padding: 14px; }
.ins-vidm video { display: block; width: 100%; max-height: calc(100vh - 140px); aspect-ratio: 16 / 10; border-radius: 16px; background: #000; }
.ins-modal.is-video .ins-win__btns { margin-top: 12px; }
.ins-link--gold { color: #fde68a !important; }
@media (prefers-reduced-motion: reduce) { .ins-vid__play { animation: none; } }

.ins-learn__c > :not(svg) { flex-shrink: 0; }

.ins-stepsbtn { display: none; }
.ins-stepsm h3 { margin: 4px 0 12px; color: #fff; font-size: 20px; }
.ins-stepsm .ins-logic { text-align: left; }

/* ---------- phones and tablets: one fixed screen too. The island and the Python code stay on top, the blocks and
   Bit's program under them (they scroll inside), the run bar is always at the bottom. Other screens scroll inside. ---------- */
@media (max-width: 1080px) {
    /* iOS ignores overflow:hidden on the page for touch scrolling, so the page itself is pinned (position: fixed) and
       only the game's own boxes scroll. Height comes from JS (--ins-vh = innerHeight), safe in in-app browsers too. */
    html.ins-lock, html.ins-lock body { overflow: hidden !important; overscroll-behavior: none; }
    html.ins-lock body { position: fixed; top: 0; left: 0; right: 0; width: 100%; height: var(--ins-vh, 100%); }
    html.ins-lock .ins { height: calc(var(--ins-vh, 100dvh) - var(--ins-top, 64px)); min-height: 0; }
    html.ins-lock .ins > [data-screen]:not([hidden]) { height: 100%; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
    html.ins-lock .ins-intro { min-height: 0; }
    html.ins-lock .ins-final:not([hidden]) { display: block; }
    html.ins-lock .ins-final .ins-final__in, html.ins-lock .ins-final .ins-final__in > *, html.ins-lock .ins-fh { flex: 0 0 auto; min-height: auto; }
    html.ins-lock .ins-final .ins-final__in { display: flex; justify-content: flex-start; gap: 18px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
    html.ins-lock .ins-learn__grid { grid-template-rows: none; }
    html.ins-lock .ins-play:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
    html.ins-lock .ins-top { flex-wrap: nowrap; gap: 6px; margin-bottom: 6px; }
    html.ins-lock .ins-top .ins-chip { padding: 7px 10px; font-size: 12.5px; }
    html.ins-lock .ins-top__t { flex: 1; min-width: 0; }
    html.ins-lock .ins-top__n { font-size: 10.5px; }
    html.ins-lock .ins-top__name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    html.ins-lock .ins-top__goal { display: none; }
    html.ins-lock .ins-stepsbtn { display: inline-flex; color: #fde68a; border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .1); }
    html.ins-lock .ins-grid { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
    html.ins-lock .ins-left { position: relative; top: 0; flex: 0 0 45%; min-height: 0; display: flex; flex-direction: column; gap: 0; }
    html.ins-lock .ins-left > .ins-logic { display: none; }
    html.ins-lock .ins-stage, html.ins-lock .ins-stage:has(> .ins-code:not([hidden])) { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; border-radius: 16px; }
    html.ins-lock .ins-view { grid-row: 1; grid-column: 1; min-height: 0; background: #0d4467; }
    html.ins-lock .ins-scene { height: 100%; min-height: 0; }
    html.ins-lock .ins-svg, html.ins-lock .ins-stage:has(> .ins-code:not([hidden])) .ins-svg { width: 100%; height: 100%; max-height: none; min-height: 0; }
    html.ins-lock .ins-stage > .ins-code { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; min-height: 0; padding: 5px 8px 6px; border-top: 1px solid rgba(94, 234, 212, .2); }
    html.ins-lock .ins-stage > .ins-code .ins-h { font-size: 9.5px; margin-bottom: 3px; gap: 6px; }
    html.ins-lock .ins-stage > .ins-code pre { height: 76px; max-height: 76px; padding: 4px 0; font-size: 11.5px; line-height: 1.55; border-radius: 8px; }
    html.ins-lock .ins-code .ln em { width: 20px; padding-right: 5px; }
    html.ins-lock .ins-stage > .ins-say { grid-row: 3; grid-column: 1 / -1; min-height: 0; padding: 7px 10px; gap: 8px; align-items: center; }
    html.ins-lock .ins-say__ava { width: 32px; height: 34px; border-radius: 10px; }
    html.ins-lock .ins-say__ava svg { width: 28px; height: 30px; }
    html.ins-lock .ins-say p { font-size: 13px; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    html.ins-lock .ins-say__btns:not(:empty) { margin-top: 6px; }
    html.ins-lock .ins-say__btns .ins-btn { padding: 7px 12px; font-size: 13px; }
    html.ins-lock .ins-hud { top: 6px; left: 6px; }
    html.ins-lock .ins-var { padding: 4px 8px; font-size: 12px; }
    html.ins-lock .ins-grid > * { min-width: 0; width: 100%; }
    html.ins-lock .ins-pal, html.ins-lock .ins-progw, html.ins-lock .ins-ctl { min-width: 0; max-width: 100%; }
    html.ins-lock .ins-work { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
    html.ins-lock .ins-pal { flex: 0 0 auto; padding: 8px; border-radius: 14px; }
    html.ins-lock .ins-pal .ins-h { display: none; }
    html.ins-lock .ins-pal__list { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; gap: 6px; }
    html.ins-lock .ins-pal__list::-webkit-scrollbar { display: none; }
    html.ins-lock .ins-pal__list > * { flex: 0 0 auto; }
    html.ins-lock .ins-pal__help { display: none; }
    html.ins-lock .ins-progw { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px; border-radius: 14px; }
    html.ins-lock .ins-progw .ins-h { margin-bottom: 4px; font-size: 11px; }
    html.ins-lock .ins-prog { flex: 1 1 auto; min-height: 0; max-height: none; }
    html.ins-lock .ins-slot--root { min-height: 100%; }
    html.ins-lock .ins-prog .ins-b.is-wrap, html.ins-lock .ins-prog .ins-b.is-wrap > .ins-slot { min-width: 0; }
    html.ins-lock .ins-slot--root:empty::before { min-height: 60px; font-size: 13px; }
    html.ins-lock .ins-tipline { margin: 6px 0 0; padding: 6px 8px 6px 28px; font-size: 12px; line-height: 1.4; }
    html.ins-lock .ins-tipline::before { left: 8px; top: 5px; font-size: 12px; }
    html.ins-lock .ins-into:not([hidden]) + .ins-prog + .ins-tipline { display: none; }
    html.ins-lock .ins-into { padding: 5px 8px; font-size: 12px; line-height: 1.35; margin-bottom: 4px; }
    html.ins-lock .ins-ctl { flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; }
    html.ins-lock .ins-btn--run { flex: 1 1 auto; padding: 12px 14px; font-size: 16px; }
    html.ins-lock .ins-ctl .ins-chip { padding: 9px 10px; white-space: nowrap; }
    html.ins-lock .ins-map:not([hidden]) { padding: 14px 12px 24px; }
    html.ins-lock .ins-map__sea { overflow: visible; }
    html.ins-lock .ins-map__svg { min-width: 0; }
}
@media (max-width: 1080px) and (min-width: 641px) {
    html.ins-lock .ins-left { flex-basis: 52%; }
    html.ins-lock .ins-stage > .ins-code pre { font-size: 13px; height: 96px; max-height: 96px; }
}
@media (max-width: 640px) {
    .ins-win__btns { flex-direction: column; align-items: stretch; }
    .ins-win__btns .ins-btn { width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
    html.ins-lock .ins-intro__art { max-height: 21vh; }
    html.ins-lock .ins-intro__art svg { max-height: 21vh; }
    html.ins-lock .ins-intro h1 { font-size: 40px; margin: 4px 0 8px; }
    html.ins-lock .ins-intro__lead { font-size: 15.5px; }
    html.ins-lock .ins-intro__steps li { padding-top: 7px; padding-bottom: 7px; }
    html.ins-lock .ins-intro__cta .ins-btn { width: 100%; justify-content: center; }
    .ins-stepsm .ins-logic ol { margin: 0 0 14px; }
}
@media (max-width: 640px) {
    .ins-vid__pill { white-space: nowrap; font-size: 10px; padding: 4px 8px; }
    .ins-vid__txt b { font-size: 19px; }
}
/* Phones: the island gets whatever is left after a fixed-size work area (blocks row, program, run bar), so it never
   collapses on short screens; Bit's message sits in one row with its button. */
@media (max-width: 1080px) {
    html.ins-lock .ins-left { flex: 0 0 auto; height: calc((var(--ins-vh, 100vh) - var(--ins-top, 64px)) * .47); }
    html.ins-lock .ins-work { flex: 1 1 auto; min-height: 0; }
    html.ins-lock .ins-progw { flex: 1 1 auto; min-height: 0; }
    html.ins-lock .ins-prog { flex: 1 1 auto; min-height: 48px; }
    html.ins-lock .ins-pal .ins-b__t { font-size: 14px; }
    html.ins-lock .ins-pal .ins-b__ic { width: 24px; height: 24px; }
    html.ins-lock .ins-say__in { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
    html.ins-lock .ins-say__in > p { flex: 1; min-width: 0; -webkit-line-clamp: 2; }
    html.ins-lock .ins-say__btns:not(:empty) { margin-top: 0; flex: 0 0 auto; }
    html.ins-lock .ins-say__btns .ins-btn { padding: 8px 12px; font-size: 12.5px; white-space: nowrap; }
    html.ins-lock .ins-say p { font-size: 12.5px; line-height: 1.35; }
    html.ins-lock .ins-pal { padding: 6px; }
    html.ins-lock .ins-pal .ins-b { min-height: 0; padding-top: 7px; padding-bottom: 7px; }
    html.ins-lock .ins-pal .ins-b.is-wrap { padding-bottom: 11px; }
    html.ins-lock .ins-pal .ins-b.is-wrap::after { bottom: 4px; height: 5px; }
    html.ins-lock .ins-pal .ins-b.is-wrap .ins-b__row { padding-bottom: 2px; }
    html.ins-lock .ins-tipline { -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
    html.ins-lock .ins-tipline:empty { display: none; }
}
@media (max-width: 1080px) and (max-height: 760px) {
    html.ins-lock .ins-stage > .ins-code pre { height: 58px; max-height: 58px; font-size: 11px; line-height: 1.5; }
    html.ins-lock .ins-stage > .ins-code .ins-h { display: none; }
    html.ins-lock .ins-top { margin-bottom: 4px; }
    html.ins-lock .ins-top .ins-chip { padding: 6px 9px; }
    html.ins-lock .ins-btn--run { padding: 10px 14px; }
    html.ins-lock .ins-progw .ins-h { margin-bottom: 2px; }
}
@media (max-width: 1080px) and (max-height: 760px) {
    html.ins-lock .ins-tipline { -webkit-line-clamp: 1; padding-top: 4px; padding-bottom: 4px; margin-top: 4px; }
    html.ins-lock .ins-tipline::before { top: 3px; }
    html.ins-lock .ins-pal .ins-b { padding-top: 4px; padding-bottom: 4px; }
    html.ins-lock .ins-pal .ins-b.is-wrap { padding-bottom: 9px; }
    html.ins-lock .ins-progw { padding: 6px 8px; }
}
@media (max-width: 1080px) { html.ins-lock .ins-progw > :not(.ins-prog) { flex-shrink: 0; } }
/* Phones: every block of the islet is visible at once (the row wraps, no sideways scroll fighting the drag), the
   program scrolls with the finger (a block is dragged by its dots or sideways), and no text is cut. */
@media (max-width: 1080px) {
    html.ins-lock .ins-pal .ins-b__t { font-size: 13.5px; }
    html.ins-lock .ins-pal .ins-b__row { gap: 6px; padding-left: 8px; padding-right: 10px; }
    html.ins-lock .ins-pal .ins-b__ic { width: 22px; height: 22px; }
    html.ins-lock .ins-say__in > p, html.ins-lock .ins-say p { display: block; -webkit-line-clamp: unset; overflow: visible; }
    html.ins-lock .ins-tipline { display: block; -webkit-line-clamp: unset; overflow: visible; }
    html.ins-lock .ins-tipline:empty { display: none; }
    html.ins-lock .ins-top__name { white-space: normal; overflow: visible; }
    html.ins-lock .ins-left { height: calc((var(--ins-vh, 100vh) - var(--ins-top, 64px)) * .44); }
}
@media (hover: none) {
    .ins-prog .ins-b { touch-action: manipulation; }
    .ins-prog .ins-grip { touch-action: none; }
}
@media (hover: none) { .ins-prog .ins-grip { width: 16px; height: 30px; margin: -6px 0 -6px -6px; background-size: 4px 6px; background-position: center; background-repeat: repeat-y; background-origin: content-box; padding: 0 4px; } }
@media (max-width: 1080px) {
    html.ins-lock .ins-pal .ins-b, html.ins-lock .ins-pal .ins-b.is-wrap { padding: 0; min-width: 0; }
    html.ins-lock .ins-pal .ins-b .ins-b__row, html.ins-lock .ins-pal .ins-b.is-wrap .ins-b__row { padding: 5px 10px 6px 6px; font-size: 13.5px; gap: 6px; }
    html.ins-lock .ins-pal .ins-b.is-wrap::after { display: none; }
    html.ins-lock .ins-pal .ins-b.is-wrap { box-shadow: inset 4px -3px 0 rgba(0, 0, 0, .22), 0 6px 14px -8px rgba(0, 0, 0, .7); }
    html.ins-lock .ins-pal .ins-b__ic { width: 22px; height: 22px; border-radius: 6px; }
    html.ins-lock .ins-pal .ins-b__ic svg { width: 15px; height: 15px; }
    html.ins-lock .ins-pal__list { gap: 5px; }
}
/* Phones: one row of blocks that the finger scrolls sideways (blocks allow horizontal panning; a tap adds the block,
   dragging it down places it), faded at the edge while more blocks hide there. */
@media (max-width: 1080px) {
    html.ins-lock .ins-pal__list { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-right: 24px; }
    html.ins-lock .ins-pal__list > * { scroll-snap-align: start; }
    html.ins-lock .ins-pal { position: relative; }
    html.ins-lock .ins-pal { padding-left: 40px; padding-right: 40px; }
    html.ins-lock .ins-pal__list { padding-right: 0; }
    html.ins-lock .ins-pal__nav { display: grid; place-items: center; position: absolute; top: 50%; width: 34px; height: 34px; margin-top: -17px; padding: 0 0 3px; border-radius: 50%; border: 1px solid rgba(94, 234, 212, .45); background: #0f2a3f; color: #fff; font-size: 24px; font-weight: 900; line-height: 1; cursor: pointer; transition: opacity .2s; -webkit-tap-highlight-color: transparent; }
    html.ins-lock .ins-pal__nav--l { left: 4px; }
    html.ins-lock .ins-pal__nav--r { right: 4px; }
    html.ins-lock .ins-pal:not(.has-less) .ins-pal__nav--l, html.ins-lock .ins-pal:not(.has-more) .ins-pal__nav--r { opacity: .25; pointer-events: none; }
}
@media (hover: none) { .ins-pal .ins-b { touch-action: none; -webkit-tap-highlight-color: transparent; } }
.ins-pal__nav { display: none; }
@media (max-width: 1080px) { html.ins-lock .ins-pal__nav { display: grid; } html.ins-lock .ins-pal__list { scroll-snap-type: none; } }
@media (max-width: 640px) { .ins-into { display: none !important; } }
/* Phones: island (60%) and Python code (40%) side by side on top, so the blocks and the program get more room below.
   Code lines wrap instead of being cut. */
@media (max-width: 1080px) {
    html.ins-lock .ins-stage, html.ins-lock .ins-stage:has(> .ins-code:not([hidden])) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); grid-template-rows: minmax(0, 1fr) auto; }
    html.ins-lock .ins-stage:has(> .ins-code[hidden]) { grid-template-columns: minmax(0, 1fr); }
    html.ins-lock .ins-view { grid-row: 1; grid-column: 1; }
    html.ins-lock .ins-stage > .ins-code { grid-row: 1; grid-column: 2; display: flex; flex-direction: column; min-height: 0; padding: 6px; border-top: 0; border-left: 1px solid rgba(94, 234, 212, .2); }
    html.ins-lock .ins-stage > .ins-code .ins-h { display: flex; font-size: 9px; margin-bottom: 4px; gap: 4px; flex-wrap: wrap; }
    html.ins-lock .ins-stage > .ins-code pre, html.ins-lock .ins-stage > .ins-code pre[class] { flex: 1 1 0; height: auto; max-height: none; min-height: 0; padding: 5px 4px 5px 6px; font-size: 10.5px; line-height: 1.5; white-space: pre; overflow: auto; }
    html.ins-lock .ins-stage > .ins-code .ln { padding: 0; }
    html.ins-lock .ins-stage > .ins-code .ln em { display: none; }
    html.ins-lock .ins-stage > .ins-say { grid-row: 2; grid-column: 1 / -1; }
    html.ins-lock .ins-left { height: calc((var(--ins-vh, 100vh) - var(--ins-top, 64px)) * .36); }
}
@media (max-width: 1080px) {
    html.ins-lock .ins-stage, html.ins-lock .ins-stage:has(> .ins-code:not([hidden])) { grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); }
    html.ins-lock .ins-stage:has(> .ins-code[hidden]) { grid-template-columns: minmax(0, 1fr); }
    html.ins-lock .ins-stage > .ins-code { padding: 5px 4px; }
    html.ins-lock .ins-stage > .ins-code pre, html.ins-lock .ins-stage > .ins-code pre[class] { padding: 4px 3px 4px 5px; }
    html.ins-lock .ins-left { height: calc((var(--ins-vh, 100vh) - var(--ins-top, 64px)) * .33); }
}
@media (max-width: 1080px) { html.ins-lock .ins-stage > .ins-code .ln:has(> .c:only-of-type) { white-space: pre-wrap; } html.ins-lock .ins-stage > .ins-code .c { white-space: pre-wrap; } }
@media (max-width: 1080px) { html.ins-lock.ins-playing .apa-topbar { display: none !important; } html.ins-lock.ins-playing .ins-play:not([hidden]) { padding-top: calc(8px + env(safe-area-inset-top)); } }
/* Phones: the code box scrolls both ways with the finger when the program is longer or wider than the box. */
@media (max-width: 1080px) {
    html.ins-lock .ins-stage > .ins-code pre, html.ins-lock .ins-stage > .ins-code pre[class] { overflow: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-behavior: auto; }
    html.ins-lock .ins-stage > .ins-code .ln { width: max-content; min-width: 100%; }
}
/* Phones: no tip strip under the program (Bit's message already says what to do), and the blocks already in the
   program are compact so the whole program is easy to follow. */
@media (max-width: 1080px) {
    html.ins-lock .ins-tipline { display: none !important; }
    html.ins-lock .ins-prog .ins-b__row { padding: 4px 8px 4px 4px; gap: 5px; font-size: 13px; }
    html.ins-lock .ins-prog .ins-b__ic { width: 20px; height: 20px; border-radius: 6px; }
    html.ins-lock .ins-prog .ins-b__ic svg { width: 14px; height: 14px; }
    html.ins-lock .ins-prog .ins-b__py { padding: 0 8px 5px 31px; margin-top: -3px; font-size: 10.5px; }
    html.ins-lock .ins-prog .ins-grip { height: 16px; }
    html.ins-lock .ins-prog .ins-x { width: 20px; height: 20px; font-size: 13px; margin-left: 2px; }
    html.ins-lock .ins-prog .ins-step { padding: 1px; }
    html.ins-lock .ins-prog .ins-step button { width: 22px; height: 22px; font-size: 14px; }
    html.ins-lock .ins-prog .ins-step b { min-width: 16px; }
    html.ins-lock .ins-prog .ins-slot { gap: 4px; padding: 4px; min-height: 30px; }
    html.ins-lock .ins-prog .ins-slot--root { padding: 6px; }
    html.ins-lock .ins-prog .ins-b.is-wrap > .ins-slot { margin-left: 10px; min-width: 0; }
    html.ins-lock .ins-prog .ins-b.is-wrap { padding-bottom: 6px; }
    html.ins-lock .ins-prog .ins-b.is-wrap > .ins-slot:empty::before { padding: 4px 8px; font-size: 12px; }
    html.ins-lock .ins-prog .ins-b { border-radius: 10px; }
}
.ins-prog .ins-b { -webkit-touch-callout: none; }
.ins-prog .ins-b.is-lift { transform: scale(1.03); box-shadow: 0 0 0 3px rgba(253, 224, 71, .9), 0 10px 22px -8px rgba(0, 0, 0, .8); z-index: 2; }
