#chest-section {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(8px, 2dvh, 20px);
  min-height: 0;
  position: relative;
}

#chest-wrap {
  position: relative;
  width: min(var(--chest-size), 90vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#chest-idle,
#chest-video,
#chest-open {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#chest-idle  { display: block; }
#chest-video { display: none; }
#chest-open  { display: none; }

#chest-idle-ph,
#chest-open-ph {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 96px;
}

@keyframes chestShake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-10px); }
  30%       { transform: translateX(10px); }
  45%       { transform: translateX(-7px); }
  60%       { transform: translateX(7px); }
  75%       { transform: translateX(-4px); }
  90%       { transform: translateX(4px); }
}
#chest-wrap.shaking { animation: chestShake 0.35s ease; }

#particle-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
