/* ClicksLab — « Le labo des petits inventeurs ». Une matière = une couleur. */
:root {
  --ink: #23264a; --ink-soft: #5b6187; --paper: #ffffff; --paper-2: #f6f8ff; --bg1: #fff5ea; --bg2: #eaf4ff; --bg3: #f3ecff;
  --line: rgba(35, 38, 74, .1); --shadow: 0 10px 30px -12px rgba(35, 38, 74, .28); --shadow-lg: 0 24px 60px -20px rgba(35, 38, 74, .4);
  --ok: #12b886; --ko: #f03e3e; --gold: #ffc53d; --radius: 22px;
  --fr1: #ff6b6b; --fr2: #ffa94d; --en1: #3a86ff; --en2: #4cc9f0; --ma1: #9b5de5; --ma2: #f15bb5; --sc1: #0ca678; --sc2: #63e6be; --li1: #4c6ef5; --li2: #91a7ff;
  --c1: #ff8c42; --c2: #ffd166;
  --code-bg: #14172e; --code-ink: #e6e9ff;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #eef0ff; --ink-soft: #b4b9dc; --paper: #20233f; --paper-2: #1a1d37; --bg1: #12142c; --bg2: #151a36; --bg3: #1c1736;
  --line: rgba(255, 255, 255, .1); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
  --code-bg: #0d0f22;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eef0ff; --ink-soft: #b4b9dc; --paper: #20233f; --paper-2: #1a1d37; --bg1: #12142c; --bg2: #151a36; --bg3: #1c1736;
    --line: rgba(255, 255, 255, .1); --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .75);
    --code-bg: #0d0f22;
    color-scheme: dark;
  }
}
.subj-fr { --c1: var(--fr1); --c2: var(--fr2); }
.subj-en { --c1: var(--en1); --c2: var(--en2); }
.subj-math { --c1: var(--ma1); --c2: var(--ma2); }
.subj-sci { --c1: var(--sc1); --c2: var(--sc2); }
.subj-free { --c1: var(--li1); --c2: var(--li2); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: "Nunito", system-ui, sans-serif; color: var(--ink); line-height: 1.5;
  background: linear-gradient(160deg, var(--bg1), var(--bg2) 50%, var(--bg3)); background-attachment: fixed; overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--c1); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: "Fredoka", "Nunito", sans-serif; line-height: 1.15; margin: 0; }

/* ---------- Décor ---------- */
.blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(64px); opacity: .42; animation: drift 24s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { width: 380px; height: 380px; background: var(--fr2); top: -120px; left: -90px; }
.blobs i:nth-child(2) { width: 330px; height: 330px; background: var(--en2); top: 28%; right: -130px; animation-delay: -7s; }
.blobs i:nth-child(3) { width: 360px; height: 360px; background: var(--ma2); bottom: -150px; left: 22%; animation-delay: -13s; opacity: .3; }
.blobs i:nth-child(4) { width: 260px; height: 260px; background: var(--li2); top: 58%; left: -110px; animation-delay: -3s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.15); } }
body.in-lab .blobs { opacity: .5; }

/* ---------- Barre du haut ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; display: flex; align-items: center; gap: 8px;
  padding: 10px clamp(12px, 3vw, 28px); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: color-mix(in srgb, var(--paper) 74%, transparent); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; min-width: 0; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: conic-gradient(from 200deg, var(--fr1), var(--fr2), var(--en1), var(--ma1), var(--fr1)); box-shadow: var(--shadow);
  transition: transform .4s cubic-bezier(.3, 1.6, .5, 1);
}
.brand:hover .brand-logo { transform: rotate(-8deg) scale(1.06); }
.brand-txt { font: 700 1.25rem "Fredoka", sans-serif; display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand-txt small { font: 700 .72rem "Nunito", sans-serif; color: var(--ink-soft); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; text-decoration: none; font-weight: 800; font-size: .9rem;
  background: var(--paper); border: 1px solid var(--line); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .2); transition: transform .2s, box-shadow .2s; min-height: 40px;
}
.chip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.chip:active { transform: scale(.96); }
.chip.stars b { min-width: 1ch; }
@media (max-width: 640px) { .chip .lbl, .brand-txt small { display: none; } .brand-txt { font-size: 1.1rem; } }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 14px; font-weight: 800;
  text-decoration: none; transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), box-shadow .2s, filter .2s; min-height: 44px; text-align: center;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.grad { color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 10px 24px -10px var(--c1); text-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.btn.grad:hover:not(:disabled) { box-shadow: 0 16px 30px -10px var(--c1); filter: saturate(1.15); }
.btn.soft { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .18); }
.btn.soft:hover { box-shadow: var(--shadow); }
.btn.big { padding: 15px 26px; font-size: 1.05rem; border-radius: 18px; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .85rem; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }

/* ---------- Apparitions ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ================= Accueil ================= */
.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 60px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(20px, 4vw, 56px); align-items: center; padding-block: clamp(28px, 6vw, 80px) 28px; }
.kicker { display: inline-block; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--en1), var(--ma1)); box-shadow: 0 8px 20px -10px var(--ma1); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 16px 0 12px; letter-spacing: -.5px; }
.grad { background: linear-gradient(120deg, var(--fr1), var(--fr2) 30%, var(--ma2) 65%, var(--en1)); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: shine 8s ease-in-out infinite alternate; }
@keyframes shine { to { background-position: 100% 0; } }
.hero p { font-size: 1.12rem; color: var(--ink-soft); max-width: 34rem; margin: 0 0 22px; }
.hero p b { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-cta .btn.grad { --c1: #ff6b3d; --c2: #f15bb5; }
.hero-art { position: relative; }
.mini { width: 100%; height: auto; filter: drop-shadow(0 30px 40px rgba(35, 38, 74, .25)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.mini .hw path { fill: none; stroke-width: 5; stroke-linecap: round; }
.mini .hw .f { stroke: #fff; stroke-width: 2.2; stroke-dasharray: 4 14; animation: flow 1s linear infinite; opacity: .9; }
.mini .hw .d2 { animation-delay: -.33s; } .mini .hw .d3 { animation-delay: -.66s; }
.mini .hl .g { opacity: 0; animation: hl 3.6s infinite; }
.mini .l2 .g { animation-delay: 1.2s; } .mini .l3 .g { animation-delay: 2.4s; }
@keyframes hl { 0%, 5% { opacity: 0; } 10%, 30% { opacity: 1; } 36%, 100% { opacity: 0; } }
.mini .seg7 .d { font: 700 46px "JetBrains Mono", monospace; fill: #ff4d5e; filter: drop-shadow(0 0 6px #ff4d5e); }
.mini .b { font: 700 22px "Fredoka", sans-serif; fill: #fff; }
.float { position: absolute; font-size: 2rem; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .15)); animation: floaty 5s ease-in-out infinite; }
.f1 { top: -6%; right: 8%; } .f2 { bottom: 10%; left: -3%; animation-delay: -1.6s; } .f3 { top: 38%; right: -2%; animation-delay: -3.2s; }
@keyframes floaty { 50% { transform: translateY(-14px) rotate(8deg); } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 10px 0 30px; }
.stats div { background: color-mix(in srgb, var(--paper) 80%, transparent); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-align: center; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.stats b { display: block; font: 700 2.2rem "Fredoka", sans-serif; background: linear-gradient(135deg, var(--en1), var(--ma2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { color: var(--ink-soft); font-weight: 700; font-size: .9rem; }

.sec { padding-block: 28px; }
.h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.lead { color: var(--ink-soft); margin: 6px 0 22px; font-size: 1.05rem; }
.mgrid-home { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.mcard {
  position: relative; display: flex; flex-direction: column; text-decoration: none; border-radius: var(--radius); overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1), box-shadow .3s, opacity .6s;
}
.mcard:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: var(--shadow-lg), 0 0 0 3px color-mix(in srgb, var(--c1) 35%, transparent); }
.mcard:active { transform: scale(.98); }
.mcard-art { height: 130px; display: grid; place-items: center; background: linear-gradient(135deg, var(--c1), var(--c2)); position: relative; overflow: hidden; }
.mcard-art::before, .mcard-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.mcard-art::before { width: 160px; height: 160px; top: -60px; right: -40px; }
.mcard-art::after { width: 90px; height: 90px; bottom: -40px; left: 10px; }
.mcard-art span { font-size: 3.6rem; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .2)); transition: transform .4s cubic-bezier(.3, 1.8, .5, 1); position: relative; z-index: 1; }
.mcard:hover .mcard-art span { transform: scale(1.15) rotate(-8deg); }
.mcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mcard .subj { font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c1); }
.mcard b { font: 600 1.3rem "Fredoka", sans-serif; }
.mcard .tag { color: var(--ink-soft); font-size: .95rem; flex: 1; }
.mcard-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.mcard .stars i { font-style: normal; color: color-mix(in srgb, var(--ink-soft) 30%, transparent); font-size: 1.15rem; }
.mcard .stars i.got { color: var(--gold); text-shadow: 0 2px 6px rgba(255, 170, 0, .45); }
.mcard .bar { flex: 1; min-width: 60px; height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--c1) 14%, transparent); overflow: hidden; }
.mcard .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c1), var(--c2)); transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.mcard .go { font-weight: 800; color: var(--c1); margin-left: auto; transition: transform .2s; }
.mcard:hover .go { transform: translateX(4px); }
.chips-mini { display: flex; flex-wrap: wrap; gap: 4px; }
.chips-mini i { font-style: normal; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }
.how-card { position: relative; padding: 24px 22px; border-radius: var(--radius); background: color-mix(in srgb, var(--paper) 84%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s, opacity .6s; }
.how-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.how-card .n { position: absolute; top: 16px; right: 18px; font: 700 2.6rem "Fredoka", sans-serif; opacity: .12; }
.how-card .e { font-size: 2.2rem; }
.how-card h3 { font-size: 1.25rem; margin: 8px 0 6px; }
.how-card p { margin: 0; color: var(--ink-soft); }

.parents { margin-top: 26px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 4px 22px; }
.parents summary { cursor: pointer; font: 600 1.15rem "Fredoka", sans-serif; padding: 14px 0; }
.parents ol { margin: 0 0 18px; padding-left: 20px; color: var(--ink-soft); }
.parents li { margin: 6px 0; }
.parents li b { color: var(--ink); }
.credits { margin-top: 26px; font-size: .82rem; color: var(--ink-soft); text-align: center; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero p { margin-inline: auto; } .hero-cta { justify-content: center; }
  .hero-art { max-width: 420px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .how-grid { grid-template-columns: 1fr; }
}

/* ================= Laboratoire ================= */
.lab { position: relative; z-index: 1; padding: 12px clamp(10px, 1.6vw, 20px) 16px; display: flex; flex-direction: column; gap: 10px; height: calc(100vh - 62px); height: calc(100dvh - 62px); min-height: 560px; }
.lab-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; text-decoration: none; font-size: 1.3rem; font-weight: 800; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); flex: none; transition: transform .2s; }
.back:hover { transform: translateX(-3px); }
.lab-id { display: flex; align-items: center; gap: 10px; flex: none; }
.lab-emoji { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 18px -8px var(--c1); }
.lab-id > span:last-child { display: flex; flex-direction: column; line-height: 1.1; }
.lab-subj { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c1); }
.lab-id b { font: 600 1.15rem "Fredoka", sans-serif; white-space: nowrap; }
.steps { display: flex; gap: 8px; overflow-x: auto; padding: 4px; margin-left: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.pill { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; font-weight: 800; font-size: .88rem; transition: transform .2s, box-shadow .2s, background .3s; min-height: 40px; }
.pill .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c1) 14%, transparent); color: var(--c1); font-size: .85rem; }
.pill:hover:not(:disabled) { transform: translateY(-2px); box-shadow: var(--shadow); }
.pill.done .n { background: var(--ok); color: #fff; }
.pill.cur { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -10px var(--c1); }
.pill.cur .n { background: rgba(255, 255, 255, .25); color: #fff; }
.pill.locked { opacity: .45; }
@media (max-width: 1280px) { .pill:not(.cur) .t { display: none; } .pill:not(.cur) { padding-right: 6px; } }

.lab-tabs { display: none; }
.lab-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(250px, 300px) minmax(0, 1fr) minmax(340px, 440px); gap: 12px; }
.panel { background: color-mix(in srgb, var(--paper) 90%, transparent); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-height: 0; backdrop-filter: blur(8px); }

/* --- Panneau mission --- */
.mission { overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mission.swap > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) backwards; }
.mission.swap > *:nth-child(2) { animation-delay: .06s; } .mission.swap > *:nth-child(3) { animation-delay: .12s; } .mission.swap > *:nth-child(4) { animation-delay: .18s; } .mission.swap > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.story { padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--c1) 9%, transparent); border-left: 4px solid var(--c1); font-size: .93rem; }
.story p { margin: 0; }
.goal .lbl { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--c1); }
.goal h2 { font-size: 1.35rem; margin: 2px 0 6px; }
.goal p { margin: 0; }
.coach { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft); transition: background .3s, border-color .3s; }
.coach .bot { flex: none; color: var(--ink); }
.coach p { margin: 0; font-weight: 700; color: var(--ink); font-size: .95rem; }
.coach.pop { animation: pop .4s cubic-bezier(.3, 1.6, .5, 1); }
.coach.good { background: color-mix(in srgb, var(--ok) 13%, var(--paper)); border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.coach.bad { background: color-mix(in srgb, var(--fr2) 16%, var(--paper)); border-color: color-mix(in srgb, var(--fr2) 55%, transparent); }
.coach.run .bot .eye { animation: blink 1.4s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes blink { 45%, 55% { transform: scaleY(.15); } }
@keyframes pop { 0% { transform: scale(.94); } 60% { transform: scale(1.02); } }
.help { display: flex; gap: 8px; flex-wrap: wrap; }
.help .btn { flex: 1; padding: 9px 10px; font-size: .88rem; }
.hint { margin: 0; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 22%, var(--paper)); font-weight: 700; font-size: .92rem; }
.hint.pop { animation: rise .35s backwards; }
.ideas h3 { font-size: 1.05rem; margin-bottom: 6px; }
.ideas ul { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: .92rem; }
.ideas li { margin: 5px 0; } .ideas b { color: var(--ink); }
.morse summary { cursor: pointer; font-weight: 800; padding: 4px 0; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; margin-top: 6px; }
.mgrid span { display: flex; gap: 6px; align-items: baseline; padding: 3px 6px; border-radius: 8px; background: var(--paper-2); font-size: .85rem; }
.mgrid b { font-family: "Fredoka", sans-serif; color: var(--c1); }
.mgrid i { font-style: normal; font-weight: 800; letter-spacing: 1px; }

/* --- Espace Blockly --- */
.ws { position: relative; overflow: hidden; }
.blockly { position: absolute; inset: 0; }
.ws-hud { position: absolute; z-index: 5; top: 10px; right: 14px; display: flex; gap: 8px; pointer-events: none; }
.ws-hud span { padding: 4px 10px; border-radius: 99px; font-size: .75rem; font-weight: 800; background: color-mix(in srgb, var(--paper) 85%, transparent); border: 1px solid var(--line); color: var(--ink-soft); }
.ws-hud #hudStep { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border-color: transparent; }
@media (pointer: coarse) { .ws-hud .kbd { display: none; } }
.ws.defi-on .blockly, .ws.defi-on .ws-hud { visibility: hidden; }
.defi { position: absolute; inset: 0; overflow-y: auto; padding: clamp(14px, 2vw, 24px); display: flex; flex-direction: column; gap: 14px; }
.blocklyMainBackground { stroke: none !important; }
.blocklyToolboxDiv { font-family: "Nunito", sans-serif; font-weight: 800; }
.blocklyFlyoutBackground { fill-opacity: .97; }
.blocklyTreeRow { border-radius: 10px; margin: 2px 6px; }

/* --- Simulateur --- */
.sim { display: flex; flex-direction: column; padding: 12px; gap: 10px; overflow-y: auto; }
.sim-bar { display: flex; gap: 10px; align-items: center; }
.btn.run { flex: 1; color: #fff; font-size: 1.05rem; background: linear-gradient(135deg, #12b886, #38d9a9); box-shadow: 0 10px 22px -10px #12b886; }
.btn.run.stop { background: linear-gradient(135deg, #f03e3e, #ff8787); box-shadow: 0 10px 22px -10px #f03e3e; }
.btn.run:not(.stop):not(:disabled) { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 10px 30px -6px #12b886; } }
.speed { display: flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.speed button { padding: 7px 10px; border-radius: 9px; font-weight: 800; font-size: .85rem; min-width: 40px; min-height: 36px; }
.speed button[aria-pressed="true"] { background: var(--paper); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .25); color: var(--c1); }
.stage { border-radius: 18px; overflow: hidden; background: #0d1030; box-shadow: inset 0 0 0 1px var(--line); flex: none; transition: box-shadow .3s; }
.stage.live { box-shadow: 0 0 0 3px color-mix(in srgb, #12b886 60%, transparent), 0 10px 30px -12px #12b886; }
.cl-svg { display: block; width: 100%; height: auto; }

/* Composants */
.cl-pin { font: 700 9px "Nunito", sans-serif; fill: #e6fbff; }
.cl-silk { font: 800 8px "Nunito", sans-serif; fill: #bff3f1; letter-spacing: .08em; }
.cl-brand { font: 700 22px "Fredoka", sans-serif; fill: #fff; }
.cl-chip { font: 700 10px "JetBrains Mono", monospace; fill: #8b90a8; }
.cl-lbl { font: 800 11px "Nunito", sans-serif; fill: #3b3f5c; }
.cl-lbl.light { fill: #e7fff2; }
.cl-title { font: 700 15px "Fredoka", sans-serif; fill: #fff; opacity: .9; }
.cl-title.dark { fill: #fff; }
.cl-led .halo { opacity: 0; transition: opacity .12s; }
.cl-led .lens { filter: saturate(.35) brightness(.6); transition: filter .12s; }
.cl-led.on .halo { opacity: 1; }
.cl-led.on .lens { filter: none; }
.cl-wire .flow { stroke-dasharray: 3 12; opacity: 0; }
.cl-wire.on .flow { opacity: .95; animation: flow .6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -30; } }
.l-led { fill: #5c4a20; transition: fill .1s; } .l-led.on { fill: #ffb703; filter: drop-shadow(0 0 4px #ffb703); }
.tx-led { fill: #3b4a5c; } .tx-led.on { fill: #ffd43b; }
.on-led { filter: drop-shadow(0 0 4px #40c057); }
.hole { transition: fill .1s; }
.beam { opacity: 0; transition: opacity .15s; mix-blend-mode: screen; }
.beam.on { opacity: 1; }
.twinkle { animation: tw 3s ease-in-out infinite; }
@keyframes tw { 50% { opacity: .25; } }
.wave { animation: wave 6s linear infinite; } .w1 { animation-duration: 8s; } .w2 { animation-duration: 11s; }
@keyframes wave { to { transform: translateX(80px); } }
.boat { animation: sail 14s ease-in-out infinite alternate; }
@keyframes sail { to { transform: translateX(-70px); } }
.seg { fill: #3a1418; transition: fill .08s; }
.seg.on { fill: #ff4d5e; filter: drop-shadow(0 0 3px #ff4d5e); }
.pip { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(.3); transition: opacity .15s, transform .25s cubic-bezier(.3, 1.8, .5, 1); }
.pip.on { opacity: 1; transform: none; }
.dice.bad rect:nth-child(2) { fill: #ffe3e3; }
.cl-btn { cursor: pointer; outline: none; }
.cl-btn .cap { transition: transform .08s; transform-box: fill-box; transform-origin: center; }
.cl-btn.down .cap { transform: translateY(3px) scale(.94); }
.cl-btn:focus-visible rect { stroke: #ffd43b; stroke-width: 3; }
.cl-btn .nudge { opacity: 0; }
.nudge-on .cl-btn:not(.down) .nudge { animation: nudge 1.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes nudge { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.5); } }
.cl-buzz .ring { opacity: 0; transform-box: fill-box; transform-origin: center; }
.cl-buzz.buzz .ring { animation: ring .7s ease-out; } .cl-buzz.buzz .r1 { animation-delay: .12s; } .cl-buzz.buzz .r2 { animation-delay: .24s; }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(2.2); } }
.cl-voice.talk > circle:first-of-type { animation: talk .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes talk { to { transform: scale(1.08); } }
.bubble { opacity: 0; transform: translateY(8px) scale(.9); transform-box: fill-box; transform-origin: center bottom; transition: opacity .2s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.bubble.show { opacity: 1; transform: none; }
.bubble-t { font: 700 20px "Fredoka", sans-serif; fill: #5b3cc4; }

/* Sous-onglets : code, moniteur, tableau */
.subtabs { display: flex; gap: 6px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.subtabs button { flex: 1; padding: 8px; border-radius: 10px; font-weight: 800; font-size: .85rem; min-height: 38px; transition: background .2s; }
.subtabs button[aria-selected="true"] { background: var(--paper); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .25); color: var(--c1); }
.subpane { min-height: 120px; }
.codebox { position: relative; border-radius: 16px; background: var(--code-bg); color: var(--code-ink); overflow: hidden; }
.codebox pre { margin: 0; padding: 14px 16px; max-height: 300px; overflow: auto; font: 500 12.5px/1.6 "JetBrains Mono", ui-monospace, monospace; tab-size: 2; }
.code-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; background: rgba(255, 255, 255, .05); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.code-head .dots { display: flex; gap: 5px; } .code-head .dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; } .code-head .dots i:nth-child(2) { background: #ffd43b; } .code-head .dots i:nth-child(3) { background: #51cf66; }
.code-head .fname { font: 700 12px "JetBrains Mono", monospace; color: #9aa3d6; margin-right: auto; }
.code-head .copy { padding: 6px 12px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 800; font-size: .82rem; min-height: 34px; transition: background .2s, transform .2s; }
.code-head .copy:hover { background: rgba(255, 255, 255, .2); transform: translateY(-1px); }
.codebox .c { color: #7f87b8; font-style: italic; } .codebox .s { color: #ffd166; } .codebox .k { color: #ff8fab; font-weight: 700; }
.codebox .n { color: #8ce99a; } .codebox .f { color: #74c0fc; }
.serial { margin: 0; min-height: 120px; max-height: 260px; overflow: auto; padding: 14px 16px; border-radius: 16px; background: #0b0d18; color: #8ce99a; font: 500 13px/1.5 "JetBrains Mono", monospace; }
.serial.empty::before { content: "Le moniteur série affiche ici les messages du bloc « écrire sur le moniteur »."; color: #6b7299; font-family: "Nunito", sans-serif; font-weight: 700; }
.statsbox { padding: 14px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 170px; align-items: end; }
.sb { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.sb i { width: 100%; max-width: 46px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--ma2), var(--ma1)); transition: height .35s cubic-bezier(.2, .8, .2, 1); min-height: 3px; box-shadow: 0 6px 14px -8px var(--ma1); }
.sb .v { font-weight: 800; font-size: .8rem; color: var(--ink-soft); }
.sb b { font: 700 1.1rem "Fredoka", sans-serif; }
.muted { color: var(--ink-soft); font-size: .88rem; margin: 10px 0 0; text-align: center; font-weight: 700; }

/* --- Défis --- */
.dcard { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 2.4vw, 26px); box-shadow: var(--shadow); }
.dcard h3 { font-size: 1.35rem; margin-bottom: 6px; }
.dcard > p { color: var(--ink-soft); margin: 0 0 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tape { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.slot { min-width: 74px; padding: 10px 8px; border-radius: 16px; background: var(--paper-2); border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; transition: border-color .2s, transform .2s, background .2s; }
.slot i { font-style: normal; font-weight: 800; font-size: 1.4rem; letter-spacing: 3px; min-height: 1.6em; color: var(--c1); }
.slot b { font: 700 1.5rem "Fredoka", sans-serif; }
.slot.cur { border-style: solid; border-color: var(--c1); transform: translateY(-3px); background: color-mix(in srgb, var(--c1) 8%, var(--paper)); }
.answer { margin-top: 14px; }
.answer label, .dcard label { display: block; font-weight: 800; margin: 8px 0 6px; }
.inp { font: 700 1.1rem "Nunito", sans-serif; color: var(--ink); background: var(--paper-2); border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; transition: border-color .2s, box-shadow .2s; min-height: 46px; }
.inp:focus { outline: none; border-color: var(--c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 20%, transparent); }
#decIn { text-transform: uppercase; letter-spacing: 3px; flex: 1; min-width: 140px; max-width: 260px; }
textarea.inp { width: 100%; resize: vertical; font-size: 1.05rem; }
.inp.num { width: 140px; }
.fb { margin: 10px 0 0; font-weight: 800; min-height: 1.2em; }
.fb.good { color: var(--ok); } .fb.bad { color: #e8590c; }
.defn { padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--c1) 9%, transparent); margin: 0 0 8px; }
.crit { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crit li { padding: 5px 12px; border-radius: 99px; font-weight: 800; font-size: .85rem; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft); transition: background .25s, color .25s; }
.crit li.ok { background: color-mix(in srgb, var(--ok) 15%, var(--paper)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.quiz { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.q p { margin: 0 0 8px; font-weight: 800; }
.q .say { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; vertical-align: middle; margin-left: 4px; box-shadow: 0 6px 14px -6px var(--c1); transition: transform .2s; }
.q .say:hover { transform: scale(1.1); } .q .say.playing { animation: pop .5s infinite; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 10px 16px; border-radius: 14px; background: var(--paper-2); border: 2px solid var(--line); font-weight: 800; min-height: 44px; transition: transform .15s, border-color .2s, background .2s; }
.opt:hover { transform: translateY(-2px); border-color: var(--c1); }
.opt.sel { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 12%, var(--paper)); }
.q.locked .opt { pointer-events: none; }
.q.locked .opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--paper)); }
.q.bad .opt.sel:not(.right) { border-color: var(--ko); background: color-mix(in srgb, var(--ko) 10%, var(--paper)); }
.why { margin: 6px 0 0; font-weight: 700; font-size: .9rem; color: var(--ink-soft); }
.q.good .why { color: var(--ok); } .q.bad .why { color: #e8590c; }

/* --- Modale --- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(15, 17, 40, .5); backdrop-filter: blur(6px); opacity: 0; transition: opacity .22s; }
.modal.open { opacity: 1; }
.modal-card { position: relative; width: min(520px, 100%); max-height: 90vh; overflow-y: auto; background: var(--paper); border-radius: 26px; padding: 28px 24px 22px; box-shadow: var(--shadow-lg); transform: translateY(20px) scale(.96); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.modal.open .modal-card { transform: none; }
.modal-card .x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border-radius: 50%; font-size: 1.1rem; color: var(--ink-soft); }
.modal-card .x:hover { background: var(--paper-2); }
.win { text-align: center; }
.medal { font-size: 3.6rem; animation: medal .8s cubic-bezier(.3, 1.8, .5, 1) backwards; }
@keyframes medal { from { transform: scale(0) rotate(-40deg); } }
.win h2 { font-size: 2rem; background: linear-gradient(120deg, var(--fr1), var(--ma2), var(--en1)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.win .sub { color: var(--ink-soft); font-weight: 800; margin: 4px 0 10px; }
.bigstars { font-size: 2.4rem; letter-spacing: 6px; margin-bottom: 12px; }
.bigstars i { font-style: normal; color: color-mix(in srgb, var(--ink-soft) 25%, transparent); display: inline-block; }
.bigstars i.got { color: var(--gold); text-shadow: 0 4px 12px rgba(255, 170, 0, .5); }
.bigstars i.new { animation: star .9s .3s cubic-bezier(.3, 1.8, .5, 1) backwards; }
@keyframes star { from { transform: scale(0) rotate(-180deg); } }
.learn, .model { text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); margin-bottom: 14px; }
.learn p, .model p { margin: 4px 0 0; color: var(--ink-soft); }
.model p { margin-bottom: 8px; color: var(--ink); font-style: italic; }
.win .row, .confirm .row { justify-content: center; }
.confirm h2 { font-size: 1.4rem; margin-bottom: 8px; }
.confirm p { color: var(--ink-soft); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 30px); opacity: 0; padding: 12px 20px; border-radius: 14px; background: #23264a; color: #fff; font-weight: 800; box-shadow: var(--shadow-lg); transition: opacity .25s, transform .3s cubic-bezier(.3, 1.5, .5, 1); pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ================= Tablette / téléphone : onglets ================= */
@media (max-width: 1099px) {
  .lab { height: auto; min-height: calc(100dvh - 62px); }
  .lab-head { flex-wrap: wrap; }
  .ws-hud { display: none; }
  .steps { margin-left: 0; width: 100%; order: 3; }
  .pill:not(.cur) .t { display: none; }
  .lab-tabs { display: flex; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 4px; box-shadow: var(--shadow); position: sticky; top: calc(62px + env(safe-area-inset-top, 0px)); z-index: 20; }
  .lab-tabs button { flex: 1; padding: 10px 6px; border-radius: 12px; font-weight: 800; min-height: 44px; transition: background .2s, color .2s; }
  .lab-tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; box-shadow: 0 6px 16px -8px var(--c1); }
  .lab-grid { display: block; }
  .lab-grid > .panel { display: none; }
  .lab[data-tab="mission"] .mission, .lab[data-tab="board"] .sim { display: flex; animation: rise .35s backwards; }
  .lab[data-tab="blocks"] .ws { display: block; height: calc(100dvh - 210px); min-height: 420px; }
  .sim .stage { max-width: 620px; width: 100%; margin: 0 auto; }
}
@media (max-width: 520px) {
  .lab-id b { font-size: 1rem; white-space: normal; }
  .stats b { font-size: 1.8rem; }
  .bars { height: 130px; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
.sc-atelier .cl-lbl.light { fill: #3b3f5c; }

/* ================= Phase 1 : filtres, nouvelles scènes ================= */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.fchip { padding: 8px 14px; border-radius: 999px; font-weight: 800; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .18); min-height: 40px; transition: transform .2s, box-shadow .2s, background .25s, color .25s; }
.fchip b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 99px; font-size: .75rem; background: color-mix(in srgb, var(--c1) 15%, transparent); color: var(--c1); }
.fchip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.fchip[aria-pressed="true"] { color: #fff; background: linear-gradient(135deg, var(--c1), var(--c2)); border-color: transparent; box-shadow: 0 8px 18px -8px var(--c1); }
.fchip[aria-pressed="true"] b { background: rgba(255, 255, 255, .25); color: #fff; }
.fchip[data-f="all"] { --c1: #ff6b3d; --c2: #f15bb5; }
.pop-in { animation: popIn .45s cubic-bezier(.2, 1.3, .4, 1) backwards; animation-delay: var(--d, 0ms); }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }

.tempctl { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-radius: 16px; background: linear-gradient(90deg, color-mix(in srgb, #4dabf7 16%, var(--paper)), color-mix(in srgb, #ff6b6b 16%, var(--paper))); border: 1px solid var(--line); }
.tempctl label { font-weight: 800; font-size: .9rem; }
.tempctl input { flex: 1; min-width: 140px; accent-color: #f03e3e; height: 28px; }
.tempctl output { font: 700 1.1rem "Fredoka", sans-serif; min-width: 60px; text-align: right; }

.cl-num { font: 700 14px "Fredoka", sans-serif; fill: #fff; opacity: .85; }
.cl-key { font: 800 12px "Nunito", sans-serif; fill: #5b3cc4; }
.cl-keys .key rect { transition: fill .1s, transform .1s; transform-box: fill-box; transform-origin: top; }
.cl-keys .key.down rect { fill: #b197fc; transform: scaleY(.96); }
.cl-keys .key.down text { fill: #fff; }
.fnote { font: 700 26px "Fredoka", sans-serif; fill: #ffd43b; animation: fnote 1.3s ease-out forwards; pointer-events: none; }
@keyframes fnote { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-120px) rotate(20deg); } }
.cl-sign { font: 700 18px "Fredoka", sans-serif; fill: #fff; letter-spacing: .2em; }
.cl-quiz { font: 700 34px "Fredoka", sans-serif; fill: #ffd43b; letter-spacing: .08em; filter: drop-shadow(0 0 10px rgba(255, 212, 59, .6)); }
.cl-lbl.small { font-size: 9px; letter-spacing: .08em; }
.cl-bell .ring { opacity: 0; transform-box: fill-box; transform-origin: center; }
.cl-bell.buzz .ring { animation: ring .7s ease-out; } .cl-bell.buzz .r1 { animation-delay: .12s; } .cl-bell.buzz .r2 { animation-delay: .24s; }
.cl-bell.buzz .swing { animation: swing .5s ease-in-out; }
@keyframes swing { 25% { transform: rotate(18deg); } 75% { transform: rotate(-18deg); } }
.cl-rocket .ship { transition: transform 2.6s cubic-bezier(.5, 0, .8, .4); }
.cl-rocket .flame { opacity: 0; transform-box: fill-box; transform-origin: top; }
.cl-rocket.go .ship { transform: translateY(-300px); }
.cl-rocket.go .flame { opacity: 1; animation: flame .12s infinite alternate; }
@keyframes flame { to { transform: scaleY(1.4); } }
.cl-rgb { color: #3b3f52; }
.cl-rgb .rgb-glow { opacity: 0; transition: opacity .2s; }
.cl-rgb.on .rgb-glow { opacity: 1; }
.cl-rgb .rgb-glass { opacity: .55; transition: fill .2s; }
.cl-rgb.on .rgb-glass { opacity: .85; }
.cl-rgb .rgb-core { transition: fill .2s; }
.cl-thermo .merc { transition: y .3s, height .3s; }
.sun { animation: tw 4s ease-in-out infinite; }

.sc-musique .cl-lbl, .sc-quiz .cl-lbl { fill: #f1eaff; }

/* ================= Bandeau « en construction » ================= */
.wip {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 16px 52px 16px 20px;
  border-radius: 20px; color: #4a2c00; background: linear-gradient(120deg, #ffe066, #ffc078 55%, #ffa94d); box-shadow: 0 14px 34px -16px rgba(232, 89, 12, .65);
  animation: wipIn .7s cubic-bezier(.2, 1.3, .4, 1) .15s backwards; transition: opacity .35s, transform .35s;
}
.wip.bye { opacity: 0; transform: translateY(-10px) scale(.98); }
@keyframes wipIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
.wip-stripes { position: absolute; inset: 0 0 auto; height: 7px; background: repeating-linear-gradient(-45deg, #23264a 0 12px, #ffd43b 12px 24px); background-size: 34px 34px; animation: stripes 1.2s linear infinite; opacity: .85; }
@keyframes stripes { to { background-position: 34px 0; } }
.wip-ico { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.9rem; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); animation: wipBob 2.4s ease-in-out infinite; }
@keyframes wipBob { 50% { transform: translateY(-4px) rotate(-6deg); } }
.wip-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wip-txt b { font: 700 1.15rem "Fredoka", sans-serif; }
.wip-txt > span { font-weight: 700; font-size: .93rem; }
.wip-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.wip-bar { width: 160px; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .55); overflow: hidden; }
.wip-bar i { display: block; height: 100%; width: 35%; border-radius: 99px; background: linear-gradient(90deg, #e8590c, #d6336c); animation: wipFill 1.6s cubic-bezier(.2, .8, .2, 1) .6s backwards; position: relative; }
.wip-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); animation: shimmer 2s 2.2s infinite; transform: translateX(-100%); }
@keyframes wipFill { from { width: 0; } }
@keyframes shimmer { to { transform: translateX(100%); } }
.wip-progress small { font-weight: 800; font-size: .78rem; opacity: .8; }
.wip-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; font-weight: 800; color: #4a2c00; background: rgba(255, 255, 255, .45); transition: background .2s, transform .2s; }
.wip-x:hover { background: rgba(255, 255, 255, .8); transform: rotate(90deg); }
.wip-badge {
  flex: none; padding: 6px 12px; border-radius: 99px; font-weight: 800; font-size: .78rem; color: #4a2c00; white-space: nowrap;
  background: linear-gradient(120deg, #ffe066, #ffa94d); box-shadow: 0 6px 16px -8px rgba(232, 89, 12, .7); animation: badgePulse 2.8s ease-in-out infinite;
}
@keyframes badgePulse { 50% { box-shadow: 0 6px 22px -4px rgba(232, 89, 12, .75); transform: translateY(-1px); } }
:root[data-theme="dark"] .wip, :root[data-theme="dark"] .wip-badge { filter: saturate(.95) brightness(.95); }
@media (max-width: 640px) {
  .wip { align-items: flex-start; padding: 18px 46px 14px 14px; gap: 12px; }
  .wip-ico { width: 44px; height: 44px; font-size: 1.5rem; }
  .wip-bar { width: 120px; }
}
@media (max-width: 1099px) { .wip-badge { order: 2; } }
@media (min-width: 1100px) and (max-width: 1440px) { .wip-badge .t { display: none; } .wip-badge { padding: 6px 9px; } }
