@font-face {
  font-family: "Scene Sans";
  src: url("assets/fonts/edfa245493c4c854-s.p.woff2") format("woff2");
  font-display: swap;
}

:root {
  --lime: #c7ff00;
  --acid: #91ff34;
  --danger: #ff315c;
  --sky: #8be8ff;
  --camera-x: 0px;
  --camera-y: 0px;
  --camera-z: 12px;
  --camera-rx: 0deg;
  --camera-ry: 0deg;
  --world-scale: .78;
  --hud-top-safe: 124px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #040704;
  color: #fff;
  font-family: "Scene Sans", "Helvetica Neue", Arial, sans-serif;
}

button { font: inherit; }

.viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  perspective: 1250px;
  perspective-origin: 50% 46%;
  background:
    radial-gradient(circle at 50% 42%, rgba(139, 232, 255, .1), transparent 28%),
    radial-gradient(circle at 50% 58%, rgba(54, 121, 25, .36), transparent 46%),
    linear-gradient(180deg, #06130b 0%, #020604 60%, #010201 100%);
  cursor: move;
}

.viewport:active { cursor: grabbing; }

.viewport.is-over-draggable {
  cursor: grab;
}

.viewport.is-over-draggable:active {
  cursor: grabbing;
}

.pause-backdrop {
  position: absolute;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(3, 18, 5, .16), rgba(0, 0, 0, .6) 76%),
    rgba(0, 0, 0, .14);
  backdrop-filter: blur(8px) brightness(.68) saturate(.82);
  transition: opacity 160ms ease;
}

.pause-backdrop.is-visible {
  opacity: 1;
}

.scene {
  position: absolute;
  inset: -10%;
  transform-style: preserve-3d;
  transform: translate3d(var(--camera-x), var(--camera-y), var(--camera-z)) rotateX(var(--camera-rx)) rotateY(var(--camera-ry)) scale(var(--world-scale));
  transform-origin: 50% 50%;
  will-change: transform;
  transition: filter 220ms ease;
}

.room,
.wall {
  position: absolute;
  transform-style: preserve-3d;
  pointer-events: none;
}

.room { inset: 0; }

.wall {
  background-color: #06180b;
  backface-visibility: visible;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .45);
}

.wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(145, 255, 52, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145, 255, 52, .14) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .82;
}

.wall-back {
  inset: 0;
  transform: translateZ(-860px) scale(2.12);
  background:
    radial-gradient(circle at 50% 48%, rgba(139, 232, 255, .12), transparent 28%),
    radial-gradient(circle at 50% 58%, rgba(31, 108, 31, .72), transparent 45%),
    linear-gradient(#041f0a, #010302 68%);
}

.wall-left,
.wall-right {
  top: -22%;
  width: 1120px;
  height: 148%;
}

.wall-left {
  left: -880px;
  transform-origin: right center;
  transform: rotateY(73deg);
  background: linear-gradient(90deg, #0c5218, #031008 72%);
}

.wall-right {
  right: -880px;
  transform-origin: left center;
  transform: rotateY(-73deg);
  background: linear-gradient(-90deg, #0c5218, #031008 72%);
}

.wall-floor,
.wall-ceiling {
  left: -24%;
  width: 148%;
  height: 1020px;
}

.wall-floor {
  bottom: -850px;
  transform-origin: top center;
  transform: rotateX(76deg);
  background:
    radial-gradient(ellipse at 50% 18%, rgba(199,255,0,.18), transparent 42%),
    linear-gradient(#05210b, #4a910d);
}

.wall-ceiling {
  top: -850px;
  transform-origin: bottom center;
  transform: rotateX(-76deg);
  background: linear-gradient(#1f4f0c, #031208);
}

.game-object {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
  transform:
    translate(-50%, -50%)
    translate3d(var(--x, 0px), var(--y, 0px), var(--z, 0px))
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    scale(var(--scale, 1));
  will-change: transform;
}

.world-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  transform-style: preserve-3d;
}

.mode-level .menu-world,
.mode-level .title-card,
.mode-level .controls-card,
.mode-level .editor-card {
  display: none;
}

.mode-menu .level-world {
  display: none;
}

.is-menu-locked .room,
.is-menu-locked .menu-world,
.is-menu-locked .controls-card,
.is-menu-locked .editor-card,
.is-menu-locked .greg-player {
  filter: blur(10px) brightness(.54) saturate(.7);
  opacity: .5;
  pointer-events: none;
  transition: filter 360ms ease, opacity 360ms ease;
}

.mode-menu.is-menu-started .title-card {
  opacity: 0;
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    translate3d(var(--x, 0px), calc(var(--y, 0px) - 26px), var(--z, 0px))
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    scale(.88);
  transition: opacity 260ms ease, transform 320ms ease;
}

.hud-card,
.title-card {
  z-index: 30;
  border: 1px solid rgba(211, 255, 177, .28);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(53, 116, 46, .76), rgba(8, 25, 11, .92)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 5px);
  box-shadow:
    inset 0 1px rgba(255,255,255,.14),
    inset 0 -18px 34px rgba(0,0,0,.16),
    0 24px 54px rgba(0,0,0,.36),
    0 0 34px rgba(145,255,52,.1);
  backdrop-filter: blur(16px);
}

.title-card {
  width: min(720px, 72vw);
  padding: 30px 34px 34px;
  text-align: center;
  --scale: 1.02;
  transition: opacity 260ms ease, transform 320ms ease;
}

.title-card h1 {
  margin: 16px 0 9px;
  color: var(--lime);
  font-size: clamp(3.5rem, 6.6vw, 7.4rem);
  line-height: .86;
  letter-spacing: -.055em;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 rgba(48, 87, 11, .9),
    0 0 30px rgba(199,255,0,.24),
    0 0 70px rgba(139,232,255,.13);
}

.title-card p,
.hud-card p {
  margin: 0;
  color: #d7e9c6;
  line-height: 1.35;
}

.title-card p {
  max-width: 48ch;
  margin-inline: auto;
  color: #eefcdf;
  font-size: .98rem;
  font-weight: 800;
}

.menu-view {
  display: none;
}

.menu-view.is-active {
  display: block;
}

.menu-kicker {
  display: inline-grid;
  place-items: center;
  margin-bottom: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(199,255,0,.32);
  border-radius: 999px;
  color: #102007;
  background: var(--lime);
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.title-card h2 {
  margin: 0 0 12px;
  color: var(--lime);
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  line-height: .88;
  letter-spacing: -.05em;
  text-transform: uppercase;
}

.title-card b {
  color: #fff;
}

.logo-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  transform: translateZ(12px);
}

.jump-tile {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255,255,255,.25);
  border-radius: 16px;
  color: #17230d;
  background: var(--lime);
  box-shadow: 0 8px 0 #66704f, 0 0 30px rgba(199,255,0,.35);
  font-weight: 1000;
}

.jump-tile:nth-child(2) { transform: translateY(-10px) rotate(-6deg); }
.jump-tile:nth-child(3) { transform: translateY(5px) rotate(5deg); }
.jump-tile:nth-child(4) { transform: translateY(-4px) rotate(8deg); }

.menu-actions,
.editor-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.primary-button,
.ghost-button {
  min-height: 45px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.run-action:hover {
  transform: translate(-50%, 0);
}

.primary-button {
  color: #182006;
  background: linear-gradient(#f8ffe7, #c7ff00);
  box-shadow: 0 5px 0 #5d7415, 0 12px 30px rgba(0,0,0,.34), 0 0 24px rgba(199,255,0,.22);
}

.ghost-button {
  color: #ebffdf;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}

.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: .78rem;
}

.hud-card {
  width: 320px;
  padding: 20px;
  --scale: .92;
}

.hud-card h2 {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: 1.1rem;
  text-transform: uppercase;
}

.mode-menu .controls-card p {
  font-size: .9rem;
}

.hud-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #bdcdb5;
  font-size: .82rem;
  line-height: 1.45;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.status-strip span {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px;
  color: #dfffd0;
  background: rgba(255,255,255,.07);
  font-size: .72rem;
  font-weight: 900;
  text-align: center;
}

.platform {
  z-index: 4;
  width: var(--w, 220px);
  height: var(--h, 42px);
  border: 2px solid rgba(230,255,206,.68);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), transparent 40%),
    linear-gradient(#c7ff4d, #5ebd22 56%, #2f7615);
  box-shadow:
    inset 0 5px rgba(255,255,255,.24),
    inset 0 -8px rgba(0,0,0,.18),
    0 12px 0 rgba(18, 50, 16, .85),
    0 21px 30px rgba(0,0,0,.38),
    0 0 22px rgba(145,255,52,.14);
  cursor: default;
}

.platform::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 11px;
  background-image: linear-gradient(90deg, rgba(0,0,0,.18) 1px, transparent 1px);
  background-size: 24px 100%;
  opacity: .35;
}

.platform.movable {
  cursor: grab;
  background:
    linear-gradient(135deg, rgba(255,255,255,.28), transparent 45%),
    linear-gradient(#e7ff7e, #88d929 48%, #4ea01b);
  box-shadow:
    inset 0 5px rgba(255,255,255,.3),
    inset 0 -8px rgba(0,0,0,.17),
    0 0 0 2px rgba(139,232,255,.3),
    0 12px 0 rgba(18, 50, 16, .85),
    0 23px 34px rgba(0,0,0,.42),
    0 0 30px rgba(139,232,255,.16);
}

.platform.movable {
  touch-action: none;
}

.platform.movable::after {
  content: "DRAG";
  display: grid;
  place-items: center;
  border: 1px dashed rgba(7, 24, 7, .38);
  color: rgba(9, 29, 4, .62);
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .22em;
  opacity: .62;
}

.platform.movable.is-hover-hitbox::after {
  opacity: .92;
  color: rgba(4, 18, 4, .78);
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 0 14px rgba(199,255,0,.18);
}

.platform.movable.is-invalid {
  border-color: rgba(255, 49, 92, .95);
  filter: drop-shadow(0 0 24px rgba(255, 49, 92, .85));
}

.platform.movable.is-invalid::after {
  content: attr(data-drag-status);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
  background: rgba(255, 49, 92, .68);
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.movable-object {
  cursor: grab;
  touch-action: none;
}

.movable-object::before,
.platform.movable::before {
  content: "";
  position: absolute;
  inset: -9px;
  z-index: -1;
  border: 1px solid rgba(199, 255, 0, 0);
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.movable-object:hover::before,
.movable-object:focus-visible::before,
.movable-object.is-hover-hitbox::before,
.platform.movable:hover::before,
.platform.movable:focus-visible::before,
.platform.movable.is-hover-hitbox::before,
.movable-object.is-dragging::before,
.platform.movable.is-dragging::before {
  border-color: rgba(199, 255, 0, .55);
  box-shadow: 0 0 28px rgba(199, 255, 0, .18);
}

.movable-object.is-hover-hitbox::before,
.platform.movable.is-hover-hitbox::before {
  inset: -16px;
  border-color: rgba(139, 232, 255, .6);
  box-shadow:
    0 0 0 6px rgba(139,232,255,.08),
    0 0 32px rgba(139,232,255,.26);
}

.platform.movable.is-dragging {
  z-index: 20;
  cursor: grabbing;
  transform:
    translate(-50%, -50%)
    translate3d(var(--x, 0px), var(--y, 0px), var(--z, 0px))
    rotateX(var(--rx, 0deg))
    rotateY(var(--ry, 0deg))
    scale(calc(var(--scale, 1) * 1.035));
  box-shadow:
    inset 0 4px rgba(255,255,255,.25),
    inset 0 -8px rgba(0,0,0,.18),
    0 0 0 3px rgba(199,255,0,.55),
    0 0 0 7px rgba(139,232,255,.16),
    0 25px 44px rgba(0,0,0,.46);
}

.drag-bounds {
  z-index: 2;
  width: var(--w, 220px);
  height: var(--h, 80px);
  border: 2px dashed rgba(255, 232, 122, calc(.18 + var(--edge-alpha, 0) * .45));
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,232,122, calc(.03 + var(--edge-alpha, 0) * .08)), transparent 64%),
    repeating-linear-gradient(90deg, rgba(255,232,122,.08) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(0deg, rgba(255,232,122,.06) 0 1px, transparent 1px 24px);
  box-shadow:
    inset 0 0 26px rgba(255,232,122, calc(.06 + var(--edge-alpha, 0) * .16)),
    0 0 30px rgba(255,232,122, calc(.04 + var(--edge-alpha, 0) * .18));
  opacity: 0;
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    translate3d(var(--x, 0px), var(--y, 0px), var(--z, 0px));
  transition: opacity 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.drag-bounds::after {
  content: "TRAVEL ZONE";
  position: absolute;
  left: 50%;
  bottom: -28px;
  display: grid;
  place-items: center;
  height: 22px;
  padding: 0 10px;
  border: 1px solid rgba(255,232,122,.22);
  border-radius: 999px;
  color: rgba(255,247,192,.76);
  background: rgba(2, 12, 5, .68);
  font-size: .58rem;
  font-weight: 1000;
  letter-spacing: .12em;
  transform: translateX(-50%);
}

.drag-bounds.is-visible {
  opacity: .62;
}

.drag-bounds.is-near-edge {
  opacity: .86;
}

.drag-bounds.is-near-edge::after {
  content: "EDGE";
  color: #fff7c0;
  background: rgba(62, 42, 2, .76);
}

.snap-ghost {
  z-index: 3;
  width: var(--w, 160px);
  height: var(--h, 42px);
  border: 2px solid rgba(139, 232, 255, .78);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(139,232,255,.22), transparent 42%),
    repeating-linear-gradient(90deg, rgba(139,232,255,.24) 0 2px, transparent 2px 12px);
  box-shadow:
    inset 0 0 18px rgba(139,232,255,.18),
    0 0 0 6px rgba(139,232,255,.08),
    0 0 34px rgba(139,232,255,.24);
  opacity: 0;
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    translate3d(var(--x, 0px), var(--y, 0px), var(--z, 0px))
    scale(.98);
  transition: opacity 90ms ease, border-color 90ms ease, box-shadow 90ms ease;
}

.snap-ghost::after {
  content: "SNAP";
  position: absolute;
  left: 50%;
  top: -28px;
  display: grid;
  place-items: center;
  min-width: 58px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(139,232,255,.45);
  border-radius: 999px;
  color: #dfffff;
  background: rgba(1, 15, 19, .78);
  font-size: .62rem;
  font-weight: 1000;
  letter-spacing: .12em;
  transform: translateX(-50%);
}

.snap-ghost.is-visible {
  opacity: .78;
}

.snap-ghost.is-clamped {
  border-color: rgba(255, 232, 122, .9);
  box-shadow:
    inset 0 0 18px rgba(255,232,122,.16),
    0 0 0 6px rgba(255,232,122,.1),
    0 0 34px rgba(255,232,122,.22);
}

.snap-ghost.is-clamped::after {
  content: "WALL";
  border-color: rgba(255,232,122,.45);
  color: #fff7c0;
}

.snap-ghost.is-invalid {
  border-color: rgba(255, 49, 92, .95);
  background:
    linear-gradient(135deg, rgba(255,49,92,.26), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255,49,92,.28) 0 2px, transparent 2px 12px);
  box-shadow:
    inset 0 0 18px rgba(255,49,92,.16),
    0 0 0 6px rgba(255,49,92,.12),
    0 0 34px rgba(255,49,92,.35);
}

.snap-ghost.is-invalid::after {
  content: "NOPE";
  border-color: rgba(255,49,92,.55);
  color: #fff;
}

.ground {
  border-color: rgba(236,255,218,.34);
  background:
    linear-gradient(135deg, rgba(255,255,255,.1), transparent 42%),
    linear-gradient(#63c824, #1b5b13);
}

.bridge-box {
  background:
    linear-gradient(135deg, rgba(255,255,255,.32), transparent 45%),
    linear-gradient(#eaff70, #b0ff1d 45%, #4b9818);
}

.solution-zone {
  z-index: 3;
  display: grid;
  place-items: center;
  width: var(--w, 260px);
  height: var(--h, 80px);
  border: 2px dashed rgba(139, 232, 255, .56);
  border-radius: 20px;
  color: rgba(210, 249, 255, .72);
  background: rgba(139, 232, 255, .06);
  box-shadow: inset 0 0 24px rgba(139, 232, 255, .08), 0 0 32px rgba(139, 232, 255, .12);
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: none;
}

.solution-zone.is-hidden {
  display: none;
}

.game-object.is-invalid {
  animation: invalidPulse 650ms ease-in-out infinite alternate;
}

.game-object.is-selected {
  outline: 2px solid rgba(139,232,255,.92);
  outline-offset: 8px;
  filter: drop-shadow(0 0 20px rgba(139,232,255,.42));
}

@keyframes invalidPulse {
  from { filter: drop-shadow(0 0 0 rgba(255,49,92,0)); }
  to { filter: drop-shadow(0 0 18px rgba(255,49,92,.9)); }
}

.obstacle {
  z-index: 5;
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 14px 20px rgba(0,0,0,.42)) drop-shadow(0 0 12px rgba(255,49,92,.28));
  transition: filter 160ms ease;
}

.obstacle::before {
  content: "";
  position: absolute;
  inset: -34px;
  z-index: -1;
  border: 1px solid rgba(255, 49, 92, .18);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 49, 92, .16), rgba(255, 49, 92, .04) 52%, transparent 72%);
  box-shadow: 0 0 24px rgba(255, 49, 92, .12);
  pointer-events: none;
  transform: translateZ(-4px);
}

.spike {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(#ffd3dd 0 12%, #ff7592 36%, var(--danger));
}

.saw {
  border-radius: 50%;
  background:
    radial-gradient(circle, #1b0309 0 14%, transparent 15%),
    repeating-conic-gradient(from 8deg, #fff 0 8deg, var(--danger) 8deg 18deg),
    var(--danger);
  border: 6px solid #ff9bad;
}

.saw::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  border: 4px dashed rgba(255,255,255,.88);
  animation: sawTeeth 900ms linear infinite;
}

@keyframes sawTeeth {
  to { transform: rotate(360deg); }
}

.exit-gate {
  z-index: 6;
  display: grid;
  place-items: center;
  width: 118px;
  height: 168px;
  border: 3px solid var(--sky);
  border-radius: 60px 60px 18px 18px;
  color: #061116;
  background:
    linear-gradient(90deg, transparent 46%, rgba(255,255,255,.35) 47% 53%, transparent 54%),
    radial-gradient(circle at 50% 28%, #fff, var(--sky) 35%, #16a9ca 72%);
  box-shadow: 0 0 34px rgba(139,232,255,.62), 0 0 80px rgba(139,232,255,.18), inset 0 0 18px rgba(255,255,255,.55);
  font-weight: 1000;
  text-transform: uppercase;
  overflow: hidden;
  transition: box-shadow 220ms ease, filter 220ms ease;
}

.exit-gate::before,
.exit-gate::after {
  content: "";
  position: absolute;
  inset: 10px 50% 10px 10px;
  border-radius: 45px 4px 8px 12px;
  background: linear-gradient(180deg, rgba(10, 45, 50, .92), rgba(2, 16, 18, .96));
  box-shadow: inset 0 0 18px rgba(139,232,255,.2);
  transform-origin: left center;
  transition: transform 460ms cubic-bezier(.2, .8, .2, 1);
}

.exit-gate::after {
  inset: 10px 10px 10px 50%;
  border-radius: 4px 45px 12px 8px;
  transform-origin: right center;
}

.exit-gate span {
  position: relative;
  z-index: 2;
}

.exit-gate.is-open {
  overflow: visible;
  filter: brightness(1.18);
  background:
    radial-gradient(circle at 50% 48%, rgba(255,255,255,.48), rgba(139,232,255,.32) 24%, rgba(2,12,16,.98) 58%),
    linear-gradient(#052732, #010708);
  box-shadow: 0 0 44px rgba(139,232,255,.78), 0 0 120px rgba(139,232,255,.28), inset 0 0 22px rgba(255,255,255,.65);
}

.exit-gate.is-open span {
  opacity: 0;
}

.exit-gate.is-open::before {
  transform: perspective(260px) rotateY(-72deg);
}

.exit-gate.is-open::after {
  transform: perspective(260px) rotateY(72deg);
}

.exit-gate.is-cleared {
  opacity: 0;
  pointer-events: none;
  filter: blur(6px) brightness(1.8);
  transition: opacity 240ms ease, filter 240ms ease;
}

.is-completing .greg-player {
  filter: drop-shadow(0 0 22px rgba(139,232,255,.75));
}

.level-title,
.gap-label {
  z-index: 7;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #eaffdc;
  background: rgba(4, 18, 8, .72);
  font-size: .78rem;
  font-weight: 900;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}

.level-title {
  width: min(980px, 74vw);
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--lime);
  background: transparent;
  font-size: clamp(1.9rem, 4.2vw, 3.9rem);
  letter-spacing: -.06em;
  line-height: .92;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: none;
  box-shadow: none;
  pointer-events: none;
  transform-origin: center center;
  white-space: normal;
  text-shadow:
    0 2px 0 rgba(10, 45, 4, .9),
    0 0 22px rgba(199,255,0,.2),
    0 0 54px rgba(139,232,255,.08);
}

.wall-title {
  opacity: .62;
  mix-blend-mode: screen;
}

.greg-player {
  z-index: 18;
  width: 54px;
  height: 72px;
  pointer-events: none;
  opacity: calc(var(--enter-opacity, 1) * var(--death-opacity, 1));
}

.greg-sprite {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center bottom;
  transition: transform 80ms linear;
  transform: scale(var(--enter-scale, 1));
}

.greg-player.is-running .greg-sprite { transform: rotate(var(--lean, 0deg)) scaleX(var(--face, 1)) scale(var(--enter-scale, 1)); }
.greg-player.is-jumping .greg-sprite { transform: translateY(-4px) scaleX(var(--face, 1)) scale(var(--enter-scale, 1)); }
.greg-player.is-entering-door .greg-sprite { transform: translateY(-8px) scaleX(var(--face, 1)) scale(var(--enter-scale, 1)); }
.greg-player.is-vaporizing .greg-sprite {
  filter: drop-shadow(0 0 24px rgba(199,255,0,.95)) blur(2px);
  transform: translateY(var(--death-y, 0px)) scaleX(var(--face, 1)) scale(var(--death-scale, 1));
}

.greg-face {
  position: absolute;
  left: 6px;
  top: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 3px solid #f7d7ba;
  border-radius: 50%;
  color: #251209;
  background: linear-gradient(#ffe0c4, #d98c57);
  box-shadow: 0 8px 14px rgba(0,0,0,.28);
  font-weight: 1000;
}

.greg-face::before,
.greg-face::after {
  content: "";
  position: absolute;
  bottom: -27px;
  width: 14px;
  height: 30px;
  border-radius: 10px;
  background: #edf1ff;
}

.greg-face::before { left: 5px; transform: rotate(8deg); }
.greg-face::after { right: 5px; transform: rotate(-8deg); }

.control-dock {
  position: absolute;
  z-index: 55;
  left: 50%;
  top: 50%;
  display: grid;
  width: min(390px, calc(100vw - 40px));
  gap: 12px;
  padding: 22px;
  border: 2px solid rgba(199,255,0,.5);
  border-radius: 28px;
  background:
    radial-gradient(circle at 22% 0%, rgba(199,255,0,.18), transparent 32%),
    linear-gradient(145deg, rgba(41, 88, 36, .95), rgba(3, 11, 5, .96)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 28px 70px rgba(0,0,0,.58), 0 0 42px rgba(199,255,0,.18);
  backdrop-filter: blur(18px);
  transition: opacity 190ms ease, transform 190ms ease;
}

.control-dock strong {
  color: var(--lime);
  font-size: 1.7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
}

.control-dock button {
  width: 100%;
}

.control-dock,
.is-completing .control-dock,
.is-complete .control-dock {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(.92);
}

.is-paused .control-dock {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.run-action {
  position: absolute;
  z-index: 42;
  left: 50%;
  bottom: 28px;
  min-width: 160px;
  transform: translate(-50%, 0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mode-menu .run-action,
.is-intro .run-action,
.is-play-mode .run-action,
.is-paused .run-action,
.is-completing .run-action,
.is-complete .run-action {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
}

.is-committing .run-action {
  opacity: 1;
  pointer-events: none;
  transform: translate(-50%, 0) scale(1.08);
  animation: commitButtonPulse 720ms cubic-bezier(.2, .8, .2, 1) both;
}

.is-committing .platform.movable {
  animation: lockPlatform 720ms cubic-bezier(.2, .8, .2, 1) both;
}

.is-committing .room::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 2px solid rgba(199,255,0,.24);
  border-radius: 42px;
  box-shadow: inset 0 0 70px rgba(199,255,0,.12), 0 0 42px rgba(199,255,0,.14);
  animation: roomCommitPulse 720ms ease both;
}

@keyframes commitButtonPulse {
  0% { filter: brightness(1); box-shadow: 0 5px 0 #5d7415, 0 12px 30px rgba(0,0,0,.34), 0 0 24px rgba(199,255,0,.22); }
  35% { filter: brightness(1.45); box-shadow: 0 3px 0 #5d7415, 0 18px 44px rgba(0,0,0,.38), 0 0 58px rgba(199,255,0,.68); }
  100% { filter: brightness(1); box-shadow: 0 5px 0 #5d7415, 0 12px 30px rgba(0,0,0,.34), 0 0 24px rgba(199,255,0,.22); }
}

@keyframes lockPlatform {
  0% { filter: brightness(1); }
  45% { filter: brightness(1.45) drop-shadow(0 0 22px rgba(199,255,0,.55)); }
  100% { filter: brightness(.84) saturate(.78); }
}

@keyframes roomCommitPulse {
  0% { opacity: 0; transform: scale(.98); }
  35% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}

.reset-view-button {
  width: 42px;
  padding: 0;
  opacity: .74;
}

.reset-view-button:hover {
  opacity: 1;
}

.designer-fab {
  border: 1px solid rgba(139,232,255,.32);
  color: rgba(234,255,255,.78);
  opacity: .78;
}

.designer-fab:hover,
.is-designer-open .designer-fab {
  opacity: 1;
  background: rgba(139,232,255,.12);
}

.drag-hint {
  position: absolute;
  z-index: 47;
  left: var(--hint-x, 50%);
  top: var(--hint-y, 50%);
  display: grid;
  place-items: center;
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(139,232,255,.42);
  border-radius: 999px;
  color: #eaffff;
  background:
    linear-gradient(180deg, rgba(28, 76, 82, .84), rgba(3, 16, 18, .88)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 5px);
  box-shadow: 0 10px 28px rgba(0,0,0,.34), 0 0 24px rgba(139,232,255,.16);
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .06em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  transform: translate(16px, -50%) scale(.94);
  transition: opacity 100ms ease, transform 100ms ease;
  backdrop-filter: blur(10px);
}

.drag-hint.is-visible {
  opacity: .94;
  transform: translate(18px, -50%) scale(1);
}

.lives-counter {
  position: absolute;
  z-index: 39;
  left: 24px;
  top: var(--hud-top-safe);
  min-width: 86px;
  padding: 9px 12px;
  border: 1px solid rgba(199,255,0,.32);
  border-radius: 14px;
  color: var(--lime);
  background: rgba(0,0,0,.34);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 24px rgba(199,255,0,.08);
  font-size: .72rem;
  font-weight: 1000;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mode-menu .lives-counter,
.is-complete .lives-counter {
  opacity: 0;
  transform: translateY(-8px);
}

.utility-cluster {
  position: absolute;
  z-index: 48;
  right: 24px;
  top: var(--hud-top-safe);
  display: flex;
  align-items: center;
  gap: 8px;
}

.utility-button,
.esc-hint {
  display: grid;
  place-items: center;
  height: 42px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: rgba(238,255,223,.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), transparent),
    rgba(0,0,0,.24);
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 12px 28px rgba(0,0,0,.2);
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.utility-button {
  min-width: 42px;
  padding: 0 12px;
  color: rgba(238,255,223,.84);
  cursor: pointer;
}

.utility-button:hover {
  border-color: rgba(199,255,0,.48);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(199,255,0,.14), transparent),
    rgba(0,0,0,.32);
}

.esc-hint {
  padding: 0 12px;
  pointer-events: none;
}

.mode-menu.is-menu-locked .esc-hint,
.is-paused .esc-hint,
.is-completing .esc-hint,
.is-complete .esc-hint {
  opacity: 0;
  transform: translateY(10px);
}

.level-hud {
  position: absolute;
  z-index: 36;
  left: 50%;
  top: 50%;
  width: min(500px, calc(100vw - 60px));
  padding: 18px;
  border: 1px solid rgba(199,255,0,.62);
  border-radius: 24px;
  color: #eaffdf;
  background:
    linear-gradient(90deg, rgba(199,255,0,.18), transparent 35%),
    linear-gradient(135deg, rgba(18, 50, 18, .92), rgba(3, 9, 4, .96)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.045) 0 1px, transparent 1px 5px);
  box-shadow: inset 0 1px rgba(255,255,255,.12), 0 24px 70px rgba(0,0,0,.5), 0 0 44px rgba(199,255,0,.16);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(.94);
  transition: opacity 180ms ease, transform 180ms ease;
}

.mode-level.is-intro .level-hud {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.mode-level:not(.is-intro) .level-hud,
.is-complete .level-hud {
  opacity: 0;
  transform: translate(-50%, -54%) scale(.94);
}

.level-hud span {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(199,255,0,.34);
  border-radius: 999px;
  color: var(--lime);
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.level-hud strong {
  display: block;
  margin-top: 14px;
  color: var(--lime);
  font-size: clamp(2.1rem, 5vw, 3.9rem);
  letter-spacing: -.055em;
  text-transform: uppercase;
  line-height: .92;
  text-shadow: 0 0 22px rgba(199,255,0,.2);
}

.level-hud p {
  margin: 14px 0 0;
  color: rgba(231, 255, 219, .82);
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.35;
}

.kit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 16px;
}

.kit-row span {
  display: grid;
  place-items: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(139,232,255,.22);
  border-radius: 12px;
  color: rgba(234,255,223,.9);
  background:
    linear-gradient(180deg, rgba(139,232,255,.08), rgba(255,255,255,.035)),
    rgba(0,0,0,.16);
  box-shadow: inset 0 1px rgba(255,255,255,.08);
  font-size: .7rem;
  font-weight: 1000;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
}

.level-hud .primary-button {
  width: 100%;
  margin-top: 18px;
}

.tutorial-card {
  position: absolute;
  z-index: 37;
  left: 24px;
  top: var(--hud-top-safe);
  width: min(390px, calc(100vw - 48px));
  padding: 16px 18px;
  border: 1px solid rgba(199,255,0,.32);
  border-radius: 24px;
  color: #eaffdf;
  background:
    radial-gradient(circle at 18% 0%, rgba(199,255,0,.16), transparent 34%),
    linear-gradient(145deg, rgba(28, 70, 28, .78), rgba(2, 10, 4, .88));
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 18px 50px rgba(0,0,0,.34);
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 240ms ease, transform 240ms ease;
}

.mode-menu.is-menu-started .tutorial-card {
  opacity: 1;
  transform: translateY(0);
}

.is-completing .tutorial-card {
  opacity: 0;
  transform: translateY(-12px);
}

.tutorial-card span {
  color: var(--lime);
  font-size: .68rem;
  font-weight: 1000;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tutorial-card strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 1.22rem;
  letter-spacing: -.03em;
  text-transform: uppercase;
}

.tutorial-card p {
  margin: 8px 0 0;
  color: rgba(231,255,219,.82);
  font-size: .82rem;
  line-height: 1.38;
}

.tutorial-card b {
  color: #fff;
}

.modal-panel,
.completion-panel {
  position: absolute;
  z-index: 50;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 38px));
  padding: 22px 34px;
  border: 2px solid rgba(199,255,0,.55);
  border-radius: 24px;
  color: #ecffdf;
  background:
    linear-gradient(145deg, rgba(48, 100, 40, .94), rgba(5, 18, 7, .97)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.06) 0 1px, transparent 1px 6px);
  box-shadow: 0 18px 70px rgba(0,0,0,.55), 0 0 60px rgba(199,255,0,.28);
  transform: translate(-50%, -50%) scale(.84);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.completion-panel {
  left: 50%;
  right: auto;
  top: 50%;
  width: min(680px, calc(100vw - 56px));
  padding: 0;
  border: 1px solid rgba(199,255,0,.72);
  border-radius: 32px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(199,255,0,.22), transparent 45%),
    linear-gradient(145deg, rgba(13, 44, 15, .96), rgba(1, 5, 3, .98));
  box-shadow:
    inset 0 1px rgba(255,255,255,.16),
    inset 0 -34px 70px rgba(0,0,0,.28),
    0 34px 90px rgba(0,0,0,.66),
    0 0 70px rgba(199,255,0,.22);
  transform: translate(-50%, -50%) scale(.94);
}

.completion-panel::before {
  content: "";
  display: block;
  height: 8px;
  background: linear-gradient(90deg, var(--lime), rgba(139,232,255,.86), transparent);
}

.modal-panel.is-visible,
.completion-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.completion-panel.is-visible {
  transform: translate(-50%, -50%) scale(1);
}

.completion-kicker {
  display: inline-grid;
  place-items: center;
  margin: 28px 32px 12px;
  padding: 6px 10px;
  border: 1px solid rgba(199,255,0,.32);
  border-radius: 999px;
  color: #102007;
  background: var(--lime);
  font-size: .66rem;
  font-weight: 1000;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.is-complete .scene {
  filter: saturate(.78) brightness(.68);
}

.modal-panel h2,
.completion-panel h2 {
  margin: 0 0 10px;
  color: var(--lime);
  font-size: clamp(1.6rem, 4vw, 3rem);
  line-height: .9;
  text-transform: uppercase;
}

.completion-panel h2 {
  margin: 0 32px 16px;
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  letter-spacing: -.065em;
}

.modal-panel p,
.completion-panel p {
  color: #d7e9c6;
  line-height: 1.45;
}

.completion-panel p {
  max-width: 46ch;
  margin: 0 32px;
  color: rgba(239,255,229,.9);
  font-size: 1.08rem;
  font-weight: 850;
}

.completion-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 28px 32px 32px;
}

.completion-actions button {
  width: 100%;
}

.level-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.level-list button {
  position: relative;
  width: 100%;
  justify-content: flex-start;
  padding-right: 82px;
}

.level-list button::after {
  content: attr(data-status);
  position: absolute;
  right: 13px;
  top: 50%;
  padding: 4px 8px;
  border-radius: 999px;
  color: rgba(7, 18, 5, .86);
  background: rgba(236, 255, 214, .86);
  font-size: .64rem;
  font-weight: 1000;
  letter-spacing: .06em;
  transform: translateY(-50%);
}

.level-list button.is-current::after {
  background: var(--lime);
  box-shadow: 0 0 18px rgba(199, 255, 0, .55);
}

.level-list button.is-complete {
  border-color: rgba(199, 255, 0, .72);
}

.level-list button.is-complete::after {
  color: rgba(7, 18, 5, .9);
  background: linear-gradient(180deg, #dfff4f, #7cff3a);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: #eaffdf;
  background: rgba(255,255,255,.08);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.designer-panel {
  position: absolute;
  z-index: 56;
  right: 24px;
  top: calc(var(--hud-top-safe) + 54px);
  display: grid;
  gap: 12px;
  width: min(390px, calc(100vw - 44px));
  max-height: calc(100vh - 102px);
  padding: 16px;
  border: 1px solid rgba(139,232,255,.34);
  border-radius: 24px;
  color: #eaffdf;
  background:
    radial-gradient(circle at 20% 0%, rgba(139,232,255,.16), transparent 34%),
    linear-gradient(145deg, rgba(22, 62, 48, .94), rgba(3, 11, 7, .97)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.045) 0 1px, transparent 1px 5px);
  box-shadow: 0 24px 70px rgba(0,0,0,.5), 0 0 44px rgba(139,232,255,.14);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateX(18px) scale(.96);
  transition: opacity 180ms ease, transform 180ms ease;
  overflow: auto;
}

.designer-panel.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.designer-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.designer-header .modal-close {
  position: static;
  flex: 0 0 auto;
}

.designer-header span {
  color: var(--lime);
  font-size: .66rem;
  font-weight: 1000;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.designer-header strong {
  display: block;
  margin-top: 5px;
  font-size: 1.1rem;
  text-transform: uppercase;
}

.designer-tools,
.designer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.designer-tools button,
.designer-actions button {
  flex: 1 1 auto;
}

.designer-grid,
.designer-room {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.designer-panel label {
  display: grid;
  gap: 5px;
  color: rgba(234,255,223,.78);
  font-size: .64rem;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.designer-panel input,
.designer-panel textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  color: #f4ffe8;
  background: rgba(0,0,0,.24);
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  outline: none;
}

.designer-panel input {
  height: 34px;
  padding: 0 9px;
}

.designer-panel textarea {
  min-height: 120px;
  padding: 10px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .68rem;
  line-height: 1.35;
}

.danger-button {
  border-color: rgba(255,49,92,.55);
  color: #ffe2e8;
}

.edge-glow {
  position: absolute;
  inset: 3.5%;
  z-index: 22;
  pointer-events: none;
  border: 2px solid rgba(195,255,0,.58);
  border-radius: 34px;
  box-shadow:
    inset 0 0 18px 4px rgba(199,255,0,.82),
    inset 0 0 65px 15px rgba(167,255,0,.34),
    0 0 30px rgba(183,255,0,.25);
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 52%, rgba(0,12,3,.56) 100%),
    linear-gradient(180deg, rgba(139,232,255,.05), transparent 24%);
}

.is-play-mode .platform.movable {
  cursor: default;
  box-shadow:
    inset 0 5px rgba(255,255,255,.3),
    inset 0 -8px rgba(0,0,0,.17),
    0 12px 0 rgba(18, 50, 16, .85),
    0 23px 34px rgba(0,0,0,.42);
}

.is-play-mode .platform.movable::after {
  content: "LOCKED";
  border-style: solid;
  border-color: rgba(4, 18, 4, .2);
  color: rgba(5, 24, 6, .52);
  background: rgba(255,255,255,.08);
}

.is-play-mode .movable-object::before,
.is-play-mode .platform.movable::before {
  opacity: 0;
}

@media (max-width: 900px) {
  :root { --world-scale: .74; }
  .scene { inset: -18%; }
  .title-card { width: 88vw; --scale: .86; }
  .title-card h1 { font-size: clamp(3rem, 14vw, 5.4rem); }
  .hud-card { --scale: .74; }
  .control-dock { width: min(360px, calc(100vw - 28px)); }
  .completion-actions { grid-template-columns: 1fr; }
  .utility-cluster { right: 14px; top: var(--hud-top-safe); }
  .esc-hint { display: none; }
  .tutorial-card { left: 14px; top: var(--hud-top-safe); width: min(360px, calc(100vw - 98px)); }
  .designer-panel { right: 14px; top: calc(var(--hud-top-safe) + 52px); width: min(390px, calc(100vw - 28px)); }
}
