/* Float or Sink? (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-float so nothing leaks into the site. */

.ls-float {
  --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-float, .ls-float * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.ls-float button { font-family: inherit; color: inherit; cursor: pointer; }
.ls-float button:focus-visible { outline: 6px solid #ffb300; outline-offset: 6px; }
.ls-float [hidden] { display: none !important; }

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

/* ---------------------------------------------------------------- menu */
.ls-float #screen-menu { background: linear-gradient(160deg, #2a62d6, #173b8c); }
.ls-float .menu-title { margin: 0; padding: 60px 0 30px; text-align: center; color: #fff; font-size: 76px; font-weight: 800; }
.ls-float #menu-cards { display: grid; grid-template-columns: repeat(4, 380px); gap: 36px; justify-content: center; }
.ls-float .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-float .level-card:active { transform: translateY(8px) scale(.97); box-shadow: 0 4px 0 #0b2466; }
.ls-float .level-card .lc-icon { font-size: 110px; line-height: 1.1; }
.ls-float .level-card .lc-num { font-size: 28px; font-weight: 700; color: #5a6b8c; }
.ls-float .level-card .lc-name { font-size: 40px; font-weight: 800; padding: 0 16px; text-align: center; line-height: 1.15; }
.ls-float .level-card .lc-stars { font-size: 46px; letter-spacing: 6px; color: #d7deea; }
.ls-float .level-card .lc-stars .on { color: var(--yellow); text-shadow: 0 2px 0 #c77800; }
.ls-float .level-card.lab { background: linear-gradient(160deg, #fff8e1, #ffe082); }
.ls-float .level-card.locked { background: linear-gradient(160deg, #eceff1, #cfd8dc); color: #546e7a; }
.ls-float .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-float .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-float #screen-level.active {
  display: grid;
  grid-template-columns: 560px 1360px;
  grid-template-rows: 100px 860px 120px;
  grid-template-areas: "top top" "bench tank" "controls controls";
}
.ls-float #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-float .tb-text { flex: 1; display: flex; align-items: baseline; gap: 26px; min-width: 0; }
.ls-float #level-name { font-size: 34px; font-weight: 800; white-space: nowrap; background: #ffffff26; padding: 4px 22px; border-radius: 30px; }
.ls-float #challenge { font-size: 38px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-float #step-count { font-size: 28px; font-weight: 700; color: #ffffffcc; white-space: nowrap; }
.ls-float #level-stars { font-size: 48px; letter-spacing: 4px; color: #ffffff55; white-space: nowrap; }
.ls-float #level-stars .on { color: var(--yellow); }

/* controls */
.ls-float #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-float .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-float .ctrl:active { transform: translateY(5px); box-shadow: 0 1px 0 #a9c3e2; }
.ls-float .ctrl .ico { font-size: 44px; line-height: 1; }
.ls-float .ctrl .lbl { font-size: 17px; font-weight: 700; line-height: 1.2; }

/* ---------------------------------------------------------------- Qatra + bubble */
/* Qatra */
.ls-float #qatra { position: absolute; bottom: 140px; inset-inline-end: 34px; width: 170px; height: 170px; z-index: 6; pointer-events: none; }
.ls-float .qatra-svg { width: 100%; height: 100%; overflow: visible; }
.ls-float .qa-body { fill: var(--qa, #64b5f6); stroke: var(--qa-dark, #1e5bd8); stroke-width: 5; stroke-linejoin: round; transition: fill .5s, stroke .5s; }
.ls-float .qa-aura { fill: var(--qa, #64b5f6); opacity: .22; transition: fill .5s; }
.ls-float .qa-arm path { fill: none; stroke: var(--qa-dark, #1e5bd8); stroke-width: 7; stroke-linecap: round; }
.ls-float .qa-arm circle { fill: var(--qa, #64b5f6); stroke: var(--qa-dark, #1e5bd8); stroke-width: 3; }
.ls-float .qa-bob { animation: qa-bob 2.4s ease-in-out infinite; }
@keyframes qa-bob { 50% { transform: translateY(-7px); } }
.ls-float .qa-arm-r { transform-origin: 50px 32px; }
.ls-float .qa-arm-l { transform-origin: -50px 32px; }
.ls-float .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-float .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-float .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-float .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-float #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-float #bubble::after {
  content: ''; position: absolute; bottom: -22px; inset-inline-end: 24px;
  border: 14px solid transparent; border-top: 18px solid var(--orange);
}
.ls-float #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-float .overlay { position: absolute; inset: 0; z-index: 20; background: #0d1b3acc; display: flex; align-items: center; justify-content: center; }
.ls-float .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-float .card h2 { margin: 0 0 8px; font-size: 72px; font-weight: 800; color: var(--blue-dark); }
.ls-float .big-stars { font-size: 110px; letter-spacing: 12px; color: #dde3ec; line-height: 1.1; }
.ls-float .big-stars span { display: inline-block; }
.ls-float .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-float .success-card { width: 1100px; }
.ls-float .dyk { background: #fff8e1; border: 4px dashed #ffca28; border-radius: 30px; padding: 18px 36px; margin: 18px 0 30px; }
.ls-float .dyk h3 { margin: 0; font-size: 40px; color: #e65100; }
.ls-float .dyk p { margin: 8px 0 0; font-size: 36px; font-weight: 600; line-height: 1.4; }
.ls-float .card-buttons { display: flex; gap: 30px; justify-content: center; }
.ls-float .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-float .btn.primary { background: var(--green); color: #fff; box-shadow: 0 8px 0 #1b6b33; }
.ls-float .btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #a9bad4; }
.ls-float .cert-card { width: 1200px; border: 14px double #ffca28; background: linear-gradient(#fffdf5, #fff6dc); }
.ls-float .cert-medal { font-size: 120px; line-height: 1; }
.ls-float .cert-qatra { width: 180px; height: 180px; margin: 0 auto; }
.ls-float #cert-body { font-size: 44px; font-weight: 700; margin: 6px 0; }
.ls-float #cert-stars bdi { color: #c77800; font-size: 90px; font-weight: 800; }

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

/* ================================================================ Float or Sink? specifics */
.ls-float #qatra { bottom: 4px; inset-inline-end: 30px; width: 160px; height: 160px; }
/* The tank floor is where sunk objects rest, so the speech bubble lives in the control bar,
   beside Qatra, with its tail pointing sideways at her. */
.ls-float #bubble { bottom: 16px; inset-inline-end: 196px; max-width: 600px; font-size: 28px; padding: 14px 24px; }
.ls-float #bubble::after {
  bottom: auto; top: 50%; inset-inline-end: -26px; transform: translateY(-50%);
  border: 13px solid transparent; border-inline-start: 18px solid var(--orange);
}

/* bench (the side panel where objects wait) */
.ls-float #bench {
  grid-area: bench; background: var(--paper); border-inline-end: 4px solid #f0dfb8;
  padding: 30px 34px; display: flex; flex-direction: column; align-items: stretch; gap: 22px; z-index: 2; overflow: hidden;
}
.ls-float .obj-card {
  background: #fff; border-radius: 34px; padding: 24px 20px 20px; text-align: center;
  box-shadow: 0 6px 0 #e3cf9f, 0 8px 18px #0001;
}
.ls-float .dish {
  height: 230px; margin: 0 auto 10px; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 78%, #e8eef6 0 34%, transparent 35%);
}
.ls-float .dish svg { max-width: 300px; max-height: 210px; width: auto; height: auto; overflow: visible; }
.ls-float .dish.draggable { cursor: grab; touch-action: none; animation: fl-hover 1.8s ease-in-out infinite; }
.ls-float .dish.lifted { opacity: .25; animation: none; }
@keyframes fl-hover { 50% { transform: translateY(-8px); } }
.ls-float .obj-name { font-size: 42px; font-weight: 800; line-height: 1.15; }
.ls-float .obj-weight { font-size: 28px; font-weight: 700; color: #5a6b8c; }

.ls-float .actions { display: flex; gap: 18px; justify-content: center; }
.ls-float .actions.two > * { flex: 1; }
.ls-float .big-btn {
  min-height: 104px; padding: 0 30px; border-radius: 30px; border: none; font-size: 38px; font-weight: 800;
  background: #e3ebf7; box-shadow: 0 8px 0 #a9bad4; transition: transform .08s;
}
.ls-float .big-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #a9bad4; }
.ls-float .big-btn:disabled { opacity: .45; }
.ls-float .big-btn.float { background: #4fc3f7; color: #06324a; box-shadow: 0 8px 0 #0277bd; }
.ls-float .big-btn.sink { background: #37474f; color: #fff; box-shadow: 0 8px 0 #1c262b; }
.ls-float .big-btn.go { background: var(--green); color: #fff; box-shadow: 0 8px 0 #1b6b33; width: 100%; }
.ls-float .big-btn.salt { background: #fff; box-shadow: 0 8px 0 #c5d3e6; width: 100%; }
.ls-float .guess { text-align: center; font-size: 30px; font-weight: 800; color: #5a6b8c; }
.ls-float .muted { text-align: center; font-size: 24px; font-weight: 600; color: #8a97ad; margin-top: -10px; }
.ls-float .waiting { margin: auto; font-size: 44px; font-weight: 800; color: #5a6b8c; }
.ls-float .task { font-size: 34px; font-weight: 800; line-height: 1.35; text-align: center; background: #fff; border-radius: 28px; padding: 20px 22px; box-shadow: 0 6px 0 #e3cf9f; }
.ls-float .status { text-align: center; font-size: 30px; font-weight: 700; color: #5a6b8c; }
.ls-float .status.big { font-size: 40px; color: var(--ink); }

.ls-float .verdict { font-size: 44px; font-weight: 800; text-align: center; line-height: 1.2; padding: 16px; border-radius: 28px; }
.ls-float .verdict.right { background: #e8f5e9; color: #1b6b33; }
.ls-float .verdict.wrong { background: #fff3e0; color: #b45309; font-size: 34px; }
.ls-float .explain { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.4; text-align: center; }
.ls-float .balance { margin: 0; text-align: center; background: #fff; border-radius: 28px; padding: 10px 10px 14px; box-shadow: 0 6px 0 #e3cf9f; }
.ls-float .balance-svg { width: 360px; height: 200px; }
.ls-float .balance figcaption { font-size: 24px; font-weight: 700; color: #5a6b8c; }
.ls-float .bal-beam { transition: transform .6s cubic-bezier(.3, 1.5, .5, 1); }
.ls-float .note { margin: 0; font-size: 27px; font-weight: 600; line-height: 1.45; background: #fff8e1; border: 3px dashed #ffca28; border-radius: 24px; padding: 14px 20px; }

.ls-float .lab-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; overflow-y: auto; padding: 4px; }
.ls-float .lab-item {
  border: none; background: #fff; border-radius: 20px; padding: 8px 4px 6px; height: 132px;
  box-shadow: 0 4px 0 #e3cf9f; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.ls-float .lab-item svg { width: 86px; height: 70px; overflow: visible; }
.ls-float .lab-item span { font-size: 17px; font-weight: 700; line-height: 1.1; }
.ls-float .lab-item:active { transform: translateY(4px); box-shadow: 0 1px 0 #e3cf9f; }

/* tank */
.ls-float #tank-wrap { grid-area: tank; position: relative; overflow: hidden; }
.ls-float #tank { width: 100%; height: 100%; display: block; }
.ls-float #tank .body .art svg { overflow: visible; }
.ls-float #tank-tools { position: absolute; top: 26px; inset-inline-start: 140px; display: flex; gap: 18px; align-items: center; }
.ls-float .chip {
  display: inline-flex; align-items: center; padding: 8px 22px; background: #fff; border-radius: 26px;
  font-size: 28px; font-weight: 800; box-shadow: 0 4px 0 #c5d3e6;
}
.ls-float .tool-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 74px; padding: 0 26px; border: none; border-radius: 37px;
  background: #fff; box-shadow: 0 6px 0 #c5d3e6; font-size: 28px; font-weight: 800;
}
.ls-float .tool-btn .ico { font-size: 40px; }
.ls-float .tool-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #c5d3e6; }
.ls-float .hint-glow { animation: fl-hint 1s ease-in-out infinite; }
@keyframes fl-hint { 50% { box-shadow: 0 0 0 8px #ffeb3b, 0 0 30px 10px #ffeb3b; transform: scale(1.03); } }

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

.ls-float #succ-score { font-size: 36px; font-weight: 700; color: #5a6b8c; margin: 4px 0 0; }
