* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at 50% 20%, #241f2e 0%, #14121b 55%, #0c0a10 100%);
  color: #e8e2f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage {
  width: 100%;
  height: 100%;
  max-width: 68rem;
  padding: 2vh 3vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2vh;
}

.titlebar { text-align: center; }

.titlebar h1 {
  font-size: clamp(1.4rem, 3.4vw, 2.4rem);
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #e8c874, #b8862f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: clamp(0.75rem, 1.6vw, 1rem);
  color: #a79fba;
  margin-top: 0.3rem;
}

.scene {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#apparatus {
  width: auto;
  height: 100%;
  max-width: 100%;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,0.5));
}

.bulb-label {
  font: 700 11px 'Segoe UI', sans-serif;
  fill: rgba(255,230,220,0.75);
  letter-spacing: 0.08em;
  pointer-events: none;
  user-select: none;
}

#handle-group, #fart-btn { cursor: pointer; }

#bulb { transition: transform 0.12s ease; transform-origin: 150px 345px; }
#bulb.squeeze { transform: scaleY(0.7) scaleX(1.08); }

.controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.fart-btn {
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  font-weight: 700;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, #b8862f, #8a5f1c);
  color: #fff6e0;
  cursor: pointer;
  box-shadow: 0 4px 0 #5c3f11, 0 6px 14px rgba(0,0,0,0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.fart-btn:hover { filter: brightness(1.08); }
.fart-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #5c3f11; }

.readout {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.readout-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8f88a3;
}
.readout-count {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  color: #9bdc4a;
  text-shadow: 0 0 14px rgba(155,220,74,0.5);
}

.jar-shelf {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  max-height: 16vh;
  overflow-y: auto;
  padding: 0.4rem;
  width: 100%;
}

.mini-jar {
  width: 2.2rem;
  height: 3rem;
  border-radius: 0.3rem 0.3rem 0.5rem 0.5rem;
  border: 2px solid #8fb9cf;
  background: linear-gradient(to top, rgba(155,220,74,0.55), rgba(200,240,255,0.12));
  position: relative;
  flex: 0 0 auto;
  animation: pop-in 0.35s cubic-bezier(0.2, 1.4, 0.4, 1);
  cursor: pointer;
}
.mini-jar::before {
  content: '';
  position: absolute;
  top: -0.35rem; left: 50%;
  transform: translateX(-50%);
  width: 1.3rem; height: 0.5rem;
  border-radius: 0.2rem;
  background: linear-gradient(#e8c874, #8a5f1c);
}
.mini-jar:hover { filter: brightness(1.2); }

@keyframes pop-in {
  from { transform: scale(0) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* gas puff particles */
.puff-p { opacity: 0; }
