/* Who Eats Whom? (shared look copied from the colour lab) — fixed 1920×1080 stage scaled into the container.
   Same visual language as the circuit game: Baloo Bhaijaan 2, chunky cards with a solid
   bottom shadow, blue gradient menu, big stars, dashed "did you know?" box.
   Everything is scoped under .ls-food so nothing leaks into the site. */

.ls-food {
  --ink: #1d2a44;
  --blue: #1e5bd8;
  --blue-dark: #163f9c;
  --sky: #eaf5ff;
  --paper: #fffaf0;
  --yellow: #ffd54f;
  --orange: #ff9800;
  --green: #2e9d4f;
  --red: #e53935;
  --font: 'Baloo Bhaijaan 2', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  position: relative; height: 100%; overflow: hidden;
  background: #0d1b3a; color: var(--ink); font-family: var(--font);
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.ls-food, .ls-food * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.ls-food button { font-family: inherit; color: inherit; cursor: pointer; }
.ls-food button:focus-visible { outline: 6px solid #ffb300; outline-offset: 6px; }
.ls-food [hidden] { display: none !important; }

.ls-food #viewport { position: absolute; inset: 0; overflow: hidden; }
.ls-food #stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; overflow: hidden; background: var(--sky);
}
.ls-food .screen { position: absolute; inset: 0; display: none; }
.ls-food .screen.active { display: block; }

/* ---------------------------------------------------------------- menu */
.ls-food #screen-menu { background: linear-gradient(160deg, #2a62d6, #173b8c); }
.ls-food .menu-title { margin: 0; padding: 60px 0 30px; text-align: center; color: #fff; font-size: 76px; font-weight: 800; }
.ls-food #menu-cards { display: grid; grid-template-columns: repeat(4, 380px); gap: 36px; justify-content: center; }
.ls-food .level-card {
  position: relative; height: 380px; border: none; border-radius: 36px;
  background: #fff; box-shadow: 0 12px 0 #0b2466, 0 20px 40px #0006;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transition: transform .12s;
}
.ls-food .level-card:active { transform: translateY(8px) scale(.97); box-shadow: 0 4px 0 #0b2466; }
.ls-food .level-card .lc-icon { font-size: 110px; line-height: 1.1; }
.ls-food .level-card .lc-num { font-size: 28px; font-weight: 700; color: #5a6b8c; }
.ls-food .level-card .lc-name { font-size: 40px; font-weight: 800; padding: 0 16px; text-align: center; line-height: 1.15; }
.ls-food .level-card .lc-stars { font-size: 46px; letter-spacing: 6px; color: #d7deea; }
.ls-food .level-card .lc-stars .on { color: var(--yellow); text-shadow: 0 2px 0 #c77800; }
.ls-food .level-card.lab { background: linear-gradient(160deg, #fff8e1, #ffe082); }
.ls-food .level-card.locked { background: linear-gradient(160deg, #eceff1, #cfd8dc); color: #546e7a; }
.ls-food .level-card .lc-badge {
  position: absolute; top: -18px; inset-inline-start: -14px;
  background: var(--red); color: #fff; font-size: 30px; font-weight: 800;
  padding: 6px 22px; border-radius: 30px; transform: rotate(-6deg);
  box-shadow: 0 4px 0 #8e1b1b; animation: lc-wobble 1.8s ease-in-out infinite;
}
@keyframes lc-wobble { 50% { transform: rotate(4deg) scale(1.08); } }
.ls-food .pill-btn {
  position: absolute; top: 28px; inset-inline-end: 40px;
  min-width: 160px; height: 72px; padding: 0 28px; border-radius: 36px;
  border: 3px solid #ffffff99; background: #ffffff22; color: #fff; font-size: 30px; font-weight: 700;
}

/* ---------------------------------------------------------------- level layout */
.ls-food #screen-level.active {
  display: grid;
  grid-template-columns: 560px 1360px;
  grid-template-rows: 100px 860px 120px;
  grid-template-areas: "top top" "side nature" "controls controls";
}
.ls-food #topbar {
  grid-area: top; display: flex; align-items: center; gap: 30px; padding-inline: 40px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue)); color: #fff;
  box-shadow: 0 4px 12px #0003; z-index: 3;
}
.ls-food .tb-text { flex: 1; display: flex; align-items: baseline; gap: 26px; min-width: 0; }
.ls-food #level-name { font-size: 34px; font-weight: 800; white-space: nowrap; background: #ffffff26; padding: 4px 22px; border-radius: 30px; }
.ls-food #challenge { font-size: 38px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-food #step-count { font-size: 28px; font-weight: 700; color: #ffffffcc; white-space: nowrap; }
.ls-food #level-stars { font-size: 48px; letter-spacing: 4px; color: #ffffff55; white-space: nowrap; }
.ls-food #level-stars .on { color: var(--yellow); }

/* controls */
.ls-food #controls {
  grid-area: controls; display: flex; align-items: center; justify-content: center; gap: 34px;
  background: #dcebfb; border-top: 4px solid #c5dbf3; z-index: 2;
}
.ls-food .ctrl {
  width: 96px; height: 96px; border-radius: 26px; border: none; background: #fff; box-shadow: 0 6px 0 #a9c3e2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .08s;
}
.ls-food .ctrl:active { transform: translateY(5px); box-shadow: 0 1px 0 #a9c3e2; }
.ls-food .ctrl .ico { font-size: 44px; line-height: 1; }
.ls-food .ctrl .lbl { font-size: 17px; font-weight: 700; line-height: 1.2; }

/* ---------------------------------------------------------------- Qatra + bubble */
/* Qatra */
.ls-food #qatra { position: absolute; bottom: 140px; inset-inline-end: 34px; width: 170px; height: 170px; z-index: 6; pointer-events: none; }
.ls-food .qatra-svg { width: 100%; height: 100%; overflow: visible; }
.ls-food .qa-body { fill: var(--qa, #64b5f6); stroke: var(--qa-dark, #1e5bd8); stroke-width: 5; stroke-linejoin: round; transition: fill .5s, stroke .5s; }
.ls-food .qa-aura { fill: var(--qa, #64b5f6); opacity: .22; transition: fill .5s; }
.ls-food .qa-arm path { fill: none; stroke: var(--qa-dark, #1e5bd8); stroke-width: 7; stroke-linecap: round; }
.ls-food .qa-arm circle { fill: var(--qa, #64b5f6); stroke: var(--qa-dark, #1e5bd8); stroke-width: 3; }
.ls-food .qa-bob { animation: qa-bob 2.4s ease-in-out infinite; }
@keyframes qa-bob { 50% { transform: translateY(-7px); } }
.ls-food .qa-arm-r { transform-origin: 50px 32px; }
.ls-food .qa-arm-l { transform-origin: -50px 32px; }
.ls-food .qatra-slot.cheer .qatra-svg { animation: qa-cheer .5s ease-in-out 2; }
@keyframes qa-cheer { 40% { transform: translateY(-50px) rotate(-12deg); } 70% { transform: translateY(0) rotate(8deg); } }
.ls-food .qatra-slot.cheer .qa-arm { animation: qa-wave .25s ease-in-out infinite alternate; }
@keyframes qa-wave { from { transform: rotate(10deg); } to { transform: rotate(-40deg); } }
.ls-food .qatra-slot.flash .qatra-svg { animation: qa-flash .3s ease-in-out 6 alternate; }
@keyframes qa-flash { to { filter: drop-shadow(0 0 22px #ffeb3b) brightness(1.15); transform: scale(1.1); } }
.ls-food .qatra-slot.worried .qatra-svg { animation: qa-shake .12s linear 8; }
@keyframes qa-shake { 25% { transform: translate(-4px, 1px) rotate(-3deg); } 75% { transform: translate(4px, -1px) rotate(3deg); } }

.ls-food #bubble {
  position: absolute; bottom: 400px; inset-inline-end: 150px; z-index: 6; max-width: 560px; padding: 18px 28px;
  background: #fff; border: 4px solid var(--orange); border-radius: 30px;
  font-size: 32px; font-weight: 700; line-height: 1.3; box-shadow: 0 8px 20px #0003; pointer-events: none;
}
.ls-food #bubble::after {
  content: ''; position: absolute; bottom: -22px; inset-inline-end: 24px;
  border: 14px solid transparent; border-top: 18px solid var(--orange);
}
.ls-food #bubble.pop { animation: col-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes col-pop { from { transform: scale(.4); opacity: 0; } }

/* ---------------------------------------------------------------- overlays (same as circuit) */
.ls-food .overlay { position: absolute; inset: 0; z-index: 20; background: #0d1b3acc; display: flex; align-items: center; justify-content: center; }
.ls-food .card {
  background: #fff; border-radius: 44px; padding: 44px 64px; box-shadow: 0 16px 0 #0b2466, 0 30px 60px #0008;
  text-align: center; animation: col-cardin .45s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes col-cardin { from { transform: scale(.5) translateY(80px); opacity: 0; } }
.ls-food .card h2 { margin: 0 0 8px; font-size: 72px; font-weight: 800; color: var(--blue-dark); }
.ls-food .big-stars { font-size: 110px; letter-spacing: 12px; color: #dde3ec; line-height: 1.1; }
.ls-food .big-stars span { display: inline-block; }
.ls-food .big-stars .on { color: var(--yellow); text-shadow: 0 5px 0 #c77800; animation: col-star .5s cubic-bezier(.3, 1.8, .5, 1) backwards; }
@keyframes col-star { from { transform: scale(0) rotate(-90deg); } }
.ls-food .success-card { width: 1100px; }
.ls-food .dyk { background: #fff8e1; border: 4px dashed #ffca28; border-radius: 30px; padding: 18px 36px; margin: 18px 0 30px; }
.ls-food .dyk h3 { margin: 0; font-size: 40px; color: #e65100; }
.ls-food .dyk p { margin: 8px 0 0; font-size: 36px; font-weight: 600; line-height: 1.4; }
.ls-food .card-buttons { display: flex; gap: 30px; justify-content: center; }
.ls-food .btn {
  min-width: 300px; height: 110px; padding: 0 44px; border-radius: 55px; border: none;
  background: #e3ebf7; font-size: 42px; font-weight: 800; box-shadow: 0 8px 0 #a9bad4;
}
.ls-food .btn.primary { background: var(--green); color: #fff; box-shadow: 0 8px 0 #1b6b33; }
.ls-food .btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #a9bad4; }
.ls-food .cert-card { width: 1200px; border: 14px double #ffca28; background: linear-gradient(#fffdf5, #fff6dc); }
.ls-food .cert-medal { font-size: 120px; line-height: 1; }
.ls-food .cert-qatra { width: 180px; height: 180px; margin: 0 auto; }
.ls-food #cert-body { font-size: 44px; font-weight: 700; margin: 6px 0; }
.ls-food #cert-stars bdi { color: #c77800; font-size: 90px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) {
  .ls-food *, .ls-food *::before, .ls-food *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ================================================================ Who Eats Whom? specifics */
.ls-food #qatra { bottom: 4px; inset-inline-end: 30px; width: 160px; height: 160px; }
.ls-food .qa-body { fill: #64b5f6; stroke: #1e5bd8; }
.ls-food .qa-arm path { stroke: #1e5bd8; } .ls-food .qa-arm circle { fill: #64b5f6; stroke: #1e5bd8; }
.ls-food #bubble { bottom: 16px; inset-inline-end: 196px; max-width: 560px; font-size: 27px; padding: 12px 22px; /* stays clear of the centred control buttons */ }
.ls-food #bubble::after { bottom: auto; top: 50%; inset-inline-end: -26px; transform: translateY(-50%); border: 13px solid transparent; border-inline-start: 18px solid var(--orange); }

.ls-food #side {
  grid-area: side; background: var(--paper); border-inline-end: 4px solid #f0dfb8;
  padding: 24px 28px; display: flex; flex-direction: column; gap: 16px; z-index: 2; overflow: hidden;
}
.ls-food .info { background: #fff; border-radius: 24px; padding: 16px 20px; font-size: 26px; font-weight: 700; line-height: 1.45; box-shadow: 0 5px 0 #e3cf9f; }
.ls-food .info.q { font-size: 30px; font-weight: 800; text-align: center; }
.ls-food .info.right { background: #e8f5e9; }
.ls-food .info.wrong { background: #fff3e0; }
.ls-food .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ls-food .org-card {
  border: none; background: #fff; border-radius: 24px; height: 190px; padding: 8px; touch-action: none; cursor: grab;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 6px 0 #e3cf9f;
}
.ls-food .org-card svg { width: 120px; height: 120px; pointer-events: none; overflow: visible; }
.ls-food .org-card span { font-size: 24px; font-weight: 800; pointer-events: none; text-align: center; line-height: 1.15; }
.ls-food .org-card.selected { background: #ffe082; box-shadow: 0 6px 0 #c79a00, inset 0 0 0 4px #ffb300; }
.ls-food .org-card:active { transform: translateY(5px); }
.ls-food .choices { display: flex; flex-direction: column; gap: 14px; }
.ls-food .choice { border: none; height: 100px; border-radius: 28px; background: #fff; font-size: 36px; font-weight: 800; box-shadow: 0 7px 0 #e3cf9f; }
.ls-food .choice:active { transform: translateY(5px); }
.ls-food .verdict { font-size: 38px; font-weight: 800; text-align: center; line-height: 1.25; padding: 14px; border-radius: 26px; }
.ls-food .verdict.right { background: #e8f5e9; color: #1b6b33; }
.ls-food .verdict.wrong { background: #fff3e0; color: #b45309; font-size: 30px; }
.ls-food .explain { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.5; }
.ls-food .big-btn {
  width: 100%; min-height: 92px; border: none; border-radius: 30px; font-size: 36px; font-weight: 800;
  background: var(--green); color: #fff; box-shadow: 0 8px 0 #1b6b33; margin-top: auto;
}
.ls-food .big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #1b6b33; }
.ls-food .big-btn:disabled { opacity: .5; }
.ls-food .slider-row { display: flex; flex-direction: column; gap: 6px; font-size: 26px; font-weight: 800; }
.ls-food .slider-row b { color: var(--blue-dark); }
.ls-food input[type=range] { width: 100%; height: 44px; accent-color: var(--blue); }
.ls-food .set-title { font-size: 24px; font-weight: 800; }
.ls-food .seg { display: flex; gap: 8px; }
.ls-food .seg-btn { flex: 1; min-height: 60px; border: none; border-radius: 18px; background: #fff; font-size: 21px; font-weight: 800; box-shadow: 0 5px 0 #d8c69d; padding: 4px 8px; }
.ls-food .seg-btn.on { background: #ffe082; box-shadow: 0 5px 0 #c79a00, inset 0 0 0 4px #ffb300; }
.ls-food .seg-btn.wide { width: 100%; flex: none; }

/* nature area */
.ls-food #nature { grid-area: nature; position: relative; overflow: hidden; display: grid; grid-template-rows: 420px 440px; }
.ls-food #nature.bg-desert { background: linear-gradient(#ffe7b8 0, #f6d79a 55%, #e0b87a 100%); }
.ls-food #nature.bg-wadi { background: linear-gradient(#d6efff 0, #b9e1c4 60%, #9cc79f 100%); }
.ls-food #nature.bg-sea { background: linear-gradient(#bfe6ff 0, #4fb3e8 45%, #1e6fb3 100%); }
.ls-food #habitat { position: relative; padding: 30px 40px 10px; }
.ls-food #nature:not(:has(.pops)) { grid-template-rows: 1fr 0; }
.ls-food .legend { font-size: 24px; font-weight: 800; color: #3e2723; background: #ffffffcc; border-radius: 18px; padding: 8px 18px; display: inline-block; }
.ls-food .chain { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 120px; }
.ls-food .slot {
  width: 230px; height: 260px; border-radius: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: 24px; font-weight: 800; text-align: center; line-height: 1.15;
}
.ls-food .slot.filled { background: #ffffffe6; box-shadow: 0 8px 0 #0002; animation: fd-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.ls-food .slot.filled svg { width: 150px; height: 150px; overflow: visible; }
.ls-food .slot.empty { border: 5px dashed #ffffffcc; background: #ffffff44; font-size: 80px; color: #fff; }
.ls-food .slot.empty.next { border-color: #ffb300; background: #fff8e199; animation: fd-breathe 1.4s ease-in-out infinite; }
@keyframes fd-pop { from { transform: scale(.5); } }
@keyframes fd-breathe { 50% { transform: scale(1.05); } }
.ls-food .arrow { font-size: 64px; font-weight: 800; color: #ffffff99; }
.ls-food .arrow.on { color: #e65100; }
.ls-food .chain.complete .arrow.on { animation: fd-flow 1s ease-in-out infinite; }
@keyframes fd-flow { 50% { transform: translateX(var(--dx, -10px)); color: #ffb300; } }
.ls-food[dir=ltr] .chain.complete .arrow.on { --dx: 10px; }

.ls-food .pops { display: flex; flex-direction: column; gap: 14px; }
.ls-food .pop-row { display: grid; grid-template-columns: 240px 1fr; align-items: center; gap: 12px; background: #ffffffcc; border-radius: 24px; padding: 8px 16px; border-inline-start: 10px solid var(--c); }
.ls-food .pop-name { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; line-height: 1.1; }
.ls-food .pop-name svg { width: 64px; height: 64px; flex: none; }
.ls-food .pop-icons { display: flex; flex-wrap: wrap; gap: 2px; min-height: 80px; align-items: center; }
.ls-food .pop-icons svg { width: 74px; height: 74px; }
.ls-food .gone { font-size: 48px; color: #b71c1c; font-weight: 800; padding-inline-start: 12px; }
.ls-food #chart { padding: 0 30px 10px; }
.ls-food .chart-svg { width: 100%; height: 340px; display: block; }
.ls-food .chart-legend { display: flex; justify-content: center; gap: 40px; font-size: 24px; font-weight: 800; margin-top: 4px; }
.ls-food .chart-legend span { display: inline-flex; align-items: center; gap: 10px; background: #ffffffcc; padding: 4px 14px; border-radius: 16px; }
.ls-food .chart-legend i { width: 34px; height: 12px; border-radius: 6px; }
.ls-food .chart-note { font-size: 20px; font-weight: 700; color: #263238; opacity: .7; text-align: center; }

.ls-food #drop-layer { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.ls-food .drag-ghost { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.ls-food .drag-ghost svg { position: absolute; width: 140px; height: 140px; transform: translate(-50%, -50%); overflow: visible; filter: drop-shadow(0 10px 10px #0005); }
